Skip to content

delete_third_party_cost async

delete_third_party_cost(
    app_id: AppId,
    cost_id: ThirdPartyCostId,
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
) -> DeleteThirdPartyCostResponse

Removes a third-party cost. This operation is idempotent: removing a cost that is already absent still succeeds. A missing or unauthorized parent app returns a ResourceNotFoundException.

Parameters:

Raises:

Source code in docs_src/capo_appmonetization/_services/async_app_monetization.py
async def delete_third_party_cost(
    self,
    app_id: "capo_appmonetization.types.app_id.AppId",
    cost_id: "capo_appmonetization.types.third_party_cost_id.ThirdPartyCostId",
    *,
    config_overrides: Optional[AsyncAppMonetizationClientConfig] = None,
) -> "capo_appmonetization.types.delete_third_party_cost_response.DeleteThirdPartyCostResponse":
    """Removes a third-party cost. This operation is idempotent: removing a cost that is already absent still succeeds. A missing or unauthorized parent app returns a ResourceNotFoundException.

    Args:
        app_id: The ID of the app.
        cost_id: The ID of the cost to remove.

    Raises:
        capo_appmonetization.errors.access_denied_exception.AccessDeniedException: The caller does not have sufficient permission to perform this action.
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appmonetization.types.delete_third_party_cost_request.DeleteThirdPartyCostRequest]",
    ) -> AsyncOperationResponse[
        "capo_appmonetization.types.delete_third_party_cost_response.DeleteThirdPartyCostResponse"
    ]:
        import capo_appmonetization._operations.aws_monetization_ai_front_end.delete_third_party_cost

        (
            output,
            http_response,
        ) = await capo_appmonetization._operations.aws_monetization_ai_front_end.delete_third_party_cost.async_delete_third_party_cost(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteThirdPartyCost")
    )
    input_: capo_appmonetization.types.delete_third_party_cost_request.DeleteThirdPartyCostRequest = {
        "app_id": app_id,
        "cost_id": cost_id,
    }

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