telnyx 3.1.0__py3-none-any.whl → 3.2.0__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.
Potentially problematic release.
This version of telnyx might be problematic. Click here for more details.
- telnyx/_client.py +32 -32
- telnyx/_version.py +1 -1
- telnyx/resources/__init__.py +24 -24
- telnyx/resources/advanced_orders.py +63 -63
- telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +3 -2
- telnyx/resources/legacy/reporting/batch_detail_records/voice.py +3 -2
- telnyx/resources/oauth.py +315 -317
- telnyx/resources/oauth_grants.py +15 -15
- telnyx/types/__init__.py +20 -13
- telnyx/types/addresses/action_validate_response.py +2 -2
- telnyx/types/{advanced_order_update_params.py → advanced_order_update_requirement_group_params.py} +2 -2
- telnyx/types/legacy/reporting/__init__.py +2 -0
- telnyx/types/legacy/reporting/batch_detail_records/__init__.py +3 -0
- telnyx/types/legacy/reporting/batch_detail_records/cdr_detailed_req_response.py +63 -0
- telnyx/types/legacy/reporting/batch_detail_records/mdr_detail_report_response.py +42 -0
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +4 -26
- telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +4 -60
- telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +4 -60
- telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +3 -59
- telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +4 -60
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +3 -22
- telnyx/types/legacy/reporting/batch_detail_records/stt_detail_report_response.py +27 -0
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +4 -26
- telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +4 -82
- telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +4 -82
- telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +3 -81
- telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +4 -82
- telnyx/types/legacy/reporting/filter.py +31 -0
- telnyx/types/legacy/reporting/filter_param.py +30 -0
- telnyx/types/legacy/reporting/usage_reports/__init__.py +2 -0
- telnyx/types/legacy/reporting/usage_reports/cdr_usage_report_response_legacy.py +43 -0
- telnyx/types/legacy/reporting/usage_reports/mdr_usage_report_response_legacy.py +38 -0
- telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +4 -34
- telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +4 -34
- telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +3 -33
- telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +4 -34
- telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +4 -39
- telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +4 -39
- telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +3 -38
- telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +4 -39
- telnyx/types/oauth_client.py +59 -0
- telnyx/types/oauth_client_create_response.py +4 -55
- telnyx/types/oauth_client_list_response.py +3 -54
- telnyx/types/oauth_client_retrieve_response.py +4 -55
- telnyx/types/oauth_client_update_response.py +4 -55
- telnyx/types/{oauth_grant_revoke_response.py → oauth_grant.py} +2 -6
- telnyx/types/oauth_grant_delete_response.py +12 -0
- telnyx/types/oauth_grant_list_response.py +3 -24
- telnyx/types/oauth_grant_retrieve_response.py +4 -25
- telnyx/types/{oauth_create_grant_params.py → oauth_grants_params.py} +2 -2
- telnyx/types/{oauth_create_grant_response.py → oauth_grants_response.py} +2 -2
- telnyx/types/{oauth_introspect_token_params.py → oauth_introspect_params.py} +2 -2
- telnyx/types/{oauth_introspect_token_response.py → oauth_introspect_response.py} +2 -2
- telnyx/types/{oauth_register_client_params.py → oauth_register_params.py} +2 -2
- telnyx/types/{oauth_register_client_response.py → oauth_register_response.py} +2 -2
- telnyx/types/{oauth_authorize_params.py → oauth_retrieve_authorize_params.py} +2 -2
- telnyx/types/{oauth_retrieve_consent_response.py → oauth_retrieve_response.py} +2 -2
- telnyx/types/{oauth_exchange_token_params.py → oauth_token_params.py} +2 -2
- telnyx/types/{oauth_exchange_token_response.py → oauth_token_response.py} +2 -2
- telnyx/types/shared/__init__.py +1 -0
- telnyx/types/{error.py → shared/api_error.py} +3 -3
- telnyx/types/verify_profile_create_template_response.py +3 -8
- telnyx/types/verify_profile_message_template_response.py +13 -0
- telnyx/types/verify_profile_retrieve_templates_response.py +4 -9
- telnyx/types/verify_profile_update_template_response.py +3 -8
- {telnyx-3.1.0.dist-info → telnyx-3.2.0.dist-info}/METADATA +1 -1
- {telnyx-3.1.0.dist-info → telnyx-3.2.0.dist-info}/RECORD +72 -62
- {telnyx-3.1.0.dist-info → telnyx-3.2.0.dist-info}/WHEEL +0 -0
- {telnyx-3.1.0.dist-info → telnyx-3.2.0.dist-info}/licenses/LICENSE +0 -0
telnyx/resources/oauth.py
CHANGED
|
@@ -8,11 +8,11 @@ from typing_extensions import Literal
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..types import (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
oauth_token_params,
|
|
12
|
+
oauth_grants_params,
|
|
13
|
+
oauth_register_params,
|
|
14
|
+
oauth_introspect_params,
|
|
15
|
+
oauth_retrieve_authorize_params,
|
|
16
16
|
)
|
|
17
17
|
from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
|
|
18
18
|
from .._utils import maybe_transform, async_maybe_transform
|
|
@@ -25,12 +25,12 @@ from .._response import (
|
|
|
25
25
|
async_to_streamed_response_wrapper,
|
|
26
26
|
)
|
|
27
27
|
from .._base_client import make_request_options
|
|
28
|
-
from ..types.
|
|
28
|
+
from ..types.oauth_token_response import OAuthTokenResponse
|
|
29
|
+
from ..types.oauth_grants_response import OAuthGrantsResponse
|
|
30
|
+
from ..types.oauth_register_response import OAuthRegisterResponse
|
|
31
|
+
from ..types.oauth_retrieve_response import OAuthRetrieveResponse
|
|
32
|
+
from ..types.oauth_introspect_response import OAuthIntrospectResponse
|
|
29
33
|
from ..types.oauth_retrieve_jwks_response import OAuthRetrieveJwksResponse
|
|
30
|
-
from ..types.oauth_exchange_token_response import OAuthExchangeTokenResponse
|
|
31
|
-
from ..types.oauth_register_client_response import OAuthRegisterClientResponse
|
|
32
|
-
from ..types.oauth_introspect_token_response import OAuthIntrospectTokenResponse
|
|
33
|
-
from ..types.oauth_retrieve_consent_response import OAuthRetrieveConsentResponse
|
|
34
34
|
|
|
35
35
|
__all__ = ["OAuthResource", "AsyncOAuthResource"]
|
|
36
36
|
|
|
@@ -55,41 +55,21 @@ class OAuthResource(SyncAPIResource):
|
|
|
55
55
|
"""
|
|
56
56
|
return OAuthResourceWithStreamingResponse(self)
|
|
57
57
|
|
|
58
|
-
def
|
|
58
|
+
def retrieve(
|
|
59
59
|
self,
|
|
60
|
+
consent_token: str,
|
|
60
61
|
*,
|
|
61
|
-
client_id: str,
|
|
62
|
-
redirect_uri: str,
|
|
63
|
-
response_type: Literal["code"],
|
|
64
|
-
code_challenge: str | Omit = omit,
|
|
65
|
-
code_challenge_method: Literal["plain", "S256"] | Omit = omit,
|
|
66
|
-
scope: str | Omit = omit,
|
|
67
|
-
state: str | Omit = omit,
|
|
68
62
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
69
63
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
70
64
|
extra_headers: Headers | None = None,
|
|
71
65
|
extra_query: Query | None = None,
|
|
72
66
|
extra_body: Body | None = None,
|
|
73
67
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
74
|
-
) ->
|
|
68
|
+
) -> OAuthRetrieveResponse:
|
|
75
69
|
"""
|
|
76
|
-
|
|
70
|
+
Retrieve details about an OAuth consent token
|
|
77
71
|
|
|
78
72
|
Args:
|
|
79
|
-
client_id: OAuth client identifier
|
|
80
|
-
|
|
81
|
-
redirect_uri: Redirect URI
|
|
82
|
-
|
|
83
|
-
response_type: OAuth response type
|
|
84
|
-
|
|
85
|
-
code_challenge: PKCE code challenge
|
|
86
|
-
|
|
87
|
-
code_challenge_method: PKCE code challenge method
|
|
88
|
-
|
|
89
|
-
scope: Space-separated list of requested scopes
|
|
90
|
-
|
|
91
|
-
state: State parameter for CSRF protection
|
|
92
|
-
|
|
93
73
|
extra_headers: Send extra headers
|
|
94
74
|
|
|
95
75
|
extra_query: Add additional query parameters to the request
|
|
@@ -98,31 +78,17 @@ class OAuthResource(SyncAPIResource):
|
|
|
98
78
|
|
|
99
79
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
100
80
|
"""
|
|
101
|
-
|
|
81
|
+
if not consent_token:
|
|
82
|
+
raise ValueError(f"Expected a non-empty value for `consent_token` but received {consent_token!r}")
|
|
102
83
|
return self._get(
|
|
103
|
-
"/oauth/
|
|
84
|
+
f"/oauth/consent/{consent_token}",
|
|
104
85
|
options=make_request_options(
|
|
105
|
-
extra_headers=extra_headers,
|
|
106
|
-
extra_query=extra_query,
|
|
107
|
-
extra_body=extra_body,
|
|
108
|
-
timeout=timeout,
|
|
109
|
-
query=maybe_transform(
|
|
110
|
-
{
|
|
111
|
-
"client_id": client_id,
|
|
112
|
-
"redirect_uri": redirect_uri,
|
|
113
|
-
"response_type": response_type,
|
|
114
|
-
"code_challenge": code_challenge,
|
|
115
|
-
"code_challenge_method": code_challenge_method,
|
|
116
|
-
"scope": scope,
|
|
117
|
-
"state": state,
|
|
118
|
-
},
|
|
119
|
-
oauth_authorize_params.OAuthAuthorizeParams,
|
|
120
|
-
),
|
|
86
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
121
87
|
),
|
|
122
|
-
cast_to=
|
|
88
|
+
cast_to=OAuthRetrieveResponse,
|
|
123
89
|
)
|
|
124
90
|
|
|
125
|
-
def
|
|
91
|
+
def grants(
|
|
126
92
|
self,
|
|
127
93
|
*,
|
|
128
94
|
allowed: bool,
|
|
@@ -133,7 +99,7 @@ class OAuthResource(SyncAPIResource):
|
|
|
133
99
|
extra_query: Query | None = None,
|
|
134
100
|
extra_body: Body | None = None,
|
|
135
101
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
136
|
-
) ->
|
|
102
|
+
) -> OAuthGrantsResponse:
|
|
137
103
|
"""
|
|
138
104
|
Create an OAuth authorization grant
|
|
139
105
|
|
|
@@ -157,83 +123,15 @@ class OAuthResource(SyncAPIResource):
|
|
|
157
123
|
"allowed": allowed,
|
|
158
124
|
"consent_token": consent_token,
|
|
159
125
|
},
|
|
160
|
-
|
|
161
|
-
),
|
|
162
|
-
options=make_request_options(
|
|
163
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
164
|
-
),
|
|
165
|
-
cast_to=OAuthCreateGrantResponse,
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
def exchange_token(
|
|
169
|
-
self,
|
|
170
|
-
*,
|
|
171
|
-
grant_type: Literal["client_credentials", "authorization_code", "refresh_token"],
|
|
172
|
-
client_id: str | Omit = omit,
|
|
173
|
-
client_secret: str | Omit = omit,
|
|
174
|
-
code: str | Omit = omit,
|
|
175
|
-
code_verifier: str | Omit = omit,
|
|
176
|
-
redirect_uri: str | Omit = omit,
|
|
177
|
-
refresh_token: str | Omit = omit,
|
|
178
|
-
scope: str | Omit = omit,
|
|
179
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
180
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
181
|
-
extra_headers: Headers | None = None,
|
|
182
|
-
extra_query: Query | None = None,
|
|
183
|
-
extra_body: Body | None = None,
|
|
184
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
185
|
-
) -> OAuthExchangeTokenResponse:
|
|
186
|
-
"""
|
|
187
|
-
Exchange authorization code, client credentials, or refresh token for access
|
|
188
|
-
token
|
|
189
|
-
|
|
190
|
-
Args:
|
|
191
|
-
grant_type: OAuth 2.0 grant type
|
|
192
|
-
|
|
193
|
-
client_id: OAuth client ID (if not using HTTP Basic auth)
|
|
194
|
-
|
|
195
|
-
client_secret: OAuth client secret (if not using HTTP Basic auth)
|
|
196
|
-
|
|
197
|
-
code: Authorization code (for authorization_code flow)
|
|
198
|
-
|
|
199
|
-
code_verifier: PKCE code verifier (for authorization_code flow)
|
|
200
|
-
|
|
201
|
-
redirect_uri: Redirect URI (for authorization_code flow)
|
|
202
|
-
|
|
203
|
-
refresh_token: Refresh token (for refresh_token flow)
|
|
204
|
-
|
|
205
|
-
scope: Space-separated list of requested scopes (for client_credentials)
|
|
206
|
-
|
|
207
|
-
extra_headers: Send extra headers
|
|
208
|
-
|
|
209
|
-
extra_query: Add additional query parameters to the request
|
|
210
|
-
|
|
211
|
-
extra_body: Add additional JSON properties to the request
|
|
212
|
-
|
|
213
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
214
|
-
"""
|
|
215
|
-
return self._post(
|
|
216
|
-
"/oauth/token",
|
|
217
|
-
body=maybe_transform(
|
|
218
|
-
{
|
|
219
|
-
"grant_type": grant_type,
|
|
220
|
-
"client_id": client_id,
|
|
221
|
-
"client_secret": client_secret,
|
|
222
|
-
"code": code,
|
|
223
|
-
"code_verifier": code_verifier,
|
|
224
|
-
"redirect_uri": redirect_uri,
|
|
225
|
-
"refresh_token": refresh_token,
|
|
226
|
-
"scope": scope,
|
|
227
|
-
},
|
|
228
|
-
oauth_exchange_token_params.OAuthExchangeTokenParams,
|
|
126
|
+
oauth_grants_params.OAuthGrantsParams,
|
|
229
127
|
),
|
|
230
128
|
options=make_request_options(
|
|
231
129
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
232
130
|
),
|
|
233
|
-
cast_to=
|
|
131
|
+
cast_to=OAuthGrantsResponse,
|
|
234
132
|
)
|
|
235
133
|
|
|
236
|
-
def
|
|
134
|
+
def introspect(
|
|
237
135
|
self,
|
|
238
136
|
*,
|
|
239
137
|
token: str,
|
|
@@ -243,7 +141,7 @@ class OAuthResource(SyncAPIResource):
|
|
|
243
141
|
extra_query: Query | None = None,
|
|
244
142
|
extra_body: Body | None = None,
|
|
245
143
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
246
|
-
) ->
|
|
144
|
+
) -> OAuthIntrospectResponse:
|
|
247
145
|
"""
|
|
248
146
|
Introspect an OAuth access token to check its validity and metadata
|
|
249
147
|
|
|
@@ -260,14 +158,14 @@ class OAuthResource(SyncAPIResource):
|
|
|
260
158
|
"""
|
|
261
159
|
return self._post(
|
|
262
160
|
"/oauth/introspect",
|
|
263
|
-
body=maybe_transform({"token": token},
|
|
161
|
+
body=maybe_transform({"token": token}, oauth_introspect_params.OAuthIntrospectParams),
|
|
264
162
|
options=make_request_options(
|
|
265
163
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
266
164
|
),
|
|
267
|
-
cast_to=
|
|
165
|
+
cast_to=OAuthIntrospectResponse,
|
|
268
166
|
)
|
|
269
167
|
|
|
270
|
-
def
|
|
168
|
+
def register(
|
|
271
169
|
self,
|
|
272
170
|
*,
|
|
273
171
|
client_name: str | Omit = omit,
|
|
@@ -285,7 +183,7 @@ class OAuthResource(SyncAPIResource):
|
|
|
285
183
|
extra_query: Query | None = None,
|
|
286
184
|
extra_body: Body | None = None,
|
|
287
185
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
288
|
-
) ->
|
|
186
|
+
) -> OAuthRegisterResponse:
|
|
289
187
|
"""
|
|
290
188
|
Register a new OAuth client dynamically (RFC 7591)
|
|
291
189
|
|
|
@@ -330,88 +228,15 @@ class OAuthResource(SyncAPIResource):
|
|
|
330
228
|
"token_endpoint_auth_method": token_endpoint_auth_method,
|
|
331
229
|
"tos_uri": tos_uri,
|
|
332
230
|
},
|
|
333
|
-
|
|
334
|
-
),
|
|
335
|
-
options=make_request_options(
|
|
336
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
337
|
-
),
|
|
338
|
-
cast_to=OAuthRegisterClientResponse,
|
|
339
|
-
)
|
|
340
|
-
|
|
341
|
-
def retrieve_consent(
|
|
342
|
-
self,
|
|
343
|
-
consent_token: str,
|
|
344
|
-
*,
|
|
345
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
346
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
347
|
-
extra_headers: Headers | None = None,
|
|
348
|
-
extra_query: Query | None = None,
|
|
349
|
-
extra_body: Body | None = None,
|
|
350
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
351
|
-
) -> OAuthRetrieveConsentResponse:
|
|
352
|
-
"""
|
|
353
|
-
Retrieve details about an OAuth consent token
|
|
354
|
-
|
|
355
|
-
Args:
|
|
356
|
-
extra_headers: Send extra headers
|
|
357
|
-
|
|
358
|
-
extra_query: Add additional query parameters to the request
|
|
359
|
-
|
|
360
|
-
extra_body: Add additional JSON properties to the request
|
|
361
|
-
|
|
362
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
363
|
-
"""
|
|
364
|
-
if not consent_token:
|
|
365
|
-
raise ValueError(f"Expected a non-empty value for `consent_token` but received {consent_token!r}")
|
|
366
|
-
return self._get(
|
|
367
|
-
f"/oauth/consent/{consent_token}",
|
|
368
|
-
options=make_request_options(
|
|
369
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
231
|
+
oauth_register_params.OAuthRegisterParams,
|
|
370
232
|
),
|
|
371
|
-
cast_to=OAuthRetrieveConsentResponse,
|
|
372
|
-
)
|
|
373
|
-
|
|
374
|
-
def retrieve_jwks(
|
|
375
|
-
self,
|
|
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
|
-
) -> OAuthRetrieveJwksResponse:
|
|
384
|
-
"""Retrieve the JSON Web Key Set for token verification"""
|
|
385
|
-
return self._get(
|
|
386
|
-
"/oauth/jwks",
|
|
387
233
|
options=make_request_options(
|
|
388
234
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
389
235
|
),
|
|
390
|
-
cast_to=
|
|
236
|
+
cast_to=OAuthRegisterResponse,
|
|
391
237
|
)
|
|
392
238
|
|
|
393
|
-
|
|
394
|
-
class AsyncOAuthResource(AsyncAPIResource):
|
|
395
|
-
@cached_property
|
|
396
|
-
def with_raw_response(self) -> AsyncOAuthResourceWithRawResponse:
|
|
397
|
-
"""
|
|
398
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
399
|
-
the raw response object instead of the parsed content.
|
|
400
|
-
|
|
401
|
-
For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
|
|
402
|
-
"""
|
|
403
|
-
return AsyncOAuthResourceWithRawResponse(self)
|
|
404
|
-
|
|
405
|
-
@cached_property
|
|
406
|
-
def with_streaming_response(self) -> AsyncOAuthResourceWithStreamingResponse:
|
|
407
|
-
"""
|
|
408
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
409
|
-
|
|
410
|
-
For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
|
|
411
|
-
"""
|
|
412
|
-
return AsyncOAuthResourceWithStreamingResponse(self)
|
|
413
|
-
|
|
414
|
-
async def authorize(
|
|
239
|
+
def retrieve_authorize(
|
|
415
240
|
self,
|
|
416
241
|
*,
|
|
417
242
|
client_id: str,
|
|
@@ -455,14 +280,14 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
455
280
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
456
281
|
"""
|
|
457
282
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
458
|
-
return
|
|
283
|
+
return self._get(
|
|
459
284
|
"/oauth/authorize",
|
|
460
285
|
options=make_request_options(
|
|
461
286
|
extra_headers=extra_headers,
|
|
462
287
|
extra_query=extra_query,
|
|
463
288
|
extra_body=extra_body,
|
|
464
289
|
timeout=timeout,
|
|
465
|
-
query=
|
|
290
|
+
query=maybe_transform(
|
|
466
291
|
{
|
|
467
292
|
"client_id": client_id,
|
|
468
293
|
"redirect_uri": redirect_uri,
|
|
@@ -472,56 +297,32 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
472
297
|
"scope": scope,
|
|
473
298
|
"state": state,
|
|
474
299
|
},
|
|
475
|
-
|
|
300
|
+
oauth_retrieve_authorize_params.OAuthRetrieveAuthorizeParams,
|
|
476
301
|
),
|
|
477
302
|
),
|
|
478
303
|
cast_to=NoneType,
|
|
479
304
|
)
|
|
480
305
|
|
|
481
|
-
|
|
306
|
+
def retrieve_jwks(
|
|
482
307
|
self,
|
|
483
308
|
*,
|
|
484
|
-
allowed: bool,
|
|
485
|
-
consent_token: str,
|
|
486
309
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
487
310
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
488
311
|
extra_headers: Headers | None = None,
|
|
489
312
|
extra_query: Query | None = None,
|
|
490
313
|
extra_body: Body | None = None,
|
|
491
314
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
492
|
-
) ->
|
|
493
|
-
"""
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
Args:
|
|
497
|
-
allowed: Whether the grant is allowed
|
|
498
|
-
|
|
499
|
-
consent_token: Consent token
|
|
500
|
-
|
|
501
|
-
extra_headers: Send extra headers
|
|
502
|
-
|
|
503
|
-
extra_query: Add additional query parameters to the request
|
|
504
|
-
|
|
505
|
-
extra_body: Add additional JSON properties to the request
|
|
506
|
-
|
|
507
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
508
|
-
"""
|
|
509
|
-
return await self._post(
|
|
510
|
-
"/oauth/grants",
|
|
511
|
-
body=await async_maybe_transform(
|
|
512
|
-
{
|
|
513
|
-
"allowed": allowed,
|
|
514
|
-
"consent_token": consent_token,
|
|
515
|
-
},
|
|
516
|
-
oauth_create_grant_params.OAuthCreateGrantParams,
|
|
517
|
-
),
|
|
315
|
+
) -> OAuthRetrieveJwksResponse:
|
|
316
|
+
"""Retrieve the JSON Web Key Set for token verification"""
|
|
317
|
+
return self._get(
|
|
318
|
+
"/oauth/jwks",
|
|
518
319
|
options=make_request_options(
|
|
519
320
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
520
321
|
),
|
|
521
|
-
cast_to=
|
|
322
|
+
cast_to=OAuthRetrieveJwksResponse,
|
|
522
323
|
)
|
|
523
324
|
|
|
524
|
-
|
|
325
|
+
def token(
|
|
525
326
|
self,
|
|
526
327
|
*,
|
|
527
328
|
grant_type: Literal["client_credentials", "authorization_code", "refresh_token"],
|
|
@@ -538,7 +339,7 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
538
339
|
extra_query: Query | None = None,
|
|
539
340
|
extra_body: Body | None = None,
|
|
540
341
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
541
|
-
) ->
|
|
342
|
+
) -> OAuthTokenResponse:
|
|
542
343
|
"""
|
|
543
344
|
Exchange authorization code, client credentials, or refresh token for access
|
|
544
345
|
token
|
|
@@ -568,9 +369,9 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
568
369
|
|
|
569
370
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
570
371
|
"""
|
|
571
|
-
return
|
|
372
|
+
return self._post(
|
|
572
373
|
"/oauth/token",
|
|
573
|
-
body=
|
|
374
|
+
body=maybe_transform(
|
|
574
375
|
{
|
|
575
376
|
"grant_type": grant_type,
|
|
576
377
|
"client_id": client_id,
|
|
@@ -581,15 +382,112 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
581
382
|
"refresh_token": refresh_token,
|
|
582
383
|
"scope": scope,
|
|
583
384
|
},
|
|
584
|
-
|
|
385
|
+
oauth_token_params.OAuthTokenParams,
|
|
386
|
+
),
|
|
387
|
+
options=make_request_options(
|
|
388
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
389
|
+
),
|
|
390
|
+
cast_to=OAuthTokenResponse,
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
class AsyncOAuthResource(AsyncAPIResource):
|
|
395
|
+
@cached_property
|
|
396
|
+
def with_raw_response(self) -> AsyncOAuthResourceWithRawResponse:
|
|
397
|
+
"""
|
|
398
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
399
|
+
the raw response object instead of the parsed content.
|
|
400
|
+
|
|
401
|
+
For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
|
|
402
|
+
"""
|
|
403
|
+
return AsyncOAuthResourceWithRawResponse(self)
|
|
404
|
+
|
|
405
|
+
@cached_property
|
|
406
|
+
def with_streaming_response(self) -> AsyncOAuthResourceWithStreamingResponse:
|
|
407
|
+
"""
|
|
408
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
409
|
+
|
|
410
|
+
For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
|
|
411
|
+
"""
|
|
412
|
+
return AsyncOAuthResourceWithStreamingResponse(self)
|
|
413
|
+
|
|
414
|
+
async def retrieve(
|
|
415
|
+
self,
|
|
416
|
+
consent_token: str,
|
|
417
|
+
*,
|
|
418
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
419
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
420
|
+
extra_headers: Headers | None = None,
|
|
421
|
+
extra_query: Query | None = None,
|
|
422
|
+
extra_body: Body | None = None,
|
|
423
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
424
|
+
) -> OAuthRetrieveResponse:
|
|
425
|
+
"""
|
|
426
|
+
Retrieve details about an OAuth consent token
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
extra_headers: Send extra headers
|
|
430
|
+
|
|
431
|
+
extra_query: Add additional query parameters to the request
|
|
432
|
+
|
|
433
|
+
extra_body: Add additional JSON properties to the request
|
|
434
|
+
|
|
435
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
436
|
+
"""
|
|
437
|
+
if not consent_token:
|
|
438
|
+
raise ValueError(f"Expected a non-empty value for `consent_token` but received {consent_token!r}")
|
|
439
|
+
return await self._get(
|
|
440
|
+
f"/oauth/consent/{consent_token}",
|
|
441
|
+
options=make_request_options(
|
|
442
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
443
|
+
),
|
|
444
|
+
cast_to=OAuthRetrieveResponse,
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
async def grants(
|
|
448
|
+
self,
|
|
449
|
+
*,
|
|
450
|
+
allowed: bool,
|
|
451
|
+
consent_token: str,
|
|
452
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
453
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
454
|
+
extra_headers: Headers | None = None,
|
|
455
|
+
extra_query: Query | None = None,
|
|
456
|
+
extra_body: Body | None = None,
|
|
457
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
458
|
+
) -> OAuthGrantsResponse:
|
|
459
|
+
"""
|
|
460
|
+
Create an OAuth authorization grant
|
|
461
|
+
|
|
462
|
+
Args:
|
|
463
|
+
allowed: Whether the grant is allowed
|
|
464
|
+
|
|
465
|
+
consent_token: Consent token
|
|
466
|
+
|
|
467
|
+
extra_headers: Send extra headers
|
|
468
|
+
|
|
469
|
+
extra_query: Add additional query parameters to the request
|
|
470
|
+
|
|
471
|
+
extra_body: Add additional JSON properties to the request
|
|
472
|
+
|
|
473
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
474
|
+
"""
|
|
475
|
+
return await self._post(
|
|
476
|
+
"/oauth/grants",
|
|
477
|
+
body=await async_maybe_transform(
|
|
478
|
+
{
|
|
479
|
+
"allowed": allowed,
|
|
480
|
+
"consent_token": consent_token,
|
|
481
|
+
},
|
|
482
|
+
oauth_grants_params.OAuthGrantsParams,
|
|
585
483
|
),
|
|
586
484
|
options=make_request_options(
|
|
587
485
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
588
486
|
),
|
|
589
|
-
cast_to=
|
|
487
|
+
cast_to=OAuthGrantsResponse,
|
|
590
488
|
)
|
|
591
489
|
|
|
592
|
-
async def
|
|
490
|
+
async def introspect(
|
|
593
491
|
self,
|
|
594
492
|
*,
|
|
595
493
|
token: str,
|
|
@@ -599,7 +497,7 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
599
497
|
extra_query: Query | None = None,
|
|
600
498
|
extra_body: Body | None = None,
|
|
601
499
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
602
|
-
) ->
|
|
500
|
+
) -> OAuthIntrospectResponse:
|
|
603
501
|
"""
|
|
604
502
|
Introspect an OAuth access token to check its validity and metadata
|
|
605
503
|
|
|
@@ -616,16 +514,14 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
616
514
|
"""
|
|
617
515
|
return await self._post(
|
|
618
516
|
"/oauth/introspect",
|
|
619
|
-
body=await async_maybe_transform(
|
|
620
|
-
{"token": token}, oauth_introspect_token_params.OAuthIntrospectTokenParams
|
|
621
|
-
),
|
|
517
|
+
body=await async_maybe_transform({"token": token}, oauth_introspect_params.OAuthIntrospectParams),
|
|
622
518
|
options=make_request_options(
|
|
623
519
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
624
520
|
),
|
|
625
|
-
cast_to=
|
|
521
|
+
cast_to=OAuthIntrospectResponse,
|
|
626
522
|
)
|
|
627
523
|
|
|
628
|
-
async def
|
|
524
|
+
async def register(
|
|
629
525
|
self,
|
|
630
526
|
*,
|
|
631
527
|
client_name: str | Omit = omit,
|
|
@@ -643,7 +539,7 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
643
539
|
extra_query: Query | None = None,
|
|
644
540
|
extra_body: Body | None = None,
|
|
645
541
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
646
|
-
) ->
|
|
542
|
+
) -> OAuthRegisterResponse:
|
|
647
543
|
"""
|
|
648
544
|
Register a new OAuth client dynamically (RFC 7591)
|
|
649
545
|
|
|
@@ -688,29 +584,49 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
688
584
|
"token_endpoint_auth_method": token_endpoint_auth_method,
|
|
689
585
|
"tos_uri": tos_uri,
|
|
690
586
|
},
|
|
691
|
-
|
|
587
|
+
oauth_register_params.OAuthRegisterParams,
|
|
692
588
|
),
|
|
693
589
|
options=make_request_options(
|
|
694
590
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
695
591
|
),
|
|
696
|
-
cast_to=
|
|
592
|
+
cast_to=OAuthRegisterResponse,
|
|
697
593
|
)
|
|
698
594
|
|
|
699
|
-
async def
|
|
595
|
+
async def retrieve_authorize(
|
|
700
596
|
self,
|
|
701
|
-
consent_token: str,
|
|
702
597
|
*,
|
|
598
|
+
client_id: str,
|
|
599
|
+
redirect_uri: str,
|
|
600
|
+
response_type: Literal["code"],
|
|
601
|
+
code_challenge: str | Omit = omit,
|
|
602
|
+
code_challenge_method: Literal["plain", "S256"] | Omit = omit,
|
|
603
|
+
scope: str | Omit = omit,
|
|
604
|
+
state: str | Omit = omit,
|
|
703
605
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
704
606
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
705
607
|
extra_headers: Headers | None = None,
|
|
706
608
|
extra_query: Query | None = None,
|
|
707
609
|
extra_body: Body | None = None,
|
|
708
610
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
709
|
-
) ->
|
|
611
|
+
) -> None:
|
|
710
612
|
"""
|
|
711
|
-
|
|
613
|
+
OAuth 2.0 authorization endpoint for the authorization code flow
|
|
712
614
|
|
|
713
615
|
Args:
|
|
616
|
+
client_id: OAuth client identifier
|
|
617
|
+
|
|
618
|
+
redirect_uri: Redirect URI
|
|
619
|
+
|
|
620
|
+
response_type: OAuth response type
|
|
621
|
+
|
|
622
|
+
code_challenge: PKCE code challenge
|
|
623
|
+
|
|
624
|
+
code_challenge_method: PKCE code challenge method
|
|
625
|
+
|
|
626
|
+
scope: Space-separated list of requested scopes
|
|
627
|
+
|
|
628
|
+
state: State parameter for CSRF protection
|
|
629
|
+
|
|
714
630
|
extra_headers: Send extra headers
|
|
715
631
|
|
|
716
632
|
extra_query: Add additional query parameters to the request
|
|
@@ -719,14 +635,28 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
719
635
|
|
|
720
636
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
721
637
|
"""
|
|
722
|
-
|
|
723
|
-
raise ValueError(f"Expected a non-empty value for `consent_token` but received {consent_token!r}")
|
|
638
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
724
639
|
return await self._get(
|
|
725
|
-
|
|
640
|
+
"/oauth/authorize",
|
|
726
641
|
options=make_request_options(
|
|
727
|
-
extra_headers=extra_headers,
|
|
642
|
+
extra_headers=extra_headers,
|
|
643
|
+
extra_query=extra_query,
|
|
644
|
+
extra_body=extra_body,
|
|
645
|
+
timeout=timeout,
|
|
646
|
+
query=await async_maybe_transform(
|
|
647
|
+
{
|
|
648
|
+
"client_id": client_id,
|
|
649
|
+
"redirect_uri": redirect_uri,
|
|
650
|
+
"response_type": response_type,
|
|
651
|
+
"code_challenge": code_challenge,
|
|
652
|
+
"code_challenge_method": code_challenge_method,
|
|
653
|
+
"scope": scope,
|
|
654
|
+
"state": state,
|
|
655
|
+
},
|
|
656
|
+
oauth_retrieve_authorize_params.OAuthRetrieveAuthorizeParams,
|
|
657
|
+
),
|
|
728
658
|
),
|
|
729
|
-
cast_to=
|
|
659
|
+
cast_to=NoneType,
|
|
730
660
|
)
|
|
731
661
|
|
|
732
662
|
async def retrieve_jwks(
|
|
@@ -748,110 +678,178 @@ class AsyncOAuthResource(AsyncAPIResource):
|
|
|
748
678
|
cast_to=OAuthRetrieveJwksResponse,
|
|
749
679
|
)
|
|
750
680
|
|
|
681
|
+
async def token(
|
|
682
|
+
self,
|
|
683
|
+
*,
|
|
684
|
+
grant_type: Literal["client_credentials", "authorization_code", "refresh_token"],
|
|
685
|
+
client_id: str | Omit = omit,
|
|
686
|
+
client_secret: str | Omit = omit,
|
|
687
|
+
code: str | Omit = omit,
|
|
688
|
+
code_verifier: str | Omit = omit,
|
|
689
|
+
redirect_uri: str | Omit = omit,
|
|
690
|
+
refresh_token: str | Omit = omit,
|
|
691
|
+
scope: str | Omit = omit,
|
|
692
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
693
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
694
|
+
extra_headers: Headers | None = None,
|
|
695
|
+
extra_query: Query | None = None,
|
|
696
|
+
extra_body: Body | None = None,
|
|
697
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
698
|
+
) -> OAuthTokenResponse:
|
|
699
|
+
"""
|
|
700
|
+
Exchange authorization code, client credentials, or refresh token for access
|
|
701
|
+
token
|
|
702
|
+
|
|
703
|
+
Args:
|
|
704
|
+
grant_type: OAuth 2.0 grant type
|
|
705
|
+
|
|
706
|
+
client_id: OAuth client ID (if not using HTTP Basic auth)
|
|
707
|
+
|
|
708
|
+
client_secret: OAuth client secret (if not using HTTP Basic auth)
|
|
709
|
+
|
|
710
|
+
code: Authorization code (for authorization_code flow)
|
|
711
|
+
|
|
712
|
+
code_verifier: PKCE code verifier (for authorization_code flow)
|
|
713
|
+
|
|
714
|
+
redirect_uri: Redirect URI (for authorization_code flow)
|
|
715
|
+
|
|
716
|
+
refresh_token: Refresh token (for refresh_token flow)
|
|
717
|
+
|
|
718
|
+
scope: Space-separated list of requested scopes (for client_credentials)
|
|
719
|
+
|
|
720
|
+
extra_headers: Send extra headers
|
|
721
|
+
|
|
722
|
+
extra_query: Add additional query parameters to the request
|
|
723
|
+
|
|
724
|
+
extra_body: Add additional JSON properties to the request
|
|
725
|
+
|
|
726
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
727
|
+
"""
|
|
728
|
+
return await self._post(
|
|
729
|
+
"/oauth/token",
|
|
730
|
+
body=await async_maybe_transform(
|
|
731
|
+
{
|
|
732
|
+
"grant_type": grant_type,
|
|
733
|
+
"client_id": client_id,
|
|
734
|
+
"client_secret": client_secret,
|
|
735
|
+
"code": code,
|
|
736
|
+
"code_verifier": code_verifier,
|
|
737
|
+
"redirect_uri": redirect_uri,
|
|
738
|
+
"refresh_token": refresh_token,
|
|
739
|
+
"scope": scope,
|
|
740
|
+
},
|
|
741
|
+
oauth_token_params.OAuthTokenParams,
|
|
742
|
+
),
|
|
743
|
+
options=make_request_options(
|
|
744
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
745
|
+
),
|
|
746
|
+
cast_to=OAuthTokenResponse,
|
|
747
|
+
)
|
|
748
|
+
|
|
751
749
|
|
|
752
750
|
class OAuthResourceWithRawResponse:
|
|
753
751
|
def __init__(self, oauth: OAuthResource) -> None:
|
|
754
752
|
self._oauth = oauth
|
|
755
753
|
|
|
756
|
-
self.
|
|
757
|
-
oauth.
|
|
758
|
-
)
|
|
759
|
-
self.create_grant = to_raw_response_wrapper(
|
|
760
|
-
oauth.create_grant,
|
|
754
|
+
self.retrieve = to_raw_response_wrapper(
|
|
755
|
+
oauth.retrieve,
|
|
761
756
|
)
|
|
762
|
-
self.
|
|
763
|
-
oauth.
|
|
757
|
+
self.grants = to_raw_response_wrapper(
|
|
758
|
+
oauth.grants,
|
|
764
759
|
)
|
|
765
|
-
self.
|
|
766
|
-
oauth.
|
|
760
|
+
self.introspect = to_raw_response_wrapper(
|
|
761
|
+
oauth.introspect,
|
|
767
762
|
)
|
|
768
|
-
self.
|
|
769
|
-
oauth.
|
|
763
|
+
self.register = to_raw_response_wrapper(
|
|
764
|
+
oauth.register,
|
|
770
765
|
)
|
|
771
|
-
self.
|
|
772
|
-
oauth.
|
|
766
|
+
self.retrieve_authorize = to_raw_response_wrapper(
|
|
767
|
+
oauth.retrieve_authorize,
|
|
773
768
|
)
|
|
774
769
|
self.retrieve_jwks = to_raw_response_wrapper(
|
|
775
770
|
oauth.retrieve_jwks,
|
|
776
771
|
)
|
|
772
|
+
self.token = to_raw_response_wrapper(
|
|
773
|
+
oauth.token,
|
|
774
|
+
)
|
|
777
775
|
|
|
778
776
|
|
|
779
777
|
class AsyncOAuthResourceWithRawResponse:
|
|
780
778
|
def __init__(self, oauth: AsyncOAuthResource) -> None:
|
|
781
779
|
self._oauth = oauth
|
|
782
780
|
|
|
783
|
-
self.
|
|
784
|
-
oauth.
|
|
781
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
782
|
+
oauth.retrieve,
|
|
785
783
|
)
|
|
786
|
-
self.
|
|
787
|
-
oauth.
|
|
784
|
+
self.grants = async_to_raw_response_wrapper(
|
|
785
|
+
oauth.grants,
|
|
788
786
|
)
|
|
789
|
-
self.
|
|
790
|
-
oauth.
|
|
787
|
+
self.introspect = async_to_raw_response_wrapper(
|
|
788
|
+
oauth.introspect,
|
|
791
789
|
)
|
|
792
|
-
self.
|
|
793
|
-
oauth.
|
|
790
|
+
self.register = async_to_raw_response_wrapper(
|
|
791
|
+
oauth.register,
|
|
794
792
|
)
|
|
795
|
-
self.
|
|
796
|
-
oauth.
|
|
797
|
-
)
|
|
798
|
-
self.retrieve_consent = async_to_raw_response_wrapper(
|
|
799
|
-
oauth.retrieve_consent,
|
|
793
|
+
self.retrieve_authorize = async_to_raw_response_wrapper(
|
|
794
|
+
oauth.retrieve_authorize,
|
|
800
795
|
)
|
|
801
796
|
self.retrieve_jwks = async_to_raw_response_wrapper(
|
|
802
797
|
oauth.retrieve_jwks,
|
|
803
798
|
)
|
|
799
|
+
self.token = async_to_raw_response_wrapper(
|
|
800
|
+
oauth.token,
|
|
801
|
+
)
|
|
804
802
|
|
|
805
803
|
|
|
806
804
|
class OAuthResourceWithStreamingResponse:
|
|
807
805
|
def __init__(self, oauth: OAuthResource) -> None:
|
|
808
806
|
self._oauth = oauth
|
|
809
807
|
|
|
810
|
-
self.
|
|
811
|
-
oauth.
|
|
812
|
-
)
|
|
813
|
-
self.create_grant = to_streamed_response_wrapper(
|
|
814
|
-
oauth.create_grant,
|
|
808
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
809
|
+
oauth.retrieve,
|
|
815
810
|
)
|
|
816
|
-
self.
|
|
817
|
-
oauth.
|
|
811
|
+
self.grants = to_streamed_response_wrapper(
|
|
812
|
+
oauth.grants,
|
|
818
813
|
)
|
|
819
|
-
self.
|
|
820
|
-
oauth.
|
|
814
|
+
self.introspect = to_streamed_response_wrapper(
|
|
815
|
+
oauth.introspect,
|
|
821
816
|
)
|
|
822
|
-
self.
|
|
823
|
-
oauth.
|
|
817
|
+
self.register = to_streamed_response_wrapper(
|
|
818
|
+
oauth.register,
|
|
824
819
|
)
|
|
825
|
-
self.
|
|
826
|
-
oauth.
|
|
820
|
+
self.retrieve_authorize = to_streamed_response_wrapper(
|
|
821
|
+
oauth.retrieve_authorize,
|
|
827
822
|
)
|
|
828
823
|
self.retrieve_jwks = to_streamed_response_wrapper(
|
|
829
824
|
oauth.retrieve_jwks,
|
|
830
825
|
)
|
|
826
|
+
self.token = to_streamed_response_wrapper(
|
|
827
|
+
oauth.token,
|
|
828
|
+
)
|
|
831
829
|
|
|
832
830
|
|
|
833
831
|
class AsyncOAuthResourceWithStreamingResponse:
|
|
834
832
|
def __init__(self, oauth: AsyncOAuthResource) -> None:
|
|
835
833
|
self._oauth = oauth
|
|
836
834
|
|
|
837
|
-
self.
|
|
838
|
-
oauth.
|
|
839
|
-
)
|
|
840
|
-
self.create_grant = async_to_streamed_response_wrapper(
|
|
841
|
-
oauth.create_grant,
|
|
835
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
836
|
+
oauth.retrieve,
|
|
842
837
|
)
|
|
843
|
-
self.
|
|
844
|
-
oauth.
|
|
838
|
+
self.grants = async_to_streamed_response_wrapper(
|
|
839
|
+
oauth.grants,
|
|
845
840
|
)
|
|
846
|
-
self.
|
|
847
|
-
oauth.
|
|
841
|
+
self.introspect = async_to_streamed_response_wrapper(
|
|
842
|
+
oauth.introspect,
|
|
848
843
|
)
|
|
849
|
-
self.
|
|
850
|
-
oauth.
|
|
844
|
+
self.register = async_to_streamed_response_wrapper(
|
|
845
|
+
oauth.register,
|
|
851
846
|
)
|
|
852
|
-
self.
|
|
853
|
-
oauth.
|
|
847
|
+
self.retrieve_authorize = async_to_streamed_response_wrapper(
|
|
848
|
+
oauth.retrieve_authorize,
|
|
854
849
|
)
|
|
855
850
|
self.retrieve_jwks = async_to_streamed_response_wrapper(
|
|
856
851
|
oauth.retrieve_jwks,
|
|
857
852
|
)
|
|
853
|
+
self.token = async_to_streamed_response_wrapper(
|
|
854
|
+
oauth.token,
|
|
855
|
+
)
|