Skip to content

Conversation

@JaviCerveraIngram
Copy link
Collaborator

No description provided.

:param dict|Query filters: Filters to pass to the request.
:return: A list with the marketplaces that match the given filters.
:rtype: list[Asset]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed type here list[Marketplace]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted. Fixing now.

:param str marketplace_id: The id of the marketplace.
:return: The asset with the given id, or ``None`` if such asset does not exist.
:rtype: Asset|None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed type, looks like should be Marketplace|None

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing...

Copy link
Contributor

@marcserrat marcserrat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few changes on descriptions requested

""" List the marketplaces.
:param dict|Query filters: Filters to pass to the request.
:return: A list with the marketplaces that match the given filters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List of marketplaces matching given filters

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

return Marketplace.deserialize(text)

def get_marketplace(self, marketplace_id):
""" Returns the marketplace with the given id.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obtains Marketplace object given it's ID

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

""" Returns the marketplace with the given id.
:param str marketplace_id: The id of the marketplace.
:return: The asset with the given id, or ``None`` if such asset does not exist.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asset?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Collaborator

@martinconstante martinconstante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be great creating a MarkeplaceResource that inherit from BaseResource and includes it in DirectoryResource. (see ProductResource).
Then we will have a resource for each object that matches the API and grouped by facades.

@JaviCerveraIngram
Copy link
Collaborator Author

JaviCerveraIngram commented Jul 1, 2020

It could be great creating a MarkeplaceResource that inherit from BaseResource and includes it in DirectoryResource. (see ProductResource).
Then we will have a resource for each object that matches the API and grouped by facades.

But ProductResource does not contain list or get methods for products itself (only for their parameters). The methods list_products and get_product are still in the Directory class.

@martinconstante
Copy link
Collaborator

It could be great creating a MarkeplaceResource that inherit from BaseResource and includes it in DirectoryResource. (see ProductResource).
Then we will have a resource for each object that matches the API and grouped by facades.

But ProductResource does not contain list or get methods for products itself (only for their parameters). The methods list_products and get_product are still in the Directory class.

ProductResouce inherits the methods search get create from BaseResource, and implements the specifics methods like the related to parameters. When you want to use the resources of ProductResource you only must include the facade class Directory. The objective is to create a resource class for every business object and group in facade classes like Directory, Fulfillment, Subscription.

@JaviCerveraIngram
Copy link
Collaborator Author

JaviCerveraIngram commented Jul 7, 2020

ProductResouce inherits the methods search get create from BaseResource, and implements the specifics methods like the related to parameters. When you want to use the resources of ProductResource you only must include the facade class Directory. The objective is to create a resource class for every business object and group in facade classes like Directory, Fulfillment, Subscription.

Ok, now I get it. I was getting confused because Directory.get_product and Directory.list_products do not use the Product resource to implement the functionality, but they do it directly with ApiClient. So, should I add a MarketplaceResource class and call the resource methods from Directory.list_marketplaces and Directory.get_marketplace?

Correct!

@JaviCerveraIngram
Copy link
Collaborator Author

Correct!

Thanks, I'll provide the changes ASAP.

@JaviCerveraIngram
Copy link
Collaborator Author

Requested changes have been added.

@marcserrat marcserrat merged commit 731bd81 into cloudblue:master Jul 14, 2020
@JaviCerveraIngram JaviCerveraIngram deleted the CPS-80-directory-marketplace branch July 14, 2020 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants