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

***********
create_view
***********



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

  

  Creates a new view with the possible status of ``SAVED`` or ``PUBLISHED``.

   

  The views will have a unique name for each connect instance.

   

  It performs basic content validation if the status is ``SAVED`` or full content validation if the status is set to ``PUBLISHED``. An error is returned if validation fails. It associates either the ``$SAVED`` qualifier or both of the ``$SAVED`` and ``$LATEST`` qualifiers with the provided view content based on the status. The view is idempotent if ClientToken is provided.

  

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


  **Request Syntax**
  ::

    response = client.create_view(
        InstanceId='string',
        ClientToken='string',
        Status='PUBLISHED'|'SAVED',
        Content={
            'Template': 'string',
            'Actions': [
                'string',
            ]
        },
        Description='string',
        Name='string',
        Tags={
            'string': 'string'
        }
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

    

  
  :type ClientToken: string
  :param ClientToken: 

    A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.

    

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

    Indicates the view status as either ``SAVED`` or ``PUBLISHED``. The ``PUBLISHED`` status will initiate validation on the content.

    

  
  :type Content: dict
  :param Content: **[REQUIRED]** 

    View content containing all content necessary to render a view except for runtime input data.

     

    The total uncompressed content has a maximum file size of 400kB.

    

  
    - **Template** *(string) --* 

      The view template representing the structure of the view.

      

    
    - **Actions** *(list) --* 

      A list of possible actions from the view.

      

    
      - *(string) --* 

      
  
  
  :type Description: string
  :param Description: 

    The description of the view.

    

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

    The name of the view.

    

  
  :type Tags: dict
  :param Tags: 

    The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'View': {
              'Id': 'string',
              'Arn': 'string',
              'Name': 'string',
              'Status': 'PUBLISHED'|'SAVED',
              'Type': 'CUSTOMER_MANAGED'|'AWS_MANAGED',
              'Description': 'string',
              'Version': 123,
              'VersionDescription': 'string',
              'Content': {
                  'InputSchema': 'string',
                  'Template': 'string',
                  'Actions': [
                      'string',
                  ]
              },
              'Tags': {
                  'string': 'string'
              },
              'CreatedTime': datetime(2015, 1, 1),
              'LastModifiedTime': datetime(2015, 1, 1),
              'ViewContentSha256': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **View** *(dict) --* 

        A view resource object. Contains metadata and content necessary to render the view.

        
        

        - **Id** *(string) --* 

          The identifier of the view.

          
        

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

          The Amazon Resource Name (ARN) of the view.

          
        

        - **Name** *(string) --* 

          The name of the view.

          
        

        - **Status** *(string) --* 

          Indicates the view status as either ``SAVED`` or ``PUBLISHED``. The ``PUBLISHED`` status will initiate validation on the content.

          
        

        - **Type** *(string) --* 

          The type of the view - ``CUSTOMER_MANAGED``.

          
        

        - **Description** *(string) --* 

          The description of the view.

          
        

        - **Version** *(integer) --* 

          Current version of the view.

          
        

        - **VersionDescription** *(string) --* 

          The description of the version.

          
        

        - **Content** *(dict) --* 

          View content containing all content necessary to render a view except for runtime input data.

          
          

          - **InputSchema** *(string) --* 

            The data schema matching data that the view template must be provided to render.

            
          

          - **Template** *(string) --* 

            The view template representing the structure of the view.

            
          

          - **Actions** *(list) --* 

            A list of possible actions from the view.

            
            

            - *(string) --* 
        
      
        

        - **Tags** *(dict) --* 

          The tags associated with the view resource (not specific to view version).

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
        

        - **CreatedTime** *(datetime) --* 

          The timestamp of when the view was created.

          
        

        - **LastModifiedTime** *(datetime) --* 

          Latest timestamp of the ``UpdateViewContent`` or ``CreateViewVersion`` operations.

          
        

        - **ViewContentSha256** *(string) --* 

          Indicates the checksum value of the latest published view content.

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

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

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

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

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

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

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

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

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

  