linq-python 0.1.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.
Files changed (139) hide show
  1. linq/__init__.py +102 -0
  2. linq/_base_client.py +2149 -0
  3. linq/_client.py +2479 -0
  4. linq/_compat.py +226 -0
  5. linq/_constants.py +14 -0
  6. linq/_exceptions.py +108 -0
  7. linq/_files.py +123 -0
  8. linq/_models.py +878 -0
  9. linq/_qs.py +153 -0
  10. linq/_resource.py +43 -0
  11. linq/_response.py +833 -0
  12. linq/_streaming.py +338 -0
  13. linq/_types.py +271 -0
  14. linq/_utils/__init__.py +65 -0
  15. linq/_utils/_compat.py +45 -0
  16. linq/_utils/_datetime_parse.py +136 -0
  17. linq/_utils/_json.py +35 -0
  18. linq/_utils/_logs.py +25 -0
  19. linq/_utils/_path.py +127 -0
  20. linq/_utils/_proxy.py +65 -0
  21. linq/_utils/_reflection.py +42 -0
  22. linq/_utils/_resources_proxy.py +24 -0
  23. linq/_utils/_streams.py +12 -0
  24. linq/_utils/_sync.py +58 -0
  25. linq/_utils/_transform.py +457 -0
  26. linq/_utils/_typing.py +156 -0
  27. linq/_utils/_utils.py +421 -0
  28. linq/_version.py +4 -0
  29. linq/lib/.keep +4 -0
  30. linq/pagination.py +95 -0
  31. linq/py.typed +0 -0
  32. linq/resources/__init__.py +134 -0
  33. linq/resources/attachments.py +589 -0
  34. linq/resources/capability.py +297 -0
  35. linq/resources/chats/__init__.py +61 -0
  36. linq/resources/chats/chats.py +1492 -0
  37. linq/resources/chats/messages.py +416 -0
  38. linq/resources/chats/participants.py +322 -0
  39. linq/resources/chats/typing.py +299 -0
  40. linq/resources/contact_card.py +472 -0
  41. linq/resources/messages.py +686 -0
  42. linq/resources/phone_numbers.py +163 -0
  43. linq/resources/phonenumbers.py +165 -0
  44. linq/resources/webhook_events.py +319 -0
  45. linq/resources/webhook_subscriptions.py +776 -0
  46. linq/resources/webhooks.py +34 -0
  47. linq/types/__init__.py +90 -0
  48. linq/types/attachment_create_params.py +42 -0
  49. linq/types/attachment_create_response.py +44 -0
  50. linq/types/attachment_retrieve_response.py +55 -0
  51. linq/types/capability_check_RCS_params.py +20 -0
  52. linq/types/capability_check_i_message_params.py +20 -0
  53. linq/types/chat.py +44 -0
  54. linq/types/chat_create_params.py +33 -0
  55. linq/types/chat_create_response.py +44 -0
  56. linq/types/chat_created_webhook_event.py +87 -0
  57. linq/types/chat_group_icon_update_failed_webhook_event.py +65 -0
  58. linq/types/chat_group_icon_updated_webhook_event.py +66 -0
  59. linq/types/chat_group_name_update_failed_webhook_event.py +65 -0
  60. linq/types/chat_group_name_updated_webhook_event.py +66 -0
  61. linq/types/chat_leave_chat_response.py +15 -0
  62. linq/types/chat_list_chats_params.py +36 -0
  63. linq/types/chat_send_voicememo_params.py +23 -0
  64. linq/types/chat_send_voicememo_response.py +79 -0
  65. linq/types/chat_typing_indicator_started_webhook_event.py +52 -0
  66. linq/types/chat_typing_indicator_stopped_webhook_event.py +52 -0
  67. linq/types/chat_update_params.py +15 -0
  68. linq/types/chat_update_response.py +13 -0
  69. linq/types/chats/__init__.py +12 -0
  70. linq/types/chats/message_list_params.py +15 -0
  71. linq/types/chats/message_send_params.py +18 -0
  72. linq/types/chats/message_send_response.py +16 -0
  73. linq/types/chats/participant_add_params.py +12 -0
  74. linq/types/chats/participant_add_response.py +15 -0
  75. linq/types/chats/participant_remove_params.py +12 -0
  76. linq/types/chats/participant_remove_response.py +15 -0
  77. linq/types/chats/sent_message.py +69 -0
  78. linq/types/contact_card_create_params.py +24 -0
  79. linq/types/contact_card_retrieve_params.py +15 -0
  80. linq/types/contact_card_retrieve_response.py +23 -0
  81. linq/types/contact_card_update_params.py +21 -0
  82. linq/types/events_webhook_event.py +50 -0
  83. linq/types/handle_check_response.py +13 -0
  84. linq/types/link_part_param.py +22 -0
  85. linq/types/media_part_param.py +54 -0
  86. linq/types/message.py +87 -0
  87. linq/types/message_add_reaction_params.py +32 -0
  88. linq/types/message_add_reaction_response.py +15 -0
  89. linq/types/message_content_param.py +82 -0
  90. linq/types/message_delivered_webhook_event.py +65 -0
  91. linq/types/message_edited_webhook_event.py +100 -0
  92. linq/types/message_effect.py +23 -0
  93. linq/types/message_effect_param.py +22 -0
  94. linq/types/message_event_v2.py +116 -0
  95. linq/types/message_failed_webhook_event.py +72 -0
  96. linq/types/message_list_messages_thread_params.py +18 -0
  97. linq/types/message_read_webhook_event.py +65 -0
  98. linq/types/message_received_webhook_event.py +65 -0
  99. linq/types/message_sent_webhook_event.py +65 -0
  100. linq/types/message_update_params.py +15 -0
  101. linq/types/participant_added_webhook_event.py +66 -0
  102. linq/types/participant_removed_webhook_event.py +66 -0
  103. linq/types/phone_number_list_response.py +20 -0
  104. linq/types/phone_number_status_updated_webhook_event.py +82 -0
  105. linq/types/phonenumber_list_response.py +39 -0
  106. linq/types/reaction_added_webhook_event.py +46 -0
  107. linq/types/reaction_event_base.py +85 -0
  108. linq/types/reaction_removed_webhook_event.py +46 -0
  109. linq/types/reply_to.py +21 -0
  110. linq/types/reply_to_param.py +21 -0
  111. linq/types/schemas_media_part_response.py +29 -0
  112. linq/types/schemas_message_effect.py +18 -0
  113. linq/types/schemas_text_part_response.py +22 -0
  114. linq/types/set_contact_card.py +24 -0
  115. linq/types/shared/__init__.py +9 -0
  116. linq/types/shared/chat_handle.py +33 -0
  117. linq/types/shared/media_part_response.py +34 -0
  118. linq/types/shared/reaction.py +56 -0
  119. linq/types/shared/reaction_type.py +7 -0
  120. linq/types/shared/service_type.py +7 -0
  121. linq/types/shared/text_decoration.py +23 -0
  122. linq/types/shared/text_part_response.py +26 -0
  123. linq/types/shared_params/__init__.py +5 -0
  124. linq/types/shared_params/reaction_type.py +9 -0
  125. linq/types/shared_params/service_type.py +9 -0
  126. linq/types/shared_params/text_decoration.py +23 -0
  127. linq/types/supported_content_type.py +60 -0
  128. linq/types/text_part_param.py +44 -0
  129. linq/types/webhook_event_list_response.py +17 -0
  130. linq/types/webhook_event_type.py +33 -0
  131. linq/types/webhook_subscription.py +35 -0
  132. linq/types/webhook_subscription_create_params.py +27 -0
  133. linq/types/webhook_subscription_create_response.py +46 -0
  134. linq/types/webhook_subscription_list_response.py +13 -0
  135. linq/types/webhook_subscription_update_params.py +30 -0
  136. linq_python-0.1.0.dist-info/METADATA +572 -0
  137. linq_python-0.1.0.dist-info/RECORD +139 -0
  138. linq_python-0.1.0.dist-info/WHEEL +4 -0
  139. linq_python-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,297 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..types import capability_check_RCS_params, capability_check_i_message_params
