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, x__xgafv=None)

Creates a user.

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

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

list_next(previous_request, previous_response)

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, since it also supports patch semantics and has better performance. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.

signOut(userKey, x__xgafv=None)

Sign 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 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.

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

Watch 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
      projectionUndefined - 
      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
      view_type_undefined - 
      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 Gmail chat 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).
      "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.
      "ims": "", # 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.
      "creationTime": "A String", # User's G Suite account creation time. (Read-only)
      "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
      "aliases": [ # Output only. List of the user's alias email addresses.
        "A String",
      ],
      "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
      "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
      "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
      "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.
      "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
      "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 (`/`).
      "deletionTime": "A String",
      "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
        "A String",
      ],
      "archived": True or False, # Indicates if user is archived.
      "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
      "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
      "sshPublicKeys": "", # A list of SSH public keys.
      "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*.
      "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
      "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.
      "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).
      "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
      "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
      "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
      "suspended": True or False, # Indicates if user is suspended.
      "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](http://support.google.com/a/bin/answer.py?answer=33325).
      "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
      "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`.
      "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
      "lastLoginTime": "A String", # User's last login time. (Read-only)
      "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
      "etag": "A String", # Output only. ETag of the resource.
      "notes": "", # Notes for the user.
      "recoveryEmail": "A String", # Recovery email of the user.
      "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
      "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
      "customSchemas": { # Custom fields of the user.
        "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
          "a_key": "",
        },
      },
      "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
        "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
        "familyName": "A String", # The user's last name. Required when creating a user account.
        "givenName": "A String", # The user's first name. Required when creating a user account.
      },
      "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.
      "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
      "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
      "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
      "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
      "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
      "password": "A String", # User's password
      "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.
    }
insert(body=None, x__xgafv=None)
Creates a user.

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 Gmail chat 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).
    "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.
    "ims": "", # 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.
    "creationTime": "A String", # User's G Suite account creation time. (Read-only)
    "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
    "aliases": [ # Output only. List of the user's alias email addresses.
      "A String",
    ],
    "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
    "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
    "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
    "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.
    "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
    "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 (`/`).
    "deletionTime": "A String",
    "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
      "A String",
    ],
    "archived": True or False, # Indicates if user is archived.
    "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
    "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
    "sshPublicKeys": "", # A list of SSH public keys.
    "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*.
    "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
    "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.
    "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).
    "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
    "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
    "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
    "suspended": True or False, # Indicates if user is suspended.
    "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](http://support.google.com/a/bin/answer.py?answer=33325).
    "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
    "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`.
    "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
    "lastLoginTime": "A String", # User's last login time. (Read-only)
    "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
    "etag": "A String", # Output only. ETag of the resource.
    "notes": "", # Notes for the user.
    "recoveryEmail": "A String", # Recovery email of the user.
    "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
    "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
    "customSchemas": { # Custom fields of the user.
      "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
        "a_key": "",
      },
    },
    "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
      "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
      "familyName": "A String", # The user's last name. Required when creating a user account.
      "givenName": "A String", # The user's first name. Required when creating a user account.
    },
    "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.
    "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
    "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
    "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
    "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
    "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
    "password": "A String", # User's password
    "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.
  }

  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 Gmail chat 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).
      "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.
      "ims": "", # 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.
      "creationTime": "A String", # User's G Suite account creation time. (Read-only)
      "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
      "aliases": [ # Output only. List of the user's alias email addresses.
        "A String",
      ],
      "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
      "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
      "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
      "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.
      "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
      "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 (`/`).
      "deletionTime": "A String",
      "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
        "A String",
      ],
      "archived": True or False, # Indicates if user is archived.
      "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
      "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
      "sshPublicKeys": "", # A list of SSH public keys.
      "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*.
      "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
      "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.
      "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).
      "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
      "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
      "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
      "suspended": True or False, # Indicates if user is suspended.
      "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](http://support.google.com/a/bin/answer.py?answer=33325).
      "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
      "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`.
      "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
      "lastLoginTime": "A String", # User's last login time. (Read-only)
      "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
      "etag": "A String", # Output only. ETag of the resource.
      "notes": "", # Notes for the user.
      "recoveryEmail": "A String", # Recovery email of the user.
      "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
      "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
      "customSchemas": { # Custom fields of the user.
        "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
          "a_key": "",
        },
      },
      "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
        "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
        "familyName": "A String", # The user's last name. Required when creating a user account.
        "givenName": "A String", # The user's first name. Required when creating a user account.
      },
      "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.
      "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
      "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
      "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
      "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
      "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
      "password": "A String", # User's password
      "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.
    }
