:doc:`CloudWatchEvidently <../../evidently>` / Client / test_segment_pattern

********************
test_segment_pattern
********************



.. py:method:: CloudWatchEvidently.Client.test_segment_pattern(**kwargs)

  

  Use this operation to test a rules pattern that you plan to use to create an audience segment. For more information about segments, see `CreateSegment <https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_CreateSegment.html>`__.

  

  .. danger::

        This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.


  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/evidently-2021-02-01/TestSegmentPattern>`_  


  **Request Syntax**
  ::

    response = client.test_segment_pattern(
        pattern='string',
        payload='string'
    )
    
  :type pattern: string
  :param pattern: **[REQUIRED]** 

    The pattern to test.

    

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

    A sample ``evaluationContext`` JSON block to test against the specified pattern.

    

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

    
    ::

      {
          'match': True|False
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **match** *(boolean) --* 

        Returns ``true`` if the pattern matches the payload.

        
  
  **Exceptions**
  
  *   :py:class:`CloudWatchEvidently.Client.exceptions.ThrottlingException`

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

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

  