Skip to content
Merged
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: 23 additions & 0 deletions robosystems_client/models/org_invitation_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from attrs import field as _attrs_field

from ..models.org_role import OrgRole
from ..types import UNSET, Unset

T = TypeVar("T", bound="OrgInvitationResponse")

Expand All @@ -27,6 +28,9 @@ class OrgInvitationResponse:
created_at (datetime.datetime):
expires_at (datetime.datetime):
is_expired (bool):
token (None | str | Unset): Test-support only: the raw invite token. Populated ONLY when
AUTH_INVITE_TOKEN_IN_RESPONSE is enabled in a non-production environment; always null in production. Lets
automated authorization tests complete the invite -> register flow without email interception.
"""

id: str
Expand All @@ -39,6 +43,7 @@ class OrgInvitationResponse:
created_at: datetime.datetime
expires_at: datetime.datetime
is_expired: bool
token: None | str | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
Expand All @@ -63,6 +68,12 @@ def to_dict(self) -> dict[str, Any]:

is_expired = self.is_expired

token: None | str | Unset
if isinstance(self.token, Unset):
token = UNSET
else:
token = self.token

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -79,6 +90,8 @@ def to_dict(self) -> dict[str, Any]:
"is_expired": is_expired,
}
)
if token is not UNSET:
field_dict["token"] = token

return field_dict

Expand Down Expand Up @@ -110,6 +123,15 @@ def _parse_invited_by_name(data: object) -> None | str:

is_expired = d.pop("is_expired")

def _parse_token(data: object) -> None | str | Unset:
if data is None:
return data
if isinstance(data, Unset):
return data
return cast(None | str | Unset, data)

token = _parse_token(d.pop("token", UNSET))

org_invitation_response = cls(
id=id,
org_id=org_id,
Expand All @@ -121,6 +143,7 @@ def _parse_invited_by_name(data: object) -> None | str:
created_at=created_at,
expires_at=expires_at,
is_expired=is_expired,
token=token,
)

org_invitation_response.additional_properties = d
Expand Down