Skip to content

fix(iam): move Connection out of GetUserConnectionResponse #902

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

Merged
merged 1 commit into from
Mar 12, 2025
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
12 changes: 6 additions & 6 deletions scaleway-async/scaleway_async/iam/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
from .types import PermissionSetScopeType
from .types import UserStatus
from .types import UserType
from .types import GetUserConnectionsResponseConnectionConnectedOrganization
from .types import GetUserConnectionsResponseConnectionConnectedUser
from .types import ConnectionConnectedOrganization
from .types import ConnectionConnectedUser
from .types import QuotumLimit
from .types import JWT
from .types import RuleSpecs
from .types import CreateUserRequestMember
from .types import GetUserConnectionsResponseConnection
from .types import Connection
from .types import APIKey
from .types import Application
from .types import GracePeriod
Expand Down Expand Up @@ -132,13 +132,13 @@
"PermissionSetScopeType",
"UserStatus",
"UserType",
"GetUserConnectionsResponseConnectionConnectedOrganization",
"GetUserConnectionsResponseConnectionConnectedUser",
"ConnectionConnectedOrganization",
"ConnectionConnectedUser",
"QuotumLimit",
"JWT",
"RuleSpecs",
"CreateUserRequestMember",
"GetUserConnectionsResponseConnection",
"Connection",
"APIKey",
"Application",
"GracePeriod",
Expand Down
42 changes: 16 additions & 26 deletions scaleway-async/scaleway_async/iam/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
SSHKey,
User,
EncodedJWT,
GetUserConnectionsResponseConnectionConnectedOrganization,
GetUserConnectionsResponseConnectionConnectedUser,
GetUserConnectionsResponseConnection,
ConnectionConnectedOrganization,
ConnectionConnectedUser,
Connection,
GetUserConnectionsResponse,
ListAPIKeysResponse,
ListApplicationsResponse,
Expand Down Expand Up @@ -704,12 +704,12 @@ def unmarshal_EncodedJWT(data: Any) -> EncodedJWT:
return EncodedJWT(**args)


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

