Skip to content

list_plan_violations

list_plan_violations(
    target_plan: PlanTier,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListPlanViolationsResponse

List the violations preventing an account to change flat rate plans. An empty list means the account already fits the target plan. If you allow the ListPlanViolations permission for your account, any requestor can see all project names that violate a downgrade from all Regions.

Parameters:

  • target_plan (PlanTier) –

    The plan to check the account's resources against.

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

    The maximum number of violations to return in one page.

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

    A pagination token returned from a previous request.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def list_plan_violations(
    self,
    target_plan: "capo_amplifygen3.types.plan_tier.PlanTier",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    max_results: Optional["capo_amplifygen3.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_amplifygen3.types.next_token.NextToken"] = None,
) -> "capo_amplifygen3.types.list_plan_violations_response.ListPlanViolationsResponse":
    """<p>List the violations preventing an account to change flat rate plans. An empty list means the account already fits the target plan. If you allow the ListPlanViolations permission for your account, any requestor can see all project names that violate a downgrade from all Regions.</p>

    Args:
        target_plan: <p>The plan to check the account's resources against.</p>
        max_results: <p>The maximum number of violations to return in one page.</p>
        next_token: <p>A pagination token returned from a previous request.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.list_plan_violations_request.ListPlanViolationsRequest]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.list_plan_violations_response.ListPlanViolationsResponse"
    ]:
        import capo_amplifygen3._operations.omega.list_plan_violations

        output, http_response = (
            capo_amplifygen3._operations.omega.list_plan_violations.list_plan_violations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPlanViolations")
    )
    input_: capo_amplifygen3.types.list_plan_violations_request.ListPlanViolationsRequest = {
        "target_plan": target_plan
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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