Skip to content

Commit

Permalink
feat(instance): set some fields of VolumeServer as optional (scaleway…
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Nov 27, 2024
1 parent cbcca62 commit e140c18
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 50 deletions.
42 changes: 26 additions & 16 deletions scaleway-async/scaleway_async/instance/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,38 +653,36 @@ def unmarshal_VolumeServer(data: Any) -> VolumeServer:
field = data.get("name", None)
if field is not None:
args["name"] = field

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

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

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

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

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

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

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

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

field = data.get("boot", None)
if field is not None:
Expand All @@ -710,6 +708,18 @@ def unmarshal_VolumeServer(data: Any) -> VolumeServer:
else:
args["modification_date"] = None

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

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

return VolumeServer(**args)


Expand Down
18 changes: 9 additions & 9 deletions scaleway-async/scaleway_async/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,21 +660,17 @@ class ServerMaintenance:
class VolumeServer:
id: str

name: str

organization: str

size: int
name: Optional[str]

export_uri: Optional[str]

server: Optional[ServerSummary]
organization: Optional[str]

volume_type: VolumeServerVolumeType
server: Optional[ServerSummary]

state: VolumeServerState
size: Optional[int]

project: str
volume_type: VolumeServerVolumeType

boot: bool

Expand All @@ -687,6 +683,10 @@ class VolumeServer:

modification_date: Optional[datetime]

state: Optional[VolumeServerState]

project: Optional[str]


@dataclass
class SnapshotBaseVolume:
Expand Down
42 changes: 26 additions & 16 deletions scaleway/scaleway/instance/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,38 +653,36 @@ def unmarshal_VolumeServer(data: Any) -> VolumeServer:
field = data.get("name", None)
if field is not None:
args["name"] = field

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

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

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

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

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

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

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

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

field = data.get("boot", None)
if field is not None:
Expand All @@ -710,6 +708,18 @@ def unmarshal_VolumeServer(data: Any) -> VolumeServer:
else:
args["modification_date"] = None

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

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

return VolumeServer(**args)


Expand Down
18 changes: 9 additions & 9 deletions scaleway/scaleway/instance/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,21 +660,17 @@ class ServerMaintenance:
class VolumeServer:
id: str

name: str

organization: str

size: int
name: Optional[str]

export_uri: Optional[str]

server: Optional[ServerSummary]
organization: Optional[str]

volume_type: VolumeServerVolumeType
server: Optional[ServerSummary]

state: VolumeServerState
size: Optional[int]

project: str
volume_type: VolumeServerVolumeType

boot: bool

Expand All @@ -687,6 +683,10 @@ class VolumeServer:

modification_date: Optional[datetime]

state: Optional[VolumeServerState]

project: Optional[str]


@dataclass
class SnapshotBaseVolume:
Expand Down

0 comments on commit e140c18

Please sign in to comment.