Skip to content

list_frameworks async

list_frameworks(
    environment_arn: EnvironmentArn,
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    type: Optional[FrameworkType] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListFrameworksOutput

Lists frameworks by type, with optional pagination. When type is omitted, the operation returns both MANAGED and CUSTOM frameworks.

Parameters:

  • type (Optional[FrameworkType], default: None ) –

    The optional filter. Values are MANAGED, CUSTOM, or omit for both.

  • environment_arn (EnvironmentArn) –

    The ARN of this governance environment.

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

    The maximum number of records to return on one page. If you omit it, the operation uses its default page size. If more records are available, use the nextToken value from the response to get the next page.

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

    The pagination token returned by a previous request. Use it to retrieve the next page of results. If the value is null, there are no more results to return.

Raises:

Examples:

List the managed frameworks in an environment Lists the AWS-managed frameworks available in a governance environment before starting an assessment. Omit the type filter to page through custom frameworks as well.

>>> await client.list_frameworks(type='MANAGED', environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111')
Source code in docs_src/capo_assurance/_services/async_assurance.py
async def list_frameworks(
    self,
    environment_arn: "capo_assurance.types.environment_arn.EnvironmentArn",
    *,
    config_overrides: Optional[AsyncAssuranceClientConfig] = None,
    type: Optional["capo_assurance.types.framework_type.FrameworkType"] = None,
    max_results: Optional["capo_assurance.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_assurance.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_assurance.types.list_frameworks_output.ListFrameworksOutput":
    """<p>Lists frameworks by type, with optional pagination. When <code>type</code> is omitted, the operation returns both MANAGED and CUSTOM frameworks.</p>

    Args:
        type: <p>The optional filter. Values are MANAGED, CUSTOM, or omit for both.</p>
        environment_arn: <p>The ARN of this governance environment.</p>
        max_results: <p>The maximum number of records to return on one page. If you omit it, the operation uses its default page size. If more records are available, use the <code>nextToken</code> value from the response to get the next page.</p>
        next_token: <p>The pagination token returned by a previous request. Use it to retrieve the next page of results. If the value is null, there are no more results to return.</p>

    Raises:
        capo_assurance.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.</p>
        capo_assurance.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred.</p>
        capo_assurance.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_assurance.errors.throttling_exception.ThrottlingException: <p>The request was throttled.</p>
        capo_assurance.errors.validation_exception.ValidationException: <p>The request failed validation.</p>
        capo_assurance.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List the managed frameworks in an environment
        Lists the AWS-managed frameworks available in a governance environment before starting an assessment. Omit the type filter to page through custom frameworks as well.

        >>> await client.list_frameworks(type='MANAGED', environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_assurance.types.list_frameworks_input.ListFrameworksInput]",
    ) -> AsyncOperationResponse[
        "capo_assurance.types.list_frameworks_output.ListFrameworksOutput"
    ]:
        import capo_assurance._operations.assurance.list_frameworks

        (
            output,
            http_response,
        ) = await capo_assurance._operations.assurance.list_frameworks.async_list_frameworks(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFrameworks")
    )
    input_: capo_assurance.types.list_frameworks_input.ListFrameworksInput = {
        "environment_arn": environment_arn
    }
    if type is not None:
        input_["type"] = type
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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