Skip to content

feat(product_catalog): filter by locality #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ListPublicCatalogProductsRequestProductType,
ListPublicCatalogProductsResponse,
PublicCatalogProduct,
PublicCatalogProductLocality,
)
from .marshalling import (
unmarshal_ListPublicCatalogProductsResponse,
Expand All @@ -28,13 +29,15 @@ async def list_public_catalog_products(
product_types: Optional[
List[ListPublicCatalogProductsRequestProductType]
] = None,
locality: Optional[PublicCatalogProductLocality] = None,
) -> ListPublicCatalogProductsResponse:
"""
List all available products.
List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
:param page: Number of the page. Value must be greater or equal to 1.
:param page_size: The number of products per page. Value must be greater or equal to 1.
:param product_types: The list of filtered product categories.
:param locality: The locality of the products to filter by. If not set, all localities are returned.
:return: :class:`ListPublicCatalogProductsResponse <ListPublicCatalogProductsResponse>`

Usage:
Expand All @@ -47,6 +50,7 @@ async def list_public_catalog_products(
"GET",
"/product-catalog/v2alpha1/public-catalog/products",
params={
"locality": locality,
"page": page,
"page_size": page_size or self.client.default_page_size,
"product_types": product_types,
Expand All @@ -64,13 +68,15 @@ async def list_public_catalog_products_all(
product_types: Optional[
List[ListPublicCatalogProductsRequestProductType]
] = None,
locality: Optional[PublicCatalogProductLocality] = None,
) -> List[PublicCatalogProduct]:
"""
List all available products.
List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
:param page: Number of the page. Value must be greater or equal to 1.
:param page_size: The number of products per page. Value must be greater or equal to 1.
:param product_types: The list of filtered product categories.
:param locality: The locality of the products to filter by. If not set, all localities are returned.
:return: :class:`List[PublicCatalogProduct] <List[PublicCatalogProduct]>`

Usage:
Expand All @@ -87,5 +93,6 @@ async def list_public_catalog_products_all(
"page": page,
"page_size": page_size,
"product_types": product_types,
"locality": locality,
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,8 @@ class PublicCatalogApiListPublicCatalogProductsRequest:
"""
The list of filtered product categories.
"""

locality: Optional[PublicCatalogProductLocality]
"""
The locality of the products to filter by. If not set, all localities are returned.
"""
7 changes: 7 additions & 0 deletions scaleway/scaleway/product_catalog/v2alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ListPublicCatalogProductsRequestProductType,
ListPublicCatalogProductsResponse,
PublicCatalogProduct,
PublicCatalogProductLocality,
)
from .marshalling import (
unmarshal_ListPublicCatalogProductsResponse,
Expand All @@ -28,13 +29,15 @@ def list_public_catalog_products(
product_types: Optional[
List[ListPublicCatalogProductsRequestProductType]
] = None,
locality: Optional[PublicCatalogProductLocality] = None,
) -> ListPublicCatalogProductsResponse:
"""
List all available products.
List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
:param page: Number of the page. Value must be greater or equal to 1.
:param page_size: The number of products per page. Value must be greater or equal to 1.
:param product_types: The list of filtered product categories.
:param locality: The locality of the products to filter by. If not set, all localities are returned.
:return: :class:`ListPublicCatalogProductsResponse <ListPublicCatalogProductsResponse>`

Usage:
Expand All @@ -47,6 +50,7 @@ def list_public_catalog_products(
"GET",
"/product-catalog/v2alpha1/public-catalog/products",
params={
"locality": locality,
"page": page,
"page_size": page_size or self.client.default_page_size,
"product_types": product_types,
Expand All @@ -64,13 +68,15 @@ def list_public_catalog_products_all(
product_types: Optional[
List[ListPublicCatalogProductsRequestProductType]
] = None,
locality: Optional[PublicCatalogProductLocality] = None,
) -> List[PublicCatalogProduct]:
"""
List all available products.
List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request.
:param page: Number of the page. Value must be greater or equal to 1.
:param page_size: The number of products per page. Value must be greater or equal to 1.
:param product_types: The list of filtered product categories.
:param locality: The locality of the products to filter by. If not set, all localities are returned.
:return: :class:`List[PublicCatalogProduct] <List[PublicCatalogProduct]>`

Usage:
Expand All @@ -87,5 +93,6 @@ def list_public_catalog_products_all(
"page": page,
"page_size": page_size,
"product_types": product_types,
"locality": locality,
},
)
5 changes: 5 additions & 0 deletions scaleway/scaleway/product_catalog/v2alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,8 @@ class PublicCatalogApiListPublicCatalogProductsRequest:
"""
The list of filtered product categories.
"""

locality: Optional[PublicCatalogProductLocality]
"""
The locality of the products to filter by. If not set, all localities are returned.
"""