:doc:`Billing <../../billing>` / Client / create_billing_view

*******************
create_billing_view
*******************



.. py:method:: Billing.Client.create_billing_view(**kwargs)

  

  Creates a billing view with the specified billing view attributes.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/billing-2023-09-07/CreateBillingView>`_  


  **Request Syntax**
  ::

    response = client.create_billing_view(
        name='string',
        description='string',
        sourceViews=[
            'string',
        ],
        dataFilterExpression={
            'dimensions': {
                'key': 'LINKED_ACCOUNT',
                'values': [
                    'string',
                ]
            },
            'tags': {
                'key': 'string',
                'values': [
                    'string',
                ]
            },
            'costCategories': {
                'key': 'string',
                'values': [
                    'string',
                ]
            },
            'timeRange': {
                'beginDateInclusive': datetime(2015, 1, 1),
                'endDateInclusive': datetime(2015, 1, 1)
            }
        },
        clientToken='string',
        resourceTags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    The name of the billing view.

    

  
  :type description: string
  :param description: 

    The description of the billing view.

    

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

    A list of billing views used as the data source for the custom billing view.

    

  
    - *(string) --* 

    

  :type dataFilterExpression: dict
  :param dataFilterExpression: 

    See `Expression <https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html>`__. Billing view only supports ``LINKED_ACCOUNT``, ``Tags``, and ``CostCategories``.

    

  
    - **dimensions** *(dict) --* 

      The specific ``Dimension`` to use for ``Expression``.

      

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

        The names of the metadata types that you can use to filter and group your results.

        

      
      - **values** *(list) --* **[REQUIRED]** 

        The metadata values that you can use to filter and group your results.

        

      
        - *(string) --* 

        
    
    
    - **tags** *(dict) --* 

      The specific ``Tag`` to use for ``Expression``.

      

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

        The key for the tag.

        

      
      - **values** *(list) --* **[REQUIRED]** 

        The specific value of the tag.

        

      
        - *(string) --* 

        
    
    
    - **costCategories** *(dict) --* 

      The filter that's based on ``CostCategory`` values.

      

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

        The unique name of the Cost Category.

        

      
      - **values** *(list) --* **[REQUIRED]** 

        The specific value of the Cost Category.

        

      
        - *(string) --* 

        
    
    
    - **timeRange** *(dict) --* 

      Specifies a time range filter for the billing view data.

      

    
      - **beginDateInclusive** *(datetime) --* 

        The inclusive start date of the time range.

        

      
      - **endDateInclusive** *(datetime) --* 

        The inclusive end date of the time range.

        

      
    
  
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.

    This field is autopopulated if not provided.

  
  :type resourceTags: list
  :param resourceTags: 

    A list of key value map specifying tags associated to the billing view being created.

    

  
    - *(dict) --* 

      The tag structure that contains a tag key and value.

      

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

        The key that's associated with the tag.

        

      
      - **value** *(string) --* 

        The value that's associated with the tag.

        

      
    

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

    
    ::

      {
          'arn': 'string',
          'createdAt': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **arn** *(string) --* 

        The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.

        
      

      - **createdAt** *(datetime) --* 

        The time when the billing view was created.

        
  
  **Exceptions**
  
  *   :py:class:`Billing.Client.exceptions.BillingViewHealthStatusException`

  
  *   :py:class:`Billing.Client.exceptions.ServiceQuotaExceededException`

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

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

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

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

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

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

  