Skip to content

list_enrollment_statuses

list_enrollment_statuses(
    *,
    config_overrides: Optional[CostOptimizationHubClientConfig] = None,
    include_organization_info: Optional[bool] = None,
    account_id: Optional[AccountId] = None,
    next_token: Optional[str] = None,
    max_results: Optional[MaxResults] = None,
) -> ListEnrollmentStatusesResponse

Retrieves the enrollment status for an account. It can also return the list of accounts that are enrolled under the organization.

Parameters:

  • include_organization_info (Optional[bool], default: None ) –

    Indicates whether to return the enrollment status for the organization.

  • account_id (Optional[AccountId], default: None ) –

    The account ID of a member account in the organization.

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

    The token to retrieve the next set of results.

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

    The maximum number of objects that are returned for the request.

Raises:

Source code in docs_src/capo_cost_optimization_hub/_services/cost_optimization_hub.py
def list_enrollment_statuses(
    self,
    *,
    config_overrides: Optional[CostOptimizationHubClientConfig] = None,
    include_organization_info: Optional[bool] = None,
    account_id: Optional[
        "capo_cost_optimization_hub.types.account_id.AccountId"
    ] = None,
    next_token: Optional[str] = None,
    max_results: Optional[
        "capo_cost_optimization_hub.types.max_results.MaxResults"
    ] = None,
) -> "capo_cost_optimization_hub.types.list_enrollment_statuses_response.ListEnrollmentStatusesResponse":
    """<p>Retrieves the enrollment status for an account. It can also return the list of accounts that are enrolled under the organization.</p>

    Args:
        include_organization_info: <p>Indicates whether to return the enrollment status for the organization.</p>
        account_id: <p>The account ID of a member account in the organization.</p>
        next_token: <p>The token to retrieve the next set of results.</p>
        max_results: <p>The maximum number of objects that are returned for the request.</p>

    Raises:
        capo_cost_optimization_hub.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to use this operation with the given parameters.</p>
        capo_cost_optimization_hub.errors.internal_server_exception.InternalServerException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
        capo_cost_optimization_hub.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_cost_optimization_hub.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_cost_optimization_hub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cost_optimization_hub.types.list_enrollment_statuses_request.ListEnrollmentStatusesRequest]",
    ) -> OperationResponse[
        "capo_cost_optimization_hub.types.list_enrollment_statuses_response.ListEnrollmentStatusesResponse"
    ]:
        import capo_cost_optimization_hub._operations.cost_optimization_hub_service.list_enrollment_statuses

        output, http_response = (
            capo_cost_optimization_hub._operations.cost_optimization_hub_service.list_enrollment_statuses.list_enrollment_statuses(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEnrollmentStatuses")
    )
    input_: capo_cost_optimization_hub.types.list_enrollment_statuses_request.ListEnrollmentStatusesRequest = {}
    if include_organization_info is not None:
        input_["include_organization_info"] = include_organization_info
    if account_id is not None:
        input_["account_id"] = account_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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