Stops a live campaign asset: an email's scheduled send is withdrawn, a social post is removed before it publishes. On a completed campaign, it also removes a published document, banner or landing page. Synchronous, and safe to repeat. Does not delete the asset record, so a stopped email or social post can be started again. Not every asset can be stopped, and the reasons differ in kind. An email that has begun sending cannot be recalled: the send is gone. A document, a banner or a landing page is refused with ASSET_NOT_DEACTIVATABLE until the campaign has completed (the UTC date is after its EndOn). Until then the partner fixes one in place by updating it and activating it again, which keeps its URL, so every email that already linked to it keeps working. Once the campaign has completed, the removal is permanent, because a completed campaign can't activate anything again: - A document's published PDF is deleted. Its URL stops serving within about a minute (the CDN revalidates), and PublicUrl is no longer returned. Anything that linked to it, such as a landing page's download button or a sent email, reaches an error page. The export still contains the document. - A banner's or landing page's published object is taken down at the delivery platform, and the images the partner put on it are deleted. A landing page stops capturing leads, and its PublicUrl is no longer returned. A partner site that embedded a banner shows nothing there. The platform's own CDN can keep serving a copy a visitor already cached, which collects nothing. A landing page and a document it links to can be removed in either order.
Parameters:
Raises:
-
AccessDeniedException
–
You do not have sufficient access to perform this action. An IAM denial carries no Reason. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence.
-
InternalServerException
–
An unexpected error occurred during the processing of the request.
-
ThrottlingException
–
The request was denied due to request throttling.
-
ValidationException
–
The input fails to satisfy the constraints specified by the service. A caller branches on Reason, and where the rejection is attributable to particular fields it reads FieldList rather than parsing Message, which is prose and may change.
-
ConflictException
–
The request conflicts with the current state of the resource.
-
ResourceNotFoundException
–
The specified resource does not exist.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
| def deactivate_campaign_asset(
self,
catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
campaign_identifier: "capo_partnercentral_marketing.types.campaign_identifier.CampaignIdentifier",
campaign_asset_identifier: "capo_partnercentral_marketing.types.campaign_asset_id.CampaignAssetId",
*,
config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> "capo_partnercentral_marketing.types.deactivate_campaign_asset_response.DeactivateCampaignAssetResponse":
"""Stops a live campaign asset: an email's scheduled send is withdrawn, a social post is removed before it publishes. On a completed campaign, it also removes a published document, banner or landing page. Synchronous, and safe to repeat. Does not delete the asset record, so a stopped email or social post can be started again. Not every asset can be stopped, and the reasons differ in kind. An email that has begun sending **cannot** be recalled: the send is gone. A document, a banner or a landing page is **refused** with `ASSET_NOT_DEACTIVATABLE` until the campaign has completed (the UTC date is after its `EndOn`). Until then the partner fixes one in place by updating it and activating it again, which keeps its URL, so every email that already linked to it keeps working. Once the campaign has completed, the removal is permanent, because a completed campaign can't activate anything again: - A document's published PDF is deleted. Its URL stops serving within about a minute (the CDN revalidates), and `PublicUrl` is no longer returned. Anything that linked to it, such as a landing page's download button or a sent email, reaches an error page. The export still contains the document. - A banner's or landing page's published object is taken down at the delivery platform, and the images the partner put on it are deleted. A landing page stops capturing leads, and its `PublicUrl` is no longer returned. A partner site that embedded a banner shows nothing there. The platform's own CDN can keep serving a copy a visitor already cached, which collects nothing. A landing page and a document it links to can be removed in either order.
Args:
catalog: The catalog (AWS or Sandbox).
campaign_identifier: The campaign identifier.
campaign_asset_identifier: The asset identifier.
Raises:
capo_partnercentral_marketing.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action. An IAM denial carries no `Reason`. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence.
capo_partnercentral_marketing.errors.internal_server_exception.InternalServerException: An unexpected error occurred during the processing of the request.
capo_partnercentral_marketing.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
capo_partnercentral_marketing.errors.validation_exception.ValidationException: The input fails to satisfy the constraints specified by the service. A caller branches on `Reason`, and where the rejection is attributable to particular fields it reads `FieldList` rather than parsing `Message`, which is prose and may change.
capo_partnercentral_marketing.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource.
capo_partnercentral_marketing.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
capo_partnercentral_marketing.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_partnercentral_marketing.types.deactivate_campaign_asset_request.DeactivateCampaignAssetRequest]",
) -> OperationResponse[
"capo_partnercentral_marketing.types.deactivate_campaign_asset_response.DeactivateCampaignAssetResponse"
]:
import capo_partnercentral_marketing._operations.aws_partner_demand_generator.deactivate_campaign_asset
output, http_response = (
capo_partnercentral_marketing._operations.aws_partner_demand_generator.deactivate_campaign_asset.deactivate_campaign_asset(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeactivateCampaignAsset")
)
input_: capo_partnercentral_marketing.types.deactivate_campaign_asset_request.DeactivateCampaignAssetRequest = {
"catalog": catalog,
"campaign_identifier": campaign_identifier,
"campaign_asset_identifier": campaign_asset_identifier,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|