@@ -90,6 +90,8 @@ def check_item_type(ctx, param, item_type) -> Optional[List[dict]]:
90
90
raise click .BadParameter (str (e ))
91
91
92
92
return item_type
93
+
94
+
93
95
def check_search_id (ctx , param , search_id ) -> str :
94
96
'''Ensure search id is a valix hex string'''
95
97
try :
@@ -498,7 +500,7 @@ async def search_update(ctx,
498
500
@coro
499
501
@click .argument ("item_type" , type = str , callback = check_item_type )
500
502
@click .argument ("item_id" )
501
- @click .argument ("asset_type_id " )
503
+ @click .argument ("asset_type " )
502
504
@click .option ('--directory' ,
503
505
default = '.' ,
504
506
help = ('Base directory for file download.' ),
@@ -521,7 +523,7 @@ async def search_update(ctx,
521
523
async def asset_download (ctx ,
522
524
item_type ,
523
525
item_id ,
524
- asset_type_id ,
526
+ asset_type ,
525
527
directory ,
526
528
filename ,
527
529
overwrite ,
@@ -544,7 +546,7 @@ async def asset_download(ctx,
544
546
"""
545
547
quiet = ctx .obj ['QUIET' ]
546
548
async with data_client (ctx ) as cl :
547
- asset = await cl .get_asset (item_type , item_id , asset_type_id )
549
+ asset = await cl .get_asset (item_type , item_id , asset_type )
548
550
path = await cl .download_asset (asset = asset ,
549
551
filename = filename ,
550
552
directory = Path (directory ),
@@ -560,11 +562,11 @@ async def asset_download(ctx,
560
562
@coro
561
563
@click .argument ("item_type" , type = str , callback = check_item_type )
562
564
@click .argument ("item_id" )
563
- @click .argument ("asset_type_id " )
564
- async def asset_activate (ctx , item_type , item_id , asset_type_id ):
565
+ @click .argument ("asset_type " )
566
+ async def asset_activate (ctx , item_type , item_id , asset_type ):
565
567
'''Activate an asset.'''
566
568
async with data_client (ctx ) as cl :
567
- asset = await cl .get_asset (item_type , item_id , asset_type_id )
569
+ asset = await cl .get_asset (item_type , item_id , asset_type )
568
570
await cl .activate_asset (asset )
569
571
570
572
@@ -574,7 +576,7 @@ async def asset_activate(ctx, item_type, item_id, asset_type_id):
574
576
@coro
575
577
@click .argument ("item_type" , type = str , callback = check_item_type )
576
578
@click .argument ("item_id" )
577
- @click .argument ("asset_type_id " )
579
+ @click .argument ("asset_type " )
578
580
@click .option ('--delay' ,
579
581
type = int ,
580
582
default = 5 ,
@@ -584,20 +586,15 @@ async def asset_activate(ctx, item_type, item_id, asset_type_id):
584
586
default = 200 ,
585
587
show_default = True ,
586
588
help = 'Maximum number of polls. Set to zero for no limit.' )
587
- async def asset_wait (ctx ,
588
- item_type ,
589
- item_id ,
590
- asset_type_id ,
591
- delay ,
592
- max_attempts ):
589
+ async def asset_wait (ctx , item_type , item_id , asset_type , delay , max_attempts ):
593
590
'''Wait for an asset to be activated.
594
591
595
592
Returns when the asset state has reached "activated" and the asset is
596
593
available.
597
594
'''
598
595
quiet = ctx .obj ['QUIET' ]
599
596
async with data_client (ctx ) as cl :
600
- asset = await cl .get_asset (item_type , item_id , asset_type_id )
597
+ asset = await cl .get_asset (item_type , item_id , asset_type )
601
598
with StateBar (order_id = "my asset" , disable = quiet ) as bar :
602
599
state = await cl .wait_asset (asset ,
603
600
delay ,
0 commit comments