-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconnect_webviews.py
More file actions
101 lines (83 loc) · 3.97 KB
/
connect_webviews.py
File metadata and controls
101 lines (83 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
from typing import Optional, Any, List, Dict, Union
from ..client import SeamHttpClient
from .models import AbstractConnectWebviews, ConnectWebview
class ConnectWebviews(AbstractConnectWebviews):
def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]):
self.client = client
self.defaults = defaults
def create(
self,
*,
accepted_capabilities: Optional[List[str]] = None,
accepted_providers: Optional[List[str]] = None,
automatically_manage_new_devices: Optional[bool] = None,
custom_metadata: Optional[Dict[str, Any]] = None,
custom_redirect_failure_url: Optional[str] = None,
custom_redirect_url: Optional[str] = None,
customer_key: Optional[str] = None,
excluded_providers: Optional[List[str]] = None,
provider_category: Optional[str] = None,
wait_for_device_creation: Optional[bool] = None
) -> ConnectWebview:
json_payload = {}
if accepted_capabilities is not None:
json_payload["accepted_capabilities"] = accepted_capabilities
if accepted_providers is not None:
json_payload["accepted_providers"] = accepted_providers
if automatically_manage_new_devices is not None:
json_payload["automatically_manage_new_devices"] = (
automatically_manage_new_devices
)
if custom_metadata is not None:
json_payload["custom_metadata"] = custom_metadata
if custom_redirect_failure_url is not None:
json_payload["custom_redirect_failure_url"] = custom_redirect_failure_url
if custom_redirect_url is not None:
json_payload["custom_redirect_url"] = custom_redirect_url
if customer_key is not None:
json_payload["customer_key"] = customer_key
if excluded_providers is not None:
json_payload["excluded_providers"] = excluded_providers
if provider_category is not None:
json_payload["provider_category"] = provider_category
if wait_for_device_creation is not None:
json_payload["wait_for_device_creation"] = wait_for_device_creation
res = self.client.post("/connect_webviews/create", json=json_payload)
return ConnectWebview.from_dict(res["connect_webview"])
def delete(self, *, connect_webview_id: str) -> None:
json_payload = {}
if connect_webview_id is not None:
json_payload["connect_webview_id"] = connect_webview_id
self.client.post("/connect_webviews/delete", json=json_payload)
return None
def get(self, *, connect_webview_id: str) -> ConnectWebview:
json_payload = {}
if connect_webview_id is not None:
json_payload["connect_webview_id"] = connect_webview_id
res = self.client.post("/connect_webviews/get", json=json_payload)
return ConnectWebview.from_dict(res["connect_webview"])
def list(
self,
*,
custom_metadata_has: Optional[Dict[str, Any]] = None,
customer_key: Optional[str] = None,
limit: Optional[float] = None,
page_cursor: Optional[str] = None,
search: Optional[str] = None,
user_identifier_key: Optional[str] = None
) -> List[ConnectWebview]:
json_payload = {}
if custom_metadata_has is not None:
json_payload["custom_metadata_has"] = custom_metadata_has
if customer_key is not None:
json_payload["customer_key"] = customer_key
if limit is not None:
json_payload["limit"] = limit
if page_cursor is not None:
json_payload["page_cursor"] = page_cursor
if search is not None:
json_payload["search"] = search
if user_identifier_key is not None:
json_payload["user_identifier_key"] = user_identifier_key
res = self.client.post("/connect_webviews/list", json=json_payload)
return [ConnectWebview.from_dict(item) for item in res["connect_webviews"]]