Skip to content

delete_app

delete_app(
    app_id: AppId,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    identifier: Optional[ResourceArn] = None,
    scope: Optional[RequestScope] = None,
) -> DeleteAppResponse

Deletes an app. If the app's published offering still has plans or metrics, the request fails with a ConflictException. Deleting an app that no longer exists returns a ResourceNotFoundException.

Parameters:

  • app_id (AppId) –

    The ID of the app to delete. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.

  • identifier (Optional[ResourceArn], default: None ) –

    The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.

  • scope (Optional[RequestScope], default: None ) –

    The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def delete_app(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    identifier: Optional[
        "capo_appmonetization.types.resource_arn.ResourceArn"
    ] = None,
    scope: Optional["capo_appmonetization.types.request_scope.RequestScope"] = None,
) -> "capo_appmonetization.types.delete_app_response.DeleteAppResponse":
    """Deletes an app. If the app's published offering still has plans or metrics, the request fails with a `ConflictException`. Deleting an app that no longer exists returns a `ResourceNotFoundException`.

    Args:
        app_id: The ID of the app to delete. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.
        identifier: The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.
        scope: The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.

    Raises:
        capo_appmonetization.errors.access_denied_exception.AccessDeniedException: The caller does not have sufficient permission to perform this action.
        capo_appmonetization.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource, such as a duplicate identifier or a version mismatch. Retrieve the current state of the resource and retry the request.
        capo_appmonetization.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_appmonetization.errors.resource_not_found_exception.ResourceNotFoundException: The referenced resource does not exist.
        capo_appmonetization.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_appmonetization.errors.validation_exception.ValidationException: The request failed input validation.
        capo_appmonetization.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appmonetization.types.delete_app_request.DeleteAppRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.delete_app_response.DeleteAppResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.delete_app

        output, http_response = (
            capo_appmonetization._operations.aws_monetization_ai_front_end.delete_app.delete_app(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteApp")
    )
    input_: capo_appmonetization.types.delete_app_request.DeleteAppRequest = {
        "app_id": app_id
    }
    if identifier is not None:
        input_["identifier"] = identifier
    if scope is not None:
        input_["scope"] = scope

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