telnyx 3.5.0a0__py3-none-any.whl → 3.7.0a0__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.

Files changed (130) hide show
  1. telnyx/_client.py +53 -2
  2. telnyx/_version.py +1 -1
  3. telnyx/resources/__init__.py +70 -0
  4. telnyx/resources/ai/conversations/conversations.py +137 -3
  5. telnyx/resources/ai/conversations/messages.py +1 -134
  6. telnyx/resources/calls/actions.py +146 -146
  7. telnyx/resources/calls/calls.py +4 -10
  8. telnyx/resources/conferences/actions.py +8 -24
  9. telnyx/resources/conferences/conferences.py +2 -6
  10. telnyx/resources/legacy/__init__.py +33 -0
  11. telnyx/resources/legacy/legacy.py +102 -0
  12. telnyx/resources/legacy/reporting/__init__.py +47 -0
  13. telnyx/resources/legacy/reporting/batch_detail_records/__init__.py +61 -0
  14. telnyx/resources/legacy/reporting/batch_detail_records/batch_detail_records.py +166 -0
  15. telnyx/resources/legacy/reporting/batch_detail_records/messaging.py +481 -0
  16. telnyx/resources/legacy/reporting/batch_detail_records/speech_to_text.py +399 -0
  17. telnyx/resources/legacy/reporting/batch_detail_records/voice.py +538 -0
  18. telnyx/resources/legacy/reporting/reporting.py +134 -0
  19. telnyx/resources/legacy/reporting/usage_reports/__init__.py +61 -0
  20. telnyx/resources/legacy/reporting/usage_reports/messaging.py +471 -0
  21. telnyx/resources/legacy/reporting/usage_reports/number_lookup.py +464 -0
  22. telnyx/resources/legacy/reporting/usage_reports/usage_reports.py +288 -0
  23. telnyx/resources/legacy/reporting/usage_reports/voice.py +493 -0
  24. telnyx/resources/oauth.py +855 -0
  25. telnyx/resources/oauth_clients.py +711 -0
  26. telnyx/resources/oauth_grants.py +349 -0
  27. telnyx/resources/phone_numbers/jobs.py +12 -0
  28. telnyx/resources/porting_orders/porting_orders.py +20 -8
  29. telnyx/resources/sim_cards/sim_cards.py +3 -2
  30. telnyx/resources/verifications/verifications.py +10 -0
  31. telnyx/resources/verify_profiles.py +183 -1
  32. telnyx/resources/well_known.py +198 -0
  33. telnyx/types/__init__.py +41 -1
  34. telnyx/types/addresses/action_validate_response.py +2 -2
  35. telnyx/types/ai/__init__.py +1 -0
  36. telnyx/types/ai/{conversations/message_create_params.py → conversation_add_message_params.py} +4 -4
  37. telnyx/types/ai/conversations/__init__.py +0 -1
  38. telnyx/types/ai/inference_embedding_webhook_tool_params.py +2 -0
  39. telnyx/types/ai/inference_embedding_webhook_tool_params_param.py +2 -0
  40. telnyx/types/{error.py → api_error.py} +2 -2
  41. telnyx/types/call_dial_params.py +2 -3
  42. telnyx/types/calls/action_answer_params.py +1 -2
  43. telnyx/types/calls/action_gather_using_ai_params.py +5 -8
  44. telnyx/types/calls/action_start_streaming_params.py +4 -2
  45. telnyx/types/calls/action_transfer_params.py +50 -0
  46. telnyx/types/campaign_submit_appeal_response.py +0 -3
  47. telnyx/types/legacy/__init__.py +3 -0
  48. telnyx/types/legacy/reporting/__init__.py +10 -0
  49. telnyx/types/legacy/reporting/batch_detail_records/__init__.py +20 -0
  50. telnyx/types/legacy/reporting/batch_detail_records/messaging_create_params.py +77 -0
  51. telnyx/types/legacy/reporting/batch_detail_records/messaging_create_response.py +68 -0
  52. telnyx/types/legacy/reporting/batch_detail_records/messaging_delete_response.py +68 -0
  53. telnyx/types/legacy/reporting/batch_detail_records/messaging_list_response.py +80 -0
  54. telnyx/types/legacy/reporting/batch_detail_records/messaging_retrieve_response.py +68 -0
  55. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_params.py +19 -0
  56. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_create_response.py +31 -0
  57. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_delete_response.py +31 -0
  58. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_list_response.py +31 -0
  59. telnyx/types/legacy/reporting/batch_detail_records/speech_to_text_retrieve_response.py +31 -0
  60. telnyx/types/legacy/reporting/batch_detail_records/voice_create_params.py +79 -0
  61. telnyx/types/legacy/reporting/batch_detail_records/voice_create_response.py +91 -0
  62. telnyx/types/legacy/reporting/batch_detail_records/voice_delete_response.py +91 -0
  63. telnyx/types/legacy/reporting/batch_detail_records/voice_list_response.py +102 -0
  64. telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_fields_response.py +23 -0
  65. telnyx/types/legacy/reporting/batch_detail_records/voice_retrieve_response.py +91 -0
  66. telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_params.py +17 -0
  67. telnyx/types/legacy/reporting/usage_report_retrieve_speech_to_text_response.py +11 -0
  68. telnyx/types/legacy/reporting/usage_reports/__init__.py +18 -0
  69. telnyx/types/legacy/reporting/usage_reports/messaging_create_params.py +29 -0
  70. telnyx/types/legacy/reporting/usage_reports/messaging_create_response.py +43 -0
  71. telnyx/types/legacy/reporting/usage_reports/messaging_delete_response.py +43 -0
  72. telnyx/types/legacy/reporting/usage_reports/messaging_list_params.py +15 -0
  73. telnyx/types/legacy/reporting/usage_reports/messaging_list_response.py +54 -0
  74. telnyx/types/legacy/reporting/usage_reports/messaging_retrieve_response.py +43 -0
  75. telnyx/types/legacy/reporting/usage_reports/number_lookup_create_params.py +26 -0
  76. telnyx/types/legacy/reporting/usage_reports/number_lookup_list_params.py +13 -0
  77. telnyx/types/legacy/reporting/usage_reports/voice_create_params.py +40 -0
  78. telnyx/types/legacy/reporting/usage_reports/voice_create_response.py +48 -0
  79. telnyx/types/legacy/reporting/usage_reports/voice_delete_response.py +48 -0
  80. telnyx/types/legacy/reporting/usage_reports/voice_list_params.py +15 -0
  81. telnyx/types/legacy/reporting/usage_reports/voice_list_response.py +59 -0
  82. telnyx/types/legacy/reporting/usage_reports/voice_retrieve_response.py +48 -0
  83. telnyx/types/number_order_status_update_webhook_event.py +30 -4
  84. telnyx/types/oauth_client_create_params.py +39 -0
  85. telnyx/types/oauth_client_create_response.py +63 -0
  86. telnyx/types/oauth_client_list_params.py +38 -0
  87. telnyx/types/oauth_client_list_response.py +79 -0
  88. telnyx/types/oauth_client_retrieve_response.py +63 -0
  89. telnyx/types/oauth_client_update_params.py +36 -0
  90. telnyx/types/oauth_client_update_response.py +63 -0
  91. telnyx/types/oauth_grant_delete_response.py +33 -0
  92. telnyx/types/oauth_grant_list_params.py +17 -0
  93. telnyx/types/oauth_grant_list_response.py +49 -0
  94. telnyx/types/oauth_grant_retrieve_response.py +33 -0
  95. telnyx/types/oauth_grants_params.py +15 -0
  96. telnyx/types/oauth_grants_response.py +10 -0
  97. telnyx/types/oauth_introspect_params.py +12 -0
  98. telnyx/types/oauth_introspect_response.py +30 -0
  99. telnyx/types/oauth_register_params.py +39 -0
  100. telnyx/types/oauth_register_response.py +45 -0
  101. telnyx/types/oauth_retrieve_authorize_params.py +30 -0
  102. telnyx/types/oauth_retrieve_jwks_response.py +25 -0
  103. telnyx/types/oauth_retrieve_response.py +47 -0
  104. telnyx/types/oauth_token_params.py +33 -0
  105. telnyx/types/oauth_token_response.py +25 -0
  106. telnyx/types/phone_number_delete_response.py +7 -0
  107. telnyx/types/phone_number_detailed.py +7 -0
  108. telnyx/types/phone_number_list_params.py +6 -0
  109. telnyx/types/phone_numbers/job_update_batch_params.py +7 -0
  110. telnyx/types/porting_order.py +3 -0
  111. telnyx/types/porting_order_create_params.py +3 -0
  112. telnyx/types/porting_order_list_params.py +52 -31
  113. telnyx/types/porting_order_update_params.py +2 -0
  114. telnyx/types/porting_orders/phone_number_configuration_list_params.py +19 -19
  115. telnyx/types/shared/simple_sim_card.py +15 -0
  116. telnyx/types/sim_card.py +12 -0
  117. telnyx/types/sim_card_update_params.py +2 -1
  118. telnyx/types/stream_bidirectional_codec.py +1 -1
  119. telnyx/types/stream_codec.py +1 -1
  120. telnyx/types/verification_trigger_call_params.py +7 -0
  121. telnyx/types/verify_profile_create_template_params.py +12 -0
  122. telnyx/types/verify_profile_create_template_response.py +17 -0
  123. telnyx/types/verify_profile_update_template_params.py +12 -0
  124. telnyx/types/verify_profile_update_template_response.py +17 -0
  125. telnyx/types/well_known_retrieve_authorization_server_metadata_response.py +42 -0
  126. telnyx/types/well_known_retrieve_protected_resource_metadata_response.py +15 -0
  127. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/METADATA +1 -1
  128. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/RECORD +130 -48
  129. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/WHEEL +0 -0
  130. {telnyx-3.5.0a0.dist-info → telnyx-3.7.0a0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,711 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..types import oauth_client_list_params, oauth_client_create_params, oauth_client_update_params
11
+ from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
12
+ from .._utils import maybe_transform, async_maybe_transform
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+ from ..types.oauth_client_list_response import OAuthClientListResponse
23
+ from ..types.oauth_client_create_response import OAuthClientCreateResponse
24
+ from ..types.oauth_client_update_response import OAuthClientUpdateResponse
25
+ from ..types.oauth_client_retrieve_response import OAuthClientRetrieveResponse
26
+
27
+ __all__ = ["OAuthClientsResource", "AsyncOAuthClientsResource"]
28
+
29
+
30
+ class OAuthClientsResource(SyncAPIResource):
31
+ @cached_property
32
+ def with_raw_response(self) -> OAuthClientsResourceWithRawResponse:
33
+ """
34
+ This property can be used as a prefix for any HTTP method call to return
35
+ the raw response object instead of the parsed content.
36
+
37
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
38
+ """
39
+ return OAuthClientsResourceWithRawResponse(self)
40
+
41
+ @cached_property
42
+ def with_streaming_response(self) -> OAuthClientsResourceWithStreamingResponse:
43
+ """
44
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
45
+
46
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
47
+ """
48
+ return OAuthClientsResourceWithStreamingResponse(self)
49
+
50
+ def create(
51
+ self,
52
+ *,
53
+ allowed_grant_types: List[Literal["client_credentials", "authorization_code", "refresh_token"]],
54
+ allowed_scopes: SequenceNotStr[str],
55
+ client_type: Literal["public", "confidential"],
56
+ name: str,
57
+ logo_uri: str | Omit = omit,
58
+ policy_uri: str | Omit = omit,
59
+ redirect_uris: SequenceNotStr[str] | Omit = omit,
60
+ require_pkce: bool | Omit = omit,
61
+ tos_uri: str | Omit = omit,
62
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
63
+ # The extra values given here take precedence over values defined on the client or passed to this method.
64
+ extra_headers: Headers | None = None,
65
+ extra_query: Query | None = None,
66
+ extra_body: Body | None = None,
67
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
68
+ ) -> OAuthClientCreateResponse:
69
+ """
70
+ Create a new OAuth client
71
+
72
+ Args:
73
+ allowed_grant_types: List of allowed OAuth grant types
74
+
75
+ allowed_scopes: List of allowed OAuth scopes
76
+
77
+ client_type: OAuth client type
78
+
79
+ name: The name of the OAuth client
80
+
81
+ logo_uri: URL of the client logo
82
+
83
+ policy_uri: URL of the client's privacy policy
84
+
85
+ redirect_uris: List of redirect URIs (required for authorization_code flow)
86
+
87
+ require_pkce: Whether PKCE (Proof Key for Code Exchange) is required for this client
88
+
89
+ tos_uri: URL of the client's terms of service
90
+
91
+ extra_headers: Send extra headers
92
+
93
+ extra_query: Add additional query parameters to the request
94
+
95
+ extra_body: Add additional JSON properties to the request
96
+
97
+ timeout: Override the client-level default timeout for this request, in seconds
98
+ """
99
+ return self._post(
100
+ "/oauth_clients",
101
+ body=maybe_transform(
102
+ {
103
+ "allowed_grant_types": allowed_grant_types,
104
+ "allowed_scopes": allowed_scopes,
105
+ "client_type": client_type,
106
+ "name": name,
107
+ "logo_uri": logo_uri,
108
+ "policy_uri": policy_uri,
109
+ "redirect_uris": redirect_uris,
110
+ "require_pkce": require_pkce,
111
+ "tos_uri": tos_uri,
112
+ },
113
+ oauth_client_create_params.OAuthClientCreateParams,
114
+ ),
115
+ options=make_request_options(
116
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
117
+ ),
118
+ cast_to=OAuthClientCreateResponse,
119
+ )
120
+
121
+ def retrieve(
122
+ self,
123
+ id: str,
124
+ *,
125
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
126
+ # The extra values given here take precedence over values defined on the client or passed to this method.
127
+ extra_headers: Headers | None = None,
128
+ extra_query: Query | None = None,
129
+ extra_body: Body | None = None,
130
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
131
+ ) -> OAuthClientRetrieveResponse:
132
+ """
133
+ Retrieve a single OAuth client by ID
134
+
135
+ Args:
136
+ extra_headers: Send extra headers
137
+
138
+ extra_query: Add additional query parameters to the request
139
+
140
+ extra_body: Add additional JSON properties to the request
141
+
142
+ timeout: Override the client-level default timeout for this request, in seconds
143
+ """
144
+ if not id:
145
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
146
+ return self._get(
147
+ f"/oauth_clients/{id}",
148
+ options=make_request_options(
149
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
150
+ ),
151
+ cast_to=OAuthClientRetrieveResponse,
152
+ )
153
+
154
+ def update(
155
+ self,
156
+ id: str,
157
+ *,
158
+ allowed_grant_types: List[Literal["client_credentials", "authorization_code", "refresh_token"]] | Omit = omit,
159
+ allowed_scopes: SequenceNotStr[str] | Omit = omit,
160
+ logo_uri: str | Omit = omit,
161
+ name: str | Omit = omit,
162
+ policy_uri: str | Omit = omit,
163
+ redirect_uris: SequenceNotStr[str] | Omit = omit,
164
+ require_pkce: bool | Omit = omit,
165
+ tos_uri: str | Omit = omit,
166
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
167
+ # The extra values given here take precedence over values defined on the client or passed to this method.
168
+ extra_headers: Headers | None = None,
169
+ extra_query: Query | None = None,
170
+ extra_body: Body | None = None,
171
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
172
+ ) -> OAuthClientUpdateResponse:
173
+ """
174
+ Update an existing OAuth client
175
+
176
+ Args:
177
+ allowed_grant_types: List of allowed OAuth grant types
178
+
179
+ allowed_scopes: List of allowed OAuth scopes
180
+
181
+ logo_uri: URL of the client logo
182
+
183
+ name: The name of the OAuth client
184
+
185
+ policy_uri: URL of the client's privacy policy
186
+
187
+ redirect_uris: List of redirect URIs
188
+
189
+ require_pkce: Whether PKCE (Proof Key for Code Exchange) is required for this client
190
+
191
+ tos_uri: URL of the client's terms of service
192
+
193
+ extra_headers: Send extra headers
194
+
195
+ extra_query: Add additional query parameters to the request
196
+
197
+ extra_body: Add additional JSON properties to the request
198
+
199
+ timeout: Override the client-level default timeout for this request, in seconds
200
+ """
201
+ if not id:
202
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
203
+ return self._put(
204
+ f"/oauth_clients/{id}",
205
+ body=maybe_transform(
206
+ {
207
+ "allowed_grant_types": allowed_grant_types,
208
+ "allowed_scopes": allowed_scopes,
209
+ "logo_uri": logo_uri,
210
+ "name": name,
211
+ "policy_uri": policy_uri,
212
+ "redirect_uris": redirect_uris,
213
+ "require_pkce": require_pkce,
214
+ "tos_uri": tos_uri,
215
+ },
216
+ oauth_client_update_params.OAuthClientUpdateParams,
217
+ ),
218
+ options=make_request_options(
219
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
220
+ ),
221
+ cast_to=OAuthClientUpdateResponse,
222
+ )
223
+
224
+ def list(
225
+ self,
226
+ *,
227
+ filter_allowed_grant_types_contains: Literal["client_credentials", "authorization_code", "refresh_token"]
228
+ | Omit = omit,
229
+ filter_client_id: str | Omit = omit,
230
+ filter_client_type: Literal["confidential", "public"] | Omit = omit,
231
+ filter_name: str | Omit = omit,
232
+ filter_name_contains: str | Omit = omit,
233
+ filter_verified: bool | Omit = omit,
234
+ page_number: int | Omit = omit,
235
+ page_size: int | Omit = omit,
236
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
237
+ # The extra values given here take precedence over values defined on the client or passed to this method.
238
+ extra_headers: Headers | None = None,
239
+ extra_query: Query | None = None,
240
+ extra_body: Body | None = None,
241
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
242
+ ) -> OAuthClientListResponse:
243
+ """
244
+ Retrieve a paginated list of OAuth clients for the authenticated user
245
+
246
+ Args:
247
+ filter_allowed_grant_types_contains: Filter by allowed grant type
248
+
249
+ filter_client_id: Filter by client ID
250
+
251
+ filter_client_type: Filter by client type
252
+
253
+ filter_name: Filter by exact client name
254
+
255
+ filter_name_contains: Filter by client name containing text
256
+
257
+ filter_verified: Filter by verification status
258
+
259
+ page_number: Page number
260
+
261
+ page_size: Number of results per page
262
+
263
+ extra_headers: Send extra headers
264
+
265
+ extra_query: Add additional query parameters to the request
266
+
267
+ extra_body: Add additional JSON properties to the request
268
+
269
+ timeout: Override the client-level default timeout for this request, in seconds
270
+ """
271
+ return self._get(
272
+ "/oauth_clients",
273
+ options=make_request_options(
274
+ extra_headers=extra_headers,
275
+ extra_query=extra_query,
276
+ extra_body=extra_body,
277
+ timeout=timeout,
278
+ query=maybe_transform(
279
+ {
280
+ "filter_allowed_grant_types_contains": filter_allowed_grant_types_contains,
281
+ "filter_client_id": filter_client_id,
282
+ "filter_client_type": filter_client_type,
283
+ "filter_name": filter_name,
284
+ "filter_name_contains": filter_name_contains,
285
+ "filter_verified": filter_verified,
286
+ "page_number": page_number,
287
+ "page_size": page_size,
288
+ },
289
+ oauth_client_list_params.OAuthClientListParams,
290
+ ),
291
+ ),
292
+ cast_to=OAuthClientListResponse,
293
+ )
294
+
295
+ def delete(
296
+ self,
297
+ id: str,
298
+ *,
299
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
300
+ # The extra values given here take precedence over values defined on the client or passed to this method.
301
+ extra_headers: Headers | None = None,
302
+ extra_query: Query | None = None,
303
+ extra_body: Body | None = None,
304
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
305
+ ) -> None:
306
+ """
307
+ Delete an OAuth client
308
+
309
+ Args:
310
+ extra_headers: Send extra headers
311
+
312
+ extra_query: Add additional query parameters to the request
313
+
314
+ extra_body: Add additional JSON properties to the request
315
+
316
+ timeout: Override the client-level default timeout for this request, in seconds
317
+ """
318
+ if not id:
319
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
320
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
321
+ return self._delete(
322
+ f"/oauth_clients/{id}",
323
+ options=make_request_options(
324
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
325
+ ),
326
+ cast_to=NoneType,
327
+ )
328
+
329
+
330
+ class AsyncOAuthClientsResource(AsyncAPIResource):
331
+ @cached_property
332
+ def with_raw_response(self) -> AsyncOAuthClientsResourceWithRawResponse:
333
+ """
334
+ This property can be used as a prefix for any HTTP method call to return
335
+ the raw response object instead of the parsed content.
336
+
337
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
338
+ """
339
+ return AsyncOAuthClientsResourceWithRawResponse(self)
340
+
341
+ @cached_property
342
+ def with_streaming_response(self) -> AsyncOAuthClientsResourceWithStreamingResponse:
343
+ """
344
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
345
+
346
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
347
+ """
348
+ return AsyncOAuthClientsResourceWithStreamingResponse(self)
349
+
350
+ async def create(
351
+ self,
352
+ *,
353
+ allowed_grant_types: List[Literal["client_credentials", "authorization_code", "refresh_token"]],
354
+ allowed_scopes: SequenceNotStr[str],
355
+ client_type: Literal["public", "confidential"],
356
+ name: str,
357
+ logo_uri: str | Omit = omit,
358
+ policy_uri: str | Omit = omit,
359
+ redirect_uris: SequenceNotStr[str] | Omit = omit,
360
+ require_pkce: bool | Omit = omit,
361
+ tos_uri: str | Omit = omit,
362
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
363
+ # The extra values given here take precedence over values defined on the client or passed to this method.
364
+ extra_headers: Headers | None = None,
365
+ extra_query: Query | None = None,
366
+ extra_body: Body | None = None,
367
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
368
+ ) -> OAuthClientCreateResponse:
369
+ """
370
+ Create a new OAuth client
371
+
372
+ Args:
373
+ allowed_grant_types: List of allowed OAuth grant types
374
+
375
+ allowed_scopes: List of allowed OAuth scopes
376
+
377
+ client_type: OAuth client type
378
+
379
+ name: The name of the OAuth client
380
+
381
+ logo_uri: URL of the client logo
382
+
383
+ policy_uri: URL of the client's privacy policy
384
+
385
+ redirect_uris: List of redirect URIs (required for authorization_code flow)
386
+
387
+ require_pkce: Whether PKCE (Proof Key for Code Exchange) is required for this client
388
+
389
+ tos_uri: URL of the client's terms of service
390
+
391
+ extra_headers: Send extra headers
392
+
393
+ extra_query: Add additional query parameters to the request
394
+
395
+ extra_body: Add additional JSON properties to the request
396
+
397
+ timeout: Override the client-level default timeout for this request, in seconds
398
+ """
399
+ return await self._post(
400
+ "/oauth_clients",
401
+ body=await async_maybe_transform(
402
+ {
403
+ "allowed_grant_types": allowed_grant_types,
404
+ "allowed_scopes": allowed_scopes,
405
+ "client_type": client_type,
406
+ "name": name,
407
+ "logo_uri": logo_uri,
408
+ "policy_uri": policy_uri,
409
+ "redirect_uris": redirect_uris,
410
+ "require_pkce": require_pkce,
411
+ "tos_uri": tos_uri,
412
+ },
413
+ oauth_client_create_params.OAuthClientCreateParams,
414
+ ),
415
+ options=make_request_options(
416
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
417
+ ),
418
+ cast_to=OAuthClientCreateResponse,
419
+ )
420
+
421
+ async def retrieve(
422
+ self,
423
+ id: str,
424
+ *,
425
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
426
+ # The extra values given here take precedence over values defined on the client or passed to this method.
427
+ extra_headers: Headers | None = None,
428
+ extra_query: Query | None = None,
429
+ extra_body: Body | None = None,
430
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
431
+ ) -> OAuthClientRetrieveResponse:
432
+ """
433
+ Retrieve a single OAuth client by ID
434
+
435
+ Args:
436
+ extra_headers: Send extra headers
437
+
438
+ extra_query: Add additional query parameters to the request
439
+
440
+ extra_body: Add additional JSON properties to the request
441
+
442
+ timeout: Override the client-level default timeout for this request, in seconds
443
+ """
444
+ if not id:
445
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
446
+ return await self._get(
447
+ f"/oauth_clients/{id}",
448
+ options=make_request_options(
449
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
450
+ ),
451
+ cast_to=OAuthClientRetrieveResponse,
452
+ )
453
+
454
+ async def update(
455
+ self,
456
+ id: str,
457
+ *,
458
+ allowed_grant_types: List[Literal["client_credentials", "authorization_code", "refresh_token"]] | Omit = omit,
459
+ allowed_scopes: SequenceNotStr[str] | Omit = omit,
460
+ logo_uri: str | Omit = omit,
461
+ name: str | Omit = omit,
462
+ policy_uri: str | Omit = omit,
463
+ redirect_uris: SequenceNotStr[str] | Omit = omit,
464
+ require_pkce: bool | Omit = omit,
465
+ tos_uri: str | Omit = omit,
466
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
467
+ # The extra values given here take precedence over values defined on the client or passed to this method.
468
+ extra_headers: Headers | None = None,
469
+ extra_query: Query | None = None,
470
+ extra_body: Body | None = None,
471
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
472
+ ) -> OAuthClientUpdateResponse:
473
+ """
474
+ Update an existing OAuth client
475
+
476
+ Args:
477
+ allowed_grant_types: List of allowed OAuth grant types
478
+
479
+ allowed_scopes: List of allowed OAuth scopes
480
+
481
+ logo_uri: URL of the client logo
482
+
483
+ name: The name of the OAuth client
484
+
485
+ policy_uri: URL of the client's privacy policy
486
+
487
+ redirect_uris: List of redirect URIs
488
+
489
+ require_pkce: Whether PKCE (Proof Key for Code Exchange) is required for this client
490
+
491
+ tos_uri: URL of the client's terms of service
492
+
493
+ extra_headers: Send extra headers
494
+
495
+ extra_query: Add additional query parameters to the request
496
+
497
+ extra_body: Add additional JSON properties to the request
498
+
499
+ timeout: Override the client-level default timeout for this request, in seconds
500
+ """
501
+ if not id:
502
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
503
+ return await self._put(
504
+ f"/oauth_clients/{id}",
505
+ body=await async_maybe_transform(
506
+ {
507
+ "allowed_grant_types": allowed_grant_types,
508
+ "allowed_scopes": allowed_scopes,
509
+ "logo_uri": logo_uri,
510
+ "name": name,
511
+ "policy_uri": policy_uri,
512
+ "redirect_uris": redirect_uris,
513
+ "require_pkce": require_pkce,
514
+ "tos_uri": tos_uri,
515
+ },
516
+ oauth_client_update_params.OAuthClientUpdateParams,
517
+ ),
518
+ options=make_request_options(
519
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
520
+ ),
521
+ cast_to=OAuthClientUpdateResponse,
522
+ )
523
+
524
+ async def list(
525
+ self,
526
+ *,
527
+ filter_allowed_grant_types_contains: Literal["client_credentials", "authorization_code", "refresh_token"]
528
+ | Omit = omit,
529
+ filter_client_id: str | Omit = omit,
530
+ filter_client_type: Literal["confidential", "public"] | Omit = omit,
531
+ filter_name: str | Omit = omit,
532
+ filter_name_contains: str | Omit = omit,
533
+ filter_verified: bool | Omit = omit,
534
+ page_number: int | Omit = omit,
535
+ page_size: int | Omit = omit,
536
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
537
+ # The extra values given here take precedence over values defined on the client or passed to this method.
538
+ extra_headers: Headers | None = None,
539
+ extra_query: Query | None = None,
540
+ extra_body: Body | None = None,
541
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
542
+ ) -> OAuthClientListResponse:
543
+ """
544
+ Retrieve a paginated list of OAuth clients for the authenticated user
545
+
546
+ Args:
547
+ filter_allowed_grant_types_contains: Filter by allowed grant type
548
+
549
+ filter_client_id: Filter by client ID
550
+
551
+ filter_client_type: Filter by client type
552
+
553
+ filter_name: Filter by exact client name
554
+
555
+ filter_name_contains: Filter by client name containing text
556
+
557
+ filter_verified: Filter by verification status
558
+
559
+ page_number: Page number
560
+
561
+ page_size: Number of results per page
562
+
563
+ extra_headers: Send extra headers
564
+
565
+ extra_query: Add additional query parameters to the request
566
+
567
+ extra_body: Add additional JSON properties to the request
568
+
569
+ timeout: Override the client-level default timeout for this request, in seconds
570
+ """
571
+ return await self._get(
572
+ "/oauth_clients",
573
+ options=make_request_options(
574
+ extra_headers=extra_headers,
575
+ extra_query=extra_query,
576
+ extra_body=extra_body,
577
+ timeout=timeout,
578
+ query=await async_maybe_transform(
579
+ {
580
+ "filter_allowed_grant_types_contains": filter_allowed_grant_types_contains,
581
+ "filter_client_id": filter_client_id,
582
+ "filter_client_type": filter_client_type,
583
+ "filter_name": filter_name,
584
+ "filter_name_contains": filter_name_contains,
585
+ "filter_verified": filter_verified,
586
+ "page_number": page_number,
587
+ "page_size": page_size,
588
+ },
589
+ oauth_client_list_params.OAuthClientListParams,
590
+ ),
591
+ ),
592
+ cast_to=OAuthClientListResponse,
593
+ )
594
+
595
+ async def delete(
596
+ self,
597
+ id: str,
598
+ *,
599
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
600
+ # The extra values given here take precedence over values defined on the client or passed to this method.
601
+ extra_headers: Headers | None = None,
602
+ extra_query: Query | None = None,
603
+ extra_body: Body | None = None,
604
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
605
+ ) -> None:
606
+ """
607
+ Delete an OAuth client
608
+
609
+ Args:
610
+ extra_headers: Send extra headers
611
+
612
+ extra_query: Add additional query parameters to the request
613
+
614
+ extra_body: Add additional JSON properties to the request
615
+
616
+ timeout: Override the client-level default timeout for this request, in seconds
617
+ """
618
+ if not id:
619
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
620
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
621
+ return await self._delete(
622
+ f"/oauth_clients/{id}",
623
+ options=make_request_options(
624
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
625
+ ),
626
+ cast_to=NoneType,
627
+ )
628
+
629
+
630
+ class OAuthClientsResourceWithRawResponse:
631
+ def __init__(self, oauth_clients: OAuthClientsResource) -> None:
632
+ self._oauth_clients = oauth_clients
633
+
634
+ self.create = to_raw_response_wrapper(
635
+ oauth_clients.create,
636
+ )
637
+ self.retrieve = to_raw_response_wrapper(
638
+ oauth_clients.retrieve,
639
+ )
640
+ self.update = to_raw_response_wrapper(
641
+ oauth_clients.update,
642
+ )
643
+ self.list = to_raw_response_wrapper(
644
+ oauth_clients.list,
645
+ )
646
+ self.delete = to_raw_response_wrapper(
647
+ oauth_clients.delete,
648
+ )
649
+
650
+
651
+ class AsyncOAuthClientsResourceWithRawResponse:
652
+ def __init__(self, oauth_clients: AsyncOAuthClientsResource) -> None:
653
+ self._oauth_clients = oauth_clients
654
+
655
+ self.create = async_to_raw_response_wrapper(
656
+ oauth_clients.create,
657
+ )
658
+ self.retrieve = async_to_raw_response_wrapper(
659
+ oauth_clients.retrieve,
660
+ )
661
+ self.update = async_to_raw_response_wrapper(
662
+ oauth_clients.update,
663
+ )
664
+ self.list = async_to_raw_response_wrapper(
665
+ oauth_clients.list,
666
+ )
667
+ self.delete = async_to_raw_response_wrapper(
668
+ oauth_clients.delete,
669
+ )
670
+
671
+
672
+ class OAuthClientsResourceWithStreamingResponse:
673
+ def __init__(self, oauth_clients: OAuthClientsResource) -> None:
674
+ self._oauth_clients = oauth_clients
675
+
676
+ self.create = to_streamed_response_wrapper(
677
+ oauth_clients.create,
678
+ )
679
+ self.retrieve = to_streamed_response_wrapper(
680
+ oauth_clients.retrieve,
681
+ )
682
+ self.update = to_streamed_response_wrapper(
683
+ oauth_clients.update,
684
+ )
685
+ self.list = to_streamed_response_wrapper(
686
+ oauth_clients.list,
687
+ )
688
+ self.delete = to_streamed_response_wrapper(
689
+ oauth_clients.delete,
690
+ )
691
+
692
+
693
+ class AsyncOAuthClientsResourceWithStreamingResponse:
694
+ def __init__(self, oauth_clients: AsyncOAuthClientsResource) -> None:
695
+ self._oauth_clients = oauth_clients
696
+
697
+ self.create = async_to_streamed_response_wrapper(
698
+ oauth_clients.create,
699
+ )
700
+ self.retrieve = async_to_streamed_response_wrapper(
701
+ oauth_clients.retrieve,
702
+ )
703
+ self.update = async_to_streamed_response_wrapper(
704
+ oauth_clients.update,
705
+ )
706
+ self.list = async_to_streamed_response_wrapper(
707
+ oauth_clients.list,
708
+ )
709
+ self.delete = async_to_streamed_response_wrapper(
710
+ oauth_clients.delete,
711
+ )