Skip to content

Commit 8ad508e

Browse files
committed
chore(sdk): add OrgInvitationResponse.token field (robosystems #1166)
1 parent 071fdb9 commit 8ad508e

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎robosystems_client/models/org_invitation_response.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from attrs import field as _attrs_field
99

1010
from ..models.org_role import OrgRole
11+
from ..types import UNSET, Unset
1112

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

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

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

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

6469
is_expired = self.is_expired
6570

71+
token: None | str | Unset
72+
if isinstance(self.token, Unset):
73+
token = UNSET
74+
else:
75+
token = self.token
76+
6677
field_dict: dict[str, Any] = {}
6778
field_dict.update(self.additional_properties)
6879
field_dict.update(
@@ -79,6 +90,8 @@ def to_dict(self) -> dict[str, Any]:
7990
"is_expired": is_expired,
8091
}
8192
)
93+
if token is not UNSET:
94+
field_dict["token"] = token
8295

8396
return field_dict
8497

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

111124
is_expired = d.pop("is_expired")
112125

126+
def _parse_token(data: object) -> None | str | Unset:
127+
if data is None:
128+
return data
129+
if isinstance(data, Unset):
130+
return data
131+
return cast(None | str | Unset, data)
132+
133+
token = _parse_token(d.pop("token", UNSET))
134+
113135
org_invitation_response = cls(
114136
id=id,
115137
org_id=org_id,
@@ -121,6 +143,7 @@ def _parse_invited_by_name(data: object) -> None | str:
121143
created_at=created_at,
122144
expires_at=expires_at,
123145
is_expired=is_expired,
146+
token=token,
124147
)
125148

126149
org_invitation_response.additional_properties = d

0 commit comments

Comments
 (0)