list(sortOrder=None, customFieldMask=None, maxResults=None, customer=None, viewType=None, showDeleted=None, domain=None, query=None, orderBy=None, projection=None, pageToken=None, x__xgafv=None)
Retrieves a paginated list of either deleted users or all users in a domain.

Args:
  sortOrder: string, Whether to return results in ascending or descending order.
    Allowed values
      SORT_ORDER_UNDEFINED - 
      ASCENDING - Ascending order.
      DESCENDING - Descending order.
  customFieldMask: string, A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when `projection=custom`.
  maxResults: integer, Maximum number of results to return.
  customer: string, The unique ID for the customer's G Suite account. In case of a multi-domain account, to fetch all groups for a customer, fill 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 resource](/admin-sdk/directory/v1/reference/users). Either the `customer` or the `domain` parameter must be provided.
  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
      view_type_undefined - 
      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.
  showDeleted: string, If set to `true`, retrieves the list of deleted users. (Default: `false`)
  domain: string, The domain name. Use this field to get fields 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.
  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).
  orderBy: string, Property to use for sorting results.
    Allowed values
      orderByUndefined - 
      email - Primary email of the user.
      familyName - User's family name.
      givenName - User's given name.
  projection: string, What subset of fields to fetch for this user.
    Allowed values
      projectionUndefined - 
      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.
  pageToken: string, Token to specify next page in the list
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
    "users": [ # List of user objects.
      { # The Directory API allows you to create and manage your account's users, user aliases, and user Gmail chat 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).
          "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.
          "ims": "", # 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.
          "creationTime": "A String", # User's G Suite account creation time. (Read-only)
          "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
          "aliases": [ # Output only. List of the user's alias email addresses.
            "A String",
          ],
          "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
          "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
          "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
          "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.
          "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
          "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 (`/`).
          "deletionTime": "A String",
          "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
            "A String",
          ],
          "archived": True or False, # Indicates if user is archived.
          "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
          "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
          "sshPublicKeys": "", # A list of SSH public keys.
          "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*.
          "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
          "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.
          "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).
          "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
          "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
          "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
          "suspended": True or False, # Indicates if user is suspended.
          "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](http://support.google.com/a/bin/answer.py?answer=33325).
          "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
          "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`.
          "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
          "lastLoginTime": "A String", # User's last login time. (Read-only)
          "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
          "etag": "A String", # Output only. ETag of the resource.
          "notes": "", # Notes for the user.
          "recoveryEmail": "A String", # Recovery email of the user.
          "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
          "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
          "customSchemas": { # Custom fields of the user.
            "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
              "a_key": "",
            },
          },
          "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
            "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
            "familyName": "A String", # The user's last name. Required when creating a user account.
            "givenName": "A String", # The user's first name. Required when creating a user account.
          },
          "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.
          "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
          "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
          "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
          "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
          "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
          "password": "A String", # User's password
          "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.
        },
    ],
    "trigger_event": "A String", # Event that triggered this response (only used in case of Push Response)
    "kind": "admin#directory#users", # Kind of resource this is.
    "etag": "A String", # ETag of the resource.
    "nextPageToken": "A String", # Token used to access next page of this result.
  }
