:doc:`Connect <../../connect>` / Client / batch_associate_analytics_data_set

**********************************
batch_associate_analytics_data_set
**********************************



.. py:method:: Connect.Client.batch_associate_analytics_data_set(**kwargs)

  

  Associates a list of analytics datasets for a given Amazon Connect instance to a target account. You can associate multiple datasets in a single call.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/BatchAssociateAnalyticsDataSet>`_  


  **Request Syntax**
  ::

    response = client.batch_associate_analytics_data_set(
        InstanceId='string',
        DataSetIds=[
            'string',
        ],
        TargetAccountId='string'
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The identifier of the Amazon Connect instance. You can `find the instance ID <https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html>`__ in the Amazon Resource Name (ARN) of the instance.

    

  
  :type DataSetIds: list
  :param DataSetIds: **[REQUIRED]** 

    An array of dataset identifiers to associate.

    

  
    - *(string) --* 

    

  :type TargetAccountId: string
  :param TargetAccountId: 

    The identifier of the target account. Use to associate a dataset to a different account than the one containing the Amazon Connect instance. If not specified, by default this value is the Amazon Web Services account that has the Amazon Connect instance.

    

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

    
    ::

      {
          'Created': [
              {
                  'DataSetId': 'string',
                  'TargetAccountId': 'string',
                  'ResourceShareId': 'string',
                  'ResourceShareArn': 'string',
                  'ResourceShareStatus': 'string'
              },
          ],
          'Errors': [
              {
                  'ErrorCode': 'string',
                  'ErrorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Created** *(list) --* 

        Information about associations that are successfully created: ``DataSetId``, ``TargetAccountId``, ``ResourceShareId``, ``ResourceShareArn``.

        
        

        - *(dict) --* 

          This API is in preview release for Amazon Connect and is subject to change.

           

          Information about associations that are successfully created: ``DataSetId``, ``TargetAccountId``, ``ResourceShareId``, ``ResourceShareArn``.

          
          

          - **DataSetId** *(string) --* 

            The identifier of the dataset.

            
          

          - **TargetAccountId** *(string) --* 

            The identifier of the target account.

            
          

          - **ResourceShareId** *(string) --* 

            The Resource Access Manager share ID.

            
          

          - **ResourceShareArn** *(string) --* 

            The Amazon Resource Name (ARN) of the Resource Access Manager share.

            
          

          - **ResourceShareStatus** *(string) --* 

            The Amazon Web Services Resource Access Manager status of association.

            
      
    
      

      - **Errors** *(list) --* 

        A list of errors for datasets that aren't successfully associated with the target account.

        
        

        - *(dict) --* 

          This API is in preview release for Amazon Connect and is subject to change.

           

          List of errors for dataset association failures.

          
          

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

            The error code.

            
          

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

            The corresponding error message for the error code.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`Connect.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Connect.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`Connect.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`Connect.Client.exceptions.InternalServiceException`

  