Debian Codegraph @

src/auth0/management/connection_profiles/client.py

raw symbols SCIP
1 # This file was auto-generated by Fern from our API Definition.
2
3 import typing
4
5 from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6 from ..core.pagination import AsyncPager, SyncPager
7 from ..core.request_options import RequestOptions
8 from ..types.connection_name_prefix_template import ConnectionNamePrefixTemplate
9 from ..types.connection_profile import ConnectionProfile
10 from ..types.connection_profile_config import ConnectionProfileConfig
11 from ..types.connection_profile_enabled_features import ConnectionProfileEnabledFeatures
12 from ..types.connection_profile_name import ConnectionProfileName
13 from ..types.connection_profile_organization import ConnectionProfileOrganization
14 from ..types.connection_profile_strategy_overrides import ConnectionProfileStrategyOverrides
15 from ..types.create_connection_profile_response_content import CreateConnectionProfileResponseContent
16 from ..types.get_connection_profile_response_content import GetConnectionProfileResponseContent
17 from ..types.get_connection_profile_template_response_content import GetConnectionProfileTemplateResponseContent
18 from ..types.list_connection_profile_template_response_content import ListConnectionProfileTemplateResponseContent
19 from ..types.list_connection_profiles_paginated_response_content import ListConnectionProfilesPaginatedResponseContent
20 from ..types.update_connection_profile_response_content import UpdateConnectionProfileResponseContent
21 from .raw_client import AsyncRawConnectionProfilesClient, RawConnectionProfilesClient
22
23 # this is used as the default value for optional parameters
24 OMIT = typing.cast(typing.Any, ...)
25
26
27 class ConnectionProfilesClient:
28 def __init__(self, *, client_wrapper: SyncClientWrapper):
29 self._raw_client = RawConnectionProfilesClient(client_wrapper=client_wrapper)
30
31 @property
32 def with_raw_response(self) -> RawConnectionProfilesClient:
33 """
34 Retrieves a raw implementation of this client that returns raw responses.
35
36 Returns
37 -------
38 RawConnectionProfilesClient
39 """
40 return self._raw_client
41
42 def list(
43 self,
44 *,
45 from_: typing.Optional[str] = None,
46 take: typing.Optional[int] = 50,
47 request_options: typing.Optional[RequestOptions] = None,
48 ) -> SyncPager[ConnectionProfile, ListConnectionProfilesPaginatedResponseContent]:
49 """
50 Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination.
51
52 Parameters
53 ----------
54 from_ : typing.Optional[str]
55 Optional Id from which to start selection.
56
57 take : typing.Optional[int]
58 Number of results per page. Defaults to 5.
59
60 request_options : typing.Optional[RequestOptions]
61 Request-specific configuration.
62
63 Returns
64 -------
65 SyncPager[ConnectionProfile, ListConnectionProfilesPaginatedResponseContent]
66 Connection Profiles successfully retrieved.
67
68 Examples
69 --------
70 from auth0 import Auth0
71
72 client = Auth0(
73 token="YOUR_TOKEN",
74 )
75 response = client.connection_profiles.list(
76 from_="from",
77 take=1,
78 )
79 for item in response:
80 yield item
81 # alternatively, you can paginate page-by-page
82 for page in response.iter_pages():
83 yield page
84 """
85 return self._raw_client.list(from_=from_, take=take, request_options=request_options)
86
87 def create(
88 self,
89 *,
90 name: ConnectionProfileName,
91 organization: typing.Optional[ConnectionProfileOrganization] = OMIT,
92 connection_name_prefix_template: typing.Optional[ConnectionNamePrefixTemplate] = OMIT,
93 enabled_features: typing.Optional[ConnectionProfileEnabledFeatures] = OMIT,
94 connection_config: typing.Optional[ConnectionProfileConfig] = OMIT,
95 strategy_overrides: typing.Optional[ConnectionProfileStrategyOverrides] = OMIT,
96 request_options: typing.Optional[RequestOptions] = None,
97 ) -> CreateConnectionProfileResponseContent:
98 """
99 Create a Connection Profile.
100
101 Parameters
102 ----------
103 name : ConnectionProfileName
104
105 organization : typing.Optional[ConnectionProfileOrganization]
106
107 connection_name_prefix_template : typing.Optional[ConnectionNamePrefixTemplate]
108
109 enabled_features : typing.Optional[ConnectionProfileEnabledFeatures]
110
111 connection_config : typing.Optional[ConnectionProfileConfig]
112
113 strategy_overrides : typing.Optional[ConnectionProfileStrategyOverrides]
114
115 request_options : typing.Optional[RequestOptions]
116 Request-specific configuration.
117
118 Returns
119 -------
120 CreateConnectionProfileResponseContent
121 Connection profile successfully created.
122
123 Examples
124 --------
125 from auth0 import Auth0
126
127 client = Auth0(
128 token="YOUR_TOKEN",
129 )
130 client.connection_profiles.create(
131 name="name",
132 )
133 """
134 _response = self._raw_client.create(
135 name=name,
136 organization=organization,
137 connection_name_prefix_template=connection_name_prefix_template,
138 enabled_features=enabled_features,
139 connection_config=connection_config,
140 strategy_overrides=strategy_overrides,
141 request_options=request_options,
142 )
143 return _response.data
144
145 def list_templates(
146 self, *, request_options: typing.Optional[RequestOptions] = None
147 ) -> ListConnectionProfileTemplateResponseContent:
148 """
149 Retrieve a list of Connection Profile Templates.
150
151 Parameters
152 ----------
153 request_options : typing.Optional[RequestOptions]
154 Request-specific configuration.
155
156 Returns
157 -------
158 ListConnectionProfileTemplateResponseContent
159 Connection Profile Templates successfully retrieved.
160
161 Examples
162 --------
163 from auth0 import Auth0
164
165 client = Auth0(
166 token="YOUR_TOKEN",
167 )
168 client.connection_profiles.list_templates()
169 """
170 _response = self._raw_client.list_templates(request_options=request_options)
171 return _response.data
172
173 def get_template(
174 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
175 ) -> GetConnectionProfileTemplateResponseContent:
176 """
177 Retrieve a Connection Profile Template.
178
179 Parameters
180 ----------
181 id : str
182 ID of the connection-profile-template to retrieve.
183
184 request_options : typing.Optional[RequestOptions]
185 Request-specific configuration.
186
187 Returns
188 -------
189 GetConnectionProfileTemplateResponseContent
190 Connection Profile Template successfully retrieved.
191
192 Examples
193 --------
194 from auth0 import Auth0
195
196 client = Auth0(
197 token="YOUR_TOKEN",
198 )
199 client.connection_profiles.get_template(
200 id="id",
201 )
202 """
203 _response = self._raw_client.get_template(id, request_options=request_options)
204 return _response.data
205
206 def get(
207 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
208 ) -> GetConnectionProfileResponseContent:
209 """
210 Retrieve details about a single Connection Profile specified by ID.
211
212 Parameters
213 ----------
214 id : str
215 ID of the connection-profile to retrieve.
216
217 request_options : typing.Optional[RequestOptions]
218 Request-specific configuration.
219
220 Returns
221 -------
222 GetConnectionProfileResponseContent
223 Record for existing connection profile.
224
225 Examples
226 --------
227 from auth0 import Auth0
228
229 client = Auth0(
230 token="YOUR_TOKEN",
231 )
232 client.connection_profiles.get(
233 id="id",
234 )
235 """
236 _response = self._raw_client.get(id, request_options=request_options)
237 return _response.data
238
239 def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
240 """
241 Delete a single Connection Profile specified by ID.
242
243 Parameters
244 ----------
245 id : str
246 ID of the connection-profile to delete.
247
248 request_options : typing.Optional[RequestOptions]
249 Request-specific configuration.
250
251 Returns
252 -------
253 None
254
255 Examples
256 --------
257 from auth0 import Auth0
258
259 client = Auth0(
260 token="YOUR_TOKEN",
261 )
262 client.connection_profiles.delete(
263 id="id",
264 )
265 """
266 _response = self._raw_client.delete(id, request_options=request_options)
267 return _response.data
268
269 def update(
270 self,
271 id: str,
272 *,
273 name: typing.Optional[ConnectionProfileName] = OMIT,
274 organization: typing.Optional[ConnectionProfileOrganization] = OMIT,
275 connection_name_prefix_template: typing.Optional[ConnectionNamePrefixTemplate] = OMIT,
276 enabled_features: typing.Optional[ConnectionProfileEnabledFeatures] = OMIT,
277 connection_config: typing.Optional[ConnectionProfileConfig] = OMIT,
278 strategy_overrides: typing.Optional[ConnectionProfileStrategyOverrides] = OMIT,
279 request_options: typing.Optional[RequestOptions] = None,
280 ) -> UpdateConnectionProfileResponseContent:
281 """
282 Update the details of a specific Connection Profile.
283
284 Parameters
285 ----------
286 id : str
287 ID of the connection profile to update.
288
289 name : typing.Optional[ConnectionProfileName]
290
291 organization : typing.Optional[ConnectionProfileOrganization]
292
293 connection_name_prefix_template : typing.Optional[ConnectionNamePrefixTemplate]
294
295 enabled_features : typing.Optional[ConnectionProfileEnabledFeatures]
296
297 connection_config : typing.Optional[ConnectionProfileConfig]
298
299 strategy_overrides : typing.Optional[ConnectionProfileStrategyOverrides]
300
301 request_options : typing.Optional[RequestOptions]
302 Request-specific configuration.
303
304 Returns
305 -------
306 UpdateConnectionProfileResponseContent
307 Connection profile successfully updated.
308
309 Examples
310 --------
311 from auth0 import Auth0
312
313 client = Auth0(
314 token="YOUR_TOKEN",
315 )
316 client.connection_profiles.update(
317 id="id",
318 )
319 """
320 _response = self._raw_client.update(
321 id,
322 name=name,
323 organization=organization,
324 connection_name_prefix_template=connection_name_prefix_template,
325 enabled_features=enabled_features,
326 connection_config=connection_config,
327 strategy_overrides=strategy_overrides,
328 request_options=request_options,
329 )
330 return _response.data
331
332
333 class AsyncConnectionProfilesClient:
334 def __init__(self, *, client_wrapper: AsyncClientWrapper):
335 self._raw_client = AsyncRawConnectionProfilesClient(client_wrapper=client_wrapper)
336
337 @property
338 def with_raw_response(self) -> AsyncRawConnectionProfilesClient:
339 """
340 Retrieves a raw implementation of this client that returns raw responses.
341
342 Returns
343 -------
344 AsyncRawConnectionProfilesClient
345 """
346 return self._raw_client
347
348 async def list(
349 self,
350 *,
351 from_: typing.Optional[str] = None,
352 take: typing.Optional[int] = 50,
353 request_options: typing.Optional[RequestOptions] = None,
354 ) -> AsyncPager[ConnectionProfile, ListConnectionProfilesPaginatedResponseContent]:
355 """
356 Retrieve a list of Connection Profiles. This endpoint supports Checkpoint pagination.
357
358 Parameters
359 ----------
360 from_ : typing.Optional[str]
361 Optional Id from which to start selection.
362
363 take : typing.Optional[int]
364 Number of results per page. Defaults to 5.
365
366 request_options : typing.Optional[RequestOptions]
367 Request-specific configuration.
368
369 Returns
370 -------
371 AsyncPager[ConnectionProfile, ListConnectionProfilesPaginatedResponseContent]
372 Connection Profiles successfully retrieved.
373
374 Examples
375 --------
376 import asyncio
377
378 from auth0 import AsyncAuth0
379
380 client = AsyncAuth0(
381 token="YOUR_TOKEN",
382 )
383
384
385 async def main() -> None:
386 response = await client.connection_profiles.list(
387 from_="from",
388 take=1,
389 )
390 async for item in response:
391 yield item
392
393 # alternatively, you can paginate page-by-page
394 async for page in response.iter_pages():
395 yield page
396
397
398 asyncio.run(main())
399 """
400 return await self._raw_client.list(from_=from_, take=take, request_options=request_options)
401
402 async def create(
403 self,
404 *,
405 name: ConnectionProfileName,
406 organization: typing.Optional[ConnectionProfileOrganization] = OMIT,
407 connection_name_prefix_template: typing.Optional[ConnectionNamePrefixTemplate] = OMIT,
408 enabled_features: typing.Optional[ConnectionProfileEnabledFeatures] = OMIT,
409 connection_config: typing.Optional[ConnectionProfileConfig] = OMIT,
410 strategy_overrides: typing.Optional[ConnectionProfileStrategyOverrides] = OMIT,
411 request_options: typing.Optional[RequestOptions] = None,
412 ) -> CreateConnectionProfileResponseContent:
413 """
414 Create a Connection Profile.
415
416 Parameters
417 ----------
418 name : ConnectionProfileName
419
420 organization : typing.Optional[ConnectionProfileOrganization]
421
422 connection_name_prefix_template : typing.Optional[ConnectionNamePrefixTemplate]
423
424 enabled_features : typing.Optional[ConnectionProfileEnabledFeatures]
425
426 connection_config : typing.Optional[ConnectionProfileConfig]
427
428 strategy_overrides : typing.Optional[ConnectionProfileStrategyOverrides]
429
430 request_options : typing.Optional[RequestOptions]
431 Request-specific configuration.
432
433 Returns
434 -------
435 CreateConnectionProfileResponseContent
436 Connection profile successfully created.
437
438 Examples
439 --------
440 import asyncio
441
442 from auth0 import AsyncAuth0
443
444 client = AsyncAuth0(
445 token="YOUR_TOKEN",
446 )
447
448
449 async def main() -> None:
450 await client.connection_profiles.create(
451 name="name",
452 )
453
454
455 asyncio.run(main())
456 """
457 _response = await self._raw_client.create(
458 name=name,
459 organization=organization,
460 connection_name_prefix_template=connection_name_prefix_template,
461 enabled_features=enabled_features,
462 connection_config=connection_config,
463 strategy_overrides=strategy_overrides,
464 request_options=request_options,
465 )
466 return _response.data
467
468 async def list_templates(
469 self, *, request_options: typing.Optional[RequestOptions] = None
470 ) -> ListConnectionProfileTemplateResponseContent:
471 """
472 Retrieve a list of Connection Profile Templates.
473
474 Parameters
475 ----------
476 request_options : typing.Optional[RequestOptions]
477 Request-specific configuration.
478
479 Returns
480 -------
481 ListConnectionProfileTemplateResponseContent
482 Connection Profile Templates successfully retrieved.
483
484 Examples
485 --------
486 import asyncio
487
488 from auth0 import AsyncAuth0
489
490 client = AsyncAuth0(
491 token="YOUR_TOKEN",
492 )
493
494
495 async def main() -> None:
496 await client.connection_profiles.list_templates()
497
498
499 asyncio.run(main())
500 """
501 _response = await self._raw_client.list_templates(request_options=request_options)
502 return _response.data
503
504 async def get_template(
505 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
506 ) -> GetConnectionProfileTemplateResponseContent:
507 """
508 Retrieve a Connection Profile Template.
509
510 Parameters
511 ----------
512 id : str
513 ID of the connection-profile-template to retrieve.
514
515 request_options : typing.Optional[RequestOptions]
516 Request-specific configuration.
517
518 Returns
519 -------
520 GetConnectionProfileTemplateResponseContent
521 Connection Profile Template successfully retrieved.
522
523 Examples
524 --------
525 import asyncio
526
527 from auth0 import AsyncAuth0
528
529 client = AsyncAuth0(
530 token="YOUR_TOKEN",
531 )
532
533
534 async def main() -> None:
535 await client.connection_profiles.get_template(
536 id="id",
537 )
538
539
540 asyncio.run(main())
541 """
542 _response = await self._raw_client.get_template(id, request_options=request_options)
543 return _response.data
544
545 async def get(
546 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
547 ) -> GetConnectionProfileResponseContent:
548 """
549 Retrieve details about a single Connection Profile specified by ID.
550
551 Parameters
552 ----------
553 id : str
554 ID of the connection-profile to retrieve.
555
556 request_options : typing.Optional[RequestOptions]
557 Request-specific configuration.
558
559 Returns
560 -------
561 GetConnectionProfileResponseContent
562 Record for existing connection profile.
563
564 Examples
565 --------
566 import asyncio
567
568 from auth0 import AsyncAuth0
569
570 client = AsyncAuth0(
571 token="YOUR_TOKEN",
572 )
573
574
575 async def main() -> None:
576 await client.connection_profiles.get(
577 id="id",
578 )
579
580
581 asyncio.run(main())
582 """
583 _response = await self._raw_client.get(id, request_options=request_options)
584 return _response.data
585
586 async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
587 """
588 Delete a single Connection Profile specified by ID.
589
590 Parameters
591 ----------
592 id : str
593 ID of the connection-profile to delete.
594
595 request_options : typing.Optional[RequestOptions]
596 Request-specific configuration.
597
598 Returns
599 -------
600 None
601
602 Examples
603 --------
604 import asyncio
605
606 from auth0 import AsyncAuth0
607
608 client = AsyncAuth0(
609 token="YOUR_TOKEN",
610 )
611
612
613 async def main() -> None:
614 await client.connection_profiles.delete(
615 id="id",
616 )
617
618
619 asyncio.run(main())
620 """
621 _response = await self._raw_client.delete(id, request_options=request_options)
622 return _response.data
623
624 async def update(
625 self,
626 id: str,
627 *,
628 name: typing.Optional[ConnectionProfileName] = OMIT,
629 organization: typing.Optional[ConnectionProfileOrganization] = OMIT,
630 connection_name_prefix_template: typing.Optional[ConnectionNamePrefixTemplate] = OMIT,
631 enabled_features: typing.Optional[ConnectionProfileEnabledFeatures] = OMIT,
632 connection_config: typing.Optional[ConnectionProfileConfig] = OMIT,
633 strategy_overrides: typing.Optional[ConnectionProfileStrategyOverrides] = OMIT,
634 request_options: typing.Optional[RequestOptions] = None,
635 ) -> UpdateConnectionProfileResponseContent:
636 """
637 Update the details of a specific Connection Profile.
638
639 Parameters
640 ----------
641 id : str
642 ID of the connection profile to update.
643
644 name : typing.Optional[ConnectionProfileName]
645
646 organization : typing.Optional[ConnectionProfileOrganization]
647
648 connection_name_prefix_template : typing.Optional[ConnectionNamePrefixTemplate]
649
650 enabled_features : typing.Optional[ConnectionProfileEnabledFeatures]
651
652 connection_config : typing.Optional[ConnectionProfileConfig]
653
654 strategy_overrides : typing.Optional[ConnectionProfileStrategyOverrides]
655
656 request_options : typing.Optional[RequestOptions]
657 Request-specific configuration.
658
659 Returns
660 -------
661 UpdateConnectionProfileResponseContent
662 Connection profile successfully updated.
663
664 Examples
665 --------
666 import asyncio
667
668 from auth0 import AsyncAuth0
669
670 client = AsyncAuth0(
671 token="YOUR_TOKEN",
672 )
673
674
675 async def main() -> None:
676 await client.connection_profiles.update(
677 id="id",
678 )
679
680
681 asyncio.run(main())
682 """
683 _response = await self._raw_client.update(
684 id,
685 name=name,
686 organization=organization,
687 connection_name_prefix_template=connection_name_prefix_template,
688 enabled_features=enabled_features,
689 connection_config=connection_config,
690 strategy_overrides=strategy_overrides,
691 request_options=request_options,
692 )
693 return _response.data