Skip to content

get_exclusions_preview

get_exclusions_preview(
    assessment_template_arn: Arn,
    preview_token: UUID,
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[ListMaxResults] = None,
    locale: Optional[Locale] = None,
) -> GetExclusionsPreviewResponse

Retrieves the exclusions preview (a list of ExclusionPreview objects) specified by the preview token. You can obtain the preview token by running the CreateExclusionsPreview API.

Parameters:

  • assessment_template_arn (Arn) –

    The ARN that specifies the assessment template for which the exclusions preview was requested.

  • preview_token (UUID) –

    The unique identifier associated of the exclusions preview.

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

    You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the GetExclusionsPreviewRequest action. Subsequent calls to the action fill nextToken in the request with the value of nextToken from the previous response to continue listing data.

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

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 100. The maximum value is 500.

  • locale (Optional[Locale], default: None ) –

    The locale into which you want to translate the exclusion's title, description, and recommendation.

Raises:

  • AccessDeniedException –

    You do not have required permissions to access the requested resource.

  • InternalException –

    Internal server error.

  • InvalidInputException –

    The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • NoSuchEntityException –

    The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_inspector/_services/inspector.py
def get_exclusions_preview(
    self,
    assessment_template_arn: "capo_inspector.types.arn.Arn",
    preview_token: "capo_inspector.types.uuid.UUID",
    *,
    config_overrides: Optional[InspectorClientConfig] = None,
    next_token: Optional[
        "capo_inspector.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional[
        "capo_inspector.types.list_max_results.ListMaxResults"
    ] = None,
    locale: Optional["capo_inspector.types.locale.Locale"] = None,
) -> "capo_inspector.types.get_exclusions_preview_response.GetExclusionsPreviewResponse":
    """<p>Retrieves the exclusions preview (a list of ExclusionPreview objects) specified by the preview token. You can obtain the preview token by running the CreateExclusionsPreview API.</p>

    Args:
        assessment_template_arn: <p>The ARN that specifies the assessment template for which the exclusions preview was requested.</p>
        preview_token: <p>The unique identifier associated of the exclusions preview.</p>
        next_token: <p>You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the GetExclusionsPreviewRequest action. Subsequent calls to the action fill nextToken in the request with the value of nextToken from the previous response to continue listing data.</p>
        max_results: <p>You can use this parameter to indicate the maximum number of items you want in the response. The default value is 100. The maximum value is 500.</p>
        locale: <p>The locale into which you want to translate the exclusion's title, description, and recommendation.</p>

    Raises:
        capo_inspector.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to access the requested resource.</p>
        capo_inspector.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_inspector.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
        capo_inspector.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced an entity that does not exist. The error code describes the entity.</p>
        capo_inspector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_inspector.types.get_exclusions_preview_request.GetExclusionsPreviewRequest]",
    ) -> OperationResponse[
        "capo_inspector.types.get_exclusions_preview_response.GetExclusionsPreviewResponse"
    ]:
        import capo_inspector._operations.inspector_service.get_exclusions_preview

        output, http_response = (
            capo_inspector._operations.inspector_service.get_exclusions_preview.get_exclusions_preview(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetExclusionsPreview")
    )
    input_: capo_inspector.types.get_exclusions_preview_request.GetExclusionsPreviewRequest = {
        "assessment_template_arn": assessment_template_arn,
        "preview_token": preview_token,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if locale is not None:
        input_["locale"] = locale

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output