args: Dict[str, Any] = {}
Expand All @@ -726,15 +726,13 @@ def unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization(
if field is not None:
args["locked"] = field

return GetUserConnectionsResponseConnectionConnectedOrganization(**args)
return ConnectionConnectedOrganization(**args)


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

args: Dict[str, Any] = {}
Expand All @@ -751,36 +749,30 @@ def unmarshal_GetUserConnectionsResponseConnectionConnectedUser(
if field is not None:
args["type_"] = field

return GetUserConnectionsResponseConnectionConnectedUser(**args)
return ConnectionConnectedUser(**args)


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

args: Dict[str, Any] = {}

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

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

return GetUserConnectionsResponseConnection(**args)
return Connection(**args)


def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsResponse:
Expand All @@ -794,9 +786,7 @@ def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsRespons
field = data.get("connections", None)
if field is not None:
args["connections"] = (
[unmarshal_GetUserConnectionsResponseConnection(v) for v in field]
if field is not None
else None
[unmarshal_Connection(v) for v in field] if field is not None else None
)

return GetUserConnectionsResponse(**args)
Expand Down
12 changes: 6 additions & 6 deletions scaleway-async/scaleway_async/iam/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __str__(self) -> str:


@dataclass
class GetUserConnectionsResponseConnectionConnectedOrganization:
class ConnectionConnectedOrganization:
id: str

name: str
Expand All @@ -216,7 +216,7 @@ class GetUserConnectionsResponseConnectionConnectedOrganization:


@dataclass
class GetUserConnectionsResponseConnectionConnectedUser:
class ConnectionConnectedUser:
id: str

username: str
Expand Down Expand Up @@ -326,13 +326,13 @@ class CreateUserRequestMember:


@dataclass
class GetUserConnectionsResponseConnection:
organization: Optional[GetUserConnectionsResponseConnectionConnectedOrganization]
class Connection:
organization: Optional[ConnectionConnectedOrganization]
"""
Information about the connected organization.
"""

user: Optional[GetUserConnectionsResponseConnectionConnectedUser]
user: Optional[ConnectionConnectedUser]
"""
Information about the connected user.
"""
Expand Down Expand Up @@ -1244,7 +1244,7 @@ class GetUserConnectionsRequest:

@dataclass
class GetUserConnectionsResponse:
connections: List[GetUserConnectionsResponseConnection]
connections: List[Connection]
"""
List of connections.
"""
Expand Down
12 changes: 6 additions & 6 deletions scaleway/scaleway/iam/v1alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
from .types import PermissionSetScopeType
from .types import UserStatus
from .types import UserType
from .types import GetUserConnectionsResponseConnectionConnectedOrganization
from .types import GetUserConnectionsResponseConnectionConnectedUser
from .types import ConnectionConnectedOrganization
from .types import ConnectionConnectedUser
from .types import QuotumLimit
from .types import JWT
from .types import RuleSpecs
from .types import CreateUserRequestMember
from .types import GetUserConnectionsResponseConnection
from .types import Connection
from .types import APIKey
from .types import Application
from .types import GracePeriod
Expand Down Expand Up @@ -132,13 +132,13 @@
"PermissionSetScopeType",
"UserStatus",
"UserType",
"GetUserConnectionsResponseConnectionConnectedOrganization",
"GetUserConnectionsResponseConnectionConnectedUser",
"ConnectionConnectedOrganization",
"ConnectionConnectedUser",
"QuotumLimit",
"JWT",
"RuleSpecs",
"CreateUserRequestMember",
"GetUserConnectionsResponseConnection",
"Connection",
"APIKey",
"Application",
"GracePeriod",
Expand Down
42 changes: 16 additions & 26 deletions scaleway/scaleway/iam/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
SSHKey,
User,
EncodedJWT,
GetUserConnectionsResponseConnectionConnectedOrganization,
GetUserConnectionsResponseConnectionConnectedUser,
GetUserConnectionsResponseConnection,
ConnectionConnectedOrganization,
ConnectionConnectedUser,
Connection,
GetUserConnectionsResponse,
ListAPIKeysResponse,
ListApplicationsResponse,
Expand Down Expand Up @@ -704,12 +704,12 @@ def unmarshal_EncodedJWT(data: Any) -> EncodedJWT:
return EncodedJWT(**args)


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

args: Dict[str, Any] = {}
Expand All @@ -726,15 +726,13 @@ def unmarshal_GetUserConnectionsResponseConnectionConnectedOrganization(
if field is not None:
args["locked"] = field

return GetUserConnectionsResponseConnectionConnectedOrganization(**args)
return ConnectionConnectedOrganization(**args)


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

args: Dict[str, Any] = {}
Expand All @@ -751,36 +749,30 @@ def unmarshal_GetUserConnectionsResponseConnectionConnectedUser(
if field is not None:
args["type_"] = field

return GetUserConnectionsResponseConnectionConnectedUser(**args)
return ConnectionConnectedUser(**args)


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

args: Dict[str, Any] = {}

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

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

return GetUserConnectionsResponseConnection(**args)
return Connection(**args)


def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsResponse:
Expand All @@ -794,9 +786,7 @@ def unmarshal_GetUserConnectionsResponse(data: Any) -> GetUserConnectionsRespons
field = data.get("connections", None)
if field is not None:
args["connections"] = (
[unmarshal_GetUserConnectionsResponseConnection(v) for v in field]
if field is not None
else None
[unmarshal_Connection(v) for v in field] if field is not None else None
)

return GetUserConnectionsResponse(**args)
Expand Down
12 changes: 6 additions & 6 deletions scaleway/scaleway/iam/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __str__(self) -> str:


@dataclass
class GetUserConnectionsResponseConnectionConnectedOrganization:
class ConnectionConnectedOrganization:
id: str

name: str
Expand All @@ -216,7 +216,7 @@ class GetUserConnectionsResponseConnectionConnectedOrganization:


@dataclass
class GetUserConnectionsResponseConnectionConnectedUser:
class ConnectionConnectedUser:
id: str

username: str
Expand Down Expand Up @@ -326,13 +326,13 @@ class CreateUserRequestMember:


@dataclass
class GetUserConnectionsResponseConnection:
organization: Optional[GetUserConnectionsResponseConnectionConnectedOrganization]
class Connection:
organization: Optional[ConnectionConnectedOrganization]
"""
Information about the connected organization.
"""

user: Optional[GetUserConnectionsResponseConnectionConnectedUser]
user: Optional[ConnectionConnectedUser]
"""
Information about the connected user.
"""
Expand Down Expand Up @@ -1244,7 +1244,7 @@ class GetUserConnectionsRequest:

@dataclass
class GetUserConnectionsResponse:
connections: List[GetUserConnectionsResponseConnection]
connections: List[Connection]
"""
List of connections.
"""
Expand Down