Admin SDK API . users

Instance Methods

aliases()

Returns the aliases Resource.

photos()

Returns the photos Resource.

close()

Close httplib2 connections.

delete(userKey, x__xgafv=None)

Deletes a user.

get(userKey, customFieldMask=None, projection=None, viewType=None, x__xgafv=None)

Retrieves a user.

insert(body=None, resolveConflictAccount=None, x__xgafv=None)

Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case. If `resolveConflictAccount` is set to `true`, a `202` response code means that a conflicting unmanaged account exists and was invited to join the organization. A `409` response code means that a conflicting account exists so the user wasn't created based on the [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) option selected.

list(customFieldMask=None, customer=None, domain=None, event=None, maxResults=None, orderBy=None, pageToken=None, projection=None, query=None, showDeleted=None, sortOrder=None, viewType=None, x__xgafv=None)

Retrieves a paginated list of either deleted users or all users in a domain.

list_next()

Retrieves the next page of results.

makeAdmin(userKey, body=None, x__xgafv=None)

Makes a user a super administrator.

patch(userKey, body=None, x__xgafv=None)

Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance. If you're mapping an external identity to a Google identity, use the [`update`](https://developers.google.com/admin-sdk/directory/v1/reference/users/update) method instead of the `patch` method. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.

signOut(userKey, x__xgafv=None)

Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.

undelete(userKey, body=None, x__xgafv=None)

Undeletes a deleted user.

update(userKey, body=None, x__xgafv=None)

Updates a user. This method supports patch semantics, meaning that you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to `null` will be cleared. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items. See the [user accounts guide](https://developers.google.com/admin-sdk/directory/v1/guides/manage-users#update_user) for more information.

watch(body=None, customFieldMask=None, customer=None, domain=None, event=None, maxResults=None, orderBy=None, pageToken=None, projection=None, query=None, showDeleted=None, sortOrder=None, viewType=None, x__xgafv=None)

Watches for changes in users list.

Method Details

close()
Close httplib2 connections.
delete(userKey, x__xgafv=None)
Deletes a user.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
get(userKey, customFieldMask=None, projection=None, viewType=None, x__xgafv=None)
Retrieves a user.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  customFieldMask: string, A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.
  projection: string, What subset of fields to fetch for this user.
    Allowed values
      basic - Do not include any custom fields for the user.
      custom - Include custom fields from schemas requested in `customFieldMask`.
      full - Include all fields associated with this user.
  viewType: string, Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
    Allowed values
      admin_view - Results include both administrator-only and domain-public fields for the user.
      domain_public - Results only include fields for the user that are publicly visible to other users in the domain.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}
insert(body=None, resolveConflictAccount=None, x__xgafv=None)
Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case. If `resolveConflictAccount` is set to `true`, a `202` response code means that a conflicting unmanaged account exists and was invited to join the organization. A `409` response code means that a conflicting account exists so the user wasn't created based on the [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) option selected.

Args:
  body: object, The request body.
    The object takes the form of:

{ # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}

  resolveConflictAccount: boolean, Optional. If set to `true`, the option selected for [handling unmanaged user accounts](https://support.google.com/a/answer/11112794) will apply. Default: `false`
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}
list(customFieldMask=None, customer=None, domain=None, event=None, maxResults=None, orderBy=None, pageToken=None, projection=None, query=None, showDeleted=None, sortOrder=None, viewType=None, x__xgafv=None)
Retrieves a paginated list of either deleted users or all users in a domain.

Args:
  customFieldMask: string, A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.
  customer: string, The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch all users for a customer, use this field instead of `domain`. You can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users](/admin-sdk/directory/v1/reference/users) resource. You must provide either the `customer` or the `domain` parameter.
  domain: string, The domain name. Use this field to get users from only one domain. To return all domains for a customer account, use the `customer` query parameter instead. Either the `customer` or the `domain` parameter must be provided.
  event: string, Event on which subscription is intended (if subscribing)
    Allowed values
      add - User Created Event
      delete - User Deleted Event
      makeAdmin - User Admin Status Change Event
      undelete - User Undeleted Event
      update - User Updated Event
  maxResults: integer, Maximum number of results to return.
  orderBy: string, Property to use for sorting results.
    Allowed values
      email - Primary email of the user.
      familyName - User's family name.
      givenName - User's given name.
  pageToken: string, Token to specify next page in the list
  projection: string, What subset of fields to fetch for this user.
    Allowed values
      basic - Do not include any custom fields for the user.
      custom - Include custom fields from schemas requested in `customFieldMask`.
      full - Include all fields associated with this user.
  query: string, Query string for searching user fields. For more information on constructing user queries, see [Search for Users](/admin-sdk/directory/v1/guides/search-users).
  showDeleted: string, If set to `true`, retrieves the list of deleted users. (Default: `false`)
  sortOrder: string, Whether to return results in ascending or descending order, ignoring case.
    Allowed values
      ASCENDING - Ascending order.
      DESCENDING - Descending order.
  viewType: string, Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
    Allowed values
      admin_view - Results include both administrator-only and domain-public fields for the user.
      domain_public - Results only include fields for the user that are publicly visible to other users in the domain.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  "etag": "A String", # ETag of the resource.
  "kind": "admin#directory#users", # Kind of resource this is.
  "nextPageToken": "A String", # Token used to access next page of this result.
  "trigger_event": "A String", # Event that triggered this response (only used in case of Push Response)
  "users": [ # A list of user objects.
    { # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
      "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
      "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
      "aliases": [ # Output only. The list of the user's alias email addresses.
        "A String",
      ],
      "archived": True or False, # Indicates if user is archived.
      "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
      "creationTime": "A String", # User's G Suite account creation time. (Read-only)
      "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
        "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
          "a_key": "",
        },
      },
      "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
      "deletionTime": "A String",
      "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
      "etag": "A String", # Output only. ETag of the resource.
      "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
      "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
      "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
      "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
      "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
      "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
      "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
      "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
      "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
      "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
      "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
      "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
      "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
      "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
      "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
      "lastLoginTime": "A String", # User's last login time. (Read-only)
      "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
      "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
        "displayName": "A String", # The user's display name. Limit: 256 characters.
        "familyName": "A String", # The user's last name. Required when creating a user account.
        "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
        "givenName": "A String", # The user's first name. Required when creating a user account.
      },
      "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
        "A String",
      ],
      "notes": "", # Notes for the user.
      "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
      "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
      "password": "A String", # User's password
      "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
      "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
      "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
      "recoveryEmail": "A String", # Recovery email of the user.
      "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
      "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
      "sshPublicKeys": "", # A list of SSH public keys.
      "suspended": True or False, # Indicates if user is suspended.
      "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
      "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
      "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
      "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
    },
  ],
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.
        
makeAdmin(userKey, body=None, x__xgafv=None)
Makes a user a super administrator.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  body: object, The request body.
    The object takes the form of:

