Debian Codegraph @

src/auth0/management/self_service_profiles/sso_ticket/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_self_service_profile_sso_ticket_response_content import (
8 CreateSelfServiceProfileSsoTicketResponseContent,
9 )
10 from ...types.self_service_profile_sso_ticket_connection_config import SelfServiceProfileSsoTicketConnectionConfig
11 from ...types.self_service_profile_sso_ticket_domain_aliases_config import (
12 SelfServiceProfileSsoTicketDomainAliasesConfig,
13 )
14 from ...types.self_service_profile_sso_ticket_enabled_features import SelfServiceProfileSsoTicketEnabledFeatures
15 from ...types.self_service_profile_sso_ticket_enabled_organization import SelfServiceProfileSsoTicketEnabledOrganization
16 from ...types.self_service_profile_sso_ticket_provisioning_config import SelfServiceProfileSsoTicketProvisioningConfig
17 from ...types.third_party_client_access_config import ThirdPartyClientAccessConfig
18 from .raw_client import AsyncRawSsoTicketClient, RawSsoTicketClient
19
20 # this is used as the default value for optional parameters
21 OMIT = typing.cast(typing.Any, ...)
22
23
24 class SsoTicketClient:
25 def __init__(self, *, client_wrapper: SyncClientWrapper):
26 self._raw_client = RawSsoTicketClient(client_wrapper=client_wrapper)
27
28 @property
29 def with_raw_response(self) -> RawSsoTicketClient:
30 """
31 Retrieves a raw implementation of this client that returns raw responses.
32
33 Returns
34 -------
35 RawSsoTicketClient
36 """
37 return self._raw_client
38
39 def create(
40 self,
41 id: str,
42 *,
43 connection_id: typing.Optional[str] = OMIT,
44 connection_config: typing.Optional[SelfServiceProfileSsoTicketConnectionConfig] = OMIT,
45 enabled_clients: typing.Optional[typing.Sequence[str]] = OMIT,
46 enabled_organizations: typing.Optional[typing.Sequence[SelfServiceProfileSsoTicketEnabledOrganization]] = OMIT,
47 ttl_sec: typing.Optional[int] = OMIT,
48 domain_aliases_config: typing.Optional[SelfServiceProfileSsoTicketDomainAliasesConfig] = OMIT,
49 provisioning_config: typing.Optional[SelfServiceProfileSsoTicketProvisioningConfig] = OMIT,
50 use_for_organization_discovery: typing.Optional[bool] = OMIT,
51 third_party_client_access_config: typing.Optional[ThirdPartyClientAccessConfig] = OMIT,
52 enabled_features: typing.Optional[SelfServiceProfileSsoTicketEnabledFeatures] = OMIT,
53 request_options: typing.Optional[RequestOptions] = None,
54 ) -> CreateSelfServiceProfileSsoTicketResponseContent:
55 """
56 Creates an access ticket to initiate the Self-Service Enterprise Configuration flow using a self-service profile.
57
58 Parameters
59 ----------
60 id : str
61 The id of the self-service profile to retrieve
62
63 connection_id : typing.Optional[str]
64 If provided, this will allow editing of the provided connection during the Self-Service Enterprise Configuration flow
65
66 connection_config : typing.Optional[SelfServiceProfileSsoTicketConnectionConfig]
67
68 enabled_clients : typing.Optional[typing.Sequence[str]]
69 List of client_ids that the connection will be enabled for.
70
71 enabled_organizations : typing.Optional[typing.Sequence[SelfServiceProfileSsoTicketEnabledOrganization]]
72 List of organizations that the connection will be enabled for.
73
74 ttl_sec : typing.Optional[int]
75 Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).
76
77 domain_aliases_config : typing.Optional[SelfServiceProfileSsoTicketDomainAliasesConfig]
78
79 provisioning_config : typing.Optional[SelfServiceProfileSsoTicketProvisioningConfig]
80
81 use_for_organization_discovery : typing.Optional[bool]
82 Indicates whether a verified domain should be used for organization discovery during authentication.
83
84 third_party_client_access_config : typing.Optional[ThirdPartyClientAccessConfig]
85
86 enabled_features : typing.Optional[SelfServiceProfileSsoTicketEnabledFeatures]
87
88 request_options : typing.Optional[RequestOptions]
89 Request-specific configuration.
90
91 Returns
92 -------
93 CreateSelfServiceProfileSsoTicketResponseContent
94 Self-Service Enterprise Configuration Access Ticket successfully created.
95
96 Examples
97 --------
98 from auth0 import Auth0
99
100 client = Auth0(
101 token="YOUR_TOKEN",
102 )
103 client.self_service_profiles.sso_ticket.create(
104 id="id",
105 )
106 """
107 _response = self._raw_client.create(
108 id,
109 connection_id=connection_id,
110 connection_config=connection_config,
111 enabled_clients=enabled_clients,
112 enabled_organizations=enabled_organizations,
113 ttl_sec=ttl_sec,
114 domain_aliases_config=domain_aliases_config,
115 provisioning_config=provisioning_config,
116 use_for_organization_discovery=use_for_organization_discovery,
117 third_party_client_access_config=third_party_client_access_config,
118 enabled_features=enabled_features,
119 request_options=request_options,
120 )
121 return _response.data
122
123 def revoke(self, profile_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
124 """
125 Revokes a Self-Service Enterprise Configuration access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service Enterprise Configuration session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a `202 Accepted` response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a `202 Accepted` response is also returned, signaling that no further action is required.
126 Clients should treat these `202` responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found.
127
128 Parameters
129 ----------
130 profile_id : str
131 The id of the self-service profile
132
133 id : str
134 The id of the ticket to revoke
135
136 request_options : typing.Optional[RequestOptions]
137 Request-specific configuration.
138
139 Returns
140 -------
141 None
142
143 Examples
144 --------
145 from auth0 import Auth0
146
147 client = Auth0(
148 token="YOUR_TOKEN",
149 )
150 client.self_service_profiles.sso_ticket.revoke(
151 profile_id="profileId",
152 id="id",
153 )
154 """
155 _response = self._raw_client.revoke(profile_id, id, request_options=request_options)
156 return _response.data
157
158
159 class AsyncSsoTicketClient:
160 def __init__(self, *, client_wrapper: AsyncClientWrapper):
161 self._raw_client = AsyncRawSsoTicketClient(client_wrapper=client_wrapper)
162
163 @property
164 def with_raw_response(self) -> AsyncRawSsoTicketClient:
165 """
166 Retrieves a raw implementation of this client that returns raw responses.
167
168 Returns
169 -------
170 AsyncRawSsoTicketClient
171 """
172 return self._raw_client
173
174 async def create(
175 self,
176 id: str,
177 *,
178 connection_id: typing.Optional[str] = OMIT,
179 connection_config: typing.Optional[SelfServiceProfileSsoTicketConnectionConfig] = OMIT,
180 enabled_clients: typing.Optional[typing.Sequence[str]] = OMIT,
181 enabled_organizations: typing.Optional[typing.Sequence[SelfServiceProfileSsoTicketEnabledOrganization]] = OMIT,
182 ttl_sec: typing.Optional[int] = OMIT,
183 domain_aliases_config: typing.Optional[SelfServiceProfileSsoTicketDomainAliasesConfig] = OMIT,
184 provisioning_config: typing.Optional[SelfServiceProfileSsoTicketProvisioningConfig] = OMIT,
185 use_for_organization_discovery: typing.Optional[bool] = OMIT,
186 third_party_client_access_config: typing.Optional[ThirdPartyClientAccessConfig] = OMIT,
187 enabled_features: typing.Optional[SelfServiceProfileSsoTicketEnabledFeatures] = OMIT,
188 request_options: typing.Optional[RequestOptions] = None,
189 ) -> CreateSelfServiceProfileSsoTicketResponseContent:
190 """
191 Creates an access ticket to initiate the Self-Service Enterprise Configuration flow using a self-service profile.
192
193 Parameters
194 ----------
195 id : str
196 The id of the self-service profile to retrieve
197
198 connection_id : typing.Optional[str]
199 If provided, this will allow editing of the provided connection during the Self-Service Enterprise Configuration flow
200
201 connection_config : typing.Optional[SelfServiceProfileSsoTicketConnectionConfig]
202
203 enabled_clients : typing.Optional[typing.Sequence[str]]
204 List of client_ids that the connection will be enabled for.
205
206 enabled_organizations : typing.Optional[typing.Sequence[SelfServiceProfileSsoTicketEnabledOrganization]]
207 List of organizations that the connection will be enabled for.
208
209 ttl_sec : typing.Optional[int]
210 Number of seconds for which the ticket is valid before expiration. If unspecified or set to 0, this value defaults to 432000 seconds (5 days).
211
212 domain_aliases_config : typing.Optional[SelfServiceProfileSsoTicketDomainAliasesConfig]
213
214 provisioning_config : typing.Optional[SelfServiceProfileSsoTicketProvisioningConfig]
215
216 use_for_organization_discovery : typing.Optional[bool]
217 Indicates whether a verified domain should be used for organization discovery during authentication.
218
219 third_party_client_access_config : typing.Optional[ThirdPartyClientAccessConfig]
220
221 enabled_features : typing.Optional[SelfServiceProfileSsoTicketEnabledFeatures]
222
223 request_options : typing.Optional[RequestOptions]
224 Request-specific configuration.
225
226 Returns
227 -------
228 CreateSelfServiceProfileSsoTicketResponseContent
229 Self-Service Enterprise Configuration Access Ticket successfully created.
230
231 Examples
232 --------
233 import asyncio
234
235 from auth0 import AsyncAuth0
236
237 client = AsyncAuth0(
238 token="YOUR_TOKEN",
239 )
240
241
242 async def main() -> None:
243 await client.self_service_profiles.sso_ticket.create(
244 id="id",
245 )
246
247
248 asyncio.run(main())
249 """
250 _response = await self._raw_client.create(
251 id,
252 connection_id=connection_id,
253 connection_config=connection_config,
254 enabled_clients=enabled_clients,
255 enabled_organizations=enabled_organizations,
256 ttl_sec=ttl_sec,
257 domain_aliases_config=domain_aliases_config,
258 provisioning_config=provisioning_config,
259 use_for_organization_discovery=use_for_organization_discovery,
260 third_party_client_access_config=third_party_client_access_config,
261 enabled_features=enabled_features,
262 request_options=request_options,
263 )
264 return _response.data
265
266 async def revoke(
267 self, profile_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None
268 ) -> None:
269 """
270 Revokes a Self-Service Enterprise Configuration access ticket and invalidates associated sessions. The ticket will no longer be accepted to initiate a Self-Service Enterprise Configuration session. If any users have already started a session through this ticket, their session will be terminated. Clients should expect a `202 Accepted` response upon successful processing, indicating that the request has been acknowledged and that the revocation is underway but may not be fully completed at the time of response. If the specified ticket does not exist, a `202 Accepted` response is also returned, signaling that no further action is required.
271 Clients should treat these `202` responses as an acknowledgment that the request has been accepted and is in progress, even if the ticket was not found.
272
273 Parameters
274 ----------
275 profile_id : str
276 The id of the self-service profile
277
278 id : str
279 The id of the ticket to revoke
280
281 request_options : typing.Optional[RequestOptions]
282 Request-specific configuration.
283
284 Returns
285 -------
286 None
287
288 Examples
289 --------
290 import asyncio
291
292 from auth0 import AsyncAuth0
293
294 client = AsyncAuth0(
295 token="YOUR_TOKEN",
296 )
297
298
299 async def main() -> None:
300 await client.self_service_profiles.sso_ticket.revoke(
301 profile_id="profileId",
302 id="id",
303 )
304
305
306 asyncio.run(main())
307 """
308 _response = await self._raw_client.revoke(profile_id, id, request_options=request_options)
309 return _response.data