amazon-ads-cli 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/PKG-INFO +1 -1
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli/main.py +28 -8
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli.egg-info/PKG-INFO +1 -1
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/setup.py +1 -1
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/LICENSE +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/README.md +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli/__init__.py +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli/__main__.py +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli.egg-info/SOURCES.txt +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli.egg-info/dependency_links.txt +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli.egg-info/entry_points.txt +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli.egg-info/requires.txt +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/amazon_ads_cli.egg-info/top_level.txt +0 -0
- {amazon_ads_cli-0.1.7 → amazon_ads_cli-0.1.8}/setup.cfg +0 -0
|
@@ -489,14 +489,34 @@ def list_all_targets(ctx):
|
|
|
489
489
|
click.echo(f"{camp_id:<20} {ag_id:<20} {expr:<40} {state}")
|
|
490
490
|
|
|
491
491
|
|
|
492
|
-
@targets.command("
|
|
492
|
+
@targets.command("delete")
|
|
493
|
+
@click.argument("target-id")
|
|
494
|
+
@click.pass_context
|
|
495
|
+
def delete_target(ctx, target_id):
|
|
496
|
+
"""Delete a product target by ID."""
|
|
497
|
+
try:
|
|
498
|
+
sponsored_products.TargetsV3(
|
|
499
|
+
marketplace=Marketplaces.NA
|
|
500
|
+
).delete_product_targets(body={"targetIdFilter": {"include": [target_id]}})
|
|
501
|
+
click.echo(f"✅ Deleted target: {target_id}")
|
|
502
|
+
except Exception as e:
|
|
503
|
+
click.echo(f"❌ Error: {e}")
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
@cli.group("asin-targets")
|
|
507
|
+
def asin_targets():
|
|
508
|
+
"""ASIN target management commands."""
|
|
509
|
+
pass
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
@asin_targets.command("add")
|
|
493
513
|
@click.argument("campaign-id")
|
|
494
514
|
@click.argument("ad-group-id")
|
|
495
515
|
@click.argument("asin")
|
|
496
516
|
@click.option("--bid", default=1.0, help="Bid amount")
|
|
497
517
|
@click.pass_context
|
|
498
|
-
def
|
|
499
|
-
"""
|
|
518
|
+
def add_asin_target(ctx, campaign_id, ad_group_id, asin, bid):
|
|
519
|
+
"""Add an ASIN target to a campaign ad group."""
|
|
500
520
|
try:
|
|
501
521
|
result = sponsored_products.TargetsV3(
|
|
502
522
|
marketplace=Marketplaces.NA
|
|
@@ -518,7 +538,7 @@ def create_asin_target(ctx, campaign_id, ad_group_id, asin, bid):
|
|
|
518
538
|
errors = result.payload.get("targetingClauses", {}).get("error", [])
|
|
519
539
|
if success:
|
|
520
540
|
target_id = success[0].get("targetId")
|
|
521
|
-
click.echo(f"✅
|
|
541
|
+
click.echo(f"✅ Added ASIN target: {asin} (ID: {target_id}) - ${bid}")
|
|
522
542
|
elif errors:
|
|
523
543
|
msg = (
|
|
524
544
|
errors[0]
|
|
@@ -532,16 +552,16 @@ def create_asin_target(ctx, campaign_id, ad_group_id, asin, bid):
|
|
|
532
552
|
click.echo(f"❌ Error: {e}")
|
|
533
553
|
|
|
534
554
|
|
|
535
|
-
@
|
|
555
|
+
@asin_targets.command("remove")
|
|
536
556
|
@click.argument("target-id")
|
|
537
557
|
@click.pass_context
|
|
538
|
-
def
|
|
539
|
-
"""
|
|
558
|
+
def remove_asin_target(ctx, target_id):
|
|
559
|
+
"""Remove an ASIN target by ID."""
|
|
540
560
|
try:
|
|
541
561
|
sponsored_products.TargetsV3(
|
|
542
562
|
marketplace=Marketplaces.NA
|
|
543
563
|
).delete_product_targets(body={"targetIdFilter": {"include": [target_id]}})
|
|
544
|
-
click.echo(f"✅
|
|
564
|
+
click.echo(f"✅ Removed ASIN target: {target_id}")
|
|
545
565
|
except Exception as e:
|
|
546
566
|
click.echo(f"❌ Error: {e}")
|
|
547
567
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|