list_campaigns
async
¶
list_campaigns(
catalog: Catalog,
*,
config_overrides: Optional[AsyncPartnerCentralMarketingClientConfig] = None,
campaign_identifiers: Optional[CampaignIdentifierList] = None,
name: Optional[CampaignName] = None,
states: Optional[CampaignStateList] = None,
sort: Optional[CampaignSort] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
) -> ListCampaignsResponse
Lists campaigns with optional filters and pagination.
Parameters:
-
catalog(Catalog) –The catalog (AWS or Sandbox).
-
campaign_identifiers(Optional[CampaignIdentifierList], default:None) –Only these campaigns, each named by its id or its campaign ARN. A campaign that does not exist, was deleted, or whose ARN names another account or catalog is left out rather than refused.
-
name(Optional[CampaignName], default:None) –Only campaigns whose name contains this, compared case-insensitively.
-
states(Optional[CampaignStateList], default:None) –Only campaigns in one of these states.
-
sort(Optional[CampaignSort], default:None) –The order of the results. Default:
CREATED_AT,DESCENDING. -
max_results(Optional[MaxResults], default:None) –Maximum results per page.
-
next_token(Optional[NextToken], default:None) –Pagination token. Bound to the filters and sort it was issued for: a request that changes
CampaignIdentifiers,Name,StatesorSortbetween pages is refused withValidationException.MaxResultsmay change.
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. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
List campaigns
>>> await client.list_campaigns(catalog='AWS', campaign_identifiers=['arn:aws:partnercentral:us-east-1:123456789012:catalog/AWS/campaign/camp-5Hq2m8x4k1p9w', 'camp-8Rt3w6y1n4b2v'])
Search active campaigns by name, by launch date
>>> await client.list_campaigns(catalog='AWS', name='genai', states=['ACTIVE'], sort={'SortBy': 'START_ON', 'SortOrder': 'ASCENDING'}, max_results=20)
Source code in docs_src/capo_partnercentral_marketing/_services/async_partner_central_marketing.py
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 | |