anchorbrowser 0.5.4__py3-none-any.whl → 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anchorbrowser/_base_client.py +1 -1
- anchorbrowser/_client.py +9 -2
- anchorbrowser/_version.py +1 -1
- anchorbrowser/resources/__init__.py +14 -0
- anchorbrowser/resources/applications/__init__.py +33 -0
- anchorbrowser/resources/applications/applications.py +715 -0
- anchorbrowser/resources/applications/auth_flows.py +547 -0
- anchorbrowser/resources/identities.py +453 -1
- anchorbrowser/resources/sessions/sessions.py +14 -0
- anchorbrowser/types/__init__.py +20 -0
- anchorbrowser/types/application_create_identity_token_params.py +17 -0
- anchorbrowser/types/application_create_identity_token_response.py +23 -0
- anchorbrowser/types/application_create_params.py +18 -0
- anchorbrowser/types/application_create_response.py +25 -0
- anchorbrowser/types/application_delete_response.py +12 -0
- anchorbrowser/types/application_list_identities_params.py +12 -0
- anchorbrowser/types/application_list_identities_response.py +33 -0
- anchorbrowser/types/application_list_params.py +12 -0
- anchorbrowser/types/application_list_response.py +41 -0
- anchorbrowser/types/application_retrieve_response.py +37 -0
- anchorbrowser/types/applications/__init__.py +10 -0
- anchorbrowser/types/applications/auth_flow_create_params.py +30 -0
- anchorbrowser/types/applications/auth_flow_create_response.py +39 -0
- anchorbrowser/types/applications/auth_flow_delete_response.py +12 -0
- anchorbrowser/types/applications/auth_flow_list_response.py +43 -0
- anchorbrowser/types/applications/auth_flow_update_params.py +32 -0
- anchorbrowser/types/applications/auth_flow_update_response.py +39 -0
- anchorbrowser/types/identity_create_params.py +84 -0
- anchorbrowser/types/identity_create_response.py +26 -0
- anchorbrowser/types/identity_delete_response.py +12 -0
- anchorbrowser/types/identity_retrieve_response.py +32 -0
- anchorbrowser/types/identity_update_params.py +70 -0
- anchorbrowser/types/identity_update_response.py +22 -0
- anchorbrowser/types/session_create_params.py +15 -0
- {anchorbrowser-0.5.4.dist-info → anchorbrowser-0.6.1.dist-info}/METADATA +1 -1
- {anchorbrowser-0.5.4.dist-info → anchorbrowser-0.6.1.dist-info}/RECORD +38 -12
- {anchorbrowser-0.5.4.dist-info → anchorbrowser-0.6.1.dist-info}/licenses/LICENSE +1 -1
- {anchorbrowser-0.5.4.dist-info → anchorbrowser-0.6.1.dist-info}/WHEEL +0 -0
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from typing import Dict, Iterable
|
|
6
|
+
|
|
5
7
|
import httpx
|
|
6
8
|
|
|
7
|
-
from ..
|
|
9
|
+
from ..types import identity_create_params, identity_update_params
|
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
8
12
|
from .._compat import cached_property
|
|
9
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
10
14
|
from .._response import (
|
|
@@ -14,6 +18,10 @@ from .._response import (
|
|
|
14
18
|
async_to_streamed_response_wrapper,
|
|
15
19
|
)
|
|
16
20
|
from .._base_client import make_request_options
|
|
21
|
+
from ..types.identity_create_response import IdentityCreateResponse
|
|
22
|
+
from ..types.identity_delete_response import IdentityDeleteResponse
|
|
23
|
+
from ..types.identity_update_response import IdentityUpdateResponse
|
|
24
|
+
from ..types.identity_retrieve_response import IdentityRetrieveResponse
|
|
17
25
|
from ..types.identity_retrieve_credentials_response import IdentityRetrieveCredentialsResponse
|
|
18
26
|
|
|
19
27
|
__all__ = ["IdentitiesResource", "AsyncIdentitiesResource"]
|
|
@@ -39,6 +47,203 @@ class IdentitiesResource(SyncAPIResource):
|
|
|
39
47
|
"""
|
|
40
48
|
return IdentitiesResourceWithStreamingResponse(self)
|
|
41
49
|
|
|
50
|
+
def create(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
credentials: Iterable[identity_create_params.Credential],
|
|
54
|
+
source: str,
|
|
55
|
+
validate_async: bool | Omit = omit,
|
|
56
|
+
application_description: str | Omit = omit,
|
|
57
|
+
application_name: str | Omit = omit,
|
|
58
|
+
metadata: Dict[str, object] | Omit = omit,
|
|
59
|
+
name: str | Omit = omit,
|
|
60
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
61
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
62
|
+
extra_headers: Headers | None = None,
|
|
63
|
+
extra_query: Query | None = None,
|
|
64
|
+
extra_body: Body | None = None,
|
|
65
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
66
|
+
) -> IdentityCreateResponse:
|
|
67
|
+
"""Creates a new identity with credentials for authentication.
|
|
68
|
+
|
|
69
|
+
**Beta** Capability.
|
|
70
|
+
|
|
71
|
+
[Contact support](mailto:support@anchorbrowser.io) to
|
|
72
|
+
enable.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
credentials: Array of credentials for authentication
|
|
76
|
+
|
|
77
|
+
source: The source URL for the identity (e.g., login page URL)
|
|
78
|
+
|
|
79
|
+
validate_async: Whether to validate the identity asynchronously. Defaults to true.
|
|
80
|
+
|
|
81
|
+
application_description: Optional application description
|
|
82
|
+
|
|
83
|
+
application_name: Optional application name to associate with the identity
|
|
84
|
+
|
|
85
|
+
metadata: Optional metadata for the identity
|
|
86
|
+
|
|
87
|
+
name: Name of the identity. Defaults to "Unnamed Identity" if not provided.
|
|
88
|
+
|
|
89
|
+
extra_headers: Send extra headers
|
|
90
|
+
|
|
91
|
+
extra_query: Add additional query parameters to the request
|
|
92
|
+
|
|
93
|
+
extra_body: Add additional JSON properties to the request
|
|
94
|
+
|
|
95
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
96
|
+
"""
|
|
97
|
+
return self._post(
|
|
98
|
+
"/v1/identities",
|
|
99
|
+
body=maybe_transform(
|
|
100
|
+
{
|
|
101
|
+
"credentials": credentials,
|
|
102
|
+
"source": source,
|
|
103
|
+
"application_description": application_description,
|
|
104
|
+
"application_name": application_name,
|
|
105
|
+
"metadata": metadata,
|
|
106
|
+
"name": name,
|
|
107
|
+
},
|
|
108
|
+
identity_create_params.IdentityCreateParams,
|
|
109
|
+
),
|
|
110
|
+
options=make_request_options(
|
|
111
|
+
extra_headers=extra_headers,
|
|
112
|
+
extra_query=extra_query,
|
|
113
|
+
extra_body=extra_body,
|
|
114
|
+
timeout=timeout,
|
|
115
|
+
query=maybe_transform({"validate_async": validate_async}, identity_create_params.IdentityCreateParams),
|
|
116
|
+
),
|
|
117
|
+
cast_to=IdentityCreateResponse,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
def retrieve(
|
|
121
|
+
self,
|
|
122
|
+
identity_id: str,
|
|
123
|
+
*,
|
|
124
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
125
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
126
|
+
extra_headers: Headers | None = None,
|
|
127
|
+
extra_query: Query | None = None,
|
|
128
|
+
extra_body: Body | None = None,
|
|
129
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
130
|
+
) -> IdentityRetrieveResponse:
|
|
131
|
+
"""Retrieves details of a specific identity by its ID.
|
|
132
|
+
|
|
133
|
+
**Beta** Capability.
|
|
134
|
+
|
|
135
|
+
[Contact support](mailto:support@anchorbrowser.io) to
|
|
136
|
+
enable.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
extra_headers: Send extra headers
|
|
140
|
+
|
|
141
|
+
extra_query: Add additional query parameters to the request
|
|
142
|
+
|
|
143
|
+
extra_body: Add additional JSON properties to the request
|
|
144
|
+
|
|
145
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
146
|
+
"""
|
|
147
|
+
if not identity_id:
|
|
148
|
+
raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
|
|
149
|
+
return self._get(
|
|
150
|
+
f"/v1/identities/{identity_id}",
|
|
151
|
+
options=make_request_options(
|
|
152
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
153
|
+
),
|
|
154
|
+
cast_to=IdentityRetrieveResponse,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
def update(
|
|
158
|
+
self,
|
|
159
|
+
identity_id: str,
|
|
160
|
+
*,
|
|
161
|
+
credentials: Iterable[identity_update_params.Credential] | Omit = omit,
|
|
162
|
+
metadata: Dict[str, object] | Omit = omit,
|
|
163
|
+
name: str | Omit = omit,
|
|
164
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
165
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
166
|
+
extra_headers: Headers | None = None,
|
|
167
|
+
extra_query: Query | None = None,
|
|
168
|
+
extra_body: Body | None = None,
|
|
169
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
170
|
+
) -> IdentityUpdateResponse:
|
|
171
|
+
"""
|
|
172
|
+
Updates an existing identity's name, metadata, or credentials.
|
|
173
|
+
|
|
174
|
+
**Beta** Capability. [Contact support](mailto:support@anchorbrowser.io) to
|
|
175
|
+
enable.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
credentials: Array of credentials for authentication
|
|
179
|
+
|
|
180
|
+
metadata: Metadata for the identity
|
|
181
|
+
|
|
182
|
+
name: Name of the identity
|
|
183
|
+
|
|
184
|
+
extra_headers: Send extra headers
|
|
185
|
+
|
|
186
|
+
extra_query: Add additional query parameters to the request
|
|
187
|
+
|
|
188
|
+
extra_body: Add additional JSON properties to the request
|
|
189
|
+
|
|
190
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
191
|
+
"""
|
|
192
|
+
if not identity_id:
|
|
193
|
+
raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
|
|
194
|
+
return self._put(
|
|
195
|
+
f"/v1/identities/{identity_id}",
|
|
196
|
+
body=maybe_transform(
|
|
197
|
+
{
|
|
198
|
+
"credentials": credentials,
|
|
199
|
+
"metadata": metadata,
|
|
200
|
+
"name": name,
|
|
201
|
+
},
|
|
202
|
+
identity_update_params.IdentityUpdateParams,
|
|
203
|
+
),
|
|
204
|
+
options=make_request_options(
|
|
205
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
206
|
+
),
|
|
207
|
+
cast_to=IdentityUpdateResponse,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
def delete(
|
|
211
|
+
self,
|
|
212
|
+
identity_id: str,
|
|
213
|
+
*,
|
|
214
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
215
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
216
|
+
extra_headers: Headers | None = None,
|
|
217
|
+
extra_query: Query | None = None,
|
|
218
|
+
extra_body: Body | None = None,
|
|
219
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
220
|
+
) -> IdentityDeleteResponse:
|
|
221
|
+
"""Deletes an existing identity.
|
|
222
|
+
|
|
223
|
+
**Beta** Capability.
|
|
224
|
+
|
|
225
|
+
[Contact support](mailto:support@anchorbrowser.io) to
|
|
226
|
+
enable.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
extra_headers: Send extra headers
|
|
230
|
+
|
|
231
|
+
extra_query: Add additional query parameters to the request
|
|
232
|
+
|
|
233
|
+
extra_body: Add additional JSON properties to the request
|
|
234
|
+
|
|
235
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
236
|
+
"""
|
|
237
|
+
if not identity_id:
|
|
238
|
+
raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
|
|
239
|
+
return self._delete(
|
|
240
|
+
f"/v1/identities/{identity_id}",
|
|
241
|
+
options=make_request_options(
|
|
242
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
243
|
+
),
|
|
244
|
+
cast_to=IdentityDeleteResponse,
|
|
245
|
+
)
|
|
246
|
+
|
|
42
247
|
def retrieve_credentials(
|
|
43
248
|
self,
|
|
44
249
|
identity_id: str,
|
|
@@ -93,6 +298,205 @@ class AsyncIdentitiesResource(AsyncAPIResource):
|
|
|
93
298
|
"""
|
|
94
299
|
return AsyncIdentitiesResourceWithStreamingResponse(self)
|
|
95
300
|
|
|
301
|
+
async def create(
|
|
302
|
+
self,
|
|
303
|
+
*,
|
|
304
|
+
credentials: Iterable[identity_create_params.Credential],
|
|
305
|
+
source: str,
|
|
306
|
+
validate_async: bool | Omit = omit,
|
|
307
|
+
application_description: str | Omit = omit,
|
|
308
|
+
application_name: str | Omit = omit,
|
|
309
|
+
metadata: Dict[str, object] | Omit = omit,
|
|
310
|
+
name: str | Omit = omit,
|
|
311
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
312
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
313
|
+
extra_headers: Headers | None = None,
|
|
314
|
+
extra_query: Query | None = None,
|
|
315
|
+
extra_body: Body | None = None,
|
|
316
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
317
|
+
) -> IdentityCreateResponse:
|
|
318
|
+
"""Creates a new identity with credentials for authentication.
|
|
319
|
+
|
|
320
|
+
**Beta** Capability.
|
|
321
|
+
|
|
322
|
+
[Contact support](mailto:support@anchorbrowser.io) to
|
|
323
|
+
enable.
|
|
324
|
+
|
|
325
|
+
Args:
|
|
326
|
+
credentials: Array of credentials for authentication
|
|
327
|
+
|
|
328
|
+
source: The source URL for the identity (e.g., login page URL)
|
|
329
|
+
|
|
330
|
+
validate_async: Whether to validate the identity asynchronously. Defaults to true.
|
|
331
|
+
|
|
332
|
+
application_description: Optional application description
|
|
333
|
+
|
|
334
|
+
application_name: Optional application name to associate with the identity
|
|
335
|
+
|
|
336
|
+
metadata: Optional metadata for the identity
|
|
337
|
+
|
|
338
|
+
name: Name of the identity. Defaults to "Unnamed Identity" if not provided.
|
|
339
|
+
|
|
340
|
+
extra_headers: Send extra headers
|
|
341
|
+
|
|
342
|
+
extra_query: Add additional query parameters to the request
|
|
343
|
+
|
|
344
|
+
extra_body: Add additional JSON properties to the request
|
|
345
|
+
|
|
346
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
347
|
+
"""
|
|
348
|
+
return await self._post(
|
|
349
|
+
"/v1/identities",
|
|
350
|
+
body=await async_maybe_transform(
|
|
351
|
+
{
|
|
352
|
+
"credentials": credentials,
|
|
353
|
+
"source": source,
|
|
354
|
+
"application_description": application_description,
|
|
355
|
+
"application_name": application_name,
|
|
356
|
+
"metadata": metadata,
|
|
357
|
+
"name": name,
|
|
358
|
+
},
|
|
359
|
+
identity_create_params.IdentityCreateParams,
|
|
360
|
+
),
|
|
361
|
+
options=make_request_options(
|
|
362
|
+
extra_headers=extra_headers,
|
|
363
|
+
extra_query=extra_query,
|
|
364
|
+
extra_body=extra_body,
|
|
365
|
+
timeout=timeout,
|
|
366
|
+
query=await async_maybe_transform(
|
|
367
|
+
{"validate_async": validate_async}, identity_create_params.IdentityCreateParams
|
|
368
|
+
),
|
|
369
|
+
),
|
|
370
|
+
cast_to=IdentityCreateResponse,
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
async def retrieve(
|
|
374
|
+
self,
|
|
375
|
+
identity_id: str,
|
|
376
|
+
*,
|
|
377
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
378
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
379
|
+
extra_headers: Headers | None = None,
|
|
380
|
+
extra_query: Query | None = None,
|
|
381
|
+
extra_body: Body | None = None,
|
|
382
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
383
|
+
) -> IdentityRetrieveResponse:
|
|
384
|
+
"""Retrieves details of a specific identity by its ID.
|
|
385
|
+
|
|
386
|
+
**Beta** Capability.
|
|
387
|
+
|
|
388
|
+
[Contact support](mailto:support@anchorbrowser.io) to
|
|
389
|
+
enable.
|
|
390
|
+
|
|
391
|
+
Args:
|
|
392
|
+
extra_headers: Send extra headers
|
|
393
|
+
|
|
394
|
+
extra_query: Add additional query parameters to the request
|
|
395
|
+
|
|
396
|
+
extra_body: Add additional JSON properties to the request
|
|
397
|
+
|
|
398
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
399
|
+
"""
|
|
400
|
+
if not identity_id:
|
|
401
|
+
raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
|
|
402
|
+
return await self._get(
|
|
403
|
+
f"/v1/identities/{identity_id}",
|
|
404
|
+
options=make_request_options(
|
|
405
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
406
|
+
),
|
|
407
|
+
cast_to=IdentityRetrieveResponse,
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
async def update(
|
|
411
|
+
self,
|
|
412
|
+
identity_id: str,
|
|
413
|
+
*,
|
|
414
|
+
credentials: Iterable[identity_update_params.Credential] | Omit = omit,
|
|
415
|
+
metadata: Dict[str, object] | Omit = omit,
|
|
416
|
+
name: str | Omit = omit,
|
|
417
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
418
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
419
|
+
extra_headers: Headers | None = None,
|
|
420
|
+
extra_query: Query | None = None,
|
|
421
|
+
extra_body: Body | None = None,
|
|
422
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
423
|
+
) -> IdentityUpdateResponse:
|
|
424
|
+
"""
|
|
425
|
+
Updates an existing identity's name, metadata, or credentials.
|
|
426
|
+
|
|
427
|
+
**Beta** Capability. [Contact support](mailto:support@anchorbrowser.io) to
|
|
428
|
+
enable.
|
|
429
|
+
|
|
430
|
+
Args:
|
|
431
|
+
credentials: Array of credentials for authentication
|
|
432
|
+
|
|
433
|
+
metadata: Metadata for the identity
|
|
434
|
+
|
|
435
|
+
name: Name of the identity
|
|
436
|
+
|
|
437
|
+
extra_headers: Send extra headers
|
|
438
|
+
|
|
439
|
+
extra_query: Add additional query parameters to the request
|
|
440
|
+
|
|
441
|
+
extra_body: Add additional JSON properties to the request
|
|
442
|
+
|
|
443
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
444
|
+
"""
|
|
445
|
+
if not identity_id:
|
|
446
|
+
raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
|
|
447
|
+
return await self._put(
|
|
448
|
+
f"/v1/identities/{identity_id}",
|
|
449
|
+
body=await async_maybe_transform(
|
|
450
|
+
{
|
|
451
|
+
"credentials": credentials,
|
|
452
|
+
"metadata": metadata,
|
|
453
|
+
"name": name,
|
|
454
|
+
},
|
|
455
|
+
identity_update_params.IdentityUpdateParams,
|
|
456
|
+
),
|
|
457
|
+
options=make_request_options(
|
|
458
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
459
|
+
),
|
|
460
|
+
cast_to=IdentityUpdateResponse,
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
async def delete(
|
|
464
|
+
self,
|
|
465
|
+
identity_id: str,
|
|
466
|
+
*,
|
|
467
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
468
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
469
|
+
extra_headers: Headers | None = None,
|
|
470
|
+
extra_query: Query | None = None,
|
|
471
|
+
extra_body: Body | None = None,
|
|
472
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
473
|
+
) -> IdentityDeleteResponse:
|
|
474
|
+
"""Deletes an existing identity.
|
|
475
|
+
|
|
476
|
+
**Beta** Capability.
|
|
477
|
+
|
|
478
|
+
[Contact support](mailto:support@anchorbrowser.io) to
|
|
479
|
+
enable.
|
|
480
|
+
|
|
481
|
+
Args:
|
|
482
|
+
extra_headers: Send extra headers
|
|
483
|
+
|
|
484
|
+
extra_query: Add additional query parameters to the request
|
|
485
|
+
|
|
486
|
+
extra_body: Add additional JSON properties to the request
|
|
487
|
+
|
|
488
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
489
|
+
"""
|
|
490
|
+
if not identity_id:
|
|
491
|
+
raise ValueError(f"Expected a non-empty value for `identity_id` but received {identity_id!r}")
|
|
492
|
+
return await self._delete(
|
|
493
|
+
f"/v1/identities/{identity_id}",
|
|
494
|
+
options=make_request_options(
|
|
495
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
496
|
+
),
|
|
497
|
+
cast_to=IdentityDeleteResponse,
|
|
498
|
+
)
|
|
499
|
+
|
|
96
500
|
async def retrieve_credentials(
|
|
97
501
|
self,
|
|
98
502
|
identity_id: str,
|
|
@@ -131,6 +535,18 @@ class IdentitiesResourceWithRawResponse:
|
|
|
131
535
|
def __init__(self, identities: IdentitiesResource) -> None:
|
|
132
536
|
self._identities = identities
|
|
133
537
|
|
|
538
|
+
self.create = to_raw_response_wrapper(
|
|
539
|
+
identities.create,
|
|
540
|
+
)
|
|
541
|
+
self.retrieve = to_raw_response_wrapper(
|
|
542
|
+
identities.retrieve,
|
|
543
|
+
)
|
|
544
|
+
self.update = to_raw_response_wrapper(
|
|
545
|
+
identities.update,
|
|
546
|
+
)
|
|
547
|
+
self.delete = to_raw_response_wrapper(
|
|
548
|
+
identities.delete,
|
|
549
|
+
)
|
|
134
550
|
self.retrieve_credentials = to_raw_response_wrapper(
|
|
135
551
|
identities.retrieve_credentials,
|
|
136
552
|
)
|
|
@@ -140,6 +556,18 @@ class AsyncIdentitiesResourceWithRawResponse:
|
|
|
140
556
|
def __init__(self, identities: AsyncIdentitiesResource) -> None:
|
|
141
557
|
self._identities = identities
|
|
142
558
|
|
|
559
|
+
self.create = async_to_raw_response_wrapper(
|
|
560
|
+
identities.create,
|
|
561
|
+
)
|
|
562
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
563
|
+
identities.retrieve,
|
|
564
|
+
)
|
|
565
|
+
self.update = async_to_raw_response_wrapper(
|
|
566
|
+
identities.update,
|
|
567
|
+
)
|
|
568
|
+
self.delete = async_to_raw_response_wrapper(
|
|
569
|
+
identities.delete,
|
|
570
|
+
)
|
|
143
571
|
self.retrieve_credentials = async_to_raw_response_wrapper(
|
|
144
572
|
identities.retrieve_credentials,
|
|
145
573
|
)
|
|
@@ -149,6 +577,18 @@ class IdentitiesResourceWithStreamingResponse:
|
|
|
149
577
|
def __init__(self, identities: IdentitiesResource) -> None:
|
|
150
578
|
self._identities = identities
|
|
151
579
|
|
|
580
|
+
self.create = to_streamed_response_wrapper(
|
|
581
|
+
identities.create,
|
|
582
|
+
)
|
|
583
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
584
|
+
identities.retrieve,
|
|
585
|
+
)
|
|
586
|
+
self.update = to_streamed_response_wrapper(
|
|
587
|
+
identities.update,
|
|
588
|
+
)
|
|
589
|
+
self.delete = to_streamed_response_wrapper(
|
|
590
|
+
identities.delete,
|
|
591
|
+
)
|
|
152
592
|
self.retrieve_credentials = to_streamed_response_wrapper(
|
|
153
593
|
identities.retrieve_credentials,
|
|
154
594
|
)
|
|
@@ -158,6 +598,18 @@ class AsyncIdentitiesResourceWithStreamingResponse:
|
|
|
158
598
|
def __init__(self, identities: AsyncIdentitiesResource) -> None:
|
|
159
599
|
self._identities = identities
|
|
160
600
|
|
|
601
|
+
self.create = async_to_streamed_response_wrapper(
|
|
602
|
+
identities.create,
|
|
603
|
+
)
|
|
604
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
605
|
+
identities.retrieve,
|
|
606
|
+
)
|
|
607
|
+
self.update = async_to_streamed_response_wrapper(
|
|
608
|
+
identities.update,
|
|
609
|
+
)
|
|
610
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
611
|
+
identities.delete,
|
|
612
|
+
)
|
|
161
613
|
self.retrieve_credentials = async_to_streamed_response_wrapper(
|
|
162
614
|
identities.retrieve_credentials,
|
|
163
615
|
)
|
|
@@ -145,6 +145,7 @@ class SessionsResource(SyncAPIResource):
|
|
|
145
145
|
self,
|
|
146
146
|
*,
|
|
147
147
|
browser: session_create_params.Browser | Omit = omit,
|
|
148
|
+
identities: Iterable[session_create_params.Identity] | Omit = omit,
|
|
148
149
|
integrations: Iterable[session_create_params.Integration] | Omit = omit,
|
|
149
150
|
session: session_create_params.Session | Omit = omit,
|
|
150
151
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -161,6 +162,11 @@ class SessionsResource(SyncAPIResource):
|
|
|
161
162
|
Args:
|
|
162
163
|
browser: Browser-specific configurations.
|
|
163
164
|
|
|
165
|
+
identities: Activates an authenticated session.
|
|
166
|
+
|
|
167
|
+
**Beta** Capability. [Contact support](mailto:support@anchorbrowser.io) to
|
|
168
|
+
enable.
|
|
169
|
+
|
|
164
170
|
integrations: Array of integrations to load in the browser session. Integrations must be
|
|
165
171
|
previously created using the Integrations API.
|
|
166
172
|
|
|
@@ -179,6 +185,7 @@ class SessionsResource(SyncAPIResource):
|
|
|
179
185
|
body=maybe_transform(
|
|
180
186
|
{
|
|
181
187
|
"browser": browser,
|
|
188
|
+
"identities": identities,
|
|
182
189
|
"integrations": integrations,
|
|
183
190
|
"session": session,
|
|
184
191
|
},
|
|
@@ -690,6 +697,7 @@ class AsyncSessionsResource(AsyncAPIResource):
|
|
|
690
697
|
self,
|
|
691
698
|
*,
|
|
692
699
|
browser: session_create_params.Browser | Omit = omit,
|
|
700
|
+
identities: Iterable[session_create_params.Identity] | Omit = omit,
|
|
693
701
|
integrations: Iterable[session_create_params.Integration] | Omit = omit,
|
|
694
702
|
session: session_create_params.Session | Omit = omit,
|
|
695
703
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -706,6 +714,11 @@ class AsyncSessionsResource(AsyncAPIResource):
|
|
|
706
714
|
Args:
|
|
707
715
|
browser: Browser-specific configurations.
|
|
708
716
|
|
|
717
|
+
identities: Activates an authenticated session.
|
|
718
|
+
|
|
719
|
+
**Beta** Capability. [Contact support](mailto:support@anchorbrowser.io) to
|
|
720
|
+
enable.
|
|
721
|
+
|
|
709
722
|
integrations: Array of integrations to load in the browser session. Integrations must be
|
|
710
723
|
previously created using the Integrations API.
|
|
711
724
|
|
|
@@ -724,6 +737,7 @@ class AsyncSessionsResource(AsyncAPIResource):
|
|
|
724
737
|
body=await async_maybe_transform(
|
|
725
738
|
{
|
|
726
739
|
"browser": browser,
|
|
740
|
+
"identities": identities,
|
|
727
741
|
"integrations": integrations,
|
|
728
742
|
"session": session,
|
|
729
743
|
},
|
anchorbrowser/types/__init__.py
CHANGED
|
@@ -18,28 +18,48 @@ from .session_copy_response import SessionCopyResponse as SessionCopyResponse
|
|
|
18
18
|
from .session_create_params import SessionCreateParams as SessionCreateParams
|
|
19
19
|
from .session_goto_response import SessionGotoResponse as SessionGotoResponse
|
|
20
20
|
from .session_scroll_params import SessionScrollParams as SessionScrollParams
|
|
21
|
+
from .identity_create_params import IdentityCreateParams as IdentityCreateParams
|
|
22
|
+
from .identity_update_params import IdentityUpdateParams as IdentityUpdateParams
|
|
21
23
|
from .session_paste_response import SessionPasteResponse as SessionPasteResponse
|
|
24
|
+
from .application_list_params import ApplicationListParams as ApplicationListParams
|
|
22
25
|
from .event_wait_for_response import EventWaitForResponse as EventWaitForResponse
|
|
23
26
|
from .extension_list_response import ExtensionListResponse as ExtensionListResponse
|
|
24
27
|
from .extension_upload_params import ExtensionUploadParams as ExtensionUploadParams
|
|
25
28
|
from .session_create_response import SessionCreateResponse as SessionCreateResponse
|
|
26
29
|
from .session_scroll_response import SessionScrollResponse as SessionScrollResponse
|
|
30
|
+
from .identity_create_response import IdentityCreateResponse as IdentityCreateResponse
|
|
31
|
+
from .identity_delete_response import IdentityDeleteResponse as IdentityDeleteResponse
|
|
32
|
+
from .identity_update_response import IdentityUpdateResponse as IdentityUpdateResponse
|
|
33
|
+
from .application_create_params import ApplicationCreateParams as ApplicationCreateParams
|
|
34
|
+
from .application_list_response import ApplicationListResponse as ApplicationListResponse
|
|
27
35
|
from .extension_delete_response import ExtensionDeleteResponse as ExtensionDeleteResponse
|
|
28
36
|
from .extension_upload_response import ExtensionUploadResponse as ExtensionUploadResponse
|
|
29
37
|
from .profile_retrieve_response import ProfileRetrieveResponse as ProfileRetrieveResponse
|
|
30
38
|
from .session_retrieve_response import SessionRetrieveResponse as SessionRetrieveResponse
|
|
31
39
|
from .tool_fetch_webpage_params import ToolFetchWebpageParams as ToolFetchWebpageParams
|
|
40
|
+
from .identity_retrieve_response import IdentityRetrieveResponse as IdentityRetrieveResponse
|
|
32
41
|
from .session_upload_file_params import SessionUploadFileParams as SessionUploadFileParams
|
|
42
|
+
from .application_create_response import ApplicationCreateResponse as ApplicationCreateResponse
|
|
43
|
+
from .application_delete_response import ApplicationDeleteResponse as ApplicationDeleteResponse
|
|
33
44
|
from .extension_retrieve_response import ExtensionRetrieveResponse as ExtensionRetrieveResponse
|
|
34
45
|
from .session_list_pages_response import SessionListPagesResponse as SessionListPagesResponse
|
|
35
46
|
from .tool_fetch_webpage_response import ToolFetchWebpageResponse as ToolFetchWebpageResponse
|
|
36
47
|
from .session_drag_and_drop_params import SessionDragAndDropParams as SessionDragAndDropParams
|
|
37
48
|
from .session_upload_file_response import SessionUploadFileResponse as SessionUploadFileResponse
|
|
38
49
|
from .tool_perform_web_task_params import ToolPerformWebTaskParams as ToolPerformWebTaskParams
|
|
50
|
+
from .application_retrieve_response import ApplicationRetrieveResponse as ApplicationRetrieveResponse
|
|
39
51
|
from .session_drag_and_drop_response import SessionDragAndDropResponse as SessionDragAndDropResponse
|
|
40
52
|
from .tool_perform_web_task_response import ToolPerformWebTaskResponse as ToolPerformWebTaskResponse
|
|
41
53
|
from .tool_screenshot_webpage_params import ToolScreenshotWebpageParams as ToolScreenshotWebpageParams
|
|
54
|
+
from .application_list_identities_params import ApplicationListIdentitiesParams as ApplicationListIdentitiesParams
|
|
42
55
|
from .session_retrieve_downloads_response import SessionRetrieveDownloadsResponse as SessionRetrieveDownloadsResponse
|
|
56
|
+
from .application_list_identities_response import ApplicationListIdentitiesResponse as ApplicationListIdentitiesResponse
|
|
43
57
|
from .identity_retrieve_credentials_response import (
|
|
44
58
|
IdentityRetrieveCredentialsResponse as IdentityRetrieveCredentialsResponse,
|
|
45
59
|
)
|
|
60
|
+
from .application_create_identity_token_params import (
|
|
61
|
+
ApplicationCreateIdentityTokenParams as ApplicationCreateIdentityTokenParams,
|
|
62
|
+
)
|
|
63
|
+
from .application_create_identity_token_response import (
|
|
64
|
+
ApplicationCreateIdentityTokenResponse as ApplicationCreateIdentityTokenResponse,
|
|
65
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, Annotated, TypedDict
|
|
6
|
+
|
|
7
|
+
from .._utils import PropertyInfo
|
|
8
|
+
|
|
9
|
+
__all__ = ["ApplicationCreateIdentityTokenParams"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ApplicationCreateIdentityTokenParams(TypedDict, total=False):
|
|
13
|
+
callback_url: Required[Annotated[str, PropertyInfo(alias="callbackUrl")]]
|
|
14
|
+
"""The HTTPS URL where the user will be redirected after authentication.
|
|
15
|
+
|
|
16
|
+
Must use HTTPS protocol.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["ApplicationCreateIdentityTokenResponse", "Data"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Data(BaseModel):
|
|
12
|
+
token: Optional[str] = None
|
|
13
|
+
"""The generated identity token for authentication"""
|
|
14
|
+
|
|
15
|
+
expires_at: Optional[datetime] = None
|
|
16
|
+
"""The timestamp when the token expires"""
|
|
17
|
+
|
|
18
|
+
token_hash: Optional[str] = None
|
|
19
|
+
"""A hash of the token for verification purposes"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ApplicationCreateIdentityTokenResponse(BaseModel):
|
|
23
|
+
data: Optional[Data] = None
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["ApplicationCreateParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ApplicationCreateParams(TypedDict, total=False):
|
|
11
|
+
source: Required[str]
|
|
12
|
+
"""The source URL of the application"""
|
|
13
|
+
|
|
14
|
+
description: str
|
|
15
|
+
"""Description of the application"""
|
|
16
|
+
|
|
17
|
+
name: str
|
|
18
|
+
"""Name of the application"""
|