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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .types import SecretManagerSecretVersionInfo
from .types import EventPrincipal
from .types import Resource
from .types import ProductService
from .types import Event
from .types import Product
from .types import ListEventsRequest
Expand All @@ -29,6 +30,7 @@
"SecretManagerSecretVersionInfo",
"EventPrincipal",
"Resource",
"ProductService",
"Event",
"Product",
"ListEventsRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Resource,
Event,
ListEventsResponse,
ProductService,
Product,
ListProductsResponse,
)
Expand Down Expand Up @@ -316,6 +317,25 @@ def unmarshal_ListEventsResponse(data: Any) -> ListEventsResponse:
return ListEventsResponse(**args)


def unmarshal_ProductService(data: Any) -> ProductService:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'ProductService' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("name", None)
if field is not None:
args["name"] = field

field = data.get("methods", None)
if field is not None:
args["methods"] = field

return ProductService(**args)


def unmarshal_Product(data: Any) -> Product:
if not isinstance(data, dict):
raise TypeError(
Expand All @@ -332,6 +352,12 @@ def unmarshal_Product(data: Any) -> Product:
if field is not None:
args["name"] = field

field = data.get("services", None)
if field is not None:
args["services"] = (
[unmarshal_ProductService(v) for v in field] if field is not None else None
)

return Product(**args)


Expand Down
12 changes: 12 additions & 0 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ class Resource:
kube_acl_info: Optional[KubernetesACLInfo]


@dataclass
class ProductService:
name: str

methods: List[str]


@dataclass
class Event:
id: str
Expand Down Expand Up @@ -192,6 +199,11 @@ class Product:
Product name.
"""

services: List[ProductService]
"""
Specifies the API versions of the products integrated with Audit Trail. Each version defines the methods logged by Audit Trail.
"""


@dataclass
class ListEventsRequest:
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .types import SecretManagerSecretVersionInfo
from .types import EventPrincipal
from .types import Resource
from .types import ProductService
from .types import Event
from .types import Product
from .types import ListEventsRequest
Expand All @@ -29,6 +30,7 @@
"SecretManagerSecretVersionInfo",
"EventPrincipal",
"Resource",
"ProductService",
"Event",
"Product",
"ListEventsRequest",
Expand Down
26 changes: 26 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Resource,
Event,
ListEventsResponse,
ProductService,
Product,
ListProductsResponse,
)
Expand Down Expand Up @@ -316,6 +317,25 @@ def unmarshal_ListEventsResponse(data: Any) -> ListEventsResponse:
return ListEventsResponse(**args)


def unmarshal_ProductService(data: Any) -> ProductService:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'ProductService' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("name", None)
if field is not None:
args["name"] = field

field = data.get("methods", None)
if field is not None:
args["methods"] = field

return ProductService(**args)


def unmarshal_Product(data: Any) -> Product:
if not isinstance(data, dict):
raise TypeError(
Expand All @@ -332,6 +352,12 @@ def unmarshal_Product(data: Any) -> Product:
if field is not None:
args["name"] = field

field = data.get("services", None)
if field is not None:
args["services"] = (
[unmarshal_ProductService(v) for v in field] if field is not None else None
)

return Product(**args)


Expand Down
12 changes: 12 additions & 0 deletions scaleway/scaleway/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ class Resource:
kube_acl_info: Optional[KubernetesACLInfo]


@dataclass
class ProductService:
name: str

methods: List[str]


@dataclass
class Event:
id: str
Expand Down Expand Up @@ -192,6 +199,11 @@ class Product:
Product name.
"""

services: List[ProductService]
"""
Specifies the API versions of the products integrated with Audit Trail. Each version defines the methods logged by Audit Trail.
"""


@dataclass
class ListEventsRequest:
Expand Down
Loading