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

************
search_views
************



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

  

  Searches views based on name, description, or tags.

  

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


  **Request Syntax**
  ::

    response = client.search_views(
        InstanceId='string',
        NextToken='string',
        MaxResults=123,
        SearchFilter={
            'AttributeFilter': {
                'OrConditions': [
                    {
                        'TagConditions': [
                            {
                                'TagKey': 'string',
                                'TagValue': 'string'
                            },
                        ]
                    },
                ],
                'AndCondition': {
                    'TagConditions': [
                        {
                            'TagKey': 'string',
                            'TagValue': 'string'
                        },
                    ]
                },
                'TagCondition': {
                    'TagKey': 'string',
                    'TagValue': 'string'
                }
            }
        },
        SearchCriteria={
            'OrConditions': [
                {'... recursive ...'},
            ],
            'AndConditions': [
                {'... recursive ...'},
            ],
            'StringCondition': {
                'FieldName': 'string',
                'Value': 'string',
                'ComparisonType': 'STARTS_WITH'|'CONTAINS'|'EXACT'
            },
            'ViewTypeCondition': 'CUSTOMER_MANAGED'|'AWS_MANAGED',
            'ViewStatusCondition': 'PUBLISHED'|'SAVED'
        }
    )
    
  :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 NextToken: string
  :param NextToken: 

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return per page.

    

  
  :type SearchFilter: dict
  :param SearchFilter: 

    Filters to apply to the search, such as tag-based filters.

    

  
    - **AttributeFilter** *(dict) --* 

      An object that can be used to specify Tag conditions inside the ``SearchFilter``. This accepts an ``OR`` or ``AND`` (List of List) input where:

       

      
      * The top level list specifies conditions that need to be applied with ``OR`` operator.
       
      * The inner list specifies conditions that need to be applied with ``AND`` operator.
      

      

    
      - **OrConditions** *(list) --* 

        A list of conditions which would be applied together with an ``OR`` condition.

        

      
        - *(dict) --* 

          A list of conditions which would be applied together with an ``AND`` condition.

          

        
          - **TagConditions** *(list) --* 

            A leaf node condition which can be used to specify a tag condition.

            

          
            - *(dict) --* 

              A leaf node condition which can be used to specify a tag condition, for example, ``HAVE BPO = 123``.

              

            
              - **TagKey** *(string) --* 

                The tag key in the tag condition.

                

              
              - **TagValue** *(string) --* 

                The tag value in the tag condition.

                

              
            
        
        
    
      - **AndCondition** *(dict) --* 

        A list of conditions which would be applied together with an ``AND`` condition.

        

      
        - **TagConditions** *(list) --* 

          A leaf node condition which can be used to specify a tag condition.

          

        
          - *(dict) --* 

            A leaf node condition which can be used to specify a tag condition, for example, ``HAVE BPO = 123``.

            

          
            - **TagKey** *(string) --* 

              The tag key in the tag condition.

              

            
            - **TagValue** *(string) --* 

              The tag value in the tag condition.

              

            
          
      
      
      - **TagCondition** *(dict) --* 

        A leaf node condition which can be used to specify a tag condition, for example, ``HAVE BPO = 123``.

        

      
        - **TagKey** *(string) --* 

          The tag key in the tag condition.

          

        
        - **TagValue** *(string) --* 

          The tag value in the tag condition.

          

        
      
    
  
  :type SearchCriteria: dict
  :param SearchCriteria: 

    The search criteria, including field names and comparison types.

    

  
    - **OrConditions** *(list) --* 

      A list of conditions to be met, where at least one condition must be satisfied.

      

    
      - *(dict) --* 

        Defines the search criteria for filtering views.

        

      
  
    - **AndConditions** *(list) --* 

      A list of conditions that must all be satisfied.

      

    
      - *(dict) --* 

        Defines the search criteria for filtering views.

        

      
  
    - **StringCondition** *(dict) --* 

      A leaf node condition which can be used to specify a string condition.

      

    
      - **FieldName** *(string) --* 

        The name of the field in the string condition.

        

      
      - **Value** *(string) --* 

        The value of the string.

        

      
      - **ComparisonType** *(string) --* 

        The type of comparison to be made when evaluating the string condition.

        

      
    
    - **ViewTypeCondition** *(string) --* 

      A condition that filters views by their type.

      

    
    - **ViewStatusCondition** *(string) --* 

      A condition that filters views by their status.

      

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

    
    ::

      {
          'Views': [
              {
                  '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'
              },
          ],
          'NextToken': 'string',
          'ApproximateTotalCount': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Views** *(list) --* 

        A list of views that match the search criteria.

        
        

        - *(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.

            
      
    
      

      - **NextToken** *(string) --* 

        If there are additional results, this is the token for the next set of results.

        
      

      - **ApproximateTotalCount** *(integer) --* 

        The approximate total number of views that match the search criteria.

        
  
  **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`

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

  