:doc:`DirectoryServiceData <../../ds-data>` / Client / update_user

***********
update_user
***********



.. py:method:: DirectoryServiceData.Client.update_user(**kwargs)

  

  Updates user information.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/directory-service-data-2023-05-31/UpdateUser>`_  


  **Request Syntax**
  ::

    response = client.update_user(
        ClientToken='string',
        DirectoryId='string',
        EmailAddress='string',
        GivenName='string',
        OtherAttributes={
            'string': {
                'BOOL': True|False,
                'N': 123,
                'S': 'string',
                'SS': [
                    'string',
                ]
            }
        },
        SAMAccountName='string',
        Surname='string',
        UpdateType='ADD'|'REPLACE'|'REMOVE'
    )
    
  :type ClientToken: string
  :param ClientToken: 

    A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

     

    A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

     

    If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ``ConflictException``.

     

    .. note::

      

      This parameter is optional when using the CLI or SDK.

      

    This field is autopopulated if not provided.

  
  :type DirectoryId: string
  :param DirectoryId: **[REQUIRED]** 

    The identifier (ID) of the directory that's associated with the user.

    

  
  :type EmailAddress: string
  :param EmailAddress: 

    The email address of the user.

    

  
  :type GivenName: string
  :param GivenName: 

    The first name of the user.

    

  
  :type OtherAttributes: dict
  :param OtherAttributes: 

    An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see `Directory Service Data Attributes <https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ad_data_attributes.html>`__.

     

    .. note::

      

      Attribute names are case insensitive.

      

    

  
    - *(string) --* 

    
      - *(dict) --* 

        The data type for an attribute. Each attribute value is described as a name-value pair. The name is the AD schema name, and the value is the data itself. For a list of supported attributes, see `Directory Service Data Attributes <https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ad_data_attributes.html>`__.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``BOOL``, ``N``, ``S``, ``SS``. 

      
        - **BOOL** *(boolean) --* 

          Indicates that the attribute type value is a boolean. For example:

           

          ``"BOOL": true``

          

        
        - **N** *(integer) --* 

          Indicates that the attribute type value is a number. For example:

           

          ``"N": "16"``

          

        
        - **S** *(string) --* 

          Indicates that the attribute type value is a string. For example:

           

          ``"S": "S Group"``

          

        
        - **SS** *(list) --* 

          Indicates that the attribute type value is a string set. For example:

           

          ``"SS": ["sample_service_class/host.sample.com:1234/sample_service_name_1", "sample_service_class/host.sample.com:1234/sample_service_name_2"]``

          

        
          - *(string) --* 

          
      
      


  :type SAMAccountName: string
  :param SAMAccountName: **[REQUIRED]** 

    The name of the user.

    

  
  :type Surname: string
  :param Surname: 

    The last name of the user.

    

  
  :type UpdateType: string
  :param UpdateType: 

    The type of update to be performed. If no value exists for the attribute, use ``ADD``. Otherwise, use ``REPLACE`` to change an attribute value or ``REMOVE`` to clear the attribute value.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.InternalServerException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ValidationException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.DirectoryUnavailableException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ConflictException`

  
  *   :py:class:`DirectoryServiceData.Client.exceptions.ThrottlingException`

  