list_next(previous_request, previous_response)
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, since it also supports patch semantics and has better performance. 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 Gmail chat 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).
    "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.
    "ims": "", # 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.
    "creationTime": "A String", # User's G Suite account creation time. (Read-only)
    "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
    "aliases": [ # Output only. List of the user's alias email addresses.
      "A String",
    ],
    "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
    "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
    "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
    "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.
    "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
    "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 (`/`).
    "deletionTime": "A String",
    "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
      "A String",
    ],
    "archived": True or False, # Indicates if user is archived.
    "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
    "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
    "sshPublicKeys": "", # A list of SSH public keys.
    "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*.
    "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
    "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.
    "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).
    "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
    "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
    "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
    "suspended": True or False, # Indicates if user is suspended.
    "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](http://support.google.com/a/bin/answer.py?answer=33325).
    "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
    "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`.
    "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
    "lastLoginTime": "A String", # User's last login time. (Read-only)
    "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
    "etag": "A String", # Output only. ETag of the resource.
    "notes": "", # Notes for the user.
    "recoveryEmail": "A String", # Recovery email of the user.
    "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
    "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
    "customSchemas": { # Custom fields of the user.
      "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
        "a_key": "",
      },
    },
    "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
      "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
      "familyName": "A String", # The user's last name. Required when creating a user account.
      "givenName": "A String", # The user's first name. Required when creating a user account.
    },
    "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.
    "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
    "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
    "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
    "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
    "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
    "password": "A String", # User's password
    "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.
  }

  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 Gmail chat 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).
      "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.
      "ims": "", # 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.
      "creationTime": "A String", # User's G Suite account creation time. (Read-only)
      "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
      "aliases": [ # Output only. List of the user's alias email addresses.
        "A String",
      ],
      "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
      "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
      "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
      "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.
      "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
      "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 (`/`).
      "deletionTime": "A String",
      "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
        "A String",
      ],
      "archived": True or False, # Indicates if user is archived.
      "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
      "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
      "sshPublicKeys": "", # A list of SSH public keys.
      "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*.
      "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
      "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.
      "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).
      "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
      "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
      "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
      "suspended": True or False, # Indicates if user is suspended.
      "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](http://support.google.com/a/bin/answer.py?answer=33325).
      "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
      "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`.
      "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
      "lastLoginTime": "A String", # User's last login time. (Read-only)
      "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
      "etag": "A String", # Output only. ETag of the resource.
      "notes": "", # Notes for the user.
      "recoveryEmail": "A String", # Recovery email of the user.
      "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
      "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
      "customSchemas": { # Custom fields of the user.
        "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
          "a_key": "",
        },
      },
      "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
        "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
        "familyName": "A String", # The user's last name. Required when creating a user account.
        "givenName": "A String", # The user's first name. Required when creating a user account.
      },
      "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.
      "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
      "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
      "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
      "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
      "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
      "password": "A String", # User's password
      "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.
    }
signOut(userKey, x__xgafv=None)
Sign 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 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.

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 Gmail chat 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).
    "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.
    "ims": "", # 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.
    "creationTime": "A String", # User's G Suite account creation time. (Read-only)
    "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
    "aliases": [ # Output only. List of the user's alias email addresses.
      "A String",
    ],
    "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
    "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
    "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
    "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.
    "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
    "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 (`/`).
    "deletionTime": "A String",
    "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
      "A String",
    ],
    "archived": True or False, # Indicates if user is archived.
    "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
    "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
    "sshPublicKeys": "", # A list of SSH public keys.
    "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*.
    "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
    "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.
    "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).
    "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
    "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
    "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
    "suspended": True or False, # Indicates if user is suspended.
    "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](http://support.google.com/a/bin/answer.py?answer=33325).
    "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
    "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`.
    "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
    "lastLoginTime": "A String", # User's last login time. (Read-only)
    "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
    "etag": "A String", # Output only. ETag of the resource.
    "notes": "", # Notes for the user.
    "recoveryEmail": "A String", # Recovery email of the user.
    "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
    "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
    "customSchemas": { # Custom fields of the user.
      "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
        "a_key": "",
      },
    },
    "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
      "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
      "familyName": "A String", # The user's last name. Required when creating a user account.
      "givenName": "A String", # The user's first name. Required when creating a user account.
    },
    "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.
    "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
    "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
    "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
    "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
    "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
    "password": "A String", # User's password
    "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.
  }

  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 Gmail chat 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).
      "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.
      "ims": "", # 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.
      "creationTime": "A String", # User's G Suite account creation time. (Read-only)
      "ipWhitelisted": True or False, # If `true`, the user's IP address is [white listed](http://support.google.com/a/bin/answer.py?answer=60752).
      "aliases": [ # Output only. List of the user's alias email addresses.
        "A String",
      ],
      "locations": "", # The user's locations. The maximum allowed data size for this field is 10Kb.
      "includeInGlobalAddressList": True or False, # Indicates if the user's profile is visible in the G Suite 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](http://support.google.com/a/bin/answer.py?answer=1285988).
      "relations": "", # A list of the user's relationships to other users. The maximum allowed data size for this field is 2Kb.
      "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.
      "id": "A String", # The unique ID for the user. A user `id` can be used as a user request URI's `userKey`.
      "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 (`/`).
      "deletionTime": "A String",
      "nonEditableAliases": [ # Output only. List of the user's non-editable alias email addresses. These are typically outside the account's primary domain or sub-domain.
        "A String",
      ],
      "archived": True or False, # Indicates if user is archived.
      "thumbnailPhotoEtag": "A String", # Output only. ETag of the user's photo (Read-only)
      "gender": "", # The user's gender. The maximum allowed data size for this field is 1Kb.
      "sshPublicKeys": "", # A list of SSH public keys.
      "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*.
      "posixAccounts": "", # A list of [POSIX](http://www.opengroup.org/austin/papers/posix_faq.html) account information for the user.
      "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.
      "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).
      "isEnforcedIn2Sv": True or False, # Output only. Is 2-step verification enforced (Read-only)
      "keywords": "", # The user's keywords. The maximum allowed data size for this field is 1Kb.
      "thumbnailPhotoUrl": "A String", # Output only. Photo Url of the user (Read-only)
      "suspended": True or False, # Indicates if user is suspended.
      "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](http://support.google.com/a/bin/answer.py?answer=33325).
      "kind": "admin#directory#user", # Output only. The type of the API resource. For Users resources, the value is `admin#directory#user`.
      "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`.
      "websites": "", # The user's websites. The maximum allowed data size for this field is 2Kb.
      "lastLoginTime": "A String", # User's last login time. (Read-only)
      "addresses": "", # A list of the user's addresses. The maximum allowed data size for this field is 10Kb.
      "etag": "A String", # Output only. ETag of the resource.
      "notes": "", # Notes for the user.
      "recoveryEmail": "A String", # Recovery email of the user.
      "hashFunction": "A String", # Stores the hash format of the password property. We recommend sending the `password` property value as a base 16 bit hexadecimal-encoded hash value. Set the `hashFunction` values as either the [SHA-1](http://wikipedia.org/wiki/SHA-1), [MD5](http://wikipedia.org/wiki/MD5), or [crypt](https://en.wikipedia.org/wiki/Crypt_(C)) hash format.
      "organizations": "", # A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
      "customSchemas": { # Custom fields of the user.
        "a_key": { # JSON template for a set of custom properties (i.e. all fields in a particular schema)
          "a_key": "",
        },
      },
      "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](http://support.google.com/a/bin/answer.py?answer=33386). Maximum allowed data size for this field is 1Kb.
        "fullName": "A String", # The user's full name formed by concatenating the first and last name values.
        "familyName": "A String", # The user's last name. Required when creating a user account.
        "givenName": "A String", # The user's first name. Required when creating a user account.
      },
      "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.
      "languages": "", # The user's languages. The maximum allowed data size for this field is 1Kb.
      "externalIds": "", # A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.
      "isEnrolledIn2Sv": True or False, # Output only. Is enrolled in 2-step verification (Read-only)
      "emails": "", # A list of the user's email addresses. The maximum allowed data size for this field is 10Kb.
      "phones": "", # A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
      "password": "A String", # User's password
      "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.
    }
