GoSpace Manager

Version v0.11.0

Manage Google Workspace resources using a developer-friendly CLI written in Go

update

Updates a user using patch semantics.

Synopsis

Implements the API documented at https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/update

gsm users update [flags]

Options

      --addresses strings            Specifies addresses for the user. May be used multiple times in the form of:
                                     '--addresses "country=...;countryCode=..;customType=..."', etc.
                                     You can use the following properties:
                                     country             - Country.
                                     countryCode         - The country code. Uses the ISO 3166-1 standard.
                                     customType          - If the address type is custom, this property contains the custom value.
                                     extendedAddress     - For extended addresses, such as an address that includes a sub-region.
                                     formatted           - A full and unstructured postal address. This is not synced with the structured address fields.
                                     locality            - The town or city of the address.
                                     poBox               - The post office box, if present.
                                     postalCode          - The ZIP or postal code, if applicable.
                                     primary             - BOOL! If this is the user's primary address. The addresses list may contain only one primary address.
                                     region              - The abbreviated province or state.
                                     sourceIsStructured  - BOOL! Indicates if the user-supplied address was formatted. Formatted addresses are not currently supported.
                                     streetAddress       - The street address, such as 1600 Amphitheatre Parkway. Whitespace within the string is ignored; however, newlines are significant.
                                     type                - The address type.
                                                           Acceptable values are:
                                                             - "custom"
                                                             - "home"
                                                             - "other"
                                                             - "work"
      --archived                     Indicates if user is archived.
      --changePasswordAtNextLogin    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.
      --customGender string          Custom gender.
      --emails strings               Specifies email addresses for the user. May be used multiple times in the form of:
                                     '--emails "address=...;customType=..;primary=..."', etc.
                                     You can use the following properties:
                                     address     - Country.
                                     customType  - The country code. Uses the ISO 3166-1 standard.
                                     primary     - If the address type is custom, this property contains the custom value.
                                     type        - The type of the email account.
                                                   Acceptable values are:
                                                     - "custom"
                                                     - "home"
                                                     - "other"
                                                     - "work"
      --externalIds strings          Specifies externalIds for the user. May be used multiple times in the form of:
                                     '--externalIds "customType=...;type=..;value=..."'
                                     You can use the following properties:
                                     customType  - Country.
                                     type        - The type of the ID.
                                                   Acceptable values are:
                                                     - "account"
                                                     - "custom"
                                                     - "customer"
                                                     - "login_id"
                                                     - "network"
                                                     - "organization": IDs of this type map to employee ID in the Admin Console
                                     value       - The value of the ID.
      --familyName string            The user's last name. Required when creating a user account.
      --fields string                Fields allows partial responses to be retrieved.
                                     See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
      --genderType string            Gender.
                                     Acceptable values are:
                                     female
                                     male
                                     other
                                     unknown
      --givenName string             The user's first name. Required when creating a user account.
      --hashFunction 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, MD5, or crypt hash format.
  -h, --help                         help for update
      --ims strings                  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.
                                     May be used multiple times in the form of:
                                     '--ims "customProtocol=...;customType=..;im=..."', etc.
                                     You can use the following properties:
                                     customProtocol  - If the protocol value is custom_protocol, this property holds the custom protocol's string.
                                     customType      - If the IM type is custom, this property holds the custom type string.
                                     im              - The user's IM network ID.
                                     primary         - BOOL! If this is the user's primary IM. Only one entry in the IM list can have a value of true.
                                     protocol        - An IM protocol identifies the IM network. The value can be a custom network or the standard network.
                                                       Acceptable values are:
                                                         - "aim": AOL Instant Messenger protocol
                                                         - "custom_protocol": A custom IM network protocol
                                                         - "gtalk": Google Talk protocol
                                                         - "icq": ICQ protocol
                                                         - "jabber": Jabber protocol
                                                         - "msn": MSN Messenger protocol
                                                         - "net_meeting": Net Meeting protocol
                                                         - "qq": QQ protocol
                                                         - "skype": Skype protocol
                                                         - "yahoo": Yahoo Messenger protocol
                                     type            - The type of the IM account.
                                                       Acceptable values are:
                                                        - "custom"
                                                        - "home"
                                                        - "other"
                                                        - "work"
      --includeInGlobalAddressList   Indicates if the user's profile is visible in the 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.
      --ipWhitelisted                If true, the user's IP address is white listed.
      --keywords strings             The user's keywords. The maximum allowed data size for this field is 1Kb.
                                     May be used multiple times in the form of:
                                     '--keywords "customType=...;type=..;value=..."'
                                     You can use the following properties:
                                     customType  - Custom Type.
                                     type        - Each entry can have a type which indicates standard type of that entry.
                                                   For example, keyword could be of type occupation or outlook.
                                                   In addition to the standard type, an entry can have a custom type and can give it any name.
                                                   Such types should have the CUSTOM value as type and also have a customType value.
                                                   Acceptable values are:
                                                     - "custom"
                                                     - "mission"
                                                     - "occupation"
                                                     - "outlook"
                                     value  -      Keyword.
      --languages strings            The user's languages. The maximum allowed data size for this field is 1Kb.
                                     May be used multiple times in the form of:
                                     '--languages "customLanguage=...;preference=..."'
                                     '--languages "languageCode=...;preference=..."'
                                     You can use the following properties:
                                     customLanguage  - Other language.
                                                       A user can provide their own language name if there is no corresponding Google III language code.
                                                       If this is set, LanguageCode can't be set
                                     languageCode    - Language Code.
                                                       Should be used for storing Google III LanguageCode string representation for language.
                                                       Illegal values cause SchemaException.
                                     preference      - Optional.
                                                       If present, controls whether the specified languageCode is the user's preferred language.
                                                       If customLanguage is set, this can't be set.
                                                       Allowed values are:
                                                         - preferred
                                                         - not_preferred
      --locations strings            The user's locations. The maximum allowed data size for this field is 10Kb.
                                     May be used multiple times in the form of:
                                     '--locations "area=...;buildingId=...;customType=..."', etc.
                                     You can use the following properties:
                                     area          - Textual location.
                                                     This is most useful for display purposes to concisely describe the location.
                                                     For example, "Mountain View, CA", "Near Seattle".
                                     buildingId    - Building identifier.
                                     customType    - If the location type is custom, this property contains the custom value.
                                     deskCode      - Most specific textual code of individual desk location.
                                     floorName     - Floor name/number.
                                     floorSection  - Floor section. More specific location within the floor.
                                                       For example, if a floor is divided into sections "A", "B", and "C", this field would identify one of those values.
                                     type          - The location type.
                                                     Acceptable values are:
                                                       - "custom"
                                                       - "default"
                                                       - "desk"
      --notesContentType string      Content type of note, either plain text or HTML.
                                     Default is plain text. Possible values are:
                                     text_plain
                                     text_html
      --notesValue string            Contents of notes.
      --orgUnitPath 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 strings        A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
                                     May be used multiple times in the form of:
                                     '--organizations "costCenter=...;customType=...;department=..."', etc.
                                     You can use the following properties:
                                     costCenter          - The cost center of the user's organization.
                                     customType          - If the value of type is custom, this property contains the custom type.
                                     department          - Specifies the department within the organization, such as 'sales' or 'engineering'.
                                     description         - The description of the organization.
                                     domain              - The domain the organization belongs to.
                                     fullTimeEquivalent  - INT! The full-time equivalent millipercent within the organization (100000 = 100%).
                                     location            - The physical location of the organization.
                                                           This does not need to be a fully qualified address.
                                     name                - The name of the organization.
                                     primary             - BOOL! Indicates if this is the user's primary organization.
                                                           A user may only have one primary organization.
                                     symbol              - Text string symbol of the organization.
                                                           For example, the text symbol for Google is GOOG.
                                     title               - The user's title within the organization, for example 'member' or 'engineer'.
                                     type                - The type of organization.
                                                           Acceptable values are:
                                                             - "domain_only"
                                                             - "school"
                                                             - "unknown"
                                                             - "work"
      --password string              Stores the password for the user account.
                                     The user's password value is required when creating a user account.
                                     It is optional when updating a user and should only be provided if the user is updating their account password.
                                     A password can contain any combination of ASCII characters.
                                     A minimum of 8 characters is required. The maximum length is 100 characters.
                                     We recommend sending the password property value as a base 16 bit, hexadecimal-encoded hash value.
                                     If a hashFunction is specified, the password must be a valid hash key.
                                     The password value is never returned in the API's response body.
      --phones strings               A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
                                     May be used multiple times in the form of:
                                     '--phones "customType=...;primary=...;type=..."', etc.
                                     You can use the following properties:
                                     customType  - If the value of type is custom, this property contains the custom type.
                                     primary     - BOOL! Indicates if this is the user's primary phone number.
                                                   A user may only have one primary phone number.
                                     type        - The type of phone number.
                                                   Acceptable values are:
                                                     - "assistant"
                                                     - "callback"
                                                     - "car"
                                                     - "company_main"
                                                     - "custom"
                                                     - "grand_central"
                                                     - "home"
                                                     - "home_fax"
                                                     - "isdn"
                                                     - "main"
                                                     - "mobile"
                                                     - "other"
                                                     - "other_fax"
                                                     - "pager"
                                                     - "radio"
                                                     - "telex"
                                                     - "tty_tdd"
                                                     - "work"
                                                     - "work_fax"
                                                     - "work_mobile"
                                                     - "work_pager"
                                     value       - A human-readable phone number.
                                                   It may be in any telephone number format.
      --posixAccounts strings        A list of POSIX account information for the user.
                                     May be used multiple times in the form of:
                                     '--posixAccounts "accountId=...;gecos=...;gid=..."', etc.
                                     You can use the following properties:
                                     accountId            - A POSIX account field identifier.
                                     gecos                - The GECOS (user information) for this account.
                                     gid                  - The default group ID.
                                     homeDirectory        - The path to the home directory for this account.
                                     operatingSystemType  - The operating system type for this account.
                                                            Acceptable values are:
                                                              - "linux"
                                                              - "unspecified"
                                                              - "windows"
                                     primary              - BOOL! If this is user's primary account within the SystemId.
                                     shell                - The path to the login shell for this account.
                                     systemId             - System identifier for which account Username or Uid apply to.
                                     uid                  - The POSIX compliant user ID.
                                     username             - The username of the account.
      --primaryEmail 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 string         Recovery email of the user.
      --recoveryPhone string         Recovery phone of the user.
                                     The phone number must be in the E.164 format, starting with the plus sign (+).
                                     Example: +16506661212.
      --relations strings            A list of the user's relationships to other users.
                                     The maximum allowed data size for this field is 2Kb.
                                     May be used multiple times in the form of:
                                     '--relations "customType=...;type=...;value=..."'
                                     You can use the following properties:
                                     customType  - If the value of type is custom, this property contains the custom type.
                                     type        - The type of relation.
                                                   Acceptable values are:
                                                   - "admin_assistant"
                                                   - "assistant"
                                                   - "brother"
                                                   - "child"
                                                   - "custom"
                                                   - "domestic_partner"
                                                   - "dotted_line_manager"
                                                   - "exec_assistant"
                                                   - "father"
                                                   - "friend"
                                                   - "manager"
                                                   - "mother"
                                                   - "parent"
                                                   - "partner"
                                                   - "referred_by"
                                                   - "relative"
                                                   - "sister"
                                                   - "spouse"
                                     value       - The name of the person the user is related to.
      --sshPublicKeys strings        A list of SSH public keys.
                                     May be used multiple times in the form of:
                                     '--sshPublicKeys "expirationTimeUsec=...;key=..."'
                                     You can use the following properties:
                                     expirationTimeUsec  - An expiration time in microseconds since epoch.
                                     key                 - An SSH public key.
      --suspended                    Indicates if user is suspended.
      --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.
      --websites strings             The user's websites.
                                     The maximum allowed data size for this field is 2Kb.
                                     May be used multiple times in the form of:
                                     '--websites "customType=...;primary=...;type=..."', etc.
                                     You can use the following properties:
                                     customType  - The custom type. Only used if the type is custom.
                                     primary     - BOOL! If this is user's primary website or not.
                                     type        - The type or purpose of the website.
                                                   For example, a website could be labeled as home or blog.
                                                   Alternatively, an entry can have a custom type.
                                                   Custom types must have a customType value.
                                                   Acceptable values are:
                                                     - "app_install_page"
                                                     - "blog"
                                                     - "custom"
                                                     - "ftp"
                                                     - "home"
                                                     - "home_page"
                                                     - "other"
                                                     - "profile"
                                                     - "reservations"
                                                     - "resume"
                                                     - "work"
                                     value       - The URL of the website.

Options inherited from parent commands

      --compressOutput         By default, GSM outputs "pretty" (indented) objects. By setting this flag, GSM's output will be compressed. This may or may not improve performance in scripts.
      --config string          config file (default is $HOME/.config/gsm/.gsm.yaml)
      --delay int              This delay (plus a random jitter between 0 and 50) will be applied after every command to avoid reaching quota and rate limits. Set to 0 to disable.
      --dwdSubject string      Specify a subject used for DWD impersonation (overrides value in config file)
      --log string             Set the path of the log file. Default is either ~/gsm.log or defined in your config file
      --maxElapsedTime int     This is the maximum total time that will be spent retrying a request in minutes. (default 15)
      --maxRetryInterval int   This is the maximum interval that will be used between retry attempts in seconds. (default 320)
      --redirectPort int       This is the TCP port on which GSM will create web server if you authenticate with a user account for the first time. This is necessary for the OAuth flow. See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback (default 8081)
      --retryOn ints           Specify the HTTP error code(s) that GSM should retry on. Note that GSM will always retry on HTTP 403 errors that indicate a quota / rate limit error
      --streamOutput           Setting this flag will cause GSM to output slice values to stdout one by one, instead of one large object

SEE ALSO