Skip to content

feat: update generated APIs #1163

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -17,6 +17,7 @@
from .types import SecretManagerSecretInfo
from .types import SecretManagerSecretVersionInfo
from .types import EventPrincipal
from .types import EventSystem
from .types import Resource
from .types import ProductService
from .types import Event
Expand Down Expand Up @@ -45,6 +46,7 @@
"SecretManagerSecretInfo",
"SecretManagerSecretVersionInfo",
"EventPrincipal",
"EventSystem",
"Resource",
"ProductService",
"Event",
Expand Down
62 changes: 42 additions & 20 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
SecretManagerSecretInfo,
SecretManagerSecretVersionInfo,
EventPrincipal,
EventSystem,
Resource,
Event,
ListEventsResponse,
Expand Down Expand Up @@ -268,6 +269,21 @@ def unmarshal_EventPrincipal(data: Any) -> EventPrincipal:
return EventPrincipal(**args)


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

args: Dict[str, Any] = {}

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

return EventSystem(**args)


def unmarshal_Resource(data: Any) -> Resource:
if not isinstance(data, dict):
raise TypeError(
Expand Down Expand Up @@ -445,6 +461,14 @@ def unmarshal_Event(data: Any) -> Event:
if field is not None:
args["product_name"] = field

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

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

field = data.get("recorded_at", None)
if field is not None:
args["recorded_at"] = (
Expand All @@ -459,26 +483,6 @@ def unmarshal_Event(data: Any) -> Event:
else:
args["principal"] = None

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

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

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

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

field = data.get("resources", None)
if field is not None:
args["resources"] = (
Expand All @@ -493,6 +497,24 @@ def unmarshal_Event(data: Any) -> Event:
if field is not None:
args["status_code"] = field

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

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

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

field = data.get("request_body", None)
if field is not None:
args["request_body"] = field
Expand Down
22 changes: 13 additions & 9 deletions scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ class EventPrincipal:
id: str


@dataclass
class EventSystem:
name: str


@dataclass
class Resource:
id: str
Expand Down Expand Up @@ -224,14 +229,14 @@ class Event:
Product name of the resource attached to the event.
"""

recorded_at: Optional[datetime]
service_name: str
"""
Timestamp of the event.
API name called to trigger the event.
"""

principal: Optional[EventPrincipal]
recorded_at: Optional[datetime]
"""
User or IAM application at the origin of the event.
Timestamp of the event.
"""

project_id: Optional[str]
Expand All @@ -244,11 +249,6 @@ class Event:
User Agent at the origin of the event.
"""

service_name: str
"""
API name called to trigger the event.
"""

method_name: str
"""
API method called to trigger the event.
Expand All @@ -274,6 +274,10 @@ class Event:
Request at the origin of the event.
"""

principal: Optional[EventPrincipal]

system: Optional[EventSystem]


@dataclass
class Product:
Expand Down
1 change: 1 addition & 0 deletions scaleway-async/scaleway_async/inference/v1/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DeploymentStatus.CREATING,
DeploymentStatus.DEPLOYING,
DeploymentStatus.DELETING,
DeploymentStatus.SCALING,
]
"""
Lists transient statutes of the enum :class:`DeploymentStatus <DeploymentStatus>`.
Expand Down
1 change: 1 addition & 0 deletions scaleway-async/scaleway_async/inference/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DeploymentStatus(str, Enum, metaclass=StrEnumMeta):
ERROR = "error"
DELETING = "deleting"
LOCKED = "locked"
SCALING = "scaling"

def __str__(self) -> str:
return str(self.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
DeploymentStatus.CREATING,
DeploymentStatus.DEPLOYING,
DeploymentStatus.DELETING,
DeploymentStatus.SCALING,
]
"""
Lists transient statutes of the enum :class:`DeploymentStatus <DeploymentStatus>`.
Expand Down
1 change: 1 addition & 0 deletions scaleway-async/scaleway_async/inference/v1beta1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DeploymentStatus(str, Enum, metaclass=StrEnumMeta):
ERROR = "error"
DELETING = "deleting"
LOCKED = "locked"
SCALING = "scaling"

def __str__(self) -> str:
return str(self.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class PublicCatalogProductStatus(str, Enum, metaclass=StrEnumMeta):
GENERAL_AVAILABILITY = "general_availability"
END_OF_DEPLOYMENT = "end_of_deployment"
END_OF_SUPPORT = "end_of_support"
END_OF_SALE = "end_of_sale"

def __str__(self) -> str:
return str(self.value)
Expand Down
12 changes: 12 additions & 0 deletions scaleway-async/scaleway_async/qaas/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .types import ListBookingsRequestOrderBy
from .types import ListJobResultsRequestOrderBy
from .types import ListJobsRequestOrderBy
from .types import ListModelsRequestOrderBy
from .types import ListPlatformsRequestOrderBy
from .types import ListProcessResultsRequestOrderBy
from .types import ListProcessesRequestOrderBy
Expand All @@ -31,13 +32,15 @@
from .types import Booking
from .types import JobResult
from .types import Job
from .types import Model
from .types import Platform
from .types import ProcessResult
from .types import Process
from .types import Session
from .types import CancelJobRequest
from .types import CancelProcessRequest
from .types import CreateJobRequest
from .types import CreateModelRequest
from .types import CreateProcessRequest
from .types import CreateSessionRequest
from .types import DeleteJobRequest
Expand All @@ -47,6 +50,7 @@
from .types import GetBookingRequest
from .types import GetJobCircuitRequest
from .types import GetJobRequest
from .types import GetModelRequest
from .types import GetPlatformRequest
from .types import GetProcessRequest
from .types import GetSessionRequest
Expand All @@ -58,6 +62,8 @@
from .types import ListJobResultsResponse
from .types import ListJobsRequest
from .types import ListJobsResponse
from .types import ListModelsRequest
from .types import ListModelsResponse
from .types import ListPlatformsRequest
from .types import ListPlatformsResponse
from .types import ListProcessResultsRequest
Expand Down Expand Up @@ -85,6 +91,7 @@
"ListBookingsRequestOrderBy",
"ListJobResultsRequestOrderBy",
"ListJobsRequestOrderBy",
"ListModelsRequestOrderBy",
"ListPlatformsRequestOrderBy",
"ListProcessResultsRequestOrderBy",
"ListProcessesRequestOrderBy",
Expand All @@ -107,13 +114,15 @@
"Booking",
"JobResult",
"Job",
"Model",
"Platform",
"ProcessResult",
"Process",
"Session",
"CancelJobRequest",
"CancelProcessRequest",
"CreateJobRequest",
"CreateModelRequest",
"CreateProcessRequest",
"CreateSessionRequest",
"DeleteJobRequest",
Expand All @@ -123,6 +132,7 @@
"GetBookingRequest",
"GetJobCircuitRequest",
"GetJobRequest",
"GetModelRequest",
"GetPlatformRequest",
"GetProcessRequest",
"GetSessionRequest",
Expand All @@ -134,6 +144,8 @@
"ListJobResultsResponse",
"ListJobsRequest",
"ListJobsResponse",
"ListModelsRequest",
"ListModelsResponse",
"ListPlatformsRequest",
"ListPlatformsResponse",
"ListProcessResultsRequest",
Expand Down
Loading
Loading