{
  "status": True or False, # Indicates the administrator status of the user.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
patch(userKey, body=None, x__xgafv=None)
Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance. If you're mapping an external identity to a Google identity, use the [`update`](https://developers.google.com/admin-sdk/directory/v1/reference/users/update) method instead of the `patch` method. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  body: object, The request body.
    The object takes the form of:

{ # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}
signOut(userKey, x__xgafv=None)
Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.

Args:
  userKey: string, Identifies the target user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
undelete(userKey, body=None, x__xgafv=None)
Undeletes a deleted user.

Args:
  userKey: string, The immutable id of the user (required)
  body: object, The request body.
    The object takes the form of:

{
  "orgUnitPath": "A String", # OrgUnit of User
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
update(userKey, body=None, x__xgafv=None)
Updates a user. This method supports patch semantics, meaning that you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to `null` will be cleared. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items. See the [user accounts guide](https://developers.google.com/admin-sdk/directory/v1/guides/manage-users#update_user) for more information.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  body: object, The request body.
    The object takes the form of:

{ # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The Directory API allows you to create and manage your account's users, user aliases, and user Google profile photos. For more information about common tasks, see the [User Accounts Developer's Guide](/admin-sdk/directory/v1/guides/manage-users.html) and the [User Aliases Developer's Guide](/admin-sdk/directory/v1/guides/manage-user-aliases.html).
  "addresses": "", # The list of the user's addresses. The maximum allowed data size for this field is 10KB.
  "agreedToTerms": True or False, # Output only. This property is `true` if the user has completed an initial login and accepted the Terms of Service agreement.
  "aliases": [ # Output only. The list of the user's alias email addresses.
    "A String",
  ],
  "archived": True or False, # Indicates if user is archived.
  "changePasswordAtNextLogin": True or False, # Indicates if the user is forced to change their password at next login. This setting doesn't apply when [the user signs in via a third-party identity provider](https://support.google.com/a/answer/60224).
  "creationTime": "A String", # User's G Suite account creation time. (Read-only)
  "customSchemas": { # Custom fields of the user. The key is a `schema_name` and its values are `'field_name': 'field_value'`.
    "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
      "a_key": "",
    },
  },
  "customerId": "A String", # Output only. The customer ID to [retrieve all account users](/admin-sdk/directory/v1/guides/manage-users.html#get_all_users). You can use the alias `my_customer` to represent your account's `customerId`. As a reseller administrator, you can use the resold customer account's `customerId`. To get a `customerId`, use the account's primary domain in the `domain` parameter of a [users.list](/admin-sdk/directory/v1/reference/users/list) request.
  "deletionTime": "A String",
  "emails": "", # The list of the user's email addresses. The maximum allowed data size for this field is 10KB. This excludes `publicKeyEncryptionCertificates`.
  "etag": "A String", # Output only. ETag of the resource.
  "externalIds": "", # The list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2KB.
  "gender": "", # The user's gender. The maximum allowed data size for this field is 1KB.
  "hashFunction": "A String", # Stores the hash format of the `password` property. The following `hashFunction` values are allowed: * `MD5` - Accepts simple hex-encoded values. * `SHA-1` - Accepts simple hex-encoded values. * `crypt` - Compliant with the [C crypt library](https://en.wikipedia.org/wiki/Crypt_%28C%29). Supports the DES, MD5 (hash prefix `$1$`), SHA-256 (hash prefix `$5$`), and SHA-512 (hash prefix `$6$`) hash algorithms. If rounds are specified as part of the prefix, they must be 10,000 or fewer.
  "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
  "ims": "", # The list of the user's Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2KB.
  "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the Google Workspace global address list when the contact sharing feature is enabled for the domain. For more information about excluding user profiles, see the [administration help center](https://support.google.com/a/answer/1285988).
  "ipWhitelisted": True or False, # If `true`, the user's IP address is subject to a deprecated IP address [`allowlist`](https://support.google.com/a/answer/60752) configuration.
  "isAdmin": True or False, # Output only. Indicates a user with super admininistrator privileges. The `isAdmin` property can only be edited in the [Make a user an administrator](/admin-sdk/directory/v1/guides/manage-users.html#make_admin) operation ( [makeAdmin](/admin-sdk/directory/v1/reference/users/makeAdmin.html) method). If edited in the user [insert](/admin-sdk/directory/v1/reference/users/insert.html) or [update](/admin-sdk/directory/v1/reference/users/update.html) methods, the edit is ignored by the API service.
  "isDelegatedAdmin": True or False, # Output only. Indicates if the user is a delegated administrator. Delegated administrators are supported by the API but cannot create or undelete users, or make users administrators. These requests are ignored by the API service. Roles and privileges for administrators are assigned using the [Admin console](https://support.google.com/a/answer/33325).
  "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
  "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
  "isMailboxSetup": True or False, # Output only. Indicates if the user's Google mailbox is created. This property is only applicable if the user has been assigned a Gmail license.
  "keywords": "", # The list of the user's keywords. The maximum allowed data size for this field is 1KB.
  "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
  "languages": "", # The user's languages. The maximum allowed data size for this field is 1KB.
  "lastLoginTime": "A String", # User's last login time. (Read-only)
  "locations": "", # The user's locations. The maximum allowed data size for this field is 10KB.
  "name": { # Holds the given and family names of the user, and the read-only `fullName` value. The maximum number of characters in the `givenName` and in the `familyName` values is 60. In addition, name values support unicode/UTF-8 characters, and can contain spaces, letters (a-z), numbers (0-9), dashes (-), forward slashes (/), and periods (.). For more information about character usage rules, see the [administration help center](https://support.google.com/a/answer/9193374). Maximum allowed data size for this field is 1KB.
    "displayName": "A String", # The user's display name. Limit: 256 characters.
    "familyName": "A String", # The user's last name. Required when creating a user account.
    "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
    "givenName": "A String", # The user's first name. Required when creating a user account.
  },
  "nonEditableAliases": [ # Output only. The list of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
    "A String",
  ],
  "notes": "", # Notes for the user.
  "orgUnitPath": "A String", # The full path of the parent organization associated with the user. If the parent organization is the top-level, it is represented as a forward slash (`/`).
  "organizations": "", # The list of organizations the user belongs to. The maximum allowed data size for this field is 10KB.
  "password": "A String", # User's password
  "phones": "", # The list of the user's phone numbers. The maximum allowed data size for this field is 1KB.
  "posixAccounts": "", # The list of [POSIX](https://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
  "primaryEmail": "A String", # The user's primary email address. This property is required in a request to create a user account. The `primaryEmail` must be unique and cannot be an alias of another user.
  "recoveryEmail": "A String", # Recovery email of the user.
  "recoveryPhone": "A String", # Recovery phone of the user. The phone number must be in the E.164 format, starting with the plus sign (+). Example: *+16506661212*.
  "relations": "", # The list of the user's relationships to other users. The maximum allowed data size for this field is 2KB.
  "sshPublicKeys": "", # A list of SSH public keys.
  "suspended": True or False, # Indicates if user is suspended.
  "suspensionReason": "A String", # Output only. Has the reason a user account is suspended either by the administrator or by Google at the time of suspension. The property is returned only if the `suspended` property is `true`.
  "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
  "thumbnailPhotoUrl": "A String", # Output only. The URL of the user's profile photo. The URL might be temporary or private.
  "websites": "", # The user's websites. The maximum allowed data size for this field is 2KB.
}
watch(body=None, customFieldMask=None, customer=None, domain=None, event=None, maxResults=None, orderBy=None, pageToken=None, projection=None, query=None, showDeleted=None, sortOrder=None, viewType=None, x__xgafv=None)
Watches for changes in users list.

Args:
  body: object, The request body.
    The object takes the form of:

{ # An notification channel used to watch for resource changes.
  "address": "A String", # The address where notifications are delivered for this channel.
  "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
  "id": "A String", # A UUID or similar unique string that identifies this channel.
  "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is `api#channel`.
  "params": { # Additional parameters controlling delivery channel behavior. Optional. For example, `params.ttl` specifies the time-to-live in seconds for the notification channel, where the default is 2 hours and the maximum TTL is 2 days.
    "a_key": "A String",
  },
  "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
  "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
  "resourceUri": "A String", # A version-specific identifier for the watched resource.
  "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
  "type": "A String", # The type of delivery mechanism used for this channel.
}

  customFieldMask: string, Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.
  customer: string, Immutable ID of the Google Workspace account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.
  domain: string, Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead."
  event: string, Events to watch for.
    Allowed values
      add - User Created Event
      delete - User Deleted Event
      makeAdmin - User Admin Status Change Event
      undelete - User Undeleted Event
      update - User Updated Event
  maxResults: integer, Maximum number of results to return.
  orderBy: string, Column to use for sorting results
    Allowed values
      email - Primary email of the user.
      familyName - User's family name.
      givenName - User's given name.
  pageToken: string, Token to specify next page in the list
  projection: string, What subset of fields to fetch for this user.
    Allowed values
      basic - Do not include any custom fields for the user.
      custom - Include custom fields from schemas mentioned in customFieldMask.
      full - Include all fields associated with this user.
  query: string, Query string search. Should be of the form "". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-users
  showDeleted: string, If set to true, retrieves the list of deleted users. (Default: false)
  sortOrder: string, Whether to return results in ascending or descending order.
    Allowed values
      ASCENDING - Ascending order.
      DESCENDING - Descending order.
  viewType: string, Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see [Retrieve a user as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin).
    Allowed values
      admin_view - Results include both administrator-only and domain-public fields.
      domain_public - Results only include fields for the user that are publicly visible to other users in the domain.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # An notification channel used to watch for resource changes.
  "address": "A String", # The address where notifications are delivered for this channel.
  "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
  "id": "A String", # A UUID or similar unique string that identifies this channel.
  "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is `api#channel`.
  "params": { # Additional parameters controlling delivery channel behavior. Optional. For example, `params.ttl` specifies the time-to-live in seconds for the notification channel, where the default is 2 hours and the maximum TTL is 2 days.
    "a_key": "A String",
  },
  "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
  "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
  "resourceUri": "A String", # A version-specific identifier for the watched resource.
  "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
  "type": "A String", # The type of delivery mechanism used for this channel.
}