update_campaign
¶
update_campaign(
catalog: Catalog,
campaign_identifier: CampaignIdentifier,
*,
config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
name: Optional[CampaignName] = None,
sender_email: Optional[SenderEmail] = None,
privacy_policy_url: Optional[PrivacyPolicyUrl] = None,
partner_address: Optional[PartnerAddress] = None,
partner_badge: Optional[FileRef] = None,
email_target: Optional[FileRef] = None,
email_target_engagement_group_ids: Optional[EngagementGroupIdList] = None,
social_connections: Optional[CampaignSocialConnections] = None,
estimated_budget: Optional[MonetaryValue] = None,
total_budget: Optional[MonetaryValue] = None,
target_audience: Optional[TargetAudience] = None,
client_token: Optional[ClientToken] = None,
start_on: Optional[UtcDate] = None,
end_on: Optional[UtcDate] = None,
) -> UpdateCampaignResponse
Edits a campaign in place. Partial update: an omitted field is left unchanged, which is the standard meaning of an Update verb — a full replacement would be a Put. Change-only, with no way to clear a field back to empty, because the campaign's file members cannot round-trip: they are written as an s3:// reference and read back as a URL or as metadata, so a replacement payload could not resend an unchanged recipient list without re-uploading it. Refused while an activation task runs (CAMPAIGN_ACTIVATION_IN_PROGRESS) and once the campaign is completed (CAMPAIGN_COMPLETED, the UTC date is after its EndOn). Last-writer-wins, with no concurrency token: this is low-contention metadata owned by one partner.
Parameters:
-
catalog(Catalog) –The catalog (AWS or Sandbox).
-
campaign_identifier(CampaignIdentifier) –The campaign identifier.
-
name(Optional[CampaignName], default:None) –The display name.
-
sender_email(Optional[SenderEmail], default:None) –Sets or replaces the address the campaign's emails are sent from. Checked by the same three rules as on
CreateCampaign, with the same codes, but only when it differs, ignoring case, from the stored sender: re-sending the stored one is not checked, andStartCampaignAssetActivationTaskre-checks it before an email activates.Replaces, never clears: like every member of this operation, an omitted value leaves the sender as it was, and there is no way to remove one once set.
-
privacy_policy_url(Optional[PrivacyPolicyUrl], default:None) –Sets or replaces the URL of the partner's privacy policy. Replaces, never clears.
-
partner_address(Optional[PartnerAddress], default:None) –Sets or replaces the partner's postal address. Replaces, never clears.
-
partner_badge(Optional[FileRef], default:None) –Sets or replaces the partner's badge, checked exactly as on
CreateCampaign. Replaces, never clears: upload the Standalone AWS Partner badge to show it again. The badge an asset already published keeps showing on it until that asset is activated again. -
email_target(Optional[FileRef], default:None) –Replaces the campaign's attached recipient list.
The referenced object is copied and pinned again on every call that supplies it, so the pinned copy always reflects the last
UpdateCampaignthat named one. Editing the source object in your own bucket without calling this operation again has no effect.Replaces, never detaches: a partner can swap the list but cannot remove it.
-
email_target_engagement_group_ids(Optional[EngagementGroupIdList], default:None) –Engagement groups whose contacts the campaign's emails will also go to (see
CreateCampaign). Replaces the stored list; never clears it.As on
CreateCampaign: each group once (INVALID_VALUEotherwise), not checked against your groups when saved, and resolved at Start where the stage can (ENGAGEMENT_GROUPS_UNAVAILABLEwhere it can't). -
social_connections(Optional[CampaignSocialConnections], default:None) –Sets the account the campaign's social posts publish from, per platform. Each platform named replaces that platform's choice; a platform not named keeps its own. Replaces, never clears.
Not checked against your connections here: a connection can be deleted at any time, so the activation checks the choice. See
Campaign$SocialConnections. -
estimated_budget(Optional[MonetaryValue], default:None) –What the partner expects the campaign to cost.
-
total_budget(Optional[MonetaryValue], default:None) –The campaign's total budget.
-
target_audience(Optional[TargetAudience], default:None) –Target audience configuration.
-
client_token(Optional[ClientToken], default:None) –Idempotency token. Accepted and not stored: this is a change-only partial update with last-writer-wins, so re-applying the same call produces the same result and the same response. There is nothing a replay cache would protect.
-
start_on(Optional[UtcDate], default:None) –The first day of the campaign's run window. Not after
EndOn(ValidationException,INVALID_VALUE). -
end_on(Optional[UtcDate], default:None) –The last day of the campaign's run window, inclusive and in UTC. Editable only while the campaign is open, like everything else here: once the stored
EndOnhas passed the campaign is completed and this update is refused (CAMPAIGN_COMPLETED). Refused withValidationException(INVALID_VALUE) when it is in the past, or earlier than the day of a scheduled send on one of the campaign's assets: move or cancel that send first. Setting it to today ends the campaign at the next UTC midnight.
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 readsFieldListrather than parsingMessage, 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.
Examples:
Rename a campaign and raise its budget
>>> client.update_campaign(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', name='Q4 GenAI Campaign (EMEA)', total_budget={'Amount': '40000.00', 'CurrencyCode': 'USD'})
Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 | |