Skip to content

describe_cases async

describe_cases(
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    case_id_list: Optional[CaseIdList] = None,
    display_id: Optional[DisplayId] = None,
    after_time: Optional[AfterTime] = None,
    before_time: Optional[BeforeTime] = None,
    include_resolved_cases: Optional[IncludeResolvedCases] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    language: Optional[Language] = None,
    include_communications: Optional[IncludeCommunications] = None,
    dry_run: Optional[NullableBooleanType] = None,
) -> DescribeCasesResponse

Returns a list of cases that you specify by passing one or more case IDs. You can use the afterTime and beforeTime parameters to filter the cases by date. You can set values for the includeResolvedCases and includeCommunications parameters to specify how much information to return.

The response returns the following in JSON format:

  • One or more CaseDetails data types.

  • One or more nextToken values, which specify where to paginate the returned records represented by the CaseDetails objects.

Case data is available for 24 months after creation. If a case was created more than 24 months ago, a request might return an error.

  • You must have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan to use the Amazon Web Services Support API. If you're in an Amazon Web Services Region that doesn't offer one of these Amazon Web Services Support plans, or if you haven't transitioned to one of these plans, you can use the Amazon Web Services Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.

  • If you call the Amazon Web Services Support API from an account that doesn't have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan, the SubscriptionRequiredException error message appears. For information about changing your support plan, see Amazon Web Services Support.

Each Communication returned by this operation includes attachment information in two fields:

  • attachmentSet: returns only attachments that are 5 MB or smaller. Attachments larger than 5 MB are not included in this field.

  • attachments: returns all attachments regardless of size.

Amazon Web Services recommends that you use the attachments field and download each attachment with GetAttachmentDownloadLink, which supports attachments of any size. The attachmentSet field and DescribeAttachment return only attachments that are 5 MB or smaller.

Parameters:

  • case_id_list (Optional[CaseIdList], default: None ) –

    A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.

  • display_id (Optional[DisplayId], default: None ) –

    The ID displayed for a case in the Amazon Web Services Support Center user interface.

  • after_time (Optional[AfterTime], default: None ) –

    The start date for a filtered date search on support case communications. Case communications are available for 24 months after creation.

  • before_time (Optional[BeforeTime], default: None ) –

    The end date for a filtered date search on support case communications. Case communications are available for 24 months after creation.

  • include_resolved_cases (Optional[IncludeResolvedCases], default: None ) –

    Specifies whether to include resolved support cases in the DescribeCases response. By default, resolved cases aren't included.

  • next_token (Optional[NextToken], default: None ) –

    A resumption point for pagination.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return before paginating.

  • language (Optional[Language], default: None ) –

    The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") , Chinese ("zh"), Spanish ("es"), Portuguese ("pt"), French ("fr"), Korean (“ko”), and Turkish ("tr"). You must specify the ISO 639-1 code for the language parameter if you want support in that language.

  • include_communications (Optional[IncludeCommunications], default: None ) –

    Specifies whether to include communications in the DescribeCases response. By default, communications are included.

  • dry_run (Optional[NullableBooleanType], default: None ) –

    Specifies whether to validate the request without actually returning case data. When set to true, the request is validated but no cases are returned, and the operation returns a DryRunOperationException. When omitted or set to false, the request runs normally.

Raises:

