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

Commit 72fab41

Browse files
authored
feat: Merge pull request #50 from seamapi/fill-connectwebview-props
fix #26: Add all properties to `ConnectWebview`
2 parents aa58b4a + 38990e8 commit 72fab41

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

seamapi/connect_webviews.py

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@ def list(self) -> List[ConnectWebview]:
6767
raise Exception(res.text)
6868
json_webviews = res.json()["connect_webviews"]
6969
return [
70-
ConnectWebview(
71-
connect_webview_id=json_webview["connect_webview_id"],
72-
status=json_webview["status"],
73-
url=json_webview["url"],
74-
login_successful=json_webview["login_successful"],
75-
connected_account_id=json_webview["connected_account_id"],
76-
)
70+
ConnectWebview(**json_webview)
7771
for json_webview in json_webviews
7872
]
7973

@@ -106,13 +100,7 @@ def get(
106100
if not res.ok:
107101
raise Exception(res.text)
108102
json_webview = res.json()["connect_webview"]
109-
return ConnectWebview(
110-
connect_webview_id=json_webview["connect_webview_id"],
111-
status=json_webview["status"],
112-
url=json_webview["url"],
113-
login_successful=json_webview["login_successful"],
114-
connected_account_id=json_webview["connected_account_id"],
115-
)
103+
return ConnectWebview(**json_webview)
116104

117105
def create(
118106
self,
@@ -154,10 +142,4 @@ def create(
154142
if not res.ok:
155143
raise Exception(res.text)
156144
json_webview = res.json()["connect_webview"]
157-
return ConnectWebview(
158-
connect_webview_id=json_webview["connect_webview_id"],
159-
status=json_webview["status"],
160-
url=json_webview["url"],
161-
login_successful=json_webview["login_successful"],
162-
connected_account_id=None,
163-
)
145+
return ConnectWebview(**json_webview)

seamapi/types.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,20 @@ class Workspace:
9696
@dataclass_json
9797
@dataclass
9898
class ConnectWebview:
99+
workspace_id: str
99100
connect_webview_id: str
100101
status: str
101102
url: str
102103
login_successful: bool
103-
connected_account_id: Optional[str]
104+
device_selection_mode: str
105+
any_provider_allowed: bool
106+
any_device_allowed: bool
107+
created_at: str
108+
connected_account_id: Optional[str] = None
109+
authorized_at: Optional[str] = None
110+
custom_redirect_url: Optional[str] = None
111+
accepted_providers: Optional[List[AcceptedProvider]] = None
112+
accepted_devices: Optional[List[str]] = None
104113

105114

106115
@dataclass_json

0 commit comments

Comments
 (0)