Skip to content
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
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/product_catalog/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.
from .types import PublicCatalogProductPriceUnitOfMeasureCountableUnit
from .types import PublicCatalogProductPropertiesHardwareCPUArch
from .types import PublicCatalogProductPropertiesHardwareCPUPhysical
from .types import PublicCatalogProductPropertiesHardwareCPUVirtual
from .types import PublicCatalogProductPropertiesHardwareCPU
from .types import PublicCatalogProductPropertiesHardwareGPU
from .types import PublicCatalogProductPropertiesHardwareNetwork
from .types import PublicCatalogProductPropertiesHardwareRAM
from .types import PublicCatalogProductPropertiesHardwareStorage
from .types import PublicCatalogProductPriceUnitOfMeasure
from .types import PublicCatalogProductPropertiesAppleSilicon
from .types import PublicCatalogProductPropertiesDedibox
from .types import PublicCatalogProductPropertiesElasticMetal
from .types import PublicCatalogProductPropertiesHardware
from .types import PublicCatalogProductPropertiesInstance
from .types import PublicCatalogProductEnvironmentalImpact
from .types import PublicCatalogProductLocality
from .types import PublicCatalogProductPrice
from .types import PublicCatalogProductProperties
from .types import PublicCatalogProduct
from .types import ListPublicCatalogProductsResponse
from .types import PublicCatalogApiListPublicCatalogProductsRequest
from .api import ProductCatalogV2Alpha1PublicCatalogAPI

__all__ = [
"PublicCatalogProductPriceUnitOfMeasureCountableUnit",
"PublicCatalogProductPropertiesHardwareCPUArch",
"PublicCatalogProductPropertiesHardwareCPUPhysical",
"PublicCatalogProductPropertiesHardwareCPUVirtual",
"PublicCatalogProductPropertiesHardwareCPU",
"PublicCatalogProductPropertiesHardwareGPU",
"PublicCatalogProductPropertiesHardwareNetwork",
"PublicCatalogProductPropertiesHardwareRAM",
"PublicCatalogProductPropertiesHardwareStorage",
"PublicCatalogProductPriceUnitOfMeasure",
"PublicCatalogProductPropertiesAppleSilicon",
"PublicCatalogProductPropertiesDedibox",
"PublicCatalogProductPropertiesElasticMetal",
"PublicCatalogProductPropertiesHardware",
"PublicCatalogProductPropertiesInstance",
"PublicCatalogProductEnvironmentalImpact",
"PublicCatalogProductLocality",
"PublicCatalogProductPrice",
"PublicCatalogProductProperties",
"PublicCatalogProduct",
"ListPublicCatalogProductsResponse",
"PublicCatalogApiListPublicCatalogProductsRequest",
"ProductCatalogV2Alpha1PublicCatalogAPI",
]
80 changes: 80 additions & 0 deletions scaleway-async/scaleway_async/product_catalog/v2alpha1/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.

from typing import List, Optional

from scaleway_core.api import API
from scaleway_core.utils import (
fetch_all_pages_async,
)
from .types import (
ListPublicCatalogProductsResponse,
PublicCatalogProduct,
)
from .marshalling import (
unmarshal_ListPublicCatalogProductsResponse,
)


class ProductCatalogV2Alpha1PublicCatalogAPI(API):
""" """

async def list_public_catalog_products(
self,
*,
page: Optional[int] = None,
page_size: Optional[int] = 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.
:return: :class:`ListPublicCatalogProductsResponse <ListPublicCatalogProductsResponse>`

Usage:
::

result = await api.list_public_catalog_products()
"""

res = self._request(
"GET",
"/product-catalog/v2alpha1/public-catalog/products",
params={
"page": page,
"page_size": page_size or self.client.default_page_size,
},
)

self._throw_on_error(res)
return unmarshal_ListPublicCatalogProductsResponse(res.json())

async def list_public_catalog_products_all(
self,
*,
page: Optional[int] = None,
page_size: Optional[int] = 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.
:return: :class:`List[PublicCatalogProduct] <List[PublicCatalogProduct]>`

Usage:
::

result = await api.list_public_catalog_products_all()
"""

return await fetch_all_pages_async(
type=ListPublicCatalogProductsResponse,
key="products",
fetcher=self.list_public_catalog_products,
args={
"page": page,
"page_size": page_size,
},
)
Loading