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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-ads-cli
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: CLI tool for Amazon Advertising API v3
5
5
  Home-page: https://github.com/stellaraether/amazon-ads-cli
6
6
  Author: Lunan Li
@@ -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("create-asin")
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 create_asin_target(ctx, campaign_id, ad_group_id, asin, bid):
499
- """Create an ASIN target in a campaign ad group."""
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"✅ Created ASIN target: {asin} (ID: {target_id}) - ${bid}")
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
- @targets.command("delete")
555
+ @asin_targets.command("remove")
536
556
  @click.argument("target-id")
537
557
  @click.pass_context
538
- def delete_target(ctx, target_id):
539
- """Delete a product target by ID."""
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"✅ Deleted target: {target_id}")
564
+ click.echo(f"✅ Removed ASIN target: {target_id}")
545
565
  except Exception as e:
546
566
  click.echo(f"❌ Error: {e}")
547
567
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-ads-cli
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: CLI tool for Amazon Advertising API v3
5
5
  Home-page: https://github.com/stellaraether/amazon-ads-cli
6
6
  Author: Lunan Li
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name="amazon-ads-cli",
5
- version="0.1.7",
5
+ version="0.1.8",
6
6
  description="CLI tool for Amazon Advertising API v3",
7
7
  author="Lunan Li",
8
8
  author_email="lunan@stellaraether.com",
File without changes
File without changes
File without changes