@@ -19,28 +19,41 @@ class MultiAttachmentsMessagesApi(MessagesApi):
1919
2020 @validate_call (config = ConfigDict (arbitrary_types_allowed = True ))
2121 async def v4_stream_sid_multi_attachment_message_create_post (
22- self ,
23- sid : Annotated [StrictStr , Field (description = "Stream ID" )],
24- session_token : Annotated [StrictStr , Field (description = "Authorization token used to make delegated calls." )],
25- key_manager_token : Annotated [Optional [StrictStr ], Field (description = "Key Manager authentication token." )] = None ,
26- message : Annotated [Optional [StrictStr ], Field (description = "The message payload in MessageML." )] = None ,
27- data : Annotated [Optional [StrictStr ], Field (description = "Optional message data in EntityJSON." )] = None ,
28- version : Annotated [Optional [StrictStr ], Field (
29- description = 'Optional message version in the format "major.minor". If empty, defaults to the latest supported version. ' )] = None ,
30- attachment : Annotated [Optional [List [io .IOBase ]], Field (description = "Optional file attachment." )] = None ,
31- preview : Annotated [Optional [List [io .IOBase ]], Field (description = "Optional attachment preview." )] = None ,
32- _request_timeout : Union [
33- None ,
34- Annotated [StrictFloat , Field (gt = 0 )],
35- Tuple [
36- Annotated [StrictFloat , Field (gt = 0 )],
37- Annotated [StrictFloat , Field (gt = 0 )]
38- ]
39- ] = None ,
40- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
41- _content_type : Optional [StrictStr ] = None ,
42- _headers : Optional [Dict [StrictStr , Any ]] = None ,
43- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
22+ self ,
23+ sid : Annotated [StrictStr , Field (description = "Stream ID" )],
24+ session_token : Annotated [
25+ StrictStr , Field (description = "Authorization token used to make delegated calls." )
26+ ],
27+ key_manager_token : Annotated [
28+ Optional [StrictStr ], Field (description = "Key Manager authentication token." )
29+ ] = None ,
30+ message : Annotated [
31+ Optional [StrictStr ], Field (description = "The message payload in MessageML." )
32+ ] = None ,
33+ data : Annotated [
34+ Optional [StrictStr ], Field (description = "Optional message data in EntityJSON." )
35+ ] = None ,
36+ version : Annotated [
37+ Optional [StrictStr ],
38+ Field (
39+ description = 'Optional message version in the format "major.minor". If empty, defaults to the latest supported version. '
40+ ),
41+ ] = None ,
42+ attachment : Annotated [
43+ Optional [List [io .IOBase ]], Field (description = "Optional file attachment." )
44+ ] = None ,
45+ preview : Annotated [
46+ Optional [List [io .IOBase ]], Field (description = "Optional attachment preview." )
47+ ] = None ,
48+ _request_timeout : Union [
49+ None ,
50+ Annotated [StrictFloat , Field (gt = 0 )],
51+ Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
52+ ] = None ,
53+ _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
54+ _content_type : Optional [StrictStr ] = None ,
55+ _headers : Optional [Dict [StrictStr , Any ]] = None ,
56+ _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
4457 ) -> V4Message :
4558 """Post a message to one existing stream."""
4659 _param = self ._v4_stream_sid_multi_attachment_message_create_post_serialize (
@@ -55,19 +68,38 @@ async def v4_stream_sid_multi_attachment_message_create_post(
5568 _request_auth = _request_auth ,
5669 _content_type = _content_type ,
5770 _headers = _headers ,
58- _host_index = _host_index
71+ _host_index = _host_index ,
5972 )
6073
61- _response_types_map : Dict [str , Optional [str ]] = {'200' : "V4Message" , '400' : "Error" , '401' : "Error" ,
62- '403' : "Error" , '500' : "Error" }
74+ _response_types_map : Dict [str , Optional [str ]] = {
75+ "200" : "V4Message" ,
76+ "400" : "Error" ,
77+ "401" : "Error" ,
78+ "403" : "Error" ,
79+ "500" : "Error" ,
80+ }
6381 response_data = await self .api_client .call_api (* _param , _request_timeout = _request_timeout )
6482 await response_data .read ()
65- return self .api_client .response_deserialize (response_data = response_data ,
66- response_types_map = _response_types_map , ).data
83+ return self .api_client .response_deserialize (
84+ response_data = response_data ,
85+ response_types_map = _response_types_map ,
86+ ).data
6787
6888 def _v4_stream_sid_multi_attachment_message_create_post_serialize (
69- self , sid , session_token , key_manager_token , message , data , version , attachment , preview , _request_auth ,
70- _content_type , _headers , _host_index ) -> RequestSerialized :
89+ self ,
90+ sid ,
91+ session_token ,
92+ key_manager_token ,
93+ message ,
94+ data ,
95+ version ,
96+ attachment ,
97+ preview ,
98+ _request_auth ,
99+ _content_type ,
100+ _headers ,
101+ _host_index ,
102+ ) -> RequestSerialized :
71103 _host = None
72104 _collection_formats : Dict [str , str ] = {}
73105 _path_params : Dict [str , str ] = {}
@@ -78,70 +110,93 @@ def _v4_stream_sid_multi_attachment_message_create_post_serialize(
78110 _body_params : Optional [bytes ] = None
79111
80112 if sid is not None :
81- _path_params [' sid' ] = sid
113+ _path_params [" sid" ] = sid
82114 if session_token is not None :
83- _header_params [' sessionToken' ] = session_token
115+ _header_params [" sessionToken" ] = session_token
84116 if key_manager_token is not None :
85- _header_params [' keyManagerToken' ] = key_manager_token
117+ _header_params [" keyManagerToken" ] = key_manager_token
86118 if message is not None :
87- _form_params .append ((' message' , message ))
119+ _form_params .append ((" message" , message ))
88120 if data is not None :
89- _form_params .append ((' data' , data ))
121+ _form_params .append ((" data" , data ))
90122 if version is not None :
91- _form_params .append ((' version' , version ))
123+ _form_params .append ((" version" , version ))
92124 if attachment :
93125 for att_file in attachment :
94126 filename = os .path .basename (att_file .name )
95127 filedata = att_file .read ()
96- mimetype = mimetypes .guess_type (filename )[0 ] or ' application/octet-stream'
97- _form_params .append ((' attachment' , (filename , filedata , mimetype )))
128+ mimetype = mimetypes .guess_type (filename )[0 ] or " application/octet-stream"
129+ _form_params .append ((" attachment" , (filename , filedata , mimetype )))
98130 if preview :
99131 for prev_file in preview :
100132 filename = os .path .basename (prev_file .name )
101133 filedata = prev_file .read ()
102- mimetype = mimetypes .guess_type (filename )[0 ] or ' application/octet-stream'
103- _form_params .append ((' preview' , (filename , filedata , mimetype )))
134+ mimetype = mimetypes .guess_type (filename )[0 ] or " application/octet-stream"
135+ _form_params .append ((" preview" , (filename , filedata , mimetype )))
104136
105- if ' Accept' not in _header_params :
106- _header_params [' Accept' ] = self .api_client .select_header_accept ([' application/json' ])
137+ if " Accept" not in _header_params :
138+ _header_params [" Accept" ] = self .api_client .select_header_accept ([" application/json" ])
107139 if _content_type :
108- _header_params [' Content-Type' ] = _content_type
140+ _header_params [" Content-Type" ] = _content_type
109141 else :
110- _default_content_type = self .api_client .select_header_content_type (['multipart/form-data' ])
142+ _default_content_type = self .api_client .select_header_content_type (
143+ ["multipart/form-data" ]
144+ )
111145 if _default_content_type is not None :
112- _header_params [' Content-Type' ] = _default_content_type
146+ _header_params [" Content-Type" ] = _default_content_type
113147
114- return self .api_client .param_serialize (method = 'POST' , resource_path = '/v4/stream/{sid}/message/create' ,
115- path_params = _path_params , query_params = _query_params ,
116- header_params = _header_params , body = _body_params ,
117- post_params = _form_params , files = _files , auth_settings = [],
118- collection_formats = _collection_formats , _host = _host ,
119- _request_auth = _request_auth )
148+ return self .api_client .param_serialize (
149+ method = "POST" ,
150+ resource_path = "/v4/stream/{sid}/message/create" ,
151+ path_params = _path_params ,
152+ query_params = _query_params ,
153+ header_params = _header_params ,
154+ body = _body_params ,
155+ post_params = _form_params ,
156+ files = _files ,
157+ auth_settings = [],
158+ collection_formats = _collection_formats ,
159+ _host = _host ,
160+ _request_auth = _request_auth ,
161+ )
120162
121163 @validate_call (config = ConfigDict (arbitrary_types_allowed = True ))
122164 async def v4_multi_attachment_message_blast_post (
123- self ,
124- session_token : Annotated [StrictStr , Field (description = "Authorization token used to make delegated calls." )],
125- sids : Annotated [List [StrictStr ], Field (description = "A comma-separated list of Stream IDs" )],
126- key_manager_token : Annotated [Optional [StrictStr ], Field (description = "Key Manager authentication token." )] = None ,
127- message : Annotated [Optional [StrictStr ], Field (description = "The message payload in MessageML." )] = None ,
128- data : Annotated [Optional [StrictStr ], Field (description = "Optional message data in EntityJSON." )] = None ,
129- version : Annotated [Optional [StrictStr ], Field (
130- description = 'Optional message version in the format "major.minor". If empty, defaults to the latest supported version. ' )] = None ,
131- attachment : Annotated [Optional [List [io .IOBase ]], Field (description = "Optional file attachment." )] = None ,
132- preview : Annotated [Optional [List [io .IOBase ]], Field (description = "Optional attachment preview." )] = None ,
133- _request_timeout : Union [
134- None ,
135- Annotated [StrictFloat , Field (gt = 0 )],
136- Tuple [
137- Annotated [StrictFloat , Field (gt = 0 )],
138- Annotated [StrictFloat , Field (gt = 0 )]
139- ]
140- ] = None ,
141- _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
142- _content_type : Optional [StrictStr ] = None ,
143- _headers : Optional [Dict [StrictStr , Any ]] = None ,
144- _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
165+ self ,
166+ session_token : Annotated [
167+ StrictStr , Field (description = "Authorization token used to make delegated calls." )
168+ ],
169+ sids : Annotated [List [StrictStr ], Field (description = "A comma-separated list of Stream IDs" )],
170+ key_manager_token : Annotated [
171+ Optional [StrictStr ], Field (description = "Key Manager authentication token." )
172+ ] = None ,
173+ message : Annotated [
174+ Optional [StrictStr ], Field (description = "The message payload in MessageML." )
175+ ] = None ,
176+ data : Annotated [
177+ Optional [StrictStr ], Field (description = "Optional message data in EntityJSON." )
178+ ] = None ,
179+ version : Annotated [
180+ Optional [StrictStr ],
181+ Field (
182+ description = 'Optional message version in the format "major.minor". If empty, defaults to the latest supported version. '
183+ ),
184+ ] = None ,
185+ attachment : Annotated [
186+ Optional [List [io .IOBase ]], Field (description = "Optional file attachment." )
187+ ] = None ,
188+ preview : Annotated [
189+ Optional [List [io .IOBase ]], Field (description = "Optional attachment preview." )
190+ ] = None ,
191+ _request_timeout : Union [
192+ None ,
193+ Annotated [StrictFloat , Field (gt = 0 )],
194+ Tuple [Annotated [StrictFloat , Field (gt = 0 )], Annotated [StrictFloat , Field (gt = 0 )]],
195+ ] = None ,
196+ _request_auth : Optional [Dict [StrictStr , Any ]] = None ,
197+ _content_type : Optional [StrictStr ] = None ,
198+ _headers : Optional [Dict [StrictStr , Any ]] = None ,
199+ _host_index : Annotated [StrictInt , Field (ge = 0 , le = 0 )] = 0 ,
145200 ) -> V4MessageBlastResponse :
146201 """Post a message to multiple existing streams."""
147202 _param = self ._v4_multi_attachment_message_blast_post_serialize (
@@ -156,21 +211,40 @@ async def v4_multi_attachment_message_blast_post(
156211 _request_auth = _request_auth ,
157212 _content_type = _content_type ,
158213 _headers = _headers ,
159- _host_index = _host_index
214+ _host_index = _host_index ,
160215 )
161216
162- _response_types_map : Dict [str , Optional [str ]] = {'200' : "V4MessageBlastResponse" , '400' : "Error" ,
163- '401' : "Error" , '403' : "Error" , '500' : "Error" }
217+ _response_types_map : Dict [str , Optional [str ]] = {
218+ "200" : "V4MessageBlastResponse" ,
219+ "400" : "Error" ,
220+ "401" : "Error" ,
221+ "403" : "Error" ,
222+ "500" : "Error" ,
223+ }
164224 response_data = await self .api_client .call_api (* _param , _request_timeout = _request_timeout )
165225 await response_data .read ()
166- return self .api_client .response_deserialize (response_data = response_data ,
167- response_types_map = _response_types_map , ).data
226+ return self .api_client .response_deserialize (
227+ response_data = response_data ,
228+ response_types_map = _response_types_map ,
229+ ).data
168230
169231 def _v4_multi_attachment_message_blast_post_serialize (
170- self , session_token , sids , key_manager_token , message , data , version , attachment , preview , _request_auth ,
171- _content_type , _headers , _host_index ) -> RequestSerialized :
232+ self ,
233+ session_token ,
234+ sids ,
235+ key_manager_token ,
236+ message ,
237+ data ,
238+ version ,
239+ attachment ,
240+ preview ,
241+ _request_auth ,
242+ _content_type ,
243+ _headers ,
244+ _host_index ,
245+ ) -> RequestSerialized :
172246 _host = None
173- _collection_formats : Dict [str , str ] = {' sids' : ' csv' }
247+ _collection_formats : Dict [str , str ] = {" sids" : " csv" }
174248 _path_params : Dict [str , str ] = {}
175249 _query_params : List [Tuple [str , str ]] = []
176250 _header_params : Dict [str , Optional [str ]] = _headers or {}
@@ -179,42 +253,52 @@ def _v4_multi_attachment_message_blast_post_serialize(
179253 _body_params : Optional [bytes ] = None
180254
181255 if session_token is not None :
182- _header_params [' sessionToken' ] = session_token
256+ _header_params [" sessionToken" ] = session_token
183257 if key_manager_token is not None :
184- _header_params [' keyManagerToken' ] = key_manager_token
258+ _header_params [" keyManagerToken" ] = key_manager_token
185259 if sids is not None :
186- _form_params .append ((' sids' , sids ))
260+ _form_params .append ((" sids" , sids ))
187261 if message is not None :
188- _form_params .append ((' message' , message ))
262+ _form_params .append ((" message" , message ))
189263 if data is not None :
190- _form_params .append ((' data' , data ))
264+ _form_params .append ((" data" , data ))
191265 if version is not None :
192- _form_params .append ((' version' , version ))
266+ _form_params .append ((" version" , version ))
193267 if attachment :
194268 for att_file in attachment :
195269 filename = os .path .basename (att_file .name )
196270 filedata = att_file .read ()
197- mimetype = mimetypes .guess_type (filename )[0 ] or ' application/octet-stream'
198- _form_params .append ((' attachment' , (filename , filedata , mimetype )))
271+ mimetype = mimetypes .guess_type (filename )[0 ] or " application/octet-stream"
272+ _form_params .append ((" attachment" , (filename , filedata , mimetype )))
199273 if preview :
200274 for prev_file in preview :
201275 filename = os .path .basename (prev_file .name )
202276 filedata = prev_file .read ()
203- mimetype = mimetypes .guess_type (filename )[0 ] or ' application/octet-stream'
204- _form_params .append ((' preview' , (filename , filedata , mimetype )))
277+ mimetype = mimetypes .guess_type (filename )[0 ] or " application/octet-stream"
278+ _form_params .append ((" preview" , (filename , filedata , mimetype )))
205279
206- if ' Accept' not in _header_params :
207- _header_params [' Accept' ] = self .api_client .select_header_accept ([' application/json' ])
280+ if " Accept" not in _header_params :
281+ _header_params [" Accept" ] = self .api_client .select_header_accept ([" application/json" ])
208282 if _content_type :
209- _header_params [' Content-Type' ] = _content_type
283+ _header_params [" Content-Type" ] = _content_type
210284 else :
211- _default_content_type = self .api_client .select_header_content_type (['multipart/form-data' ])
285+ _default_content_type = self .api_client .select_header_content_type (
286+ ["multipart/form-data" ]
287+ )
212288 if _default_content_type is not None :
213- _header_params ['Content-Type' ] = _default_content_type
214-
215- return self .api_client .param_serialize (method = 'POST' , resource_path = '/v4/message/blast' ,
216- path_params = _path_params , query_params = _query_params ,
217- header_params = _header_params , body = _body_params ,
218- post_params = _form_params , files = _files , auth_settings = [],
219- collection_formats = _collection_formats , _host = _host ,
220- _request_auth = _request_auth )
289+ _header_params ["Content-Type" ] = _default_content_type
290+
291+ return self .api_client .param_serialize (
292+ method = "POST" ,
293+ resource_path = "/v4/message/blast" ,
294+ path_params = _path_params ,
295+ query_params = _query_params ,
296+ header_params = _header_params ,
297+ body = _body_params ,
298+ post_params = _form_params ,
299+ files = _files ,
300+ auth_settings = [],
301+ collection_formats = _collection_formats ,
302+ _host = _host ,
303+ _request_auth = _request_auth ,
304+ )
0 commit comments