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