feat: show product-id for each offer when listing offers#16
feat: show product-id for each offer when listing offers#16toabctl wants to merge 1 commit intocanonical:mainfrom
Conversation
A product can have multiple offers but a offer can have only a single product. So listing the product-id for each offer when showing a list of available offers is useful to get the relationship.
4674ab8 to
9c807a3
Compare
JessicaJang
left a comment
There was a problem hiding this comment.
Please fix the linting
awsmp/cli.py:71: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice" [index]
Found 1 error in 1 file (checked 13 source files)
Error: Sequence aborted after failed subtask 'mypy'
lint: exit 1 (10.12 seconds) /home/runner/work/awsmp/awsmp> poetry run poe lint pid=1863
lint: FAIL ✖ in 15.15 seconds
change-wise looks good to me
| t.field_names = ["entity-id", "name", "visibility", "last-changed"] | ||
| if entity_type == "AmiProduct": | ||
| t.field_names = ["entity-id", "name", "visibility", "last-changed"] | ||
| else: |
There was a problem hiding this comment.
we should be explicit on which entity types this is (e.g. in case we add SaaS later or other marketplace types)
There was a problem hiding this comment.
you have to give the entity type at the command line. so imo you can't get this wrong:
awsmp inspect entity-list AmiProduct
vs.
awsmp inspect entity-list Offer
There was a problem hiding this comment.
what about direct library users? if we add more supported entities?
| t.add_row([entity["EntityId"], entity["Name"], entity["Visibility"], entity["LastModifiedDate"]]) | ||
| if entity_type == "AmiProduct": | ||
| t.add_row([entity["EntityId"], entity["Name"], entity["Visibility"], entity["LastModifiedDate"]]) | ||
| else: |
There was a problem hiding this comment.
again, explicit on entity_type
A product can have multiple offers but a offer can have only a single product. So listing the product-id for each offer when showing a list of available offers is useful to get the relationship.