Searches for cases within their associated Cases domain. Search results are returned as a paginated list of abridged case documents.
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.
Parameters:
-
domain_id
(DomainId)
–
The unique identifier of the Cases domain.
-
max_results
(Optional[int], default:
None
)
–
The maximum number of cases to return. When no value is provided, 25 is the default.
-
next_token
(Optional[NextToken], default:
None
)
–
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.
-
search_term
(Optional[str], default:
None
)
–
A word or phrase used to perform a quick search.
-
filter
(Optional[CaseFilter], default:
None
)
–
A list of filter objects.
-
sorts
(Optional[SortList], default:
None
)
–
A list of sorts where each sort specifies a field and their sort order to be applied to the results.
-
fields
(Optional[FieldIdentifierList], default:
None
)
–
The list of field identifiers to be returned as part of the response.
Raises:
-
AccessDeniedException
–
You do not have sufficient access to perform this action.
-
InternalServerException
–
We couldn't process your request because of an issue with the server. Try again later.
-
ResourceNotFoundException
–
We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.
-
ThrottlingException
–
The rate has been exceeded for this API. Please try again after a few minutes.
-
ValidationException
–
The request isn't valid. Check the syntax and try again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_connectcases/_services/connect_cases.py
| def search_cases(
self,
domain_id: "capo_connectcases.types.domain_id.DomainId",
*,
config_overrides: Optional[ConnectCasesClientConfig] = None,
max_results: Optional[int] = None,
next_token: Optional["capo_connectcases.types.next_token.NextToken"] = None,
search_term: Optional[str] = None,
filter: Optional["capo_connectcases.types.case_filter.CaseFilter"] = None,
sorts: Optional["capo_connectcases.types.sort_list.SortList"] = None,
fields: Optional[
"capo_connectcases.types.field_identifier_list.FieldIdentifierList"
] = None,
) -> "capo_connectcases.types.search_cases_response.SearchCasesResponse":
"""<p>Searches for cases within their associated Cases domain. Search results are returned as a paginated list of abridged case documents.</p> <note> <p>For <code>customer_id</code> you must provide the full customer profile ARN in this format: <code> arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles domain name/profiles/profile ID</code>. </p> </note>
Args:
domain_id: <p>The unique identifier of the Cases domain. </p>
max_results: <p>The maximum number of cases to return. When no value is provided, 25 is the default.</p>
next_token: <p>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.</p>
search_term: <p>A word or phrase used to perform a quick search.</p>
filter: <p>A list of filter objects.</p>
sorts: <p>A list of sorts where each sort specifies a field and their sort order to be applied to the results. </p>
fields: <p>The list of field identifiers to be returned as part of the response.</p>
Raises:
capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_connectcases.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
capo_connectcases.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
capo_connectcases.errors.throttling_exception.ThrottlingException: <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
capo_connectcases.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
capo_connectcases.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_connectcases.types.search_cases_request.SearchCasesRequest]",
) -> OperationResponse[
"capo_connectcases.types.search_cases_response.SearchCasesResponse"
]:
import capo_connectcases._operations.amazon_connect_cases.search_cases
output, http_response = (
capo_connectcases._operations.amazon_connect_cases.search_cases.search_cases(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("SearchCases")
)
input_: capo_connectcases.types.search_cases_request.SearchCasesRequest = {
"domain_id": domain_id
}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
if search_term is not None:
input_["search_term"] = search_term
if filter is not None:
input_["filter"] = filter
if sorts is not None:
input_["sorts"] = sorts
if fields is not None:
input_["fields"] = fields
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|