watch(body=None, customFieldMask=None, domain=None, orderBy=None, pageToken=None, showDeleted=None, projection=None, customer=None, query=None, viewType=None, maxResults=None, sortOrder=None, event=None, x__xgafv=None)
Watch 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.
    "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.
    "type": "A String", # The type of delivery mechanism used for this channel.
    "address": "A String", # The address where notifications are delivered for this channel.
    "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is `api#channel`.
    "id": "A String", # A UUID or similar unique string that identifies this channel.
    "params": { # Additional parameters controlling delivery channel behavior. Optional.
      "a_key": "A String",
    },
    "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
    "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
    "resourceUri": "A String", # A version-specific identifier for the watched resource.
  }

  customFieldMask: string, Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.
  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."
  orderBy: string, Column to use for sorting results
    Allowed values
      orderByUnspecified - 
      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
  showDeleted: string, If set to true, retrieves the list of deleted users. (Default: false)
  projection: string, What subset of fields to fetch for this user.
    Allowed values
      projectionUnspecified - 
      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.
  customer: string, Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain.
  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
  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.
  maxResults: integer, Maximum number of results to return.
  sortOrder: string, Whether to return results in ascending or descending order.
    Allowed values
      sortOrderUnspecified - 
      ASCENDING - Ascending order.
      DESCENDING - Descending order.
  event: string, Events to watch for.
    Allowed values
      eventTypeUnspecified - 
      add - User Created Event
      delete - User Deleted Event
      makeAdmin - User Admin Status Change Event
      undelete - User Undeleted Event
      update - User Updated Event
  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.
      "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.
      "type": "A String", # The type of delivery mechanism used for this channel.
      "address": "A String", # The address where notifications are delivered for this channel.
      "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is `api#channel`.
      "id": "A String", # A UUID or similar unique string that identifies this channel.
      "params": { # Additional parameters controlling delivery channel behavior. Optional.
        "a_key": "A String",
      },
      "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
      "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
      "resourceUri": "A String", # A version-specific identifier for the watched resource.
    }