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
23 changes: 19 additions & 4 deletions scaleway-async/scaleway_async/marketplace/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from typing import List, Optional

from scaleway_core.api import API
from scaleway_core.bridge import (
Zone,
)
from scaleway_core.utils import (
OneOfPossibility,
fetch_all_pages_async,
Expand Down Expand Up @@ -238,14 +241,18 @@ async def list_local_images(
page_size: Optional[int] = None,
page: Optional[int] = None,
order_by: ListLocalImagesRequestOrderBy = ListLocalImagesRequestOrderBy.CREATED_AT_ASC,
image_label: Optional[str] = None,
zone: Optional[Zone] = None,
) -> ListLocalImagesResponse:
"""
List local images from a specific image or version
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param page_size:
:param page:
:param order_by:
:param image_label: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param zone:
:return: :class:`ListLocalImagesResponse <ListLocalImagesResponse>`

Usage:
Expand All @@ -261,10 +268,12 @@ async def list_local_images(
"order_by": order_by,
"page": page,
"page_size": page_size or self.client.default_page_size,
"zone": zone or self.client.default_zone,
**resolve_one_of(
[
OneOfPossibility("image_id", image_id),
OneOfPossibility("version_id", version_id),
OneOfPossibility("image_label", image_label),
]
),
},
Expand All @@ -281,14 +290,18 @@ async def list_local_images_all(
page_size: Optional[int] = None,
page: Optional[int] = None,
order_by: Optional[ListLocalImagesRequestOrderBy] = None,
image_label: Optional[str] = None,
zone: Optional[Zone] = None,
) -> List[LocalImage]:
"""
List local images from a specific image or version
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param page_size:
:param page:
:param order_by:
:param image_label: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param zone:
:return: :class:`List[ListLocalImagesResponse] <List[ListLocalImagesResponse]>`

Usage:
Expand All @@ -307,6 +320,8 @@ async def list_local_images_all(
"page_size": page_size,
"page": page,
"order_by": order_by,
"image_label": image_label,
"zone": zone,
},
)

Expand Down
3 changes: 3 additions & 0 deletions scaleway-async/scaleway_async/marketplace/v2/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def unmarshal_LocalImage(data: Any) -> LocalImage:
field = data.get("id")
args["id"] = field

field = data.get("label")
args["label"] = field

field = data.get("zone")
args["zone"] = field

Expand Down
16 changes: 14 additions & 2 deletions scaleway-async/scaleway_async/marketplace/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ class LocalImage:
Availability Zone where this local image is available
"""

label: str
"""
Image label this image belongs to
"""


@dataclass
class Version:
Expand Down Expand Up @@ -251,12 +256,12 @@ class GetVersionRequest:
class ListLocalImagesRequest:
image_id: Optional[str]
"""
One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
"""

version_id: Optional[str]
"""
One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
"""

page_size: Optional[int]
Expand All @@ -265,6 +270,13 @@ class ListLocalImagesRequest:

order_by: Optional[ListLocalImagesRequestOrderBy]

image_label: Optional[str]
"""
One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
"""

zone: Optional[Zone]


@dataclass
class GetLocalImageRequest:
Expand Down
23 changes: 19 additions & 4 deletions scaleway/scaleway/marketplace/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from typing import List, Optional

from scaleway_core.api import API
from scaleway_core.bridge import (
Zone,
)
from scaleway_core.utils import (
OneOfPossibility,
fetch_all_pages,
Expand Down Expand Up @@ -238,14 +241,18 @@ def list_local_images(
page_size: Optional[int] = None,
page: Optional[int] = None,
order_by: ListLocalImagesRequestOrderBy = ListLocalImagesRequestOrderBy.CREATED_AT_ASC,
image_label: Optional[str] = None,
zone: Optional[Zone] = None,
) -> ListLocalImagesResponse:
"""
List local images from a specific image or version
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param page_size:
:param page:
:param order_by:
:param image_label: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param zone:
:return: :class:`ListLocalImagesResponse <ListLocalImagesResponse>`

Usage:
Expand All @@ -261,10 +268,12 @@ def list_local_images(
"order_by": order_by,
"page": page,
"page_size": page_size or self.client.default_page_size,
"zone": zone or self.client.default_zone,
**resolve_one_of(
[
OneOfPossibility("image_id", image_id),
OneOfPossibility("version_id", version_id),
OneOfPossibility("image_label", image_label),
]
),
},
Expand All @@ -281,14 +290,18 @@ def list_local_images_all(
page_size: Optional[int] = None,
page: Optional[int] = None,
order_by: Optional[ListLocalImagesRequestOrderBy] = None,
image_label: Optional[str] = None,
zone: Optional[Zone] = None,
) -> List[LocalImage]:
"""
List local images from a specific image or version
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
:param image_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param version_id: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param page_size:
:param page:
:param order_by:
:param image_label: One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
:param zone:
:return: :class:`List[ListLocalImagesResponse] <List[ListLocalImagesResponse]>`

Usage:
Expand All @@ -307,6 +320,8 @@ def list_local_images_all(
"page_size": page_size,
"page": page,
"order_by": order_by,
"image_label": image_label,
"zone": zone,
},
)

Expand Down
3 changes: 3 additions & 0 deletions scaleway/scaleway/marketplace/v2/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def unmarshal_LocalImage(data: Any) -> LocalImage:
field = data.get("id")
args["id"] = field

field = data.get("label")
args["label"] = field

field = data.get("zone")
args["zone"] = field

Expand Down
16 changes: 14 additions & 2 deletions scaleway/scaleway/marketplace/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ class LocalImage:
Availability Zone where this local image is available
"""

label: str
"""
Image label this image belongs to
"""


@dataclass
class Version:
Expand Down Expand Up @@ -251,12 +256,12 @@ class GetVersionRequest:
class ListLocalImagesRequest:
image_id: Optional[str]
"""
One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
"""

version_id: Optional[str]
"""
One-of ('scope'): at most one of 'image_id', 'version_id' could be set.
One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
"""

page_size: Optional[int]
Expand All @@ -265,6 +270,13 @@ class ListLocalImagesRequest:

order_by: Optional[ListLocalImagesRequestOrderBy]

image_label: Optional[str]
"""
One-of ('scope'): at most one of 'image_id', 'version_id', 'image_label' could be set.
"""

zone: Optional[Zone]


@dataclass
class GetLocalImageRequest:
Expand Down