Reference documentation and code samples for the Google Cloud Sql Admin V1 Client class User.
A Cloud SQL user resource.
Generated from protobuf messagegoogle.cloud.sql.v1.User
Namespace
Google \ Cloud \ Sql \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ kind
string
This is alwayssql#user.
↳ password
string
The password for the user.
↳ etag
string
This field is deprecated and will be removed from a future version of the API.
↳ name
string
The name of the user in the Cloud SQL instance. Can be omitted forupdatebecause it is already specified in the URL.
↳ host
string
Optional. The host from which the user can connect. Forinsertoperations, host defaults to an empty string. Forupdateoperations, host is specified as part of the request URL. The host name cannot be updated after insertion. For a MySQL instance, it's required; for a PostgreSQL or SQL Server instance, it's optional.
↳ instance
string
The name of the Cloud SQL instance. This does not include the project ID. Can be omitted forupdatebecause it is already specified on the URL.
↳ project
string
The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted forupdatebecause it is already specified on the URL.
↳ type
int
The user type. It determines the method to authenticate the user during login. The default is the database's built-in user type.
This field is deprecated and will be removed from a future version of the
API.
Returns
Type
Description
string
setEtag
This field is deprecated and will be removed from a future version of the
API.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getName
The name of the user in the Cloud SQL instance. Can be omitted forupdatebecause it is already specified in the URL.
Returns
Type
Description
string
setName
The name of the user in the Cloud SQL instance. Can be omitted forupdatebecause it is already specified in the URL.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getHost
Optional. The host from which the user can connect. Forinsertoperations, host defaults to an empty string. Forupdateoperations, host is specified as part of the request URL. The host name
cannot be updated after insertion. For a MySQL instance, it's required;
for a PostgreSQL or SQL Server instance, it's optional.
Returns
Type
Description
string
setHost
Optional. The host from which the user can connect. Forinsertoperations, host defaults to an empty string. Forupdateoperations, host is specified as part of the request URL. The host name
cannot be updated after insertion. For a MySQL instance, it's required;
for a PostgreSQL or SQL Server instance, it's optional.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getInstance
The name of the Cloud SQL instance. This does not include the project ID.
Can be omitted forupdatebecause it is already specified on the
URL.
Returns
Type
Description
string
setInstance
The name of the Cloud SQL instance. This does not include the project ID.
Can be omitted forupdatebecause it is already specified on the
URL.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getProject
The project ID of the project containing the Cloud SQL database. The Google
apps domain is prefixed if applicable. Can be omitted forupdatebecause
it is already specified on the URL.
Returns
Type
Description
string
setProject
The project ID of the project containing the Cloud SQL database. The Google
apps domain is prefixed if applicable. Can be omitted forupdatebecause
it is already specified on the URL.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getType
The user type. It determines the method to authenticate the user during
login. The default is the database's built-in user type.
Returns
Type
Description
int
setType
The user type. It determines the method to authenticate the user during
login. The default is the database's built-in user type.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getSqlserverUserDetails
Generated from protobuf field.google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9;
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Sql Admin V1 Client - Class User (1.2.6)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.6 (latest)](/php/docs/reference/cloud-sql-admin/latest/V1.User)\n- [1.2.5](/php/docs/reference/cloud-sql-admin/1.2.5/V1.User)\n- [1.1.0](/php/docs/reference/cloud-sql-admin/1.1.0/V1.User)\n- [1.0.0](/php/docs/reference/cloud-sql-admin/1.0.0/V1.User)\n- [0.19.0](/php/docs/reference/cloud-sql-admin/0.19.0/V1.User)\n- [0.18.0](/php/docs/reference/cloud-sql-admin/0.18.0/V1.User)\n- [0.17.1](/php/docs/reference/cloud-sql-admin/0.17.1/V1.User)\n- [0.16.1](/php/docs/reference/cloud-sql-admin/0.16.1/V1.User)\n- [0.12.0](/php/docs/reference/cloud-sql-admin/0.12.0/V1.User)\n- [0.11.0](/php/docs/reference/cloud-sql-admin/0.11.0/V1.User)\n- [0.10.0](/php/docs/reference/cloud-sql-admin/0.10.0/V1.User)\n- [0.9.0](/php/docs/reference/cloud-sql-admin/0.9.0/V1.User)\n- [0.8.0](/php/docs/reference/cloud-sql-admin/0.8.0/V1.User)\n- [0.7.0](/php/docs/reference/cloud-sql-admin/0.7.0/V1.User)\n- [0.6.0](/php/docs/reference/cloud-sql-admin/0.6.0/V1.User)\n- [0.5.0](/php/docs/reference/cloud-sql-admin/0.5.0/V1.User)\n- [0.4.1](/php/docs/reference/cloud-sql-admin/0.4.1/V1.User)\n- [0.3.1](/php/docs/reference/cloud-sql-admin/0.3.1/V1.User)\n- [0.2.12](/php/docs/reference/cloud-sql-admin/0.2.12/V1.User) \nReference documentation and code samples for the Google Cloud Sql Admin V1 Client class User.\n\nA Cloud SQL user resource.\n\nGenerated from protobuf message `google.cloud.sql.v1.User`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Sql \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getKind\n\nThis is always `sql#user`.\n\n### setKind\n\nThis is always `sql#user`.\n\n### getPassword\n\nThe password for the user.\n\n### setPassword\n\nThe password for the user.\n\n### getEtag\n\nThis field is deprecated and will be removed from a future version of the\nAPI.\n\n### setEtag\n\nThis field is deprecated and will be removed from a future version of the\nAPI.\n\n### getName\n\nThe name of the user in the Cloud SQL instance. Can be omitted for\n`update` because it is already specified in the URL.\n\n### setName\n\nThe name of the user in the Cloud SQL instance. Can be omitted for\n`update` because it is already specified in the URL.\n\n### getHost\n\nOptional. The host from which the user can connect. For `insert`\noperations, host defaults to an empty string. For `update`\noperations, host is specified as part of the request URL. The host name\ncannot be updated after insertion. For a MySQL instance, it's required;\nfor a PostgreSQL or SQL Server instance, it's optional.\n\n### setHost\n\nOptional. The host from which the user can connect. For `insert`\noperations, host defaults to an empty string. For `update`\noperations, host is specified as part of the request URL. The host name\ncannot be updated after insertion. For a MySQL instance, it's required;\nfor a PostgreSQL or SQL Server instance, it's optional.\n\n### getInstance\n\nThe name of the Cloud SQL instance. This does not include the project ID.\n\nCan be omitted for `update` because it is already specified on the\nURL.\n\n### setInstance\n\nThe name of the Cloud SQL instance. This does not include the project ID.\n\nCan be omitted for `update` because it is already specified on the\nURL.\n\n### getProject\n\nThe project ID of the project containing the Cloud SQL database. The Google\napps domain is prefixed if applicable. Can be omitted for `update` because\nit is already specified on the URL.\n\n### setProject\n\nThe project ID of the project containing the Cloud SQL database. The Google\napps domain is prefixed if applicable. Can be omitted for `update` because\nit is already specified on the URL.\n\n### getType\n\nThe user type. It determines the method to authenticate the user during\nlogin. The default is the database's built-in user type.\n\n### setType\n\nThe user type. It determines the method to authenticate the user during\nlogin. The default is the database's built-in user type.\n\n### getSqlserverUserDetails\n\nGenerated from protobuf field `.google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9;`\n\n### hasSqlserverUserDetails\n\n### setSqlserverUserDetails\n\nGenerated from protobuf field `.google.cloud.sql.v1.SqlServerUserDetails sqlserver_user_details = 9;`\n\n### getPasswordPolicy\n\nUser level password validation policy.\n\n### hasPasswordPolicy\n\n### clearPasswordPolicy\n\n### setPasswordPolicy\n\nUser level password validation policy.\n\n### getDualPasswordType\n\nDual password status for the user.\n\n### hasDualPasswordType\n\n### clearDualPasswordType\n\n### setDualPasswordType\n\nDual password status for the user.\n\n### getUserDetails"]]