pluggy-sdk 1.0.0.post2__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 (163) hide show
  1. pluggy_sdk/__init__.py +183 -0
  2. pluggy_sdk/api/__init__.py +26 -0
  3. pluggy_sdk/api/account_api.py +582 -0
  4. pluggy_sdk/api/acquirer_anticipation_api.py +658 -0
  5. pluggy_sdk/api/acquirer_receivable_api.py +658 -0
  6. pluggy_sdk/api/acquirer_sale_api.py +658 -0
  7. pluggy_sdk/api/auth_api.py +599 -0
  8. pluggy_sdk/api/bill_api.py +561 -0
  9. pluggy_sdk/api/bulk_payment_api.py +854 -0
  10. pluggy_sdk/api/category_api.py +1084 -0
  11. pluggy_sdk/api/connector_api.py +970 -0
  12. pluggy_sdk/api/identity_api.py +575 -0
  13. pluggy_sdk/api/income_report_api.py +308 -0
  14. pluggy_sdk/api/investment_api.py +909 -0
  15. pluggy_sdk/api/items_api.py +1441 -0
  16. pluggy_sdk/api/loan_api.py +561 -0
  17. pluggy_sdk/api/payment_customer_api.py +1399 -0
  18. pluggy_sdk/api/payment_intent_api.py +833 -0
  19. pluggy_sdk/api/payment_recipient_api.py +1976 -0
  20. pluggy_sdk/api/payment_request_api.py +1636 -0
  21. pluggy_sdk/api/portfolio_yield_api.py +574 -0
  22. pluggy_sdk/api/smart_account_api.py +1116 -0
  23. pluggy_sdk/api/transaction_api.py +954 -0
  24. pluggy_sdk/api/webhook_api.py +1391 -0
  25. pluggy_sdk/api_client.py +769 -0
  26. pluggy_sdk/api_response.py +21 -0
  27. pluggy_sdk/configuration.py +466 -0
  28. pluggy_sdk/exceptions.py +200 -0
  29. pluggy_sdk/models/__init__.py +145 -0
  30. pluggy_sdk/models/account.py +134 -0
  31. pluggy_sdk/models/accounts_list200_response.py +102 -0
  32. pluggy_sdk/models/acquirer_anticipation.py +117 -0
  33. pluggy_sdk/models/acquirer_anticipation_data.py +101 -0
  34. pluggy_sdk/models/acquirer_data.py +113 -0
  35. pluggy_sdk/models/acquirer_receivable.py +143 -0
  36. pluggy_sdk/models/acquirer_receivable_data.py +108 -0
  37. pluggy_sdk/models/acquirer_receivable_data_establishment.py +96 -0
  38. pluggy_sdk/models/acquirer_receivable_destination_account.py +92 -0
  39. pluggy_sdk/models/acquirer_receivable_related_sale.py +99 -0
  40. pluggy_sdk/models/acquirer_sale.py +171 -0
  41. pluggy_sdk/models/acquirer_sale_data.py +150 -0
  42. pluggy_sdk/models/acquirer_sale_installment.py +93 -0
  43. pluggy_sdk/models/acquirer_sale_installment_data.py +95 -0
  44. pluggy_sdk/models/address.py +110 -0
  45. pluggy_sdk/models/aggregated_portfolio.py +120 -0
  46. pluggy_sdk/models/aggregated_portfolio_response.py +102 -0
  47. pluggy_sdk/models/asset_distribution.py +88 -0
  48. pluggy_sdk/models/auth_request.py +90 -0
  49. pluggy_sdk/models/auth_response.py +88 -0
  50. pluggy_sdk/models/bank_data.py +92 -0
  51. pluggy_sdk/models/bill.py +109 -0
  52. pluggy_sdk/models/bill_finance_charge.py +103 -0
  53. pluggy_sdk/models/bills_list200_response.py +102 -0
  54. pluggy_sdk/models/bulk_payment.py +128 -0
  55. pluggy_sdk/models/bulk_payments_list200_response.py +102 -0
  56. pluggy_sdk/models/category.py +96 -0
  57. pluggy_sdk/models/client_category_rule.py +94 -0
  58. pluggy_sdk/models/company.py +90 -0
  59. pluggy_sdk/models/connect_token_request.py +94 -0
  60. pluggy_sdk/models/connect_token_response.py +88 -0
  61. pluggy_sdk/models/connector.py +141 -0
  62. pluggy_sdk/models/connector_credential.py +121 -0
  63. pluggy_sdk/models/connector_health.py +96 -0
  64. pluggy_sdk/models/connector_health_details.py +90 -0
  65. pluggy_sdk/models/connector_list_response.py +102 -0
  66. pluggy_sdk/models/connector_user_action.py +93 -0
  67. pluggy_sdk/models/create_bulk_payment.py +96 -0
  68. pluggy_sdk/models/create_client_category_rule.py +92 -0
  69. pluggy_sdk/models/create_item.py +111 -0
  70. pluggy_sdk/models/create_item_parameters.py +144 -0
  71. pluggy_sdk/models/create_or_update_payment_customer.py +105 -0
  72. pluggy_sdk/models/create_payment_customer_request_body.py +103 -0
  73. pluggy_sdk/models/create_payment_intent.py +94 -0
  74. pluggy_sdk/models/create_payment_recipient.py +100 -0
  75. pluggy_sdk/models/create_payment_request.py +102 -0
  76. pluggy_sdk/models/create_pix_qr_payment_request.py +96 -0
  77. pluggy_sdk/models/create_smart_account_request.py +102 -0
  78. pluggy_sdk/models/create_webhook.py +99 -0
  79. pluggy_sdk/models/credential_select_option.py +90 -0
  80. pluggy_sdk/models/credit_card_metadata.py +101 -0
  81. pluggy_sdk/models/credit_data.py +127 -0
  82. pluggy_sdk/models/document.py +100 -0
  83. pluggy_sdk/models/email.py +100 -0
  84. pluggy_sdk/models/global_error_response.py +94 -0
  85. pluggy_sdk/models/i_count_response.py +88 -0
  86. pluggy_sdk/models/identity_relation.py +102 -0
  87. pluggy_sdk/models/identity_response.py +149 -0
  88. pluggy_sdk/models/income_report.py +90 -0
  89. pluggy_sdk/models/income_reports_response.py +102 -0
  90. pluggy_sdk/models/investment.py +192 -0
  91. pluggy_sdk/models/investment_expenses.py +108 -0
  92. pluggy_sdk/models/investment_metadata.py +99 -0
  93. pluggy_sdk/models/investment_transaction.py +124 -0
  94. pluggy_sdk/models/investments_list200_response.py +102 -0
  95. pluggy_sdk/models/item.py +148 -0
  96. pluggy_sdk/models/item_creation_error_response.py +102 -0
  97. pluggy_sdk/models/item_error.py +94 -0
  98. pluggy_sdk/models/item_options.py +90 -0
  99. pluggy_sdk/models/loan.py +199 -0
  100. pluggy_sdk/models/loan_contracted_fee.py +118 -0
  101. pluggy_sdk/models/loan_contracted_finance_charge.py +92 -0
  102. pluggy_sdk/models/loan_installment_balloon_payment.py +95 -0
  103. pluggy_sdk/models/loan_installment_balloon_payment_amount.py +90 -0
  104. pluggy_sdk/models/loan_installments.py +130 -0
  105. pluggy_sdk/models/loan_interest_rate.py +136 -0
  106. pluggy_sdk/models/loan_payment_release.py +103 -0
  107. pluggy_sdk/models/loan_payment_release_over_parcel.py +106 -0
  108. pluggy_sdk/models/loan_payment_release_over_parcel_charge.py +92 -0
  109. pluggy_sdk/models/loan_payment_release_over_parcel_fee.py +92 -0
  110. pluggy_sdk/models/loan_payments.py +98 -0
  111. pluggy_sdk/models/loan_warranty.py +94 -0
  112. pluggy_sdk/models/loans_list200_response.py +102 -0
  113. pluggy_sdk/models/merchant.py +96 -0
  114. pluggy_sdk/models/monthly_portfolio.py +100 -0
  115. pluggy_sdk/models/monthly_portfolio_response.py +102 -0
  116. pluggy_sdk/models/not_authenticated_response.py +90 -0
  117. pluggy_sdk/models/page_response_acquirer_anticipations.py +102 -0
  118. pluggy_sdk/models/page_response_acquirer_receivables.py +102 -0
  119. pluggy_sdk/models/page_response_acquirer_sales.py +102 -0
  120. pluggy_sdk/models/page_response_category_rules.py +102 -0
  121. pluggy_sdk/models/page_response_investment_transactions.py +102 -0
  122. pluggy_sdk/models/page_response_transactions.py +102 -0
  123. pluggy_sdk/models/parameter_validation_error.py +92 -0
  124. pluggy_sdk/models/parameter_validation_response.py +98 -0
  125. pluggy_sdk/models/payment_customer.py +105 -0
  126. pluggy_sdk/models/payment_customers_list200_response.py +102 -0
  127. pluggy_sdk/models/payment_data.py +105 -0
  128. pluggy_sdk/models/payment_data_participant.py +101 -0
  129. pluggy_sdk/models/payment_institution.py +101 -0
  130. pluggy_sdk/models/payment_intent.py +145 -0
  131. pluggy_sdk/models/payment_intents_list200_response.py +102 -0
  132. pluggy_sdk/models/payment_recipient.py +106 -0
  133. pluggy_sdk/models/payment_recipient_account.py +99 -0
  134. pluggy_sdk/models/payment_recipients_institution_list200_response.py +102 -0
  135. pluggy_sdk/models/payment_recipients_list200_response.py +102 -0
  136. pluggy_sdk/models/payment_request.py +118 -0
  137. pluggy_sdk/models/payment_request_callback_urls.py +92 -0
  138. pluggy_sdk/models/payment_requests_list200_response.py +102 -0
  139. pluggy_sdk/models/percentage_over_index.py +90 -0
  140. pluggy_sdk/models/phone_number.py +100 -0
  141. pluggy_sdk/models/pix_data.py +90 -0
  142. pluggy_sdk/models/smart_account.py +107 -0
  143. pluggy_sdk/models/smart_account_address.py +112 -0
  144. pluggy_sdk/models/smart_account_balance.py +95 -0
  145. pluggy_sdk/models/smart_accounts_list200_response.py +102 -0
  146. pluggy_sdk/models/status_detail.py +142 -0
  147. pluggy_sdk/models/status_detail_product.py +101 -0
  148. pluggy_sdk/models/status_detail_product_warning.py +92 -0
  149. pluggy_sdk/models/transaction.py +145 -0
  150. pluggy_sdk/models/update_item.py +109 -0
  151. pluggy_sdk/models/update_item_parameters.py +144 -0
  152. pluggy_sdk/models/update_payment_recipient.py +100 -0
  153. pluggy_sdk/models/update_payment_request.py +102 -0
  154. pluggy_sdk/models/update_transaction.py +88 -0
  155. pluggy_sdk/models/webhook.py +106 -0
  156. pluggy_sdk/models/webhook_creation_error_response.py +90 -0
  157. pluggy_sdk/models/webhooks_list200_response.py +102 -0
  158. pluggy_sdk/py.typed +0 -0
  159. pluggy_sdk/rest.py +258 -0
  160. pluggy_sdk-1.0.0.post2.dist-info/METADATA +336 -0
  161. pluggy_sdk-1.0.0.post2.dist-info/RECORD +163 -0
  162. pluggy_sdk-1.0.0.post2.dist-info/WHEEL +5 -0
  163. pluggy_sdk-1.0.0.post2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1391 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pluggy API