Source code in docs_src/capo_support/_services/async_support.py
async def describe_cases(
    self,
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    case_id_list: Optional["capo_support.types.case_id_list.CaseIdList"] = None,
    display_id: Optional["capo_support.types.display_id.DisplayId"] = None,
    after_time: Optional["capo_support.types.after_time.AfterTime"] = None,
    before_time: Optional["capo_support.types.before_time.BeforeTime"] = None,
    include_resolved_cases: Optional[
        "capo_support.types.include_resolved_cases.IncludeResolvedCases"
    ] = None,
    next_token: Optional["capo_support.types.next_token.NextToken"] = None,
    max_results: Optional["capo_support.types.max_results.MaxResults"] = None,
    language: Optional["capo_support.types.language.Language"] = None,
    include_communications: Optional[
        "capo_support.types.include_communications.IncludeCommunications"
    ] = None,
    dry_run: Optional[
        "capo_support.types.nullable_boolean_type.NullableBooleanType"
    ] = None,
) -> "capo_support.types.describe_cases_response.DescribeCasesResponse":
    """<p>Returns a list of cases that you specify by passing one or more case IDs. You can use the <code>afterTime</code> and <code>beforeTime</code> parameters to filter the cases by date. You can set values for the <code>includeResolvedCases</code> and <code>includeCommunications</code> parameters to specify how much information to return.</p> <p>The response returns the following in JSON format:</p> <ul> <li> <p>One or more <a href="https://docs.aws.amazon.com/awssupport/latest/APIReference/API_CaseDetails.html">CaseDetails</a> data types.</p> </li> <li> <p>One or more <code>nextToken</code> values, which specify where to paginate the returned records represented by the <code>CaseDetails</code> objects.</p> </li> </ul> <p>Case data is available for 24 months after creation. If a case was created more than 24 months ago, a request might return an error.</p> <note> <ul> <li> <p>You must have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan to use the Amazon Web Services Support API. If you're in an Amazon Web Services Region that doesn't offer one of these Amazon Web Services Support plans, or if you haven't transitioned to one of these plans, you can use the Amazon Web Services Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.</p> </li> <li> <p>If you call the Amazon Web Services Support API from an account that doesn't have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan, the <code>SubscriptionRequiredException</code> error message appears. For information about changing your support plan, see <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a>.</p> </li> </ul> </note> <important> <p>Each <a>Communication</a> returned by this operation includes attachment information in two fields:</p> <ul> <li> <p> <code>attachmentSet</code>: returns only attachments that are 5 MB or smaller. Attachments larger than 5 MB are not included in this field.</p> </li> <li> <p> <code>attachments</code>: returns all attachments regardless of size.</p> </li> </ul> <p>Amazon Web Services recommends that you use the <code>attachments</code> field and download each attachment with <a>GetAttachmentDownloadLink</a>, which supports attachments of any size. The <code>attachmentSet</code> field and <a>DescribeAttachment</a> return only attachments that are 5 MB or smaller.</p> </important>

    Args:
        case_id_list: <p>A list of ID numbers of the support cases you want returned. The maximum number of cases is 100.</p>
        display_id: <p>The ID displayed for a case in the Amazon Web Services Support Center user interface.</p>
        after_time: <p>The start date for a filtered date search on support case communications. Case communications are available for 24 months after creation.</p>
        before_time: <p>The end date for a filtered date search on support case communications. Case communications are available for 24 months after creation.</p>
        include_resolved_cases: <p>Specifies whether to include resolved support cases in the <code>DescribeCases</code> response. By default, resolved cases aren't included.</p>
        next_token: <p>A resumption point for pagination.</p>
        max_results: <p>The maximum number of results to return before paginating.</p>
        language: <p>The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") , Chinese ("zh"), Spanish ("es"), Portuguese ("pt"), French ("fr"), Korean (“ko”), and Turkish ("tr"). You must specify the ISO 639-1 code for the <code>language</code> parameter if you want support in that language.</p>
        include_communications: <p>Specifies whether to include communications in the <code>DescribeCases</code> response. By default, communications are included.</p>
        dry_run: <p>Specifies whether to validate the request without actually returning case data. When set to <code>true</code>, the request is validated but no cases are returned, and the operation returns a <code>DryRunOperationException</code>. When omitted or set to <code>false</code>, the request runs normally.</p>

    Raises:
        capo_support.errors.case_id_not_found.CaseIdNotFound: <p>The requested <code>caseId</code> couldn't be located.</p>
        capo_support.errors.dry_run_operation_exception.DryRunOperationException: <p>The request was valid, but the operation wasn't performed because <code>dryRun</code> was set to <code>true</code>.</p>
        capo_support.errors.internal_server_error.InternalServerError: <p>An internal server error occurred.</p>
        capo_support.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_support.types.describe_cases_request.DescribeCasesRequest]",
    ) -> AsyncOperationResponse[
        "capo_support.types.describe_cases_response.DescribeCasesResponse"
    ]:
        import capo_support._operations.aws_support_20130415.describe_cases

        (
            output,
            http_response,
        ) = await capo_support._operations.aws_support_20130415.describe_cases.async_describe_cases(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCases")
    )
    input_: capo_support.types.describe_cases_request.DescribeCasesRequest = {}
    if case_id_list is not None:
        input_["case_id_list"] = case_id_list
    if display_id is not None:
        input_["display_id"] = display_id
    if after_time is not None:
        input_["after_time"] = after_time
    if before_time is not None:
        input_["before_time"] = before_time
    if include_resolved_cases is not None:
        input_["include_resolved_cases"] = include_resolved_cases
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if language is not None:
        input_["language"] = language
    if include_communications is not None:
        input_["include_communications"] = include_communications
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output