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,61 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .voice import (
4
+ VoiceResource,
5
+ AsyncVoiceResource,
6
+ VoiceResourceWithRawResponse,
7
+ AsyncVoiceResourceWithRawResponse,
8
+ VoiceResourceWithStreamingResponse,
9
+ AsyncVoiceResourceWithStreamingResponse,
10
+ )
11
+ from .messaging import (
12
+ MessagingResource,
13
+ AsyncMessagingResource,
14
+ MessagingResourceWithRawResponse,
15
+ AsyncMessagingResourceWithRawResponse,
16
+ MessagingResourceWithStreamingResponse,
17
+ AsyncMessagingResourceWithStreamingResponse,
18
+ )
19
+ from .number_lookup import (
20
+ NumberLookupResource,
21
+ AsyncNumberLookupResource,
22
+ NumberLookupResourceWithRawResponse,
23
+ AsyncNumberLookupResourceWithRawResponse,
24
+ NumberLookupResourceWithStreamingResponse,
25
+ AsyncNumberLookupResourceWithStreamingResponse,
26
+ )
27
+ from .usage_reports import (
28
+ UsageReportsResource,
29
+ AsyncUsageReportsResource,
30
+ UsageReportsResourceWithRawResponse,
31
+ AsyncUsageReportsResourceWithRawResponse,
32
+ UsageReportsResourceWithStreamingResponse,
33
+ AsyncUsageReportsResourceWithStreamingResponse,
34
+ )
35
+
36
+ __all__ = [
37
+ "MessagingResource",
38
+ "AsyncMessagingResource",
39
+ "MessagingResourceWithRawResponse",
40
+ "AsyncMessagingResourceWithRawResponse",
41
+ "MessagingResourceWithStreamingResponse",
42
+ "AsyncMessagingResourceWithStreamingResponse",
43
+ "NumberLookupResource",
44
+ "AsyncNumberLookupResource",
45
+ "NumberLookupResourceWithRawResponse",
46
+ "AsyncNumberLookupResourceWithRawResponse",
47
+ "NumberLookupResourceWithStreamingResponse",
48
+ "AsyncNumberLookupResourceWithStreamingResponse",
49
+ "VoiceResource",
50
+ "AsyncVoiceResource",
51
+ "VoiceResourceWithRawResponse",
52
+ "AsyncVoiceResourceWithRawResponse",
53
+ "VoiceResourceWithStreamingResponse",
54
+ "AsyncVoiceResourceWithStreamingResponse",
55
+ "UsageReportsResource",
56
+ "AsyncUsageReportsResource",
57
+ "UsageReportsResourceWithRawResponse",
58
+ "AsyncUsageReportsResourceWithRawResponse",
59
+ "UsageReportsResourceWithStreamingResponse",
60
+ "AsyncUsageReportsResourceWithStreamingResponse",
61
+ ]
@@ -0,0 +1,471 @@
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 Union
6
+ from datetime import datetime
7
+
8
+ import httpx
9
+
10
+ from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
11
+ from ....._utils import maybe_transform, async_maybe_transform
12
+ from ....._compat import cached_property
13
+ from ....._resource import SyncAPIResource, AsyncAPIResource
14
+ from ....._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from ....._base_client import make_request_options
21
+ from .....types.legacy.reporting.usage_reports import messaging_list_params, messaging_create_params
22
+ from .....types.legacy.reporting.usage_reports.messaging_list_response import MessagingListResponse
23
+ from .....types.legacy.reporting.usage_reports.messaging_create_response import MessagingCreateResponse
24
+ from .....types.legacy.reporting.usage_reports.messaging_delete_response import MessagingDeleteResponse
25
+ from .....types.legacy.reporting.usage_reports.messaging_retrieve_response import MessagingRetrieveResponse
26
+
27
+ __all__ = ["MessagingResource", "AsyncMessagingResource"]
28
+
29
+
30
+ class MessagingResource(SyncAPIResource):
31
+ @cached_property
32
+ def with_raw_response(self) -> MessagingResourceWithRawResponse:
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 MessagingResourceWithRawResponse(self)
40
+
41
+ @cached_property
42
+ def with_streaming_response(self) -> MessagingResourceWithStreamingResponse:
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 MessagingResourceWithStreamingResponse(self)
49
+
50
+ def create(
51
+ self,
52
+ *,
53
+ aggregation_type: int,
54
+ end_time: Union[str, datetime] | Omit = omit,
55
+ managed_accounts: SequenceNotStr[str] | Omit = omit,
56
+ profiles: SequenceNotStr[str] | Omit = omit,
57
+ select_all_managed_accounts: bool | Omit = omit,
58
+ start_time: Union[str, datetime] | Omit = omit,
59
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
60
+ # The extra values given here take precedence over values defined on the client or passed to this method.
61
+ extra_headers: Headers | None = None,
62
+ extra_query: Query | None = None,
63
+ extra_body: Body | None = None,
64
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
65
+ ) -> MessagingCreateResponse:
66
+ """
67
+ Creates a new legacy usage V2 MDR report request with the specified filters
68
+
69
+ Args:
70
+ aggregation_type: Aggregation type: No aggregation = 0, By Messaging Profile = 1, By Tags = 2
71
+
72
+ managed_accounts: List of managed accounts to include
73
+
74
+ profiles: List of messaging profile IDs to filter by
75
+
76
+ extra_headers: Send extra headers
77
+
78
+ extra_query: Add additional query parameters to the request
79
+
80
+ extra_body: Add additional JSON properties to the request
81
+
82
+ timeout: Override the client-level default timeout for this request, in seconds
83
+ """
84
+ return self._post(
85
+ "/legacy/reporting/usage_reports/messaging",
86
+ body=maybe_transform(
87
+ {
88
+ "aggregation_type": aggregation_type,
89
+ "end_time": end_time,
90
+ "managed_accounts": managed_accounts,
91
+ "profiles": profiles,
92
+ "select_all_managed_accounts": select_all_managed_accounts,
93
+ "start_time": start_time,
94
+ },
95
+ messaging_create_params.MessagingCreateParams,
96
+ ),
97
+ options=make_request_options(
98
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
99
+ ),
100
+ cast_to=MessagingCreateResponse,
101
+ )
102
+
103
+ def retrieve(
104
+ self,
105
+ id: str,
106
+ *,
107
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
108
+ # The extra values given here take precedence over values defined on the client or passed to this method.
109
+ extra_headers: Headers | None = None,
110
+ extra_query: Query | None = None,
111
+ extra_body: Body | None = None,
112
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
113
+ ) -> MessagingRetrieveResponse:
114
+ """
115
+ Fetch single MDR usage report by id.
116
+
117
+ Args:
118
+ extra_headers: Send extra headers
119
+
120
+ extra_query: Add additional query parameters to the request
121
+
122
+ extra_body: Add additional JSON properties to the request
123
+
124
+ timeout: Override the client-level default timeout for this request, in seconds
125
+ """
126
+ if not id:
127
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
128
+ return self._get(
129
+ f"/legacy/reporting/usage_reports/messaging/{id}",
130
+ options=make_request_options(
131
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
132
+ ),
133
+ cast_to=MessagingRetrieveResponse,
134
+ )
135
+
136
+ def list(
137
+ self,
138
+ *,
139
+ page: int | Omit = omit,
140
+ per_page: int | Omit = omit,
141
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
142
+ # The extra values given here take precedence over values defined on the client or passed to this method.
143
+ extra_headers: Headers | None = None,
144
+ extra_query: Query | None = None,
145
+ extra_body: Body | None = None,
146
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
147
+ ) -> MessagingListResponse:
148
+ """
149
+ Fetch all previous requests for MDR usage reports.
150
+
151
+ Args:
152
+ page: Page number
153
+
154
+ per_page: Size of the page
155
+
156
+ extra_headers: Send extra headers
157
+
158
+ extra_query: Add additional query parameters to the request
159
+
160
+ extra_body: Add additional JSON properties to the request
161
+
162
+ timeout: Override the client-level default timeout for this request, in seconds
163
+ """
164
+ return self._get(
165
+ "/legacy/reporting/usage_reports/messaging",
166
+ options=make_request_options(
167
+ extra_headers=extra_headers,
168
+ extra_query=extra_query,
169
+ extra_body=extra_body,
170
+ timeout=timeout,
171
+ query=maybe_transform(
172
+ {
173
+ "page": page,
174
+ "per_page": per_page,
175
+ },
176
+ messaging_list_params.MessagingListParams,
177
+ ),
178
+ ),
179
+ cast_to=MessagingListResponse,
180
+ )
181
+
182
+ def delete(
183
+ self,
184
+ id: str,
185
+ *,
186
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
187
+ # The extra values given here take precedence over values defined on the client or passed to this method.
188
+ extra_headers: Headers | None = None,
189
+ extra_query: Query | None = None,
190
+ extra_body: Body | None = None,
191
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
192
+ ) -> MessagingDeleteResponse:
193
+ """
194
+ Deletes a specific V2 legacy usage MDR report request by ID
195
+
196
+ Args:
197
+ extra_headers: Send extra headers
198
+
199
+ extra_query: Add additional query parameters to the request
200
+
201
+ extra_body: Add additional JSON properties to the request
202
+
203
+ timeout: Override the client-level default timeout for this request, in seconds
204
+ """
205
+ if not id:
206
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
207
+ return self._delete(
208
+ f"/legacy/reporting/usage_reports/messaging/{id}",
209
+ options=make_request_options(
210
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
211
+ ),
212
+ cast_to=MessagingDeleteResponse,
213
+ )
214
+
215
+
216
+ class AsyncMessagingResource(AsyncAPIResource):
217
+ @cached_property
218
+ def with_raw_response(self) -> AsyncMessagingResourceWithRawResponse:
219
+ """
220
+ This property can be used as a prefix for any HTTP method call to return
221
+ the raw response object instead of the parsed content.
222
+
223
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers
224
+ """
225
+ return AsyncMessagingResourceWithRawResponse(self)
226
+
227
+ @cached_property
228
+ def with_streaming_response(self) -> AsyncMessagingResourceWithStreamingResponse:
229
+ """
230
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
231
+
232
+ For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response
233
+ """
234
+ return AsyncMessagingResourceWithStreamingResponse(self)
235
+
236
+ async def create(
237
+ self,
238
+ *,
239
+ aggregation_type: int,
240
+ end_time: Union[str, datetime] | Omit = omit,
241
+ managed_accounts: SequenceNotStr[str] | Omit = omit,
242
+ profiles: SequenceNotStr[str] | Omit = omit,
243
+ select_all_managed_accounts: bool | Omit = omit,
244
+ start_time: Union[str, datetime] | Omit = omit,
245
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
246
+ # The extra values given here take precedence over values defined on the client or passed to this method.
247
+ extra_headers: Headers | None = None,
248
+ extra_query: Query | None = None,
249
+ extra_body: Body | None = None,
250
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
251
+ ) -> MessagingCreateResponse:
252
+ """
253
+ Creates a new legacy usage V2 MDR report request with the specified filters
254
+
255
+ Args:
256
+ aggregation_type: Aggregation type: No aggregation = 0, By Messaging Profile = 1, By Tags = 2
257
+
258
+ managed_accounts: List of managed accounts to include
259
+
260
+ profiles: List of messaging profile IDs to filter by
261
+
262
+ extra_headers: Send extra headers
263
+
264
+ extra_query: Add additional query parameters to the request
265
+
266
+ extra_body: Add additional JSON properties to the request
267
+
268
+ timeout: Override the client-level default timeout for this request, in seconds
269
+ """
270
+ return await self._post(
271
+ "/legacy/reporting/usage_reports/messaging",
272
+ body=await async_maybe_transform(
273
+ {
274
+ "aggregation_type": aggregation_type,
275
+ "end_time": end_time,
276
+ "managed_accounts": managed_accounts,
277
+ "profiles": profiles,
278
+ "select_all_managed_accounts": select_all_managed_accounts,
279
+ "start_time": start_time,
280
+ },
281
+ messaging_create_params.MessagingCreateParams,
282
+ ),
283
+ options=make_request_options(
284
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
285
+ ),
286
+ cast_to=MessagingCreateResponse,
287
+ )
288
+
289
+ async def retrieve(
290
+ self,
291
+ id: str,
292
+ *,
293
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
294
+ # The extra values given here take precedence over values defined on the client or passed to this method.
295
+ extra_headers: Headers | None = None,
296
+ extra_query: Query | None = None,
297
+ extra_body: Body | None = None,
298
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
299
+ ) -> MessagingRetrieveResponse:
300
+ """
301
+ Fetch single MDR usage report by id.
302
+
303
+ Args:
304
+ extra_headers: Send extra headers
305
+
306
+ extra_query: Add additional query parameters to the request
307
+
308
+ extra_body: Add additional JSON properties to the request
309
+
310
+ timeout: Override the client-level default timeout for this request, in seconds
311
+ """
312
+ if not id:
313
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
314
+ return await self._get(
315
+ f"/legacy/reporting/usage_reports/messaging/{id}",
316
+ options=make_request_options(
317
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
318
+ ),
319
+ cast_to=MessagingRetrieveResponse,
320
+ )
321
+
322
+ async def list(
323
+ self,
324
+ *,
325
+ page: int | Omit = omit,
326
+ per_page: int | Omit = omit,
327
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
328
+ # The extra values given here take precedence over values defined on the client or passed to this method.
329
+ extra_headers: Headers | None = None,
330
+ extra_query: Query | None = None,
331
+ extra_body: Body | None = None,
332
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
333
+ ) -> MessagingListResponse:
334
+ """
335
+ Fetch all previous requests for MDR usage reports.
336
+
337
+ Args:
338
+ page: Page number
339
+
340
+ per_page: Size of the page
341
+
342
+ extra_headers: Send extra headers
343
+
344
+ extra_query: Add additional query parameters to the request
345
+
346
+ extra_body: Add additional JSON properties to the request
347
+
348
+ timeout: Override the client-level default timeout for this request, in seconds
349
+ """
350
+ return await self._get(
351
+ "/legacy/reporting/usage_reports/messaging",
352
+ options=make_request_options(
353
+ extra_headers=extra_headers,
354
+ extra_query=extra_query,
355
+ extra_body=extra_body,
356
+ timeout=timeout,
357
+ query=await async_maybe_transform(
358
+ {
359
+ "page": page,
360
+ "per_page": per_page,
361
+ },
362
+ messaging_list_params.MessagingListParams,
363
+ ),
364
+ ),
365
+ cast_to=MessagingListResponse,
366
+ )
367
+
368
+ async def delete(
369
+ self,
370
+ id: str,
371
+ *,
372
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
373
+ # The extra values given here take precedence over values defined on the client or passed to this method.
374
+ extra_headers: Headers | None = None,
375
+ extra_query: Query | None = None,
376
+ extra_body: Body | None = None,
377
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
378
+ ) -> MessagingDeleteResponse:
379
+ """
380
+ Deletes a specific V2 legacy usage MDR report request by ID
381
+
382
+ Args:
383
+ extra_headers: Send extra headers
384
+
385
+ extra_query: Add additional query parameters to the request
386
+
387
+ extra_body: Add additional JSON properties to the request
388
+
389
+ timeout: Override the client-level default timeout for this request, in seconds
390
+ """
391
+ if not id:
392
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
393
+ return await self._delete(
394
+ f"/legacy/reporting/usage_reports/messaging/{id}",
395
+ options=make_request_options(
396
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
397
+ ),
398
+ cast_to=MessagingDeleteResponse,
399
+ )
400
+
401
+
402
+ class MessagingResourceWithRawResponse:
403
+ def __init__(self, messaging: MessagingResource) -> None:
404
+ self._messaging = messaging
405
+
406
+ self.create = to_raw_response_wrapper(
407
+ messaging.create,
408
+ )
409
+ self.retrieve = to_raw_response_wrapper(
410
+ messaging.retrieve,
411
+ )
412
+ self.list = to_raw_response_wrapper(
413
+ messaging.list,
414
+ )
415
+ self.delete = to_raw_response_wrapper(
416
+ messaging.delete,
417
+ )
418
+
419
+
420
+ class AsyncMessagingResourceWithRawResponse:
421
+ def __init__(self, messaging: AsyncMessagingResource) -> None:
422
+ self._messaging = messaging
423
+
424
+ self.create = async_to_raw_response_wrapper(
425
+ messaging.create,
426
+ )
427
+ self.retrieve = async_to_raw_response_wrapper(
428
+ messaging.retrieve,
429
+ )
430
+ self.list = async_to_raw_response_wrapper(
431
+ messaging.list,
432
+ )
433
+ self.delete = async_to_raw_response_wrapper(
434
+ messaging.delete,
435
+ )
436
+
437
+
438
+ class MessagingResourceWithStreamingResponse:
439
+ def __init__(self, messaging: MessagingResource) -> None:
440
+ self._messaging = messaging
441
+
442
+ self.create = to_streamed_response_wrapper(
443
+ messaging.create,
444
+ )
445
+ self.retrieve = to_streamed_response_wrapper(
446
+ messaging.retrieve,
447
+ )
448
+ self.list = to_streamed_response_wrapper(
449
+ messaging.list,
450
+ )
451
+ self.delete = to_streamed_response_wrapper(
452
+ messaging.delete,
453
+ )
454
+
455
+
456
+ class AsyncMessagingResourceWithStreamingResponse:
457
+ def __init__(self, messaging: AsyncMessagingResource) -> None:
458
+ self._messaging = messaging
459
+
460
+ self.create = async_to_streamed_response_wrapper(
461
+ messaging.create,
462
+ )
463
+ self.retrieve = async_to_streamed_response_wrapper(
464
+ messaging.retrieve,
465
+ )
466
+ self.list = async_to_streamed_response_wrapper(
467
+ messaging.list,
468
+ )
469
+ self.delete = async_to_streamed_response_wrapper(
470
+ messaging.delete,
471
+ )