5
+
6
+ Pluggy's main API to review data and execute connectors
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: hello@pluggy.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictStr
21
+ from typing_extensions import Annotated
22
+ from pluggy_sdk.models.create_webhook import CreateWebhook
23
+ from pluggy_sdk.models.i_count_response import ICountResponse
24
+ from pluggy_sdk.models.webhook import Webhook
25
+ from pluggy_sdk.models.webhooks_list200_response import WebhooksList200Response
26
+
27
+ from pluggy_sdk.api_client import ApiClient, RequestSerialized
28
+ from pluggy_sdk.api_response import ApiResponse
29
+ from pluggy_sdk.rest import RESTResponseType
30
+
31
+
32
+ class WebhookApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ def webhooks_create(
47
+ self,
48
+ create_webhook: Annotated[CreateWebhook, Field(description="Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event.")],
49
+ _request_timeout: Union[
50
+ None,
51
+ Annotated[StrictFloat, Field(gt=0)],
52
+ Tuple[
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Annotated[StrictFloat, Field(gt=0)]
55
+ ]
56
+ ] = None,
57
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
58
+ _content_type: Optional[StrictStr] = None,
59
+ _headers: Optional[Dict[StrictStr, Any]] = None,
60
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61
+ ) -> Webhook:
62
+ """Create
63
+
64
+ Creates a webhook attached to the specific event and provides the notification url
65
+
66
+ :param create_webhook: Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event. (required)
67
+ :type create_webhook: CreateWebhook
68
+ :param _request_timeout: timeout setting for this request. If one
69
+ number provided, it will be total request
70
+ timeout. It can also be a pair (tuple) of
71
+ (connection, read) timeouts.
72
+ :type _request_timeout: int, tuple(int, int), optional
73
+ :param _request_auth: set to override the auth_settings for an a single
74
+ request; this effectively ignores the
75
+ authentication in the spec for a single request.
76
+ :type _request_auth: dict, optional
77
+ :param _content_type: force content-type for the request.
78
+ :type _content_type: str, Optional
79
+ :param _headers: set to override the headers for a single
80
+ request; this effectively ignores the headers
81
+ in the spec for a single request.
82
+ :type _headers: dict, optional
83
+ :param _host_index: set to override the host_index for a single
84
+ request; this effectively ignores the host_index
85
+ in the spec for a single request.
86
+ :type _host_index: int, optional
87
+ :return: Returns the result object.
88
+ """ # noqa: E501
89
+
90
+ _param = self._webhooks_create_serialize(
91
+ create_webhook=create_webhook,
92
+ _request_auth=_request_auth,
93
+ _content_type=_content_type,
94
+ _headers=_headers,
95
+ _host_index=_host_index
96
+ )
97
+
98
+ _response_types_map: Dict[str, Optional[str]] = {
99
+ '201': "Webhook",
100
+ '400': "ItemCreationErrorResponse",
101
+ '500': "GlobalErrorResponse",
102
+ }
103
+ response_data = self.api_client.call_api(
104
+ *_param,
105
+ _request_timeout=_request_timeout
106
+ )
107
+ response_data.read()
108
+ return self.api_client.response_deserialize(
109
+ response_data=response_data,
110
+ response_types_map=_response_types_map,
111
+ ).data
112
+
113
+
114
+ @validate_call
115
+ def webhooks_create_with_http_info(
116
+ self,
117
+ create_webhook: Annotated[CreateWebhook, Field(description="Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event.")],
118
+ _request_timeout: Union[
119
+ None,
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Tuple[
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Annotated[StrictFloat, Field(gt=0)]
124
+ ]
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[Webhook]:
131
+ """Create
132
+
133
+ Creates a webhook attached to the specific event and provides the notification url
134
+
135
+ :param create_webhook: Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event. (required)
136
+ :type create_webhook: CreateWebhook
137
+ :param _request_timeout: timeout setting for this request. If one
138
+ number provided, it will be total request
139
+ timeout. It can also be a pair (tuple) of
140
+ (connection, read) timeouts.
141
+ :type _request_timeout: int, tuple(int, int), optional
142
+ :param _request_auth: set to override the auth_settings for an a single
143
+ request; this effectively ignores the
144
+ authentication in the spec for a single request.
145
+ :type _request_auth: dict, optional
146
+ :param _content_type: force content-type for the request.
147
+ :type _content_type: str, Optional
148
+ :param _headers: set to override the headers for a single
149
+ request; this effectively ignores the headers
150
+ in the spec for a single request.
151
+ :type _headers: dict, optional
152
+ :param _host_index: set to override the host_index for a single
153
+ request; this effectively ignores the host_index
154
+ in the spec for a single request.
155
+ :type _host_index: int, optional
156
+ :return: Returns the result object.
157
+ """ # noqa: E501
158
+
159
+ _param = self._webhooks_create_serialize(
160
+ create_webhook=create_webhook,
161
+ _request_auth=_request_auth,
162
+ _content_type=_content_type,
163
+ _headers=_headers,
164
+ _host_index=_host_index
165
+ )
166
+
167
+ _response_types_map: Dict[str, Optional[str]] = {
168
+ '201': "Webhook",
169
+ '400': "ItemCreationErrorResponse",
170
+ '500': "GlobalErrorResponse",
171
+ }
172
+ response_data = self.api_client.call_api(
173
+ *_param,
174
+ _request_timeout=_request_timeout
175
+ )
176
+ response_data.read()
177
+ return self.api_client.response_deserialize(
178
+ response_data=response_data,
179
+ response_types_map=_response_types_map,
180
+ )
181
+
182
+
183
+ @validate_call
184
+ def webhooks_create_without_preload_content(
185
+ self,
186
+ create_webhook: Annotated[CreateWebhook, Field(description="Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event.")],
187
+ _request_timeout: Union[
188
+ None,
189
+ Annotated[StrictFloat, Field(gt=0)],
190
+ Tuple[
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Annotated[StrictFloat, Field(gt=0)]
193
+ ]
194
+ ] = None,
195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
196
+ _content_type: Optional[StrictStr] = None,
197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
199
+ ) -> RESTResponseType:
200
+ """Create
201
+
202
+ Creates a webhook attached to the specific event and provides the notification url
203
+
204
+ :param create_webhook: Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event. (required)
205
+ :type create_webhook: CreateWebhook
206
+ :param _request_timeout: timeout setting for this request. If one
207
+ number provided, it will be total request
208
+ timeout. It can also be a pair (tuple) of
209
+ (connection, read) timeouts.
210
+ :type _request_timeout: int, tuple(int, int), optional
211
+ :param _request_auth: set to override the auth_settings for an a single
212
+ request; this effectively ignores the
213
+ authentication in the spec for a single request.
214
+ :type _request_auth: dict, optional
215
+ :param _content_type: force content-type for the request.
216
+ :type _content_type: str, Optional
217
+ :param _headers: set to override the headers for a single
218
+ request; this effectively ignores the headers
219
+ in the spec for a single request.
220
+ :type _headers: dict, optional
221
+ :param _host_index: set to override the host_index for a single
222
+ request; this effectively ignores the host_index
223
+ in the spec for a single request.
224
+ :type _host_index: int, optional
225
+ :return: Returns the result object.
226
+ """ # noqa: E501
227
+
228
+ _param = self._webhooks_create_serialize(
229
+ create_webhook=create_webhook,
230
+ _request_auth=_request_auth,
231
+ _content_type=_content_type,
232
+ _headers=_headers,
233
+ _host_index=_host_index
234
+ )
235
+
236
+ _response_types_map: Dict[str, Optional[str]] = {
237
+ '201': "Webhook",
238
+ '400': "ItemCreationErrorResponse",
239
+ '500': "GlobalErrorResponse",
240
+ }
241
+ response_data = self.api_client.call_api(
242
+ *_param,
243
+ _request_timeout=_request_timeout
244
+ )
245
+ return response_data.response
246
+
247
+
248
+ def _webhooks_create_serialize(
249
+ self,
250
+ create_webhook,
251
+ _request_auth,
252
+ _content_type,
253
+ _headers,
254
+ _host_index,
255
+ ) -> RequestSerialized:
256
+
257
+ _host = None
258
+
259
+ _collection_formats: Dict[str, str] = {
260
+ }
261
+
262
+ _path_params: Dict[str, str] = {}
263
+ _query_params: List[Tuple[str, str]] = []
264
+ _header_params: Dict[str, Optional[str]] = _headers or {}
265
+ _form_params: List[Tuple[str, str]] = []
266
+ _files: Dict[str, Union[str, bytes]] = {}
267
+ _body_params: Optional[bytes] = None
268
+
269
+ # process the path parameters
270
+ # process the query parameters
271
+ # process the header parameters
272
+ # process the form parameters
273
+ # process the body parameter
274
+ if create_webhook is not None:
275
+ _body_params = create_webhook
276
+
277
+
278
+ # set the HTTP header `Accept`
279
+ _header_params['Accept'] = self.api_client.select_header_accept(
280
+ [
281
+ 'application/json'
282
+ ]
283
+ )
284
+
285
+ # set the HTTP header `Content-Type`
286
+ if _content_type:
287
+ _header_params['Content-Type'] = _content_type
288
+ else:
289
+ _default_content_type = (
290
+ self.api_client.select_header_content_type(
291
+ [
292
+ 'application/json'
293
+ ]
294
+ )
295
+ )
296
+ if _default_content_type is not None:
297
+ _header_params['Content-Type'] = _default_content_type
298
+
299
+ # authentication setting
300
+ _auth_settings: List[str] = [
301
+ 'default'
302
+ ]
303
+
304
+ return self.api_client.param_serialize(
305
+ method='POST',
306
+ resource_path='/webhooks',
307
+ path_params=_path_params,
308
+ query_params=_query_params,
309
+ header_params=_header_params,
310
+ body=_body_params,
311
+ post_params=_form_params,
312
+ files=_files,
313
+ auth_settings=_auth_settings,
314
+ collection_formats=_collection_formats,
315
+ _host=_host,
316
+ _request_auth=_request_auth
317
+ )
318
+
319
+
320
+
321
+
322
+ @validate_call
323
+ def webhooks_delete(
324
+ self,
325
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
326
+ _request_timeout: Union[
327
+ None,
328
+ Annotated[StrictFloat, Field(gt=0)],
329
+ Tuple[
330
+ Annotated[StrictFloat, Field(gt=0)],
331
+ Annotated[StrictFloat, Field(gt=0)]
332
+ ]
333
+ ] = None,
334
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
335
+ _content_type: Optional[StrictStr] = None,
336
+ _headers: Optional[Dict[StrictStr, Any]] = None,
337
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
338
+ ) -> ICountResponse:
339
+ """Delete
340
+
341
+ Deletes a webhook listener by its id
342
+
343
+ :param id: webhook primary identifier (required)
344
+ :type id: str
345
+ :param _request_timeout: timeout setting for this request. If one
346
+ number provided, it will be total request
347
+ timeout. It can also be a pair (tuple) of
348
+ (connection, read) timeouts.
349
+ :type _request_timeout: int, tuple(int, int), optional
350
+ :param _request_auth: set to override the auth_settings for an a single
351
+ request; this effectively ignores the
352
+ authentication in the spec for a single request.
353
+ :type _request_auth: dict, optional
354
+ :param _content_type: force content-type for the request.
355
+ :type _content_type: str, Optional
356
+ :param _headers: set to override the headers for a single
357
+ request; this effectively ignores the headers
358
+ in the spec for a single request.
359
+ :type _headers: dict, optional
360
+ :param _host_index: set to override the host_index for a single
361
+ request; this effectively ignores the host_index
362
+ in the spec for a single request.
363
+ :type _host_index: int, optional
364
+ :return: Returns the result object.
365
+ """ # noqa: E501
366
+
367
+ _param = self._webhooks_delete_serialize(
368
+ id=id,
369
+ _request_auth=_request_auth,
370
+ _content_type=_content_type,
371
+ _headers=_headers,
372
+ _host_index=_host_index
373
+ )
374
+
375
+ _response_types_map: Dict[str, Optional[str]] = {
376
+ '200': "ICountResponse",
377
+ '404': "GlobalErrorResponse",
378
+ '500': "GlobalErrorResponse",
379
+ }
380
+ response_data = self.api_client.call_api(
381
+ *_param,
382
+ _request_timeout=_request_timeout
383
+ )
384
+ response_data.read()
385
+ return self.api_client.response_deserialize(
386
+ response_data=response_data,
387
+ response_types_map=_response_types_map,
388
+ ).data
389
+
390
+
391
+ @validate_call
392
+ def webhooks_delete_with_http_info(
393
+ self,
394
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
395
+ _request_timeout: Union[
396
+ None,
397
+ Annotated[StrictFloat, Field(gt=0)],
398
+ Tuple[
399
+ Annotated[StrictFloat, Field(gt=0)],
400
+ Annotated[StrictFloat, Field(gt=0)]
401
+ ]
402
+ ] = None,
403
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
404
+ _content_type: Optional[StrictStr] = None,
405
+ _headers: Optional[Dict[StrictStr, Any]] = None,
406
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
407
+ ) -> ApiResponse[ICountResponse]:
408
+ """Delete
409
+
410
+ Deletes a webhook listener by its id
411
+
412
+ :param id: webhook primary identifier (required)
413
+ :type id: str
414
+ :param _request_timeout: timeout setting for this request. If one
415
+ number provided, it will be total request
416
+ timeout. It can also be a pair (tuple) of
417
+ (connection, read) timeouts.
418
+ :type _request_timeout: int, tuple(int, int), optional
419
+ :param _request_auth: set to override the auth_settings for an a single
420
+ request; this effectively ignores the
421
+ authentication in the spec for a single request.
422
+ :type _request_auth: dict, optional
423
+ :param _content_type: force content-type for the request.
424
+ :type _content_type: str, Optional
425
+ :param _headers: set to override the headers for a single
426
+ request; this effectively ignores the headers
427
+ in the spec for a single request.
428
+ :type _headers: dict, optional
429
+ :param _host_index: set to override the host_index for a single
430
+ request; this effectively ignores the host_index
431
+ in the spec for a single request.
432
+ :type _host_index: int, optional
433
+ :return: Returns the result object.
434
+ """ # noqa: E501
435
+
436
+ _param = self._webhooks_delete_serialize(
437
+ id=id,
438
+ _request_auth=_request_auth,
439
+ _content_type=_content_type,
440
+ _headers=_headers,
441
+ _host_index=_host_index
442
+ )
443
+
444
+ _response_types_map: Dict[str, Optional[str]] = {
445
+ '200': "ICountResponse",
446
+ '404': "GlobalErrorResponse",
447
+ '500': "GlobalErrorResponse",
448
+ }
449
+ response_data = self.api_client.call_api(
450
+ *_param,
451
+ _request_timeout=_request_timeout
452
+ )
453
+ response_data.read()
454
+ return self.api_client.response_deserialize(
455
+ response_data=response_data,
456
+ response_types_map=_response_types_map,
457
+ )
458
+
459
+
460
+ @validate_call
461
+ def webhooks_delete_without_preload_content(
462
+ self,
463
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
464
+ _request_timeout: Union[
465
+ None,
466
+ Annotated[StrictFloat, Field(gt=0)],
467
+ Tuple[
468
+ Annotated[StrictFloat, Field(gt=0)],
469
+ Annotated[StrictFloat, Field(gt=0)]
470
+ ]
471
+ ] = None,
472
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
473
+ _content_type: Optional[StrictStr] = None,
474
+ _headers: Optional[Dict[StrictStr, Any]] = None,
475
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
476
+ ) -> RESTResponseType:
477
+ """Delete
478
+
479
+ Deletes a webhook listener by its id
480
+
481
+ :param id: webhook primary identifier (required)
482
+ :type id: str
483
+ :param _request_timeout: timeout setting for this request. If one
484
+ number provided, it will be total request
485
+ timeout. It can also be a pair (tuple) of
486
+ (connection, read) timeouts.
487
+ :type _request_timeout: int, tuple(int, int), optional
488
+ :param _request_auth: set to override the auth_settings for an a single
489
+ request; this effectively ignores the
490
+ authentication in the spec for a single request.
491
+ :type _request_auth: dict, optional
492
+ :param _content_type: force content-type for the request.
493
+ :type _content_type: str, Optional
494
+ :param _headers: set to override the headers for a single
495
+ request; this effectively ignores the headers
496
+ in the spec for a single request.
497
+ :type _headers: dict, optional
498
+ :param _host_index: set to override the host_index for a single
499
+ request; this effectively ignores the host_index
500
+ in the spec for a single request.
501
+ :type _host_index: int, optional
502
+ :return: Returns the result object.
503
+ """ # noqa: E501
504
+
505
+ _param = self._webhooks_delete_serialize(
506
+ id=id,
507
+ _request_auth=_request_auth,
508
+ _content_type=_content_type,
509
+ _headers=_headers,
510
+ _host_index=_host_index
511
+ )
512
+
513
+ _response_types_map: Dict[str, Optional[str]] = {
514
+ '200': "ICountResponse",
515
+ '404': "GlobalErrorResponse",
516
+ '500': "GlobalErrorResponse",
517
+ }
518
+ response_data = self.api_client.call_api(
519
+ *_param,
520
+ _request_timeout=_request_timeout
521
+ )
522
+ return response_data.response
523
+
524
+
525
+ def _webhooks_delete_serialize(
526
+ self,
527
+ id,
528
+ _request_auth,
529
+ _content_type,
530
+ _headers,
531
+ _host_index,
532
+ ) -> RequestSerialized:
533
+
534
+ _host = None
535
+
536
+ _collection_formats: Dict[str, str] = {
537
+ }
538
+
539
+ _path_params: Dict[str, str] = {}
540
+ _query_params: List[Tuple[str, str]] = []
541
+ _header_params: Dict[str, Optional[str]] = _headers or {}
542
+ _form_params: List[Tuple[str, str]] = []
543
+ _files: Dict[str, Union[str, bytes]] = {}
544
+ _body_params: Optional[bytes] = None
545
+
546
+ # process the path parameters
547
+ if id is not None:
548
+ _path_params['id'] = id
549
+ # process the query parameters
550
+ # process the header parameters
551
+ # process the form parameters
552
+ # process the body parameter
553
+
554
+
555
+ # set the HTTP header `Accept`
556
+ _header_params['Accept'] = self.api_client.select_header_accept(
557
+ [
558
+ 'application/json'
559
+ ]
560
+ )
561
+
562
+
563
+ # authentication setting
564
+ _auth_settings: List[str] = [
565
+ 'default'
566
+ ]
567
+
568
+ return self.api_client.param_serialize(
569
+ method='DELETE',
570
+ resource_path='/webhooks/{id}',
571
+ path_params=_path_params,
572
+ query_params=_query_params,
573
+ header_params=_header_params,
574
+ body=_body_params,
575
+ post_params=_form_params,
576
+ files=_files,
577
+ auth_settings=_auth_settings,
578
+ collection_formats=_collection_formats,
579
+ _host=_host,
580
+ _request_auth=_request_auth
581
+ )
582
+
583
+
584
+
585
+
586
+ @validate_call
587
+ def webhooks_list(
588
+ self,
589
+ _request_timeout: Union[
590
+ None,
591
+ Annotated[StrictFloat, Field(gt=0)],
592
+ Tuple[
593
+ Annotated[StrictFloat, Field(gt=0)],
594
+ Annotated[StrictFloat, Field(gt=0)]
595
+ ]
596
+ ] = None,
597
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
598
+ _content_type: Optional[StrictStr] = None,
599
+ _headers: Optional[Dict[StrictStr, Any]] = None,
600
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
601
+ ) -> WebhooksList200Response:
602
+ """List
603
+
604
+ Retrieves all Webhooks associated with your application
605
+
606
+ :param _request_timeout: timeout setting for this request. If one
607
+ number provided, it will be total request
608
+ timeout. It can also be a pair (tuple) of
609
+ (connection, read) timeouts.
610
+ :type _request_timeout: int, tuple(int, int), optional
611
+ :param _request_auth: set to override the auth_settings for an a single
612
+ request; this effectively ignores the
613
+ authentication in the spec for a single request.
614
+ :type _request_auth: dict, optional
615
+ :param _content_type: force content-type for the request.
616
+ :type _content_type: str, Optional
617
+ :param _headers: set to override the headers for a single
618
+ request; this effectively ignores the headers
619
+ in the spec for a single request.
620
+ :type _headers: dict, optional
621
+ :param _host_index: set to override the host_index for a single
622
+ request; this effectively ignores the host_index
623
+ in the spec for a single request.
624
+ :type _host_index: int, optional
625
+ :return: Returns the result object.
626
+ """ # noqa: E501
627
+
628
+ _param = self._webhooks_list_serialize(
629
+ _request_auth=_request_auth,
630
+ _content_type=_content_type,
631
+ _headers=_headers,
632
+ _host_index=_host_index
633
+ )
634
+
635
+ _response_types_map: Dict[str, Optional[str]] = {
636
+ '200': "WebhooksList200Response",
637
+ '500': "GlobalErrorResponse",
638
+ '204': None,
639
+ }
640
+ response_data = self.api_client.call_api(
641
+ *_param,
642
+ _request_timeout=_request_timeout
643
+ )
644
+ response_data.read()
645
+ return self.api_client.response_deserialize(
646
+ response_data=response_data,
647
+ response_types_map=_response_types_map,
648
+ ).data
649
+
650
+
651
+ @validate_call
652
+ def webhooks_list_with_http_info(
653
+ self,
654
+ _request_timeout: Union[
655
+ None,
656
+ Annotated[StrictFloat, Field(gt=0)],
657
+ Tuple[
658
+ Annotated[StrictFloat, Field(gt=0)],
659
+ Annotated[StrictFloat, Field(gt=0)]
660
+ ]
661
+ ] = None,
662
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
663
+ _content_type: Optional[StrictStr] = None,
664
+ _headers: Optional[Dict[StrictStr, Any]] = None,
665
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
666
+ ) -> ApiResponse[WebhooksList200Response]:
667
+ """List
668
+
669
+ Retrieves all Webhooks associated with your application
670
+
671
+ :param _request_timeout: timeout setting for this request. If one
672
+ number provided, it will be total request
673
+ timeout. It can also be a pair (tuple) of
674
+ (connection, read) timeouts.
675
+ :type _request_timeout: int, tuple(int, int), optional
676
+ :param _request_auth: set to override the auth_settings for an a single
677
+ request; this effectively ignores the
678
+ authentication in the spec for a single request.
679
+ :type _request_auth: dict, optional
680
+ :param _content_type: force content-type for the request.
681
+ :type _content_type: str, Optional
682
+ :param _headers: set to override the headers for a single
683
+ request; this effectively ignores the headers
684
+ in the spec for a single request.
685
+ :type _headers: dict, optional
686
+ :param _host_index: set to override the host_index for a single
687
+ request; this effectively ignores the host_index
688
+ in the spec for a single request.
689
+ :type _host_index: int, optional
690
+ :return: Returns the result object.
691
+ """ # noqa: E501
692
+
693
+ _param = self._webhooks_list_serialize(
694
+ _request_auth=_request_auth,
695
+ _content_type=_content_type,
696
+ _headers=_headers,
697
+ _host_index=_host_index
698
+ )
699
+
700
+ _response_types_map: Dict[str, Optional[str]] = {
701
+ '200': "WebhooksList200Response",
702
+ '500': "GlobalErrorResponse",
703
+ '204': None,
704
+ }
705
+ response_data = self.api_client.call_api(
706
+ *_param,
707
+ _request_timeout=_request_timeout
708
+ )
709
+ response_data.read()
710
+ return self.api_client.response_deserialize(
711
+ response_data=response_data,
712
+ response_types_map=_response_types_map,
713
+ )
714
+
715
+
716
+ @validate_call
717
+ def webhooks_list_without_preload_content(
718
+ self,
719
+ _request_timeout: Union[
720
+ None,
721
+ Annotated[StrictFloat, Field(gt=0)],
722
+ Tuple[
723
+ Annotated[StrictFloat, Field(gt=0)],
724
+ Annotated[StrictFloat, Field(gt=0)]
725
+ ]
726
+ ] = None,
727
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
728
+ _content_type: Optional[StrictStr] = None,
729
+ _headers: Optional[Dict[StrictStr, Any]] = None,
730
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
731
+ ) -> RESTResponseType:
732
+ """List
733
+
734
+ Retrieves all Webhooks associated with your application
735
+
736
+ :param _request_timeout: timeout setting for this request. If one
737
+ number provided, it will be total request
738
+ timeout. It can also be a pair (tuple) of
739
+ (connection, read) timeouts.
740
+ :type _request_timeout: int, tuple(int, int), optional
741
+ :param _request_auth: set to override the auth_settings for an a single
742
+ request; this effectively ignores the
743
+ authentication in the spec for a single request.
744
+ :type _request_auth: dict, optional
745
+ :param _content_type: force content-type for the request.
746
+ :type _content_type: str, Optional
747
+ :param _headers: set to override the headers for a single
748
+ request; this effectively ignores the headers
749
+ in the spec for a single request.
750
+ :type _headers: dict, optional
751
+ :param _host_index: set to override the host_index for a single
752
+ request; this effectively ignores the host_index
753
+ in the spec for a single request.
754
+ :type _host_index: int, optional
755
+ :return: Returns the result object.
756
+ """ # noqa: E501
757
+
758
+ _param = self._webhooks_list_serialize(
759
+ _request_auth=_request_auth,
760
+ _content_type=_content_type,
761
+ _headers=_headers,
762
+ _host_index=_host_index
763
+ )
764
+
765
+ _response_types_map: Dict[str, Optional[str]] = {
766
+ '200': "WebhooksList200Response",
767
+ '500': "GlobalErrorResponse",
768
+ '204': None,
769
+ }
770
+ response_data = self.api_client.call_api(
771
+ *_param,
772
+ _request_timeout=_request_timeout
773
+ )
774
+ return response_data.response
775
+
776
+
777
+ def _webhooks_list_serialize(
778
+ self,
779
+ _request_auth,
780
+ _content_type,
781
+ _headers,
782
+ _host_index,
783
+ ) -> RequestSerialized:
784
+
785
+ _host = None
786
+
787
+ _collection_formats: Dict[str, str] = {
788
+ }
789
+
790
+ _path_params: Dict[str, str] = {}
791
+ _query_params: List[Tuple[str, str]] = []
792
+ _header_params: Dict[str, Optional[str]] = _headers or {}
793
+ _form_params: List[Tuple[str, str]] = []
794
+ _files: Dict[str, Union[str, bytes]] = {}
795
+ _body_params: Optional[bytes] = None
796
+
797
+ # process the path parameters
798
+ # process the query parameters
799
+ # process the header parameters
800
+ # process the form parameters
801
+ # process the body parameter
802
+
803
+
804
+ # set the HTTP header `Accept`
805
+ _header_params['Accept'] = self.api_client.select_header_accept(
806
+ [
807
+ 'application/json'
808
+ ]
809
+ )
810
+
811
+
812
+ # authentication setting
813
+ _auth_settings: List[str] = [
814
+ 'default'
815
+ ]
816
+
817
+ return self.api_client.param_serialize(
818
+ method='GET',
819
+ resource_path='/webhooks',
820
+ path_params=_path_params,
821
+ query_params=_query_params,
822
+ header_params=_header_params,
823
+ body=_body_params,
824
+ post_params=_form_params,
825
+ files=_files,
826
+ auth_settings=_auth_settings,
827
+ collection_formats=_collection_formats,
828
+ _host=_host,
829
+ _request_auth=_request_auth
830
+ )
831
+
832
+
833
+
834
+
835
+ @validate_call
836
+ def webhooks_retrieve(
837
+ self,
838
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
839
+ _request_timeout: Union[
840
+ None,
841
+ Annotated[StrictFloat, Field(gt=0)],
842
+ Tuple[
843
+ Annotated[StrictFloat, Field(gt=0)],
844
+ Annotated[StrictFloat, Field(gt=0)]
845
+ ]
846
+ ] = None,
847
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
848
+ _content_type: Optional[StrictStr] = None,
849
+ _headers: Optional[Dict[StrictStr, Any]] = None,
850
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
851
+ ) -> Webhook:
852
+ """Retrieve
853
+
854
+ Retrieves a specific webhook
855
+
856
+ :param id: webhook primary identifier (required)
857
+ :type id: str
858
+ :param _request_timeout: timeout setting for this request. If one
859
+ number provided, it will be total request
860
+ timeout. It can also be a pair (tuple) of
861
+ (connection, read) timeouts.
862
+ :type _request_timeout: int, tuple(int, int), optional
863
+ :param _request_auth: set to override the auth_settings for an a single
864
+ request; this effectively ignores the
865
+ authentication in the spec for a single request.
866
+ :type _request_auth: dict, optional
867
+ :param _content_type: force content-type for the request.
868
+ :type _content_type: str, Optional
869
+ :param _headers: set to override the headers for a single
870
+ request; this effectively ignores the headers
871
+ in the spec for a single request.
872
+ :type _headers: dict, optional
873
+ :param _host_index: set to override the host_index for a single
874
+ request; this effectively ignores the host_index
875
+ in the spec for a single request.
876
+ :type _host_index: int, optional
877
+ :return: Returns the result object.
878
+ """ # noqa: E501
879
+
880
+ _param = self._webhooks_retrieve_serialize(
881
+ id=id,
882
+ _request_auth=_request_auth,
883
+ _content_type=_content_type,
884
+ _headers=_headers,
885
+ _host_index=_host_index
886
+ )
887
+
888
+ _response_types_map: Dict[str, Optional[str]] = {
889
+ '200': "Webhook",
890
+ '404': "GlobalErrorResponse",
891
+ '500': "GlobalErrorResponse",
892
+ }
893
+ response_data = self.api_client.call_api(
894
+ *_param,
895
+ _request_timeout=_request_timeout
896
+ )
897
+ response_data.read()
898
+ return self.api_client.response_deserialize(
899
+ response_data=response_data,
900
+ response_types_map=_response_types_map,
901
+ ).data
902
+
903
+
904
+ @validate_call
905
+ def webhooks_retrieve_with_http_info(
906
+ self,
907
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
908
+ _request_timeout: Union[
909
+ None,
910
+ Annotated[StrictFloat, Field(gt=0)],
911
+ Tuple[
912
+ Annotated[StrictFloat, Field(gt=0)],
913
+ Annotated[StrictFloat, Field(gt=0)]
914
+ ]
915
+ ] = None,
916
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
917
+ _content_type: Optional[StrictStr] = None,
918
+ _headers: Optional[Dict[StrictStr, Any]] = None,
919
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
920
+ ) -> ApiResponse[Webhook]:
921
+ """Retrieve
922
+
923
+ Retrieves a specific webhook
924
+
925
+ :param id: webhook primary identifier (required)
926
+ :type id: str
927
+ :param _request_timeout: timeout setting for this request. If one
928
+ number provided, it will be total request
929
+ timeout. It can also be a pair (tuple) of
930
+ (connection, read) timeouts.
931
+ :type _request_timeout: int, tuple(int, int), optional
932
+ :param _request_auth: set to override the auth_settings for an a single
933
+ request; this effectively ignores the
934
+ authentication in the spec for a single request.
935
+ :type _request_auth: dict, optional
936
+ :param _content_type: force content-type for the request.
937
+ :type _content_type: str, Optional
938
+ :param _headers: set to override the headers for a single
939
+ request; this effectively ignores the headers
940
+ in the spec for a single request.
941
+ :type _headers: dict, optional
942
+ :param _host_index: set to override the host_index for a single
943
+ request; this effectively ignores the host_index
944
+ in the spec for a single request.
945
+ :type _host_index: int, optional
946
+ :return: Returns the result object.
947
+ """ # noqa: E501
948
+
949
+ _param = self._webhooks_retrieve_serialize(
950
+ id=id,
951
+ _request_auth=_request_auth,
952
+ _content_type=_content_type,
953
+ _headers=_headers,
954
+ _host_index=_host_index
955
+ )
956
+
957
+ _response_types_map: Dict[str, Optional[str]] = {
958
+ '200': "Webhook",
959
+ '404': "GlobalErrorResponse",
960
+ '500': "GlobalErrorResponse",
961
+ }
962
+ response_data = self.api_client.call_api(
963
+ *_param,
964
+ _request_timeout=_request_timeout
965
+ )
966
+ response_data.read()
967
+ return self.api_client.response_deserialize(
968
+ response_data=response_data,
969
+ response_types_map=_response_types_map,
970
+ )
971
+
972
+
973
+ @validate_call
974
+ def webhooks_retrieve_without_preload_content(
975
+ self,
976
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
977
+ _request_timeout: Union[
978
+ None,
979
+ Annotated[StrictFloat, Field(gt=0)],
980
+ Tuple[
981
+ Annotated[StrictFloat, Field(gt=0)],
982
+ Annotated[StrictFloat, Field(gt=0)]
983
+ ]
984
+ ] = None,
985
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
986
+ _content_type: Optional[StrictStr] = None,
987
+ _headers: Optional[Dict[StrictStr, Any]] = None,
988
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
989
+ ) -> RESTResponseType:
990
+ """Retrieve
991
+
992
+ Retrieves a specific webhook
993
+
994
+ :param id: webhook primary identifier (required)
995
+ :type id: str
996
+ :param _request_timeout: timeout setting for this request. If one
997
+ number provided, it will be total request
998
+ timeout. It can also be a pair (tuple) of
999
+ (connection, read) timeouts.
1000
+ :type _request_timeout: int, tuple(int, int), optional
1001
+ :param _request_auth: set to override the auth_settings for an a single
1002
+ request; this effectively ignores the
1003
+ authentication in the spec for a single request.
1004
+ :type _request_auth: dict, optional
1005
+ :param _content_type: force content-type for the request.
1006
+ :type _content_type: str, Optional
1007
+ :param _headers: set to override the headers for a single
1008
+ request; this effectively ignores the headers
1009
+ in the spec for a single request.
1010
+ :type _headers: dict, optional
1011
+ :param _host_index: set to override the host_index for a single
1012
+ request; this effectively ignores the host_index
1013
+ in the spec for a single request.
1014
+ :type _host_index: int, optional
1015
+ :return: Returns the result object.
1016
+ """ # noqa: E501
1017
+
1018
+ _param = self._webhooks_retrieve_serialize(
1019
+ id=id,
1020
+ _request_auth=_request_auth,
1021
+ _content_type=_content_type,
1022
+ _headers=_headers,
1023
+ _host_index=_host_index
1024
+ )
1025
+
1026
+ _response_types_map: Dict[str, Optional[str]] = {
1027
+ '200': "Webhook",
1028
+ '404': "GlobalErrorResponse",
1029
+ '500': "GlobalErrorResponse",
1030
+ }
1031
+ response_data = self.api_client.call_api(
1032
+ *_param,
1033
+ _request_timeout=_request_timeout
1034
+ )
1035
+ return response_data.response
1036
+
1037
+
1038
+ def _webhooks_retrieve_serialize(
1039
+ self,
1040
+ id,
1041
+ _request_auth,
1042
+ _content_type,
1043
+ _headers,
1044
+ _host_index,
1045
+ ) -> RequestSerialized:
1046
+
1047
+ _host = None
1048
+
1049
+ _collection_formats: Dict[str, str] = {
1050
+ }
1051
+
1052
+ _path_params: Dict[str, str] = {}
1053
+ _query_params: List[Tuple[str, str]] = []
1054
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1055
+ _form_params: List[Tuple[str, str]] = []
1056
+ _files: Dict[str, Union[str, bytes]] = {}
1057
+ _body_params: Optional[bytes] = None
1058
+
1059
+ # process the path parameters
1060
+ if id is not None:
1061
+ _path_params['id'] = id
1062
+ # process the query parameters
1063
+ # process the header parameters
1064
+ # process the form parameters
1065
+ # process the body parameter
1066
+
1067
+
1068
+ # set the HTTP header `Accept`
1069
+ _header_params['Accept'] = self.api_client.select_header_accept(
1070
+ [
1071
+ 'application/json'
1072
+ ]
1073
+ )
1074
+
1075
+
1076
+ # authentication setting
1077
+ _auth_settings: List[str] = [
1078
+ 'default'
1079
+ ]
1080
+
1081
+ return self.api_client.param_serialize(
1082
+ method='GET',
1083
+ resource_path='/webhooks/{id}',
1084
+ path_params=_path_params,
1085
+ query_params=_query_params,
1086
+ header_params=_header_params,
1087
+ body=_body_params,
1088
+ post_params=_form_params,
1089
+ files=_files,
1090
+ auth_settings=_auth_settings,
1091
+ collection_formats=_collection_formats,
1092
+ _host=_host,
1093
+ _request_auth=_request_auth
1094
+ )
1095
+
1096
+
1097
+
1098
+
1099
+ @validate_call
1100
+ def webhooks_update(
1101
+ self,
1102
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
1103
+ create_webhook: Annotated[CreateWebhook, Field(description="Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event.")],
1104
+ _request_timeout: Union[
1105
+ None,
1106
+ Annotated[StrictFloat, Field(gt=0)],
1107
+ Tuple[
1108
+ Annotated[StrictFloat, Field(gt=0)],
1109
+ Annotated[StrictFloat, Field(gt=0)]
1110
+ ]
1111
+ ] = None,
1112
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1113
+ _content_type: Optional[StrictStr] = None,
1114
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1115
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1116
+ ) -> Webhook:
1117
+ """Update
1118
+
1119
+ Updates a webhook event and/or url listener. Once updated all events that are triggered will replicate the updated logic
1120
+
1121
+ :param id: webhook primary identifier (required)
1122
+ :type id: str
1123
+ :param create_webhook: Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event. (required)
1124
+ :type create_webhook: CreateWebhook
1125
+ :param _request_timeout: timeout setting for this request. If one
1126
+ number provided, it will be total request
1127
+ timeout. It can also be a pair (tuple) of
1128
+ (connection, read) timeouts.
1129
+ :type _request_timeout: int, tuple(int, int), optional
1130
+ :param _request_auth: set to override the auth_settings for an a single
1131
+ request; this effectively ignores the
1132
+ authentication in the spec for a single request.
1133
+ :type _request_auth: dict, optional
1134
+ :param _content_type: force content-type for the request.
1135
+ :type _content_type: str, Optional
1136
+ :param _headers: set to override the headers for a single
1137
+ request; this effectively ignores the headers
1138
+ in the spec for a single request.
1139
+ :type _headers: dict, optional
1140
+ :param _host_index: set to override the host_index for a single
1141
+ request; this effectively ignores the host_index
1142
+ in the spec for a single request.
1143
+ :type _host_index: int, optional
1144
+ :return: Returns the result object.
1145
+ """ # noqa: E501
1146
+
1147
+ _param = self._webhooks_update_serialize(
1148
+ id=id,
1149
+ create_webhook=create_webhook,
1150
+ _request_auth=_request_auth,
1151
+ _content_type=_content_type,
1152
+ _headers=_headers,
1153
+ _host_index=_host_index
1154
+ )
1155
+
1156
+ _response_types_map: Dict[str, Optional[str]] = {
1157
+ '200': "Webhook",
1158
+ '400': "WebhookCreationErrorResponse",
1159
+ '404': "GlobalErrorResponse",
1160
+ '500': "GlobalErrorResponse",
1161
+ }
1162
+ response_data = self.api_client.call_api(
1163
+ *_param,
1164
+ _request_timeout=_request_timeout
1165
+ )
1166
+ response_data.read()
1167
+ return self.api_client.response_deserialize(
1168
+ response_data=response_data,
1169
+ response_types_map=_response_types_map,
1170
+ ).data
1171
+
1172
+
1173
+ @validate_call
1174
+ def webhooks_update_with_http_info(
1175
+ self,
1176
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
1177
+ create_webhook: Annotated[CreateWebhook, Field(description="Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event.")],
1178
+ _request_timeout: Union[
1179
+ None,
1180
+ Annotated[StrictFloat, Field(gt=0)],
1181
+ Tuple[
1182
+ Annotated[StrictFloat, Field(gt=0)],
1183
+ Annotated[StrictFloat, Field(gt=0)]
1184
+ ]
1185
+ ] = None,
1186
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1187
+ _content_type: Optional[StrictStr] = None,
1188
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1189
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1190
+ ) -> ApiResponse[Webhook]:
1191
+ """Update
1192
+
1193
+ Updates a webhook event and/or url listener. Once updated all events that are triggered will replicate the updated logic
1194
+
1195
+ :param id: webhook primary identifier (required)
1196
+ :type id: str
1197
+ :param create_webhook: Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event. (required)
1198
+ :type create_webhook: CreateWebhook
1199
+ :param _request_timeout: timeout setting for this request. If one
1200
+ number provided, it will be total request
1201
+ timeout. It can also be a pair (tuple) of
1202
+ (connection, read) timeouts.
1203
+ :type _request_timeout: int, tuple(int, int), optional
1204
+ :param _request_auth: set to override the auth_settings for an a single
1205
+ request; this effectively ignores the
1206
+ authentication in the spec for a single request.
1207
+ :type _request_auth: dict, optional
1208
+ :param _content_type: force content-type for the request.
1209
+ :type _content_type: str, Optional
1210
+ :param _headers: set to override the headers for a single
1211
+ request; this effectively ignores the headers
1212
+ in the spec for a single request.
1213
+ :type _headers: dict, optional
1214
+ :param _host_index: set to override the host_index for a single
1215
+ request; this effectively ignores the host_index
1216
+ in the spec for a single request.
1217
+ :type _host_index: int, optional
1218
+ :return: Returns the result object.
1219
+ """ # noqa: E501
1220
+
1221
+ _param = self._webhooks_update_serialize(
1222
+ id=id,
1223
+ create_webhook=create_webhook,
1224
+ _request_auth=_request_auth,
1225
+ _content_type=_content_type,
1226
+ _headers=_headers,
1227
+ _host_index=_host_index
1228
+ )
1229
+
1230
+ _response_types_map: Dict[str, Optional[str]] = {
1231
+ '200': "Webhook",
1232
+ '400': "WebhookCreationErrorResponse",
1233
+ '404': "GlobalErrorResponse",
1234
+ '500': "GlobalErrorResponse",
1235
+ }
1236
+ response_data = self.api_client.call_api(
1237
+ *_param,
1238
+ _request_timeout=_request_timeout
1239
+ )
1240
+ response_data.read()
1241
+ return self.api_client.response_deserialize(
1242
+ response_data=response_data,
1243
+ response_types_map=_response_types_map,
1244
+ )
1245
+
1246
+
1247
+ @validate_call
1248
+ def webhooks_update_without_preload_content(
1249
+ self,
1250
+ id: Annotated[StrictStr, Field(description="webhook primary identifier")],
1251
+ create_webhook: Annotated[CreateWebhook, Field(description="Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event.")],
1252
+ _request_timeout: Union[
1253
+ None,
1254
+ Annotated[StrictFloat, Field(gt=0)],
1255
+ Tuple[
1256
+ Annotated[StrictFloat, Field(gt=0)],
1257
+ Annotated[StrictFloat, Field(gt=0)]
1258
+ ]
1259
+ ] = None,
1260
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1261
+ _content_type: Optional[StrictStr] = None,
1262
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1263
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1264
+ ) -> RESTResponseType:
1265
+ """Update
1266
+
1267
+ Updates a webhook event and/or url listener. Once updated all events that are triggered will replicate the updated logic
1268
+
1269
+ :param id: webhook primary identifier (required)
1270
+ :type id: str
1271
+ :param create_webhook: Expects the following webhooks parameters: event: One of the event types that are supported. url: An https url that will receive the POST of the event. headers: optional key-value pairs to send with the POST of the event. (required)
1272
+ :type create_webhook: CreateWebhook
1273
+ :param _request_timeout: timeout setting for this request. If one
1274
+ number provided, it will be total request
1275
+ timeout. It can also be a pair (tuple) of
1276
+ (connection, read) timeouts.
1277
+ :type _request_timeout: int, tuple(int, int), optional
1278
+ :param _request_auth: set to override the auth_settings for an a single
1279
+ request; this effectively ignores the
1280
+ authentication in the spec for a single request.
1281
+ :type _request_auth: dict, optional
1282
+ :param _content_type: force content-type for the request.
1283
+ :type _content_type: str, Optional
1284
+ :param _headers: set to override the headers for a single
1285
+ request; this effectively ignores the headers
1286
+ in the spec for a single request.
1287
+ :type _headers: dict, optional
1288
+ :param _host_index: set to override the host_index for a single
1289
+ request; this effectively ignores the host_index
1290
+ in the spec for a single request.
1291
+ :type _host_index: int, optional
1292
+ :return: Returns the result object.
1293
+ """ # noqa: E501
1294
+
1295
+ _param = self._webhooks_update_serialize(
1296
+ id=id,
1297
+ create_webhook=create_webhook,
1298
+ _request_auth=_request_auth,
1299
+ _content_type=_content_type,
1300
+ _headers=_headers,
1301
+ _host_index=_host_index
1302
+ )
1303
+
1304
+ _response_types_map: Dict[str, Optional[str]] = {
1305
+ '200': "Webhook",
1306
+ '400': "WebhookCreationErrorResponse",
1307
+ '404': "GlobalErrorResponse",
1308
+ '500': "GlobalErrorResponse",
1309
+ }
1310
+ response_data = self.api_client.call_api(
1311
+ *_param,
1312
+ _request_timeout=_request_timeout
1313
+ )
1314
+ return response_data.response
1315
+
1316
+
1317
+ def _webhooks_update_serialize(
1318
+ self,
1319
+ id,
1320
+ create_webhook,
1321
+ _request_auth,
1322
+ _content_type,
1323
+ _headers,
1324
+ _host_index,
1325
+ ) -> RequestSerialized:
1326
+
1327
+ _host = None
1328
+
1329
+ _collection_formats: Dict[str, str] = {
1330
+ }
1331
+
1332
+ _path_params: Dict[str, str] = {}
1333
+ _query_params: List[Tuple[str, str]] = []
1334
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1335
+ _form_params: List[Tuple[str, str]] = []
1336
+ _files: Dict[str, Union[str, bytes]] = {}
1337
+ _body_params: Optional[bytes] = None
1338
+
1339
+ # process the path parameters
1340
+ if id is not None:
1341
+ _path_params['id'] = id
1342
+ # process the query parameters
1343
+ # process the header parameters
1344
+ # process the form parameters
1345
+ # process the body parameter
1346
+ if create_webhook is not None:
1347
+ _body_params = create_webhook
1348
+
1349
+
1350
+ # set the HTTP header `Accept`
1351
+ _header_params['Accept'] = self.api_client.select_header_accept(
1352
+ [
1353
+ 'application/json'
1354
+ ]
1355
+ )
1356
+
1357
+ # set the HTTP header `Content-Type`
1358
+ if _content_type:
1359
+ _header_params['Content-Type'] = _content_type
1360
+ else:
1361
+ _default_content_type = (
1362
+ self.api_client.select_header_content_type(
1363
+ [
1364
+ 'application/json'
1365
+ ]
1366
+ )
1367
+ )
1368
+ if _default_content_type is not None:
1369
+ _header_params['Content-Type'] = _default_content_type
1370
+
1371
+ # authentication setting
1372
+ _auth_settings: List[str] = [
1373
+ 'default'
1374
+ ]
1375
+
1376
+ return self.api_client.param_serialize(
1377
+ method='PATCH',
1378
+ resource_path='/webhooks/{id}',
1379
+ path_params=_path_params,
1380
+ query_params=_query_params,
1381
+ header_params=_header_params,
1382
+ body=_body_params,
1383
+ post_params=_form_params,
1384
+ files=_files,
1385
+ auth_settings=_auth_settings,
1386
+ collection_formats=_collection_formats,
1387
+ _host=_host,
1388
+ _request_auth=_request_auth
1389
+ )
1390
+
1391
+