Debian Codegraph @

src/auth0/management/connections/directory_provisioning/synchronizations/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.request_options import RequestOptions
7 from ....types.create_directory_synchronization_response_content import CreateDirectorySynchronizationResponseContent
8 from .raw_client import AsyncRawSynchronizationsClient, RawSynchronizationsClient
9
10
11 class SynchronizationsClient:
12 def __init__(self, *, client_wrapper: SyncClientWrapper):
13 self._raw_client = RawSynchronizationsClient(client_wrapper=client_wrapper)
14
15 @property
16 def with_raw_response(self) -> RawSynchronizationsClient:
17 """
18 Retrieves a raw implementation of this client that returns raw responses.
19
20 Returns
21 -------
22 RawSynchronizationsClient
23 """
24 return self._raw_client
25
26 def create(
27 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
28 ) -> CreateDirectorySynchronizationResponseContent:
29 """
30 Request an on-demand synchronization of the directory.
31
32 Parameters
33 ----------
34 id : str
35 The id of the connection to trigger synchronization for
36
37 request_options : typing.Optional[RequestOptions]
38 Request-specific configuration.
39
40 Returns
41 -------
42 CreateDirectorySynchronizationResponseContent
43 The directory synchronization was triggered. See <strong>Response Schemas</strong> for schema.
44
45 Examples
46 --------
47 from auth0 import Auth0
48
49 client = Auth0(
50 token="YOUR_TOKEN",
51 )
52 client.connections.directory_provisioning.synchronizations.create(
53 id="id",
54 )
55 """
56 _response = self._raw_client.create(id, request_options=request_options)
57 return _response.data
58
59
60 class AsyncSynchronizationsClient:
61 def __init__(self, *, client_wrapper: AsyncClientWrapper):
62 self._raw_client = AsyncRawSynchronizationsClient(client_wrapper=client_wrapper)
63
64 @property
65 def with_raw_response(self) -> AsyncRawSynchronizationsClient:
66 """
67 Retrieves a raw implementation of this client that returns raw responses.
68
69 Returns
70 -------
71 AsyncRawSynchronizationsClient
72 """
73 return self._raw_client
74
75 async def create(
76 self, id: str, *, request_options: typing.Optional[RequestOptions] = None
77 ) -> CreateDirectorySynchronizationResponseContent:
78 """
79 Request an on-demand synchronization of the directory.
80
81 Parameters
82 ----------
83 id : str
84 The id of the connection to trigger synchronization for
85
86 request_options : typing.Optional[RequestOptions]
87 Request-specific configuration.
88
89 Returns
90 -------
91 CreateDirectorySynchronizationResponseContent
92 The directory synchronization was triggered. See <strong>Response Schemas</strong> for schema.
93
94 Examples
95 --------
96 import asyncio
97
98 from auth0 import AsyncAuth0
99
100 client = AsyncAuth0(
101 token="YOUR_TOKEN",
102 )
103
104
105 async def main() -> None:
106 await client.connections.directory_provisioning.synchronizations.create(
107 id="id",
108 )
109
110
111 asyncio.run(main())
112 """
113 _response = await self._raw_client.create(id, request_options=request_options)
114 return _response.data