:doc:`BillingConductor <../../billingconductor>` / Client / batch_associate_resources_to_custom_line_item

*********************************************
batch_associate_resources_to_custom_line_item
*********************************************



.. py:method:: BillingConductor.Client.batch_associate_resources_to_custom_line_item(**kwargs)

  

  Associates a batch of resources to a percentage custom line item.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/billingconductor-2021-07-30/BatchAssociateResourcesToCustomLineItem>`_  


  **Request Syntax**
  ::

    response = client.batch_associate_resources_to_custom_line_item(
        TargetArn='string',
        ResourceArns=[
            'string',
        ],
        BillingPeriodRange={
            'InclusiveStartBillingPeriod': 'string',
            'ExclusiveEndBillingPeriod': 'string'
        }
    )
    
  :type TargetArn: string
  :param TargetArn: **[REQUIRED]** 

    A percentage custom line item ARN to associate the resources to.

    

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

    A list containing the ARNs of the resources to be associated.

    

  
    - *(string) --* 

    

  :type BillingPeriodRange: dict
  :param BillingPeriodRange: 

    The billing period range in which the custom line item request will be applied.

    

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

      The inclusive start billing period that defines a billing period range where a custom line is applied.

      

    
    - **ExclusiveEndBillingPeriod** *(string) --* 

      The inclusive end billing period that defines a billing period range where a custom line is applied.

      

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

    
    ::

      {
          'SuccessfullyAssociatedResources': [
              {
                  'Arn': 'string',
                  'Error': {
                      'Message': 'string',
                      'Reason': 'INVALID_ARN'|'SERVICE_LIMIT_EXCEEDED'|'ILLEGAL_CUSTOMLINEITEM'|'INTERNAL_SERVER_EXCEPTION'|'INVALID_BILLING_PERIOD_RANGE'
                  }
              },
          ],
          'FailedAssociatedResources': [
              {
                  'Arn': 'string',
                  'Error': {
                      'Message': 'string',
                      'Reason': 'INVALID_ARN'|'SERVICE_LIMIT_EXCEEDED'|'ILLEGAL_CUSTOMLINEITEM'|'INTERNAL_SERVER_EXCEPTION'|'INVALID_BILLING_PERIOD_RANGE'
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SuccessfullyAssociatedResources** *(list) --* 

        A list of ``AssociateResourceResponseElement`` for each resource that's been associated to a percentage custom line item successfully.

        
        

        - *(dict) --* 

          A resource association result for a percentage custom line item.

          
          

          - **Arn** *(string) --* 

            The resource ARN that was associated to the custom line item.

            
          

          - **Error** *(dict) --* 

            An ``AssociateResourceError`` that will populate if the resource association fails.

            
            

            - **Message** *(string) --* 

              The reason why the resource association failed.

              
            

            - **Reason** *(string) --* 

              A static error code that's used to classify the type of failure.

              
        
      
    
      

      - **FailedAssociatedResources** *(list) --* 

        A list of ``AssociateResourceResponseElement`` for each resource that failed association to a percentage custom line item.

        
        

        - *(dict) --* 

          A resource association result for a percentage custom line item.

          
          

          - **Arn** *(string) --* 

            The resource ARN that was associated to the custom line item.

            
          

          - **Error** *(dict) --* 

            An ``AssociateResourceError`` that will populate if the resource association fails.

            
            

            - **Message** *(string) --* 

              The reason why the resource association failed.

              
            

            - **Reason** *(string) --* 

              A static error code that's used to classify the type of failure.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`BillingConductor.Client.exceptions.ConflictException`

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

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

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

  
  *   :py:class:`BillingConductor.Client.exceptions.ServiceLimitExceededException`

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

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

  