8
+ from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9
+ from .._utils import maybe_transform, async_maybe_transform
10
+ from .._compat import cached_property
11
+ from .._resource import SyncAPIResource, AsyncAPIResource
12
+ from .._response import (
13
+ to_raw_response_wrapper,
14
+ to_streamed_response_wrapper,
15
+ async_to_raw_response_wrapper,
16
+ async_to_streamed_response_wrapper,
17
+ )
18
+ from .._base_client import make_request_options
19
+ from ..types.handle_check_response import HandleCheckResponse
20
+
21
+ __all__ = ["CapabilityResource", "AsyncCapabilityResource"]
22
+
23
+
24
+ class CapabilityResource(SyncAPIResource):
25
+ """
26
+ Check whether a recipient address supports iMessage or RCS before sending a message.
27
+ """
28
+
29
+ @cached_property
30
+ def with_raw_response(self) -> CapabilityResourceWithRawResponse:
31
+ """
32
+ This property can be used as a prefix for any HTTP method call to return
33
+ the raw response object instead of the parsed content.
34
+
35
+ For more information, see https://www.github.com/linq-team/linq-python#accessing-raw-response-data-eg-headers
36
+ """
37
+ return CapabilityResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> CapabilityResourceWithStreamingResponse:
41
+ """
42
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
+
44
+ For more information, see https://www.github.com/linq-team/linq-python#with_streaming_response
45
+ """
46
+ return CapabilityResourceWithStreamingResponse(self)
47
+
48
+ def check_i_message(
49
+ self,
50
+ *,
51
+ address: str,
52
+ from_: str | Omit = omit,
53
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54
+ # The extra values given here take precedence over values defined on the client or passed to this method.
55
+ extra_headers: Headers | None = None,
56
+ extra_query: Query | None = None,
57
+ extra_body: Body | None = None,
58
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
59
+ ) -> HandleCheckResponse:
60
+ """
61
+ Check whether a recipient address (phone number or email) is reachable via
62
+ iMessage.
63
+
64
+ Args:
65
+ address: The recipient phone number or email address to check
66
+
67
+ from_: Optional sender phone number. If omitted, an available phone from your pool is
68
+ used automatically.
69
+
70
+ extra_headers: Send extra headers
71
+
72
+ extra_query: Add additional query parameters to the request
73
+
74
+ extra_body: Add additional JSON properties to the request
75
+
76
+ timeout: Override the client-level default timeout for this request, in seconds
77
+ """
78
+ return self._post(
79
+ "/v3/capability/check_imessage",
80
+ body=maybe_transform(
81
+ {
82
+ "address": address,
83
+ "from_": from_,
84
+ },
85
+ capability_check_i_message_params.CapabilityCheckiMessageParams,
86
+ ),
87
+ options=make_request_options(
88
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
89
+ ),
90
+ cast_to=HandleCheckResponse,
91
+ )
92
+
93
+ def check_RCS(
94
+ self,
95
+ *,
96
+ address: str,
97
+ from_: str | Omit = omit,
98
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99
+ # The extra values given here take precedence over values defined on the client or passed to this method.
100
+ extra_headers: Headers | None = None,
101
+ extra_query: Query | None = None,
102
+ extra_body: Body | None = None,
103
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
104
+ ) -> HandleCheckResponse:
105
+ """
106
+ Check whether a recipient address (phone number) supports RCS messaging.
107
+
108
+ Args:
109
+ address: The recipient phone number or email address to check
110
+
111
+ from_: Optional sender phone number. If omitted, an available phone from your pool is
112
+ used automatically.
113
+
114
+ extra_headers: Send extra headers
115
+
116
+ extra_query: Add additional query parameters to the request
117
+
118
+ extra_body: Add additional JSON properties to the request
119
+
120
+ timeout: Override the client-level default timeout for this request, in seconds
121
+ """
122
+ return self._post(
123
+ "/v3/capability/check_rcs",
124
+ body=maybe_transform(
125
+ {
126
+ "address": address,
127
+ "from_": from_,
128
+ },
129
+ capability_check_RCS_params.CapabilityCheckRCSParams,
130
+ ),
131
+ options=make_request_options(
132
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
133
+ ),
134
+ cast_to=HandleCheckResponse,
135
+ )
136
+
137
+
138
+ class AsyncCapabilityResource(AsyncAPIResource):
139
+ """
140
+ Check whether a recipient address supports iMessage or RCS before sending a message.
141
+ """
142
+
143
+ @cached_property
144
+ def with_raw_response(self) -> AsyncCapabilityResourceWithRawResponse:
145
+ """
146
+ This property can be used as a prefix for any HTTP method call to return
147
+ the raw response object instead of the parsed content.
148
+
149
+ For more information, see https://www.github.com/linq-team/linq-python#accessing-raw-response-data-eg-headers
150
+ """
151
+ return AsyncCapabilityResourceWithRawResponse(self)
152
+
153
+ @cached_property
154
+ def with_streaming_response(self) -> AsyncCapabilityResourceWithStreamingResponse:
155
+ """
156
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
157
+
158
+ For more information, see https://www.github.com/linq-team/linq-python#with_streaming_response
159
+ """
160
+ return AsyncCapabilityResourceWithStreamingResponse(self)
161
+
162
+ async def check_i_message(
163
+ self,
164
+ *,
165
+ address: str,
166
+ from_: str | Omit = omit,
167
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168
+ # The extra values given here take precedence over values defined on the client or passed to this method.
169
+ extra_headers: Headers | None = None,
170
+ extra_query: Query | None = None,
171
+ extra_body: Body | None = None,
172
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
173
+ ) -> HandleCheckResponse:
174
+ """
175
+ Check whether a recipient address (phone number or email) is reachable via
176
+ iMessage.
177
+
178
+ Args:
179
+ address: The recipient phone number or email address to check
180
+
181
+ from_: Optional sender phone number. If omitted, an available phone from your pool is
182
+ used automatically.
183
+
184
+ extra_headers: Send extra headers
185
+
186
+ extra_query: Add additional query parameters to the request
187
+
188
+ extra_body: Add additional JSON properties to the request
189
+
190
+ timeout: Override the client-level default timeout for this request, in seconds
191
+ """
192
+ return await self._post(
193
+ "/v3/capability/check_imessage",
194
+ body=await async_maybe_transform(
195
+ {
196
+ "address": address,
197
+ "from_": from_,
198
+ },
199
+ capability_check_i_message_params.CapabilityCheckiMessageParams,
200
+ ),
201
+ options=make_request_options(
202
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
203
+ ),
204
+ cast_to=HandleCheckResponse,
205
+ )
206
+
207
+ async def check_RCS(
208
+ self,
209
+ *,
210
+ address: str,
211
+ from_: str | Omit = omit,
212
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
213
+ # The extra values given here take precedence over values defined on the client or passed to this method.
214
+ extra_headers: Headers | None = None,
215
+ extra_query: Query | None = None,
216
+ extra_body: Body | None = None,
217
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
218
+ ) -> HandleCheckResponse:
219
+ """
220
+ Check whether a recipient address (phone number) supports RCS messaging.
221
+
222
+ Args:
223
+ address: The recipient phone number or email address to check
224
+
225
+ from_: Optional sender phone number. If omitted, an available phone from your pool is
226
+ used automatically.
227
+
228
+ extra_headers: Send extra headers
229
+
230
+ extra_query: Add additional query parameters to the request
231
+
232
+ extra_body: Add additional JSON properties to the request
233
+
234
+ timeout: Override the client-level default timeout for this request, in seconds
235
+ """
236
+ return await self._post(
237
+ "/v3/capability/check_rcs",
238
+ body=await async_maybe_transform(
239
+ {
240
+ "address": address,
241
+ "from_": from_,
242
+ },
243
+ capability_check_RCS_params.CapabilityCheckRCSParams,
244
+ ),
245
+ options=make_request_options(
246
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
247
+ ),
248
+ cast_to=HandleCheckResponse,
249
+ )
250
+
251
+
252
+ class CapabilityResourceWithRawResponse:
253
+ def __init__(self, capability: CapabilityResource) -> None:
254
+ self._capability = capability
255
+
256
+ self.check_i_message = to_raw_response_wrapper(
257
+ capability.check_i_message,
258
+ )
259
+ self.check_RCS = to_raw_response_wrapper(
260
+ capability.check_RCS,
261
+ )
262
+
263
+
264
+ class AsyncCapabilityResourceWithRawResponse:
265
+ def __init__(self, capability: AsyncCapabilityResource) -> None:
266
+ self._capability = capability
267
+
268
+ self.check_i_message = async_to_raw_response_wrapper(
269
+ capability.check_i_message,
270
+ )
271
+ self.check_RCS = async_to_raw_response_wrapper(
272
+ capability.check_RCS,
273
+ )
274
+
275
+
276
+ class CapabilityResourceWithStreamingResponse:
277
+ def __init__(self, capability: CapabilityResource) -> None:
278
+ self._capability = capability
279
+
280
+ self.check_i_message = to_streamed_response_wrapper(
281
+ capability.check_i_message,
282
+ )
283
+ self.check_RCS = to_streamed_response_wrapper(
284
+ capability.check_RCS,
285
+ )
286
+
287
+
288
+ class AsyncCapabilityResourceWithStreamingResponse:
289
+ def __init__(self, capability: AsyncCapabilityResource) -> None:
290
+ self._capability = capability
291
+
292
+ self.check_i_message = async_to_streamed_response_wrapper(
293
+ capability.check_i_message,
294
+ )
295
+ self.check_RCS = async_to_streamed_response_wrapper(
296
+ capability.check_RCS,
297
+ )
@@ -0,0 +1,61 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .chats import (
4
+ ChatsResource,
5
+ AsyncChatsResource,
6
+ ChatsResourceWithRawResponse,
7
+ AsyncChatsResourceWithRawResponse,
8
+ ChatsResourceWithStreamingResponse,
9
+ AsyncChatsResourceWithStreamingResponse,
10
+ )
11
+ from .typing import (
12
+ TypingResource,
13
+ AsyncTypingResource,
14
+ TypingResourceWithRawResponse,
15
+ AsyncTypingResourceWithRawResponse,
16
+ TypingResourceWithStreamingResponse,
17
+ AsyncTypingResourceWithStreamingResponse,
18
+ )
19
+ from .messages import (
20
+ MessagesResource,
21
+ AsyncMessagesResource,
22
+ MessagesResourceWithRawResponse,
23
+ AsyncMessagesResourceWithRawResponse,
24
+ MessagesResourceWithStreamingResponse,
25
+ AsyncMessagesResourceWithStreamingResponse,
26
+ )
27
+ from .participants import (
28
+ ParticipantsResource,
29
+ AsyncParticipantsResource,
30
+ ParticipantsResourceWithRawResponse,
31
+ AsyncParticipantsResourceWithRawResponse,
32
+ ParticipantsResourceWithStreamingResponse,
33
+ AsyncParticipantsResourceWithStreamingResponse,
34
+ )
35
+
36
+ __all__ = [
37
+ "ParticipantsResource",
38
+ "AsyncParticipantsResource",
39
+ "ParticipantsResourceWithRawResponse",
40
+ "AsyncParticipantsResourceWithRawResponse",
41
+ "ParticipantsResourceWithStreamingResponse",
42
+ "AsyncParticipantsResourceWithStreamingResponse",
43
+ "TypingResource",
44
+ "AsyncTypingResource",
45
+ "TypingResourceWithRawResponse",
46
+ "AsyncTypingResourceWithRawResponse",
47
+ "TypingResourceWithStreamingResponse",
48
+ "AsyncTypingResourceWithStreamingResponse",
49
+ "MessagesResource",
50
+ "AsyncMessagesResource",
51
+ "MessagesResourceWithRawResponse",
52
+ "AsyncMessagesResourceWithRawResponse",
53
+ "MessagesResourceWithStreamingResponse",
54
+ "AsyncMessagesResourceWithStreamingResponse",
55
+ "ChatsResource",
56
+ "AsyncChatsResource",
57
+ "ChatsResourceWithRawResponse",
58
+ "AsyncChatsResourceWithRawResponse",
59
+ "ChatsResourceWithStreamingResponse",
60
+ "AsyncChatsResourceWithStreamingResponse",
61
+ ]