ConnectCases / Client / search_cases

search_cases#

ConnectCases.Client.search_cases(**kwargs)#

Searches for cases within their associated Cases domain. Search results are returned as a paginated list of abridged case documents.

Note

For customer_id you must provide the full customer profile ARN in this format: arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles domain name/profiles/profile ID.

See also: AWS API Documentation

Request Syntax

response = client.search_cases(
    domainId='string',
    fields=[
        {
            'id': 'string'
        },
    ],
    filter={
        'andAll': [
            {'... recursive ...'},
        ],
        'field': {
            'contains': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'equalTo': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'greaterThan': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'greaterThanOrEqualTo': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'lessThan': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            },
            'lessThanOrEqualTo': {
                'id': 'string',
                'value': {
                    'booleanValue': True|False,
                    'doubleValue': 123.0,
                    'emptyValue': {}
                    ,
                    'stringValue': 'string',
                    'userArnValue': 'string'
                }
            }
        },
        'not': {'... recursive ...'},
        'orAll': [
            {'... recursive ...'},
        ]
    },
    maxResults=123,
    nextToken='string',
    searchTerm='string',
    sorts=[
        {
            'fieldId': 'string',
            'sortOrder': 'Asc'|'Desc'
        },
    ]
)
Parameters:
  • domainId (string) –

    [REQUIRED]

    The unique identifier of the Cases domain.

  • fields (list) –

    The list of field identifiers to be returned as part of the response.

    • (dict) –

      Object for unique identifier of a field.

      • id (string) – [REQUIRED]

        Unique identifier of a field.

  • filter (dict) –

    A list of filter objects.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: andAll, field, not, orAll.

    • andAll (list) –

      Provides “and all” filtering.

      • (dict) –

        A filter for cases. Only one value can be provided.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: andAll, field, not, orAll.

    • field (dict) –

      A list of fields to filter on.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: contains, equalTo, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo.

      • contains (dict) –

        Object containing field identifier and value information.

        • id (string) – [REQUIRED]

          Unique identifier of a field.

        • value (dict) – [REQUIRED]

          Union of potential field value types.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue.

          • booleanValue (boolean) –

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) –

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) –

            An empty value.

          • stringValue (string) –

            String value type.

          • userArnValue (string) –

            Represents the user that performed the audit.

      • equalTo (dict) –

        Object containing field identifier and value information.

        • id (string) – [REQUIRED]

          Unique identifier of a field.

        • value (dict) – [REQUIRED]

          Union of potential field value types.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue.

          • booleanValue (boolean) –

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) –

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) –

            An empty value.

          • stringValue (string) –

            String value type.

          • userArnValue (string) –

            Represents the user that performed the audit.

      • greaterThan (dict) –

        Object containing field identifier and value information.

        • id (string) – [REQUIRED]

          Unique identifier of a field.

        • value (dict) – [REQUIRED]

          Union of potential field value types.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue.

          • booleanValue (boolean) –

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) –

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) –

            An empty value.

          • stringValue (string) –

            String value type.

          • userArnValue (string) –

            Represents the user that performed the audit.

      • greaterThanOrEqualTo (dict) –

        Object containing field identifier and value information.

        • id (string) – [REQUIRED]

          Unique identifier of a field.

        • value (dict) – [REQUIRED]

          Union of potential field value types.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue.

          • booleanValue (boolean) –

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) –

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) –

            An empty value.

          • stringValue (string) –

            String value type.

          • userArnValue (string) –

            Represents the user that performed the audit.

      • lessThan (dict) –

        Object containing field identifier and value information.

        • id (string) – [REQUIRED]

          Unique identifier of a field.

        • value (dict) – [REQUIRED]

          Union of potential field value types.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue.

          • booleanValue (boolean) –

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) –

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) –

            An empty value.

          • stringValue (string) –

            String value type.

          • userArnValue (string) –

            Represents the user that performed the audit.

      • lessThanOrEqualTo (dict) –

        Object containing field identifier and value information.

        • id (string) – [REQUIRED]

          Unique identifier of a field.

        • value (dict) – [REQUIRED]

          Union of potential field value types.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue.

          • booleanValue (boolean) –

            Can be either null, or have a Boolean value type. Only one value can be provided.

          • doubleValue (float) –

            Can be either null, or have a Double number value type. Only one value can be provided.

          • emptyValue (dict) –

            An empty value.

          • stringValue (string) –

            String value type.

          • userArnValue (string) –

            Represents the user that performed the audit.

    • not (dict) –

      A filter for cases. Only one value can be provided.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: andAll, field, not, orAll.

    • orAll (list) –

      Provides “or all” filtering.

      • (dict) –

        A filter for cases. Only one value can be provided.

        Note

        This is a Tagged Union structure. Only one of the following top level keys can be set: andAll, field, not, orAll.

  • maxResults (integer) – The maximum number of cases to return. The current maximum supported value is 25. This is also the default value when no other value is provided.

  • nextToken (string) – 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.

  • searchTerm (string) – A word or phrase used to perform a quick search.

  • sorts (list) –

    A list of sorts where each sort specifies a field and their sort order to be applied to the results.

    • (dict) –

      A structured set of sort terms.

      • fieldId (string) – [REQUIRED]

        Unique identifier of a field.

      • sortOrder (string) – [REQUIRED]

        A structured set of sort terms

Return type:

dict

Returns:

Response Syntax

{
    'cases': [
        {
            'caseId': 'string',
            'fields': [
                {
                    'id': 'string',
                    'value': {
                        'booleanValue': True|False,
                        'doubleValue': 123.0,
                        'emptyValue': {},
                        'stringValue': 'string',
                        'userArnValue': 'string'
                    }
                },
            ],
            'tags': {
                'string': 'string'
            },
            'templateId': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • cases (list) –

      A list of case documents where each case contains the properties CaseId and Fields where each field is a complex union structure.

      • (dict) –

        A list of items that represent cases.

        • caseId (string) –

          A unique identifier of the case.

        • fields (list) –

          List of case field values.

          • (dict) –

            Object for case field values.

            • id (string) –

              Unique identifier of a field.

            • value (dict) –

              Union of potential field value types.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: booleanValue, doubleValue, emptyValue, stringValue, userArnValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • booleanValue (boolean) –

                Can be either null, or have a Boolean value type. Only one value can be provided.

              • doubleValue (float) –

                Can be either null, or have a Double number value type. Only one value can be provided.

              • emptyValue (dict) –

                An empty value.

              • stringValue (string) –

                String value type.

              • userArnValue (string) –

                Represents the user that performed the audit.

        • tags (dict) –

          A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

          • (string) –

            • (string) –

        • templateId (string) –

          A unique identifier of a template.

    • nextToken (string) –

      The token for the next set of results. This is null if there are no more results to return.

Exceptions