3
3
"""
4
4
message_media_webhooks.controllers.api_controller
5
5
6
- This file was automatically generated for MessageMedia by APIMATIC v2.0 ( https://apimatic.io ).
6
+
7
7
"""
8
8
9
9
import logging
@@ -25,7 +25,7 @@ def __init__(self, client=None, call_back=None):
25
25
def create (self ,
26
26
content_type ,
27
27
body ):
28
- """Does a POST request to /v1/webooks /messages.
28
+ """Does a POST request to /v1/webhooks /messages.
29
29
30
30
This will create a webhook for the specified `events`
31
31
### Parameters
@@ -75,11 +75,11 @@ def create(self,
75
75
</ul>
76
76
77
77
Args:
78
- content_type (string): TODO: type description here. Example:
79
- body (CreateRequest): TODO: type description here. Example:
78
+ content_type (string): TODO: type description here. Example:
79
+ body (CreateRequest): TODO: type description here. Example:
80
80
81
81
Returns:
82
- mixed: Response from the API.
82
+ mixed: Response from the API.
83
83
84
84
Raises:
85
85
APIException: When an error occurs while fetching the data from
@@ -90,20 +90,20 @@ def create(self,
90
90
"""
91
91
try :
92
92
self .logger .info ('create called.' )
93
-
93
+
94
94
# Prepare query URL
95
95
self .logger .info ('Preparing query URL for create.' )
96
96
_query_builder = Configuration .base_uri
97
- _query_builder += '/v1/webooks /messages'
97
+ _query_builder += '/v1/webhooks /messages'
98
98
_query_url = APIHelper .clean_url (_query_builder )
99
-
99
+
100
100
# Prepare headers
101
101
self .logger .info ('Preparing headers for create.' )
102
102
_headers = {
103
103
'accept' : 'application/json' ,
104
104
'Content-Type' : content_type
105
105
}
106
-
106
+
107
107
# Prepare and execute request
108
108
self .logger .info ('Preparing and executing request for create.' )
109
109
_request = self .http_client .post (_query_url , headers = _headers , parameters = APIHelper .json_serialize (body ))
@@ -115,7 +115,7 @@ def create(self,
115
115
if _context .response .status_code == 400 :
116
116
raise APIException ('' , _context )
117
117
self .validate_response (_context )
118
-
118
+
119
119
# Return appropriate type
120
120
return APIHelper .json_deserialize (_context .response .raw_body )
121
121
@@ -125,7 +125,7 @@ def create(self,
125
125
126
126
def delete_delete_and_update_webhook (self ,
127
127
webhook_id ):
128
- """Does a DELETE request to /v1/webooks /messages/{webhookId}.
128
+ """Does a DELETE request to /v1/webhooks /messages/{webhookId}.
129
129
130
130
This will delete the webhook wuth the give id.
131
131
a **Response 404 is returned when** :
@@ -134,10 +134,10 @@ def delete_delete_and_update_webhook(self,
134
134
</ul>
135
135
136
136
Args:
137
- webhook_id (uuid|string): TODO: type description here. Example:
137
+ webhook_id (uuid|string): TODO: type description here. Example:
138
138
139
139
Returns:
140
- void: Response from the API.
140
+ void: Response from the API.
141
141
142
142
Raises:
143
143
APIException: When an error occurs while fetching the data from
@@ -148,16 +148,16 @@ def delete_delete_and_update_webhook(self,
148
148
"""
149
149
try :
150
150
self .logger .info ('delete_delete_and_update_webhook called.' )
151
-
151
+
152
152
# Prepare query URL
153
153
self .logger .info ('Preparing query URL for delete_delete_and_update_webhook.' )
154
154
_query_builder = Configuration .base_uri
155
- _query_builder += '/v1/webooks /messages/{webhookId}'
156
- _query_builder = APIHelper .append_url_with_template_parameters (_query_builder , {
155
+ _query_builder += '/v1/webhooks /messages/{webhookId}'
156
+ _query_builder = APIHelper .append_url_with_template_parameters (_query_builder , {
157
157
'webhookId' : webhook_id
158
158
})
159
159
_query_url = APIHelper .clean_url (_query_builder )
160
-
160
+
161
161
# Prepare and execute request
162
162
self .logger .info ('Preparing and executing request for delete_delete_and_update_webhook.' )
163
163
_request = self .http_client .delete (_query_url )
@@ -177,7 +177,7 @@ def delete_delete_and_update_webhook(self,
177
177
def retrieve (self ,
178
178
page = None ,
179
179
page_size = None ):
180
- """Does a GET request to /v1/webooks /messages/.
180
+ """Does a GET request to /v1/webhooks /messages/.
181
181
182
182
This will retrieve all webhooks for the account we're connected with.
183
183
a **Response 400 is returned when** :
@@ -187,11 +187,11 @@ def retrieve(self,
187
187
</ul>
188
188
189
189
Args:
190
- page (int, optional): TODO: type description here. Example:
191
- page_size (int, optional): TODO: type description here. Example:
190
+ page (int, optional): TODO: type description here. Example:
191
+ page_size (int, optional): TODO: type description here. Example:
192
192
193
193
Returns:
194
- RetrieveResponse: Response from the API.
194
+ RetrieveResponse: Response from the API.
195
195
196
196
Raises:
197
197
APIException: When an error occurs while fetching the data from
@@ -202,25 +202,25 @@ def retrieve(self,
202
202
"""
203
203
try :
204
204
self .logger .info ('retrieve called.' )
205
-
205
+
206
206
# Prepare query URL
207
207
self .logger .info ('Preparing query URL for retrieve.' )
208
208
_query_builder = Configuration .base_uri
209
- _query_builder += '/v1/webooks /messages/'
209
+ _query_builder += '/v1/webhooks /messages/'
210
210
_query_parameters = {
211
211
'page' : page ,
212
212
'pageSize' : page_size
213
213
}
214
214
_query_builder = APIHelper .append_url_with_query_parameters (_query_builder ,
215
215
_query_parameters , Configuration .array_serialization )
216
216
_query_url = APIHelper .clean_url (_query_builder )
217
-
217
+
218
218
# Prepare headers
219
219
self .logger .info ('Preparing headers for retrieve.' )
220
220
_headers = {
221
221
'accept' : 'application/json'
222
222
}
223
-
223
+
224
224
# Prepare and execute request
225
225
self .logger .info ('Preparing and executing request for retrieve.' )
226
226
_request = self .http_client .get (_query_url , headers = _headers )
@@ -232,7 +232,7 @@ def retrieve(self,
232
232
if _context .response .status_code == 400 :
233
233
raise APIException ('' , _context )
234
234
self .validate_response (_context )
235
-
235
+
236
236
# Return appropriate type
237
237
return APIHelper .json_deserialize (_context .response .raw_body , RetrieveResponse .from_dictionary )
238
238
@@ -244,17 +244,17 @@ def update(self,
244
244
webhook_id ,
245
245
content_type ,
246
246
body ):
247
- """Does a PATCH request to /v1/webooks /messages/{webhookId}.
247
+ """Does a PATCH request to /v1/webhooks /messages/{webhookId}.
248
248
249
- This will update a webhook and returned the updated Webhook.
249
+ This will update a webhook and returned the updated Webhook.
250
250
you can update all the attributes individually or together.
251
251
PS : the new value will override the previous one.
252
252
### Parameters
253
253
+ same parameters rules as create webhook apply
254
254
a **Response 404 is returned when** :
255
255
<ul>
256
256
<li>there is no webhook with this `webhookId` </li>
257
- </ul>
257
+ </ul>
258
258
a **Response 400 is returned when** :
259
259
<ul>
260
260
<li>all attributes are null </li>
@@ -264,12 +264,12 @@ def update(self,
264
264
</ul>
265
265
266
266
Args:
267
- webhook_id (uuid|string): TODO: type description here. Example:
268
- content_type (string): TODO: type description here. Example:
269
- body (UpdateRequest): TODO: type description here. Example:
267
+ webhook_id (uuid|string): TODO: type description here. Example:
268
+ content_type (string): TODO: type description here. Example:
269
+ body (UpdateRequest): TODO: type description here. Example:
270
270
271
271
Returns:
272
- void: Response from the API.
272
+ void: Response from the API.
273
273
274
274
Raises:
275
275
APIException: When an error occurs while fetching the data from
@@ -280,22 +280,22 @@ def update(self,
280
280
"""
281
281
try :
282
282
self .logger .info ('update called.' )
283
-
283
+
284
284
# Prepare query URL
285
285
self .logger .info ('Preparing query URL for update.' )
286
286
_query_builder = Configuration .base_uri
287
- _query_builder += '/v1/webooks /messages/{webhookId}'
288
- _query_builder = APIHelper .append_url_with_template_parameters (_query_builder , {
287
+ _query_builder += '/v1/webhooks /messages/{webhookId}'
288
+ _query_builder = APIHelper .append_url_with_template_parameters (_query_builder , {
289
289
'webhookId' : webhook_id
290
290
})
291
291
_query_url = APIHelper .clean_url (_query_builder )
292
-
292
+
293
293
# Prepare headers
294
294
self .logger .info ('Preparing headers for update.' )
295
295
_headers = {
296
296
'Content-Type' : content_type
297
297
}
298
-
298
+
299
299
# Prepare and execute request
300
300
self .logger .info ('Preparing and executing request for update.' )
301
301
_request = self .http_client .patch (_query_url , headers = _headers , parameters = APIHelper .json_serialize (body ))
0 commit comments