Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 01be89c

Browse files
authored
feat: Add custom_metadata (#75)
1 parent c5c6cf5 commit 01be89c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

seamapi/connect_webviews.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def create(
109109
custom_redirect_url: Optional[str] = None,
110110
custom_redirect_failure_url: Optional[str] = None,
111111
device_selection_mode: Optional[str] = None,
112+
custom_metadata: Optional[dict] = None,
112113
) -> ConnectWebview:
113114
"""Creates a connect webview.
114115
@@ -122,6 +123,7 @@ def create(
122123
Custom redirect failure url
123124
device_selection_mode : str, optional
124125
Selection mode: 'none', 'single' or 'multiple'
126+
custom_metadata : dict, optional
125127
126128
Raises
127129
------
@@ -140,6 +142,8 @@ def create(
140142
create_payload["custom_redirect_failure_url"] = custom_redirect_failure_url
141143
if device_selection_mode is not None:
142144
create_payload["device_selection_mode"] = device_selection_mode
145+
if custom_metadata is not None:
146+
create_payload["custom_metadata"] = custom_metadata
143147

144148
res = self.seam.make_request(
145149
"POST",

seamapi/connected_accounts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def list(self) -> List[ConnectedAccount]:
7171
user_identifier=json_account["user_identifier"],
7272
account_type=json_account["account_type"],
7373
errors=json_account.get("errors", []),
74+
custom_metadata=json_account.get("custom_metadata", {})
7475
)
7576
for json_account in json_accounts
7677
]
@@ -130,6 +131,7 @@ def get(
130131
user_identifier=json_account["user_identifier"],
131132
account_type=json_account["account_type"],
132133
errors=json_account.get("errors", []),
134+
custom_metadata=json_account.get("custom_metadata", {}),
133135
)
134136

135137
@report_error

seamapi/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class ConnectWebview:
133133
any_provider_allowed: bool
134134
any_device_allowed: bool
135135
created_at: str
136+
custom_metadata: Dict[str, Union[str, int, bool, None]]
136137
connected_account_id: Optional[str] = None
137138
authorized_at: Optional[str] = None
138139
custom_redirect_url: Optional[str] = None
@@ -149,7 +150,7 @@ class ConnectedAccount:
149150
user_identifier: str
150151
account_type: str
151152
errors: List[str]
152-
153+
custom_metadata: Dict[str, Union[str, int, bool, None]]
153154

154155
@dataclass_json
155156
@dataclass

0 commit comments

Comments
 (0)