Reads a campaign's current activation task. Keyed on the campaign, with no task identifier, because a campaign has at most one activation task: runs are serialised, so there is no collection to address into. The caller always holds the task id anyway, because Start returned it — the id is a correlation value, not an address. Returns the campaign's most recent task. A new task overwrites the previous one, so this is not a history: the durable per-asset record is on the assets themselves. Returns ResourceNotFoundException when the campaign has never had a task, or when its last one has expired.
Parameters:
-
catalog
(Catalog)
–
The catalog (AWS or Sandbox).
-
campaign_identifier
(CampaignIdentifier)
–
The campaign whose current task to read. This addresses the task, and also authorizes the call.
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.
-
ResourceNotFoundException
–
The specified resource does not exist.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Read a finished task where one asset failed
>>> await client.get_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w')
Source code in docs_src/capo_partnercentral_marketing/_services/async_partner_central_marketing.py
| async def get_campaign_asset_activation_task(
self,
catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
campaign_identifier: "capo_partnercentral_marketing.types.campaign_identifier.CampaignIdentifier",
*,
config_overrides: Optional[AsyncPartnerCentralMarketingClientConfig] = None,
) -> "capo_partnercentral_marketing.types.get_campaign_asset_activation_task_response.GetCampaignAssetActivationTaskResponse":
"""Reads a campaign's current activation task. Keyed on the **campaign**, with no task identifier, because a campaign has at most one activation task: runs are serialised, so there is no collection to address into. The caller always holds the task id anyway, because Start returned it — the id is a correlation value, not an address. Returns the campaign's most recent task. A new task overwrites the previous one, so this is not a history: the durable per-asset record is on the assets themselves. Returns ResourceNotFoundException when the campaign has never had a task, or when its last one has expired.
Args:
catalog: The catalog (AWS or Sandbox).
campaign_identifier: The campaign whose current task to read. This addresses the task, and also authorizes the call.
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.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.
Examples:
Read a finished task where one asset failed
>>> await client.get_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w')
"""
async def _handler(
req: "AsyncOperationRequest[capo_partnercentral_marketing.types.get_campaign_asset_activation_task_request.GetCampaignAssetActivationTaskRequest]",
) -> AsyncOperationResponse[
"capo_partnercentral_marketing.types.get_campaign_asset_activation_task_response.GetCampaignAssetActivationTaskResponse"
]:
import capo_partnercentral_marketing._operations.aws_partner_demand_generator.get_campaign_asset_activation_task
(
output,
http_response,
) = await capo_partnercentral_marketing._operations.aws_partner_demand_generator.get_campaign_asset_activation_task.async_get_campaign_asset_activation_task(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetCampaignAssetActivationTask")
)
input_: capo_partnercentral_marketing.types.get_campaign_asset_activation_task_request.GetCampaignAssetActivationTaskRequest = {
"catalog": catalog,
"campaign_identifier": campaign_identifier,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|