:doc:`AppStream <../../appstream>` / Client / batch_associate_user_stack

**************************
batch_associate_user_stack
**************************



.. py:method:: AppStream.Client.batch_associate_user_stack(**kwargs)

  

  Associates the specified users with the specified stacks. Users in a user pool cannot be assigned to stacks with fleets that are joined to an Active Directory domain.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/BatchAssociateUserStack>`_  


  **Request Syntax**
  ::

    response = client.batch_associate_user_stack(
        UserStackAssociations=[
            {
                'StackName': 'string',
                'UserName': 'string',
                'AuthenticationType': 'API'|'SAML'|'USERPOOL'|'AWS_AD',
                'SendEmailNotification': True|False
            },
        ]
    )
    
  :type UserStackAssociations: list
  :param UserStackAssociations: **[REQUIRED]** 

    The list of UserStackAssociation objects.

    

  
    - *(dict) --* 

      Describes a user in the user pool and the associated stack.

      

    
      - **StackName** *(string) --* **[REQUIRED]** 

        The name of the stack that is associated with the user.

        

      
      - **UserName** *(string) --* **[REQUIRED]** 

        The email address of the user who is associated with the stack.

         

        .. note::

          

          Users' email addresses are case-sensitive.

          

        

      
      - **AuthenticationType** *(string) --* **[REQUIRED]** 

        The authentication type for the user.

        

      
      - **SendEmailNotification** *(boolean) --* 

        Specifies whether a welcome email is sent to a user after the user is created in the user pool.

        

      
    

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

    
    ::

      {
          'errors': [
              {
                  'UserStackAssociation': {
                      'StackName': 'string',
                      'UserName': 'string',
                      'AuthenticationType': 'API'|'SAML'|'USERPOOL'|'AWS_AD',
                      'SendEmailNotification': True|False
                  },
                  'ErrorCode': 'STACK_NOT_FOUND'|'USER_NAME_NOT_FOUND'|'DIRECTORY_NOT_FOUND'|'INTERNAL_ERROR',
                  'ErrorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **errors** *(list) --* 

        The list of UserStackAssociationError objects.

        
        

        - *(dict) --* 

          Describes the error that is returned when a user can’t be associated with or disassociated from a stack.

          
          

          - **UserStackAssociation** *(dict) --* 

            Information about the user and associated stack.

            
            

            - **StackName** *(string) --* 

              The name of the stack that is associated with the user.

              
            

            - **UserName** *(string) --* 

              The email address of the user who is associated with the stack.

               

              .. note::

                

                Users' email addresses are case-sensitive.

                

              
            

            - **AuthenticationType** *(string) --* 

              The authentication type for the user.

              
            

            - **SendEmailNotification** *(boolean) --* 

              Specifies whether a welcome email is sent to a user after the user is created in the user pool.

              
        
          

          - **ErrorCode** *(string) --* 

            The error code for the error that is returned when a user can’t be associated with or disassociated from a stack.

            
          

          - **ErrorMessage** *(string) --* 

            The error message for the error that is returned when a user can’t be associated with or disassociated from a stack.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`AppStream.Client.exceptions.OperationNotPermittedException`

  
  *   :py:class:`AppStream.Client.exceptions.InvalidParameterCombinationException`

  