Skip to content

update_app

update_app(
    app_id: AppId,
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    name: Optional[AppName] = None,
    description: Optional[AppDescription] = None,
    identifier: Optional[ResourceArn] = None,
    scope: Optional[RequestScope] = None,
    cost_tracking: Optional[CostTrackingConfiguration] = None,
) -> UpdateAppResponse

Updates an existing app. This operation is idempotent.

Parameters:

  • app_id (AppId) –

    The ID of the app to update. 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.

  • name (Optional[AppName], default: None ) –

    A human-readable display name for the app.

  • description (Optional[AppDescription], default: None ) –

    The new description. An empty string clears it; omitting the member keeps the current one.

  • 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.

  • cost_tracking (Optional[CostTrackingConfiguration], default: None ) –

    Optional cost-tracking configuration: the IAM role AWS App Monetization uses to track this app's AWS costs. Passing a role also requires permission for iam:PassRole on it. You can send it with or without a new name or description.

Raises:

Source code in docs_src/capo_appmonetization/_services/app_monetization.py
def update_app(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    *,
    config_overrides: Optional[AppMonetizationClientConfig] = None,
    name: Optional["capo_appmonetization.types.app_name.AppName"] = None,
    description: Optional[
        "capo_appmonetization.types.app_description.AppDescription"
    ] = None,
    identifier: Optional[
        "capo_appmonetization.types.resource_arn.ResourceArn"
    ] = None,
    scope: Optional["capo_appmonetization.types.request_scope.RequestScope"] = None,
    cost_tracking: Optional[
        "capo_appmonetization.types.cost_tracking_configuration.CostTrackingConfiguration"
    ] = None,
) -> "capo_appmonetization.types.update_app_response.UpdateAppResponse":
    """Updates an existing app. This operation is idempotent.

    Args:
        app_id: The ID of the app to update. 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.
        name: A human-readable display name for the app.
        description: The new description. An empty string clears it; omitting the member keeps the current one.
        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.
        cost_tracking: Optional cost-tracking configuration: the IAM role AWS App Monetization uses to track this app's AWS costs. Passing a role also requires permission for iam:PassRole on it. You can send it with or without a new name or description.

    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.update_app_request.UpdateAppRequest]",
    ) -> OperationResponse[
        "capo_appmonetization.types.update_app_response.UpdateAppResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.update_app

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateApp")
    )
    input_: capo_appmonetization.types.update_app_request.UpdateAppRequest = {
        "app_id": app_id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if identifier is not None:
        input_["identifier"] = identifier
    if scope is not None:
        input_["scope"] = scope
    if cost_tracking is not None:
        input_["cost_tracking"] = cost_tracking

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