Skip to content

Commit 6ff17de

Browse files
authored
feat(product_catalog): filter by locality (#1036)
1 parent d5afbe6 commit 6ff17de

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

scaleway-async/scaleway_async/product_catalog/v2alpha1/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ListPublicCatalogProductsRequestProductType,
1212
ListPublicCatalogProductsResponse,
1313
PublicCatalogProduct,
14+
PublicCatalogProductLocality,
1415
)
1516
from .marshalling import (
1617
unmarshal_ListPublicCatalogProductsResponse,
@@ -28,13 +29,15 @@ async def list_public_catalog_products(
2829
product_types: Optional[
2930
List[ListPublicCatalogProductsRequestProductType]
3031
] = None,
32+
locality: Optional[PublicCatalogProductLocality] = None,
3133
) -> ListPublicCatalogProductsResponse:
3234
"""
3335
List all available products.
3436
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.
3537
:param page: Number of the page. Value must be greater or equal to 1.
3638
:param page_size: The number of products per page. Value must be greater or equal to 1.
3739
:param product_types: The list of filtered product categories.
40+
:param locality: The locality of the products to filter by. If not set, all localities are returned.
3841
:return: :class:`ListPublicCatalogProductsResponse <ListPublicCatalogProductsResponse>`
3942
4043
Usage:
@@ -47,6 +50,7 @@ async def list_public_catalog_products(
4750
"GET",
4851
"/product-catalog/v2alpha1/public-catalog/products",
4952
params={
53+
"locality": locality,
5054
"page": page,
5155
"page_size": page_size or self.client.default_page_size,
5256
"product_types": product_types,
@@ -64,13 +68,15 @@ async def list_public_catalog_products_all(
6468
product_types: Optional[
6569
List[ListPublicCatalogProductsRequestProductType]
6670
] = None,
71+
locality: Optional[PublicCatalogProductLocality] = None,
6772
) -> List[PublicCatalogProduct]:
6873
"""
6974
List all available products.
7075
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.
7176
:param page: Number of the page. Value must be greater or equal to 1.
7277
:param page_size: The number of products per page. Value must be greater or equal to 1.
7378
:param product_types: The list of filtered product categories.
79+
:param locality: The locality of the products to filter by. If not set, all localities are returned.
7480
:return: :class:`List[PublicCatalogProduct] <List[PublicCatalogProduct]>`
7581
7682
Usage:
@@ -87,5 +93,6 @@ async def list_public_catalog_products_all(
8793
"page": page,
8894
"page_size": page_size,
8995
"product_types": product_types,
96+
"locality": locality,
9097
},
9198
)

scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,3 +432,8 @@ class PublicCatalogApiListPublicCatalogProductsRequest:
432432
"""
433433
The list of filtered product categories.
434434
"""
435+
436+
locality: Optional[PublicCatalogProductLocality]
437+
"""
438+
The locality of the products to filter by. If not set, all localities are returned.
439+
"""

scaleway/scaleway/product_catalog/v2alpha1/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ListPublicCatalogProductsRequestProductType,
1212
ListPublicCatalogProductsResponse,
1313
PublicCatalogProduct,
14+
PublicCatalogProductLocality,
1415
)
1516
from .marshalling import (
1617
unmarshal_ListPublicCatalogProductsResponse,
@@ -28,13 +29,15 @@ def list_public_catalog_products(
2829
product_types: Optional[
2930
List[ListPublicCatalogProductsRequestProductType]
3031
] = None,
32+
locality: Optional[PublicCatalogProductLocality] = None,
3133
) -> ListPublicCatalogProductsResponse:
3234
"""
3335
List all available products.
3436
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.
3537
:param page: Number of the page. Value must be greater or equal to 1.
3638
:param page_size: The number of products per page. Value must be greater or equal to 1.
3739
:param product_types: The list of filtered product categories.
40+
:param locality: The locality of the products to filter by. If not set, all localities are returned.
3841
:return: :class:`ListPublicCatalogProductsResponse <ListPublicCatalogProductsResponse>`
3942
4043
Usage:
@@ -47,6 +50,7 @@ def list_public_catalog_products(
4750
"GET",
4851
"/product-catalog/v2alpha1/public-catalog/products",
4952
params={
53+
"locality": locality,
5054
"page": page,
5155
"page_size": page_size or self.client.default_page_size,
5256
"product_types": product_types,
@@ -64,13 +68,15 @@ def list_public_catalog_products_all(
6468
product_types: Optional[
6569
List[ListPublicCatalogProductsRequestProductType]
6670
] = None,
71+
locality: Optional[PublicCatalogProductLocality] = None,
6772
) -> List[PublicCatalogProduct]:
6873
"""
6974
List all available products.
7075
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.
7176
:param page: Number of the page. Value must be greater or equal to 1.
7277
:param page_size: The number of products per page. Value must be greater or equal to 1.
7378
:param product_types: The list of filtered product categories.
79+
:param locality: The locality of the products to filter by. If not set, all localities are returned.
7480
:return: :class:`List[PublicCatalogProduct] <List[PublicCatalogProduct]>`
7581
7682
Usage:
@@ -87,5 +93,6 @@ def list_public_catalog_products_all(
8793
"page": page,
8894
"page_size": page_size,
8995
"product_types": product_types,
96+
"locality": locality,
9097
},
9198
)

scaleway/scaleway/product_catalog/v2alpha1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,3 +432,8 @@ class PublicCatalogApiListPublicCatalogProductsRequest:
432432
"""
433433
The list of filtered product categories.
434434
"""
435+
436+
locality: Optional[PublicCatalogProductLocality]
437+
"""
438+
The locality of the products to filter by. If not set, all localities are returned.
439+
"""

0 commit comments

Comments
 (0)