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.
- pluggy_sdk/__init__.py +200 -0
- pluggy_sdk/api/__init__.py +25 -0
- pluggy_sdk/api/account_api.py +588 -0
- pluggy_sdk/api/acquirer_anticipation_api.py +664 -0
- pluggy_sdk/api/acquirer_receivable_api.py +664 -0
- pluggy_sdk/api/acquirer_sale_api.py +664 -0
- pluggy_sdk/api/auth_api.py +605 -0
- pluggy_sdk/api/benefit_api.py +567 -0
- pluggy_sdk/api/bill_api.py +567 -0
- pluggy_sdk/api/bulk_payment_api.py +1127 -0
- pluggy_sdk/api/category_api.py +1096 -0
- pluggy_sdk/api/connector_api.py +979 -0
- pluggy_sdk/api/consent_api.py +576 -0
- pluggy_sdk/api/identity_api.py +581 -0
- pluggy_sdk/api/income_report_api.py +311 -0
- pluggy_sdk/api/investment_api.py +918 -0
- pluggy_sdk/api/items_api.py +1456 -0
- pluggy_sdk/api/loan_api.py +567 -0
- pluggy_sdk/api/payment_customer_api.py +1414 -0
- pluggy_sdk/api/payment_intent_api.py +842 -0
- pluggy_sdk/api/payment_receipts_api.py +842 -0
- pluggy_sdk/api/payment_recipient_api.py +1997 -0
- pluggy_sdk/api/payment_request_api.py +2739 -0
- pluggy_sdk/api/payment_schedule_api.py +823 -0
- pluggy_sdk/api/payroll_loan_api.py +561 -0
- pluggy_sdk/api/portfolio_yield_api.py +580 -0
- pluggy_sdk/api/smart_account_api.py +1704 -0
- pluggy_sdk/api/smart_account_transfer_api.py +610 -0
- pluggy_sdk/api/smart_transfer_api.py +1406 -0
- pluggy_sdk/api/transaction_api.py +963 -0
- pluggy_sdk/api/webhook_api.py +1406 -0
- pluggy_sdk/api_client.py +798 -0
- pluggy_sdk/api_response.py +21 -0
- pluggy_sdk/configuration.py +596 -0
- pluggy_sdk/exceptions.py +217 -0
- pluggy_sdk/models/__init__.py +163 -0
- pluggy_sdk/models/account.py +134 -0
- pluggy_sdk/models/accounts_list200_response.py +102 -0
- pluggy_sdk/models/acquirer_anticipation.py +117 -0
- pluggy_sdk/models/acquirer_anticipation_data.py +101 -0
- pluggy_sdk/models/acquirer_data.py +113 -0
- pluggy_sdk/models/acquirer_receivable.py +143 -0
- pluggy_sdk/models/acquirer_receivable_data.py +108 -0
- pluggy_sdk/models/acquirer_receivable_data_establishment.py +96 -0
- pluggy_sdk/models/acquirer_receivable_destination_account.py +92 -0
- pluggy_sdk/models/acquirer_receivable_related_sale.py +99 -0
- pluggy_sdk/models/acquirer_sale.py +171 -0
- pluggy_sdk/models/acquirer_sale_data.py +150 -0
- pluggy_sdk/models/acquirer_sale_installment.py +93 -0
- pluggy_sdk/models/acquirer_sale_installment_data.py +95 -0
- pluggy_sdk/models/address.py +110 -0
- pluggy_sdk/models/aggregated_portfolio.py +120 -0
- pluggy_sdk/models/aggregated_portfolio_response.py +102 -0
- pluggy_sdk/models/asset_distribution.py +88 -0
- pluggy_sdk/models/auth_request.py +90 -0
- pluggy_sdk/models/auth_response.py +88 -0
- pluggy_sdk/models/bank_data.py +92 -0
- pluggy_sdk/models/benefit_loan.py +121 -0
- pluggy_sdk/models/benefit_loan_client.py +102 -0
- pluggy_sdk/models/benefit_response.py +118 -0
- pluggy_sdk/models/benefit_response_paying_institution.py +94 -0
- pluggy_sdk/models/benefits_list200_response.py +102 -0
- pluggy_sdk/models/bill.py +109 -0
- pluggy_sdk/models/bill_finance_charge.py +103 -0
- pluggy_sdk/models/bills_list200_response.py +102 -0
- pluggy_sdk/models/boleto.py +121 -0
- pluggy_sdk/models/boleto_payer.py +90 -0
- pluggy_sdk/models/boleto_recipient.py +90 -0
- pluggy_sdk/models/bulk_payment.py +128 -0
- pluggy_sdk/models/bulk_payments_list200_response.py +102 -0
- pluggy_sdk/models/category.py +96 -0
- pluggy_sdk/models/client_category_rule.py +98 -0
- pluggy_sdk/models/company.py +90 -0
- pluggy_sdk/models/connect_token_request.py +94 -0
- pluggy_sdk/models/connect_token_response.py +88 -0
- pluggy_sdk/models/connector.py +145 -0
- pluggy_sdk/models/connector_credential.py +121 -0
- pluggy_sdk/models/connector_health.py +96 -0
- pluggy_sdk/models/connector_health_details.py +90 -0
- pluggy_sdk/models/connector_list_response.py +102 -0
- pluggy_sdk/models/connector_user_action.py +93 -0
- pluggy_sdk/models/consent.py +120 -0
- pluggy_sdk/models/create_boleto_payment_request.py +98 -0
- pluggy_sdk/models/create_bulk_payment.py +96 -0
- pluggy_sdk/models/create_client_category_rule.py +96 -0
- pluggy_sdk/models/create_item.py +115 -0
- pluggy_sdk/models/create_item_parameters.py +144 -0
- pluggy_sdk/models/create_or_update_payment_customer.py +105 -0
- pluggy_sdk/models/create_payment_customer_request_body.py +103 -0
- pluggy_sdk/models/create_payment_intent.py +110 -0
- pluggy_sdk/models/create_payment_recipient.py +104 -0
- pluggy_sdk/models/create_payment_request.py +115 -0
- pluggy_sdk/models/create_payment_request_schedule.py +189 -0
- pluggy_sdk/models/create_pix_qr_payment_request.py +96 -0
- pluggy_sdk/models/create_smart_account_request.py +104 -0
- pluggy_sdk/models/create_smart_account_transfer_request.py +92 -0
- pluggy_sdk/models/create_smart_transfer_payment.py +96 -0
- pluggy_sdk/models/create_smart_transfer_preauthorization.py +104 -0
- pluggy_sdk/models/create_webhook.py +99 -0
- pluggy_sdk/models/credential_select_option.py +90 -0
- pluggy_sdk/models/credit_card_metadata.py +101 -0
- pluggy_sdk/models/credit_data.py +127 -0
- pluggy_sdk/models/custom.py +100 -0
- pluggy_sdk/models/daily.py +101 -0
- pluggy_sdk/models/document.py +100 -0
- pluggy_sdk/models/email.py +100 -0
- pluggy_sdk/models/global_error_response.py +94 -0
- pluggy_sdk/models/i_count_response.py +88 -0
- pluggy_sdk/models/identity_relation.py +102 -0
- pluggy_sdk/models/identity_response.py +173 -0
- pluggy_sdk/models/identity_response_financial_relationships.py +111 -0
- pluggy_sdk/models/identity_response_financial_relationships_accounts_inner.py +98 -0
- pluggy_sdk/models/identity_response_financial_relationships_procurators_inner.py +101 -0
- pluggy_sdk/models/identity_response_qualifications.py +112 -0
- pluggy_sdk/models/identity_response_qualifications_informed_income.py +100 -0
- pluggy_sdk/models/identity_response_qualifications_informed_patrimony.py +90 -0
- pluggy_sdk/models/income_report.py +90 -0
- pluggy_sdk/models/income_reports_response.py +102 -0
- pluggy_sdk/models/investment.py +192 -0
- pluggy_sdk/models/investment_expenses.py +108 -0
- pluggy_sdk/models/investment_metadata.py +100 -0
- pluggy_sdk/models/investment_transaction.py +124 -0
- pluggy_sdk/models/investments_list200_response.py +102 -0
- pluggy_sdk/models/item.py +150 -0
- pluggy_sdk/models/item_creation_error_response.py +102 -0
- pluggy_sdk/models/item_error.py +94 -0
- pluggy_sdk/models/item_options.py +94 -0
- pluggy_sdk/models/loan.py +199 -0
- pluggy_sdk/models/loan_contracted_fee.py +118 -0
- pluggy_sdk/models/loan_contracted_finance_charge.py +92 -0
- pluggy_sdk/models/loan_installment_balloon_payment.py +95 -0
- pluggy_sdk/models/loan_installment_balloon_payment_amount.py +90 -0
- pluggy_sdk/models/loan_installments.py +130 -0
- pluggy_sdk/models/loan_interest_rate.py +136 -0
- pluggy_sdk/models/loan_payment_release.py +103 -0
- pluggy_sdk/models/loan_payment_release_over_parcel.py +106 -0
- pluggy_sdk/models/loan_payment_release_over_parcel_charge.py +92 -0
- pluggy_sdk/models/loan_payment_release_over_parcel_fee.py +92 -0
- pluggy_sdk/models/loan_payments.py +98 -0
- pluggy_sdk/models/loan_warranty.py +94 -0
- pluggy_sdk/models/loans_list200_response.py +102 -0
- pluggy_sdk/models/merchant.py +96 -0
- pluggy_sdk/models/monthly.py +103 -0
- pluggy_sdk/models/monthly_portfolio.py +100 -0
- pluggy_sdk/models/monthly_portfolio_response.py +102 -0
- pluggy_sdk/models/not_authenticated_response.py +90 -0
- pluggy_sdk/models/page_response_acquirer_anticipations.py +102 -0
- pluggy_sdk/models/page_response_acquirer_receivables.py +102 -0
- pluggy_sdk/models/page_response_acquirer_sales.py +102 -0
- pluggy_sdk/models/page_response_category_rules.py +102 -0
- pluggy_sdk/models/page_response_consents.py +102 -0
- pluggy_sdk/models/page_response_investment_transactions.py +102 -0
- pluggy_sdk/models/page_response_transactions.py +102 -0
- pluggy_sdk/models/parameter_validation_error.py +92 -0
- pluggy_sdk/models/parameter_validation_response.py +98 -0
- pluggy_sdk/models/payment_customer.py +105 -0
- pluggy_sdk/models/payment_customers_list200_response.py +102 -0
- pluggy_sdk/models/payment_data.py +111 -0
- pluggy_sdk/models/payment_data_boleto_metadata.py +98 -0
- pluggy_sdk/models/payment_data_participant.py +102 -0
- pluggy_sdk/models/payment_institution.py +101 -0
- pluggy_sdk/models/payment_intent.py +145 -0
- pluggy_sdk/models/payment_intent_parameter.py +90 -0
- pluggy_sdk/models/payment_intents_list200_response.py +102 -0
- pluggy_sdk/models/payment_receipt.py +120 -0
- pluggy_sdk/models/payment_receipt_bank_account.py +92 -0
- pluggy_sdk/models/payment_receipt_person.py +96 -0
- pluggy_sdk/models/payment_recipient.py +110 -0
- pluggy_sdk/models/payment_recipient_account.py +92 -0
- pluggy_sdk/models/payment_recipients_institution_list200_response.py +102 -0
- pluggy_sdk/models/payment_recipients_list200_response.py +102 -0
- pluggy_sdk/models/payment_request.py +132 -0
- pluggy_sdk/models/payment_request_callback_urls.py +92 -0
- pluggy_sdk/models/payment_request_receipt_list200_response.py +102 -0
- pluggy_sdk/models/payment_request_schedule.py +183 -0
- pluggy_sdk/models/payment_requests_list200_response.py +102 -0
- pluggy_sdk/models/payment_schedules_list200_response.py +102 -0
- pluggy_sdk/models/payroll_loan.py +121 -0
- pluggy_sdk/models/payroll_loan_client.py +102 -0
- pluggy_sdk/models/payroll_loan_response.py +125 -0
- pluggy_sdk/models/payroll_loan_response_client.py +102 -0
- pluggy_sdk/models/payroll_loans_list200_response.py +102 -0
- pluggy_sdk/models/percentage_over_index.py +90 -0
- pluggy_sdk/models/phone_number.py +100 -0
- pluggy_sdk/models/pix_data.py +90 -0
- pluggy_sdk/models/schedule_payment.py +102 -0
- pluggy_sdk/models/schedule_type_custom.py +100 -0
- pluggy_sdk/models/schedule_type_daily.py +101 -0
- pluggy_sdk/models/schedule_type_monthly.py +103 -0
- pluggy_sdk/models/schedule_type_single.py +98 -0
- pluggy_sdk/models/schedule_type_weekly.py +110 -0
- pluggy_sdk/models/single.py +98 -0
- pluggy_sdk/models/smart_account.py +107 -0
- pluggy_sdk/models/smart_account_address.py +112 -0
- pluggy_sdk/models/smart_account_balance.py +95 -0
- pluggy_sdk/models/smart_account_transfer.py +123 -0
- pluggy_sdk/models/smart_accounts_list200_response.py +102 -0
- pluggy_sdk/models/smart_tranfers_preauthorizations_list200_response.py +102 -0
- pluggy_sdk/models/smart_transfer_callback_urls.py +90 -0
- pluggy_sdk/models/smart_transfer_payment.py +116 -0
- pluggy_sdk/models/smart_transfer_preauthorization.py +128 -0
- pluggy_sdk/models/smart_transfer_preauthorization_parameter.py +90 -0
- pluggy_sdk/models/status_detail.py +127 -0
- pluggy_sdk/models/status_detail_product.py +101 -0
- pluggy_sdk/models/status_detail_product_warning.py +92 -0
- pluggy_sdk/models/transaction.py +141 -0
- pluggy_sdk/models/update_item.py +109 -0
- pluggy_sdk/models/update_item_parameters.py +144 -0
- pluggy_sdk/models/update_payment_recipient.py +102 -0
- pluggy_sdk/models/update_payment_request.py +102 -0
- pluggy_sdk/models/update_transaction.py +88 -0
- pluggy_sdk/models/webhook.py +106 -0
- pluggy_sdk/models/webhook_creation_error_response.py +90 -0
- pluggy_sdk/models/webhooks_list200_response.py +102 -0
- pluggy_sdk/models/weekly.py +110 -0
- pluggy_sdk/py.typed +0 -0
- pluggy_sdk/rest.py +258 -0
- pluggy_sdk-1.0.0.post34.dist-info/METADATA +373 -0
- pluggy_sdk-1.0.0.post34.dist-info/RECORD +221 -0
- pluggy_sdk-1.0.0.post34.dist-info/WHEEL +5 -0
- pluggy_sdk-1.0.0.post34.dist-info/top_level.txt +1 -0
pluggy_sdk/exceptions.py
ADDED
@@ -0,0 +1,217 @@
|
|
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
|
+
from typing import Any, Optional
|
16
|
+
from typing_extensions import Self
|
17
|
+
|
18
|
+
class OpenApiException(Exception):
|
19
|
+
"""The base exception class for all OpenAPIExceptions"""
|
20
|
+
|
21
|
+
|
22
|
+
class ApiTypeError(OpenApiException, TypeError):
|
23
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
24
|
+
key_type=None) -> None:
|
25
|
+
""" Raises an exception for TypeErrors
|
26
|
+
|
27
|
+
Args:
|
28
|
+
msg (str): the exception message
|
29
|
+
|
30
|
+
Keyword Args:
|
31
|
+
path_to_item (list): a list of keys an indices to get to the
|
32
|
+
current_item
|
33
|
+
None if unset
|
34
|
+
valid_classes (tuple): the primitive classes that current item
|
35
|
+
should be an instance of
|
36
|
+
None if unset
|
37
|
+
key_type (bool): False if our value is a value in a dict
|
38
|
+
True if it is a key in a dict
|
39
|
+
False if our item is an item in a list
|
40
|
+
None if unset
|
41
|
+
"""
|
42
|
+
self.path_to_item = path_to_item
|
43
|
+
self.valid_classes = valid_classes
|
44
|
+
self.key_type = key_type
|
45
|
+
full_msg = msg
|
46
|
+
if path_to_item:
|
47
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
48
|
+
super(ApiTypeError, self).__init__(full_msg)
|
49
|
+
|
50
|
+
|
51
|
+
class ApiValueError(OpenApiException, ValueError):
|
52
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
53
|
+
"""
|
54
|
+
Args:
|
55
|
+
msg (str): the exception message
|
56
|
+
|
57
|
+
Keyword Args:
|
58
|
+
path_to_item (list) the path to the exception in the
|
59
|
+
received_data dict. None if unset
|
60
|
+
"""
|
61
|
+
|
62
|
+
self.path_to_item = path_to_item
|
63
|
+
full_msg = msg
|
64
|
+
if path_to_item:
|
65
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
66
|
+
super(ApiValueError, self).__init__(full_msg)
|
67
|
+
|
68
|
+
|
69
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
70
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
71
|
+
"""
|
72
|
+
Raised when an attribute reference or assignment fails.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
msg (str): the exception message
|
76
|
+
|
77
|
+
Keyword Args:
|
78
|
+
path_to_item (None/list) the path to the exception in the
|
79
|
+
received_data dict
|
80
|
+
"""
|
81
|
+
self.path_to_item = path_to_item
|
82
|
+
full_msg = msg
|
83
|
+
if path_to_item:
|
84
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
85
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
86
|
+
|
87
|
+
|
88
|
+
class ApiKeyError(OpenApiException, KeyError):
|
89
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
90
|
+
"""
|
91
|
+
Args:
|
92
|
+
msg (str): the exception message
|
93
|
+
|
94
|
+
Keyword Args:
|
95
|
+
path_to_item (None/list) the path to the exception in the
|
96
|
+
received_data dict
|
97
|
+
"""
|
98
|
+
self.path_to_item = path_to_item
|
99
|
+
full_msg = msg
|
100
|
+
if path_to_item:
|
101
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
102
|
+
super(ApiKeyError, self).__init__(full_msg)
|
103
|
+
|
104
|
+
|
105
|
+
class ApiException(OpenApiException):
|
106
|
+
|
107
|
+
def __init__(
|
108
|
+
self,
|
109
|
+
status=None,
|
110
|
+
reason=None,
|
111
|
+
http_resp=None,
|
112
|
+
*,
|
113
|
+
body: Optional[str] = None,
|
114
|
+
data: Optional[Any] = None,
|
115
|
+
) -> None:
|
116
|
+
self.status = status
|
117
|
+
self.reason = reason
|
118
|
+
self.body = body
|
119
|
+
self.data = data
|
120
|
+
self.headers = None
|
121
|
+
|
122
|
+
if http_resp:
|
123
|
+
if self.status is None:
|
124
|
+
self.status = http_resp.status
|
125
|
+
if self.reason is None:
|
126
|
+
self.reason = http_resp.reason
|
127
|
+
if self.body is None:
|
128
|
+
try:
|
129
|
+
self.body = http_resp.data.decode('utf-8')
|
130
|
+
except Exception:
|
131
|
+
pass
|
132
|
+
self.headers = http_resp.getheaders()
|
133
|
+
|
134
|
+
@classmethod
|
135
|
+
def from_response(
|
136
|
+
cls,
|
137
|
+
*,
|
138
|
+
http_resp,
|
139
|
+
body: Optional[str],
|
140
|
+
data: Optional[Any],
|
141
|
+
) -> Self:
|
142
|
+
if http_resp.status == 400:
|
143
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
144
|
+
|
145
|
+
if http_resp.status == 401:
|
146
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
147
|
+
|
148
|
+
if http_resp.status == 403:
|
149
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
150
|
+
|
151
|
+
if http_resp.status == 404:
|
152
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
153
|
+
|
154
|
+
# Added new conditions for 409 and 422
|
155
|
+
if http_resp.status == 409:
|
156
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
157
|
+
|
158
|
+
if http_resp.status == 422:
|
159
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
160
|
+
|
161
|
+
if 500 <= http_resp.status <= 599:
|
162
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
163
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
164
|
+
|
165
|
+
def __str__(self):
|
166
|
+
"""Custom error messages for exception"""
|
167
|
+
error_message = "({0})\n"\
|
168
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
169
|
+
if self.headers:
|
170
|
+
error_message += "HTTP response headers: {0}\n".format(
|
171
|
+
self.headers)
|
172
|
+
|
173
|
+
if self.data or self.body:
|
174
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
175
|
+
|
176
|
+
return error_message
|
177
|
+
|
178
|
+
|
179
|
+
class BadRequestException(ApiException):
|
180
|
+
pass
|
181
|
+
|
182
|
+
|
183
|
+
class NotFoundException(ApiException):
|
184
|
+
pass
|
185
|
+
|
186
|
+
|
187
|
+
class UnauthorizedException(ApiException):
|
188
|
+
pass
|
189
|
+
|
190
|
+
|
191
|
+
class ForbiddenException(ApiException):
|
192
|
+
pass
|
193
|
+
|
194
|
+
|
195
|
+
class ServiceException(ApiException):
|
196
|
+
pass
|
197
|
+
|
198
|
+
|
199
|
+
class ConflictException(ApiException):
|
200
|
+
"""Exception for HTTP 409 Conflict."""
|
201
|
+
pass
|
202
|
+
|
203
|
+
|
204
|
+
class UnprocessableEntityException(ApiException):
|
205
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
206
|
+
pass
|
207
|
+
|
208
|
+
|
209
|
+
def render_path(path_to_item):
|
210
|
+
"""Returns a string representation of a path"""
|
211
|
+
result = ""
|
212
|
+
for pth in path_to_item:
|
213
|
+
if isinstance(pth, int):
|
214
|
+
result += "[{0}]".format(pth)
|
215
|
+
else:
|
216
|
+
result += "['{0}']".format(pth)
|
217
|
+
return result
|
@@ -0,0 +1,163 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# flake8: noqa
|
4
|
+
"""
|
5
|
+
Pluggy API
|
6
|
+
|
7
|
+
Pluggy's main API to review data and execute connectors
|
8
|
+
|
9
|
+
The version of the OpenAPI document: 1.0.0
|
10
|
+
Contact: hello@pluggy.ai
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
12
|
+
|
13
|
+
Do not edit the class manually.
|
14
|
+
""" # noqa: E501
|
15
|
+
|
16
|
+
|
17
|
+
# import models into model package
|
18
|
+
from pluggy_sdk.models.account import Account
|
19
|
+
from pluggy_sdk.models.accounts_list200_response import AccountsList200Response
|
20
|
+
from pluggy_sdk.models.address import Address
|
21
|
+
from pluggy_sdk.models.auth_request import AuthRequest
|
22
|
+
from pluggy_sdk.models.auth_response import AuthResponse
|
23
|
+
from pluggy_sdk.models.bank_data import BankData
|
24
|
+
from pluggy_sdk.models.benefit_loan import BenefitLoan
|
25
|
+
from pluggy_sdk.models.benefit_loan_client import BenefitLoanClient
|
26
|
+
from pluggy_sdk.models.benefit_response import BenefitResponse
|
27
|
+
from pluggy_sdk.models.benefit_response_paying_institution import BenefitResponsePayingInstitution
|
28
|
+
from pluggy_sdk.models.benefits_list200_response import BenefitsList200Response
|
29
|
+
from pluggy_sdk.models.bill import Bill
|
30
|
+
from pluggy_sdk.models.bill_finance_charge import BillFinanceCharge
|
31
|
+
from pluggy_sdk.models.bills_list200_response import BillsList200Response
|
32
|
+
from pluggy_sdk.models.boleto import Boleto
|
33
|
+
from pluggy_sdk.models.boleto_payer import BoletoPayer
|
34
|
+
from pluggy_sdk.models.boleto_recipient import BoletoRecipient
|
35
|
+
from pluggy_sdk.models.bulk_payment import BulkPayment
|
36
|
+
from pluggy_sdk.models.bulk_payments_list200_response import BulkPaymentsList200Response
|
37
|
+
from pluggy_sdk.models.custom import CUSTOM
|
38
|
+
from pluggy_sdk.models.category import Category
|
39
|
+
from pluggy_sdk.models.client_category_rule import ClientCategoryRule
|
40
|
+
from pluggy_sdk.models.company import Company
|
41
|
+
from pluggy_sdk.models.connect_token_request import ConnectTokenRequest
|
42
|
+
from pluggy_sdk.models.connect_token_response import ConnectTokenResponse
|
43
|
+
from pluggy_sdk.models.connector import Connector
|
44
|
+
from pluggy_sdk.models.connector_credential import ConnectorCredential
|
45
|
+
from pluggy_sdk.models.connector_health import ConnectorHealth
|
46
|
+
from pluggy_sdk.models.connector_health_details import ConnectorHealthDetails
|
47
|
+
from pluggy_sdk.models.connector_list_response import ConnectorListResponse
|
48
|
+
from pluggy_sdk.models.connector_user_action import ConnectorUserAction
|
49
|
+
from pluggy_sdk.models.consent import Consent
|
50
|
+
from pluggy_sdk.models.create_boleto_payment_request import CreateBoletoPaymentRequest
|
51
|
+
from pluggy_sdk.models.create_bulk_payment import CreateBulkPayment
|
52
|
+
from pluggy_sdk.models.create_client_category_rule import CreateClientCategoryRule
|
53
|
+
from pluggy_sdk.models.create_item import CreateItem
|
54
|
+
from pluggy_sdk.models.create_item_parameters import CreateItemParameters
|
55
|
+
from pluggy_sdk.models.create_or_update_payment_customer import CreateOrUpdatePaymentCustomer
|
56
|
+
from pluggy_sdk.models.create_payment_customer_request_body import CreatePaymentCustomerRequestBody
|
57
|
+
from pluggy_sdk.models.create_payment_intent import CreatePaymentIntent
|
58
|
+
from pluggy_sdk.models.create_payment_recipient import CreatePaymentRecipient
|
59
|
+
from pluggy_sdk.models.create_payment_request import CreatePaymentRequest
|
60
|
+
from pluggy_sdk.models.create_payment_request_schedule import CreatePaymentRequestSchedule
|
61
|
+
from pluggy_sdk.models.create_pix_qr_payment_request import CreatePixQrPaymentRequest
|
62
|
+
from pluggy_sdk.models.create_smart_account_request import CreateSmartAccountRequest
|
63
|
+
from pluggy_sdk.models.create_smart_account_transfer_request import CreateSmartAccountTransferRequest
|
64
|
+
from pluggy_sdk.models.create_smart_transfer_payment import CreateSmartTransferPayment
|
65
|
+
from pluggy_sdk.models.create_smart_transfer_preauthorization import CreateSmartTransferPreauthorization
|
66
|
+
from pluggy_sdk.models.create_webhook import CreateWebhook
|
67
|
+
from pluggy_sdk.models.credential_select_option import CredentialSelectOption
|
68
|
+
from pluggy_sdk.models.credit_card_metadata import CreditCardMetadata
|
69
|
+
from pluggy_sdk.models.credit_data import CreditData
|
70
|
+
from pluggy_sdk.models.daily import DAILY
|
71
|
+
from pluggy_sdk.models.document import Document
|
72
|
+
from pluggy_sdk.models.email import Email
|
73
|
+
from pluggy_sdk.models.global_error_response import GlobalErrorResponse
|
74
|
+
from pluggy_sdk.models.i_count_response import ICountResponse
|
75
|
+
from pluggy_sdk.models.identity_relation import IdentityRelation
|
76
|
+
from pluggy_sdk.models.identity_response import IdentityResponse
|
77
|
+
from pluggy_sdk.models.identity_response_financial_relationships import IdentityResponseFinancialRelationships
|
78
|
+
from pluggy_sdk.models.identity_response_financial_relationships_accounts_inner import IdentityResponseFinancialRelationshipsAccountsInner
|
79
|
+
from pluggy_sdk.models.identity_response_financial_relationships_procurators_inner import IdentityResponseFinancialRelationshipsProcuratorsInner
|
80
|
+
from pluggy_sdk.models.identity_response_qualifications import IdentityResponseQualifications
|
81
|
+
from pluggy_sdk.models.identity_response_qualifications_informed_income import IdentityResponseQualificationsInformedIncome
|
82
|
+
from pluggy_sdk.models.identity_response_qualifications_informed_patrimony import IdentityResponseQualificationsInformedPatrimony
|
83
|
+
from pluggy_sdk.models.investment import Investment
|
84
|
+
from pluggy_sdk.models.investment_expenses import InvestmentExpenses
|
85
|
+
from pluggy_sdk.models.investment_metadata import InvestmentMetadata
|
86
|
+
from pluggy_sdk.models.investment_transaction import InvestmentTransaction
|
87
|
+
from pluggy_sdk.models.investments_list200_response import InvestmentsList200Response
|
88
|
+
from pluggy_sdk.models.item import Item
|
89
|
+
from pluggy_sdk.models.item_creation_error_response import ItemCreationErrorResponse
|
90
|
+
from pluggy_sdk.models.item_error import ItemError
|
91
|
+
from pluggy_sdk.models.item_options import ItemOptions
|
92
|
+
from pluggy_sdk.models.loan import Loan
|
93
|
+
from pluggy_sdk.models.loan_contracted_fee import LoanContractedFee
|
94
|
+
from pluggy_sdk.models.loan_contracted_finance_charge import LoanContractedFinanceCharge
|
95
|
+
from pluggy_sdk.models.loan_installment_balloon_payment import LoanInstallmentBalloonPayment
|
96
|
+
from pluggy_sdk.models.loan_installment_balloon_payment_amount import LoanInstallmentBalloonPaymentAmount
|
97
|
+
from pluggy_sdk.models.loan_installments import LoanInstallments
|
98
|
+
from pluggy_sdk.models.loan_interest_rate import LoanInterestRate
|
99
|
+
from pluggy_sdk.models.loan_payment_release import LoanPaymentRelease
|
100
|
+
from pluggy_sdk.models.loan_payment_release_over_parcel import LoanPaymentReleaseOverParcel
|
101
|
+
from pluggy_sdk.models.loan_payment_release_over_parcel_charge import LoanPaymentReleaseOverParcelCharge
|
102
|
+
from pluggy_sdk.models.loan_payment_release_over_parcel_fee import LoanPaymentReleaseOverParcelFee
|
103
|
+
from pluggy_sdk.models.loan_payments import LoanPayments
|
104
|
+
from pluggy_sdk.models.loan_warranty import LoanWarranty
|
105
|
+
from pluggy_sdk.models.loans_list200_response import LoansList200Response
|
106
|
+
from pluggy_sdk.models.monthly import MONTHLY
|
107
|
+
from pluggy_sdk.models.merchant import Merchant
|
108
|
+
from pluggy_sdk.models.not_authenticated_response import NotAuthenticatedResponse
|
109
|
+
from pluggy_sdk.models.page_response_category_rules import PageResponseCategoryRules
|
110
|
+
from pluggy_sdk.models.page_response_consents import PageResponseConsents
|
111
|
+
from pluggy_sdk.models.page_response_investment_transactions import PageResponseInvestmentTransactions
|
112
|
+
from pluggy_sdk.models.page_response_transactions import PageResponseTransactions
|
113
|
+
from pluggy_sdk.models.parameter_validation_error import ParameterValidationError
|
114
|
+
from pluggy_sdk.models.parameter_validation_response import ParameterValidationResponse
|
115
|
+
from pluggy_sdk.models.payment_customer import PaymentCustomer
|
116
|
+
from pluggy_sdk.models.payment_customers_list200_response import PaymentCustomersList200Response
|
117
|
+
from pluggy_sdk.models.payment_data import PaymentData
|
118
|
+
from pluggy_sdk.models.payment_data_boleto_metadata import PaymentDataBoletoMetadata
|
119
|
+
from pluggy_sdk.models.payment_data_participant import PaymentDataParticipant
|
120
|
+
from pluggy_sdk.models.payment_institution import PaymentInstitution
|
121
|
+
from pluggy_sdk.models.payment_intent import PaymentIntent
|
122
|
+
from pluggy_sdk.models.payment_intent_parameter import PaymentIntentParameter
|
123
|
+
from pluggy_sdk.models.payment_intents_list200_response import PaymentIntentsList200Response
|
124
|
+
from pluggy_sdk.models.payment_receipt import PaymentReceipt
|
125
|
+
from pluggy_sdk.models.payment_receipt_bank_account import PaymentReceiptBankAccount
|
126
|
+
from pluggy_sdk.models.payment_receipt_person import PaymentReceiptPerson
|
127
|
+
from pluggy_sdk.models.payment_recipient import PaymentRecipient
|
128
|
+
from pluggy_sdk.models.payment_recipient_account import PaymentRecipientAccount
|
129
|
+
from pluggy_sdk.models.payment_recipients_institution_list200_response import PaymentRecipientsInstitutionList200Response
|
130
|
+
from pluggy_sdk.models.payment_recipients_list200_response import PaymentRecipientsList200Response
|
131
|
+
from pluggy_sdk.models.payment_request import PaymentRequest
|
132
|
+
from pluggy_sdk.models.payment_request_callback_urls import PaymentRequestCallbackUrls
|
133
|
+
from pluggy_sdk.models.payment_request_receipt_list200_response import PaymentRequestReceiptList200Response
|
134
|
+
from pluggy_sdk.models.payment_request_schedule import PaymentRequestSchedule
|
135
|
+
from pluggy_sdk.models.payment_requests_list200_response import PaymentRequestsList200Response
|
136
|
+
from pluggy_sdk.models.payment_schedules_list200_response import PaymentSchedulesList200Response
|
137
|
+
from pluggy_sdk.models.phone_number import PhoneNumber
|
138
|
+
from pluggy_sdk.models.pix_data import PixData
|
139
|
+
from pluggy_sdk.models.single import SINGLE
|
140
|
+
from pluggy_sdk.models.schedule_payment import SchedulePayment
|
141
|
+
from pluggy_sdk.models.smart_account import SmartAccount
|
142
|
+
from pluggy_sdk.models.smart_account_address import SmartAccountAddress
|
143
|
+
from pluggy_sdk.models.smart_account_balance import SmartAccountBalance
|
144
|
+
from pluggy_sdk.models.smart_account_transfer import SmartAccountTransfer
|
145
|
+
from pluggy_sdk.models.smart_accounts_list200_response import SmartAccountsList200Response
|
146
|
+
from pluggy_sdk.models.smart_tranfers_preauthorizations_list200_response import SmartTranfersPreauthorizationsList200Response
|
147
|
+
from pluggy_sdk.models.smart_transfer_callback_urls import SmartTransferCallbackUrls
|
148
|
+
from pluggy_sdk.models.smart_transfer_payment import SmartTransferPayment
|
149
|
+
from pluggy_sdk.models.smart_transfer_preauthorization import SmartTransferPreauthorization
|
150
|
+
from pluggy_sdk.models.smart_transfer_preauthorization_parameter import SmartTransferPreauthorizationParameter
|
151
|
+
from pluggy_sdk.models.status_detail import StatusDetail
|
152
|
+
from pluggy_sdk.models.status_detail_product import StatusDetailProduct
|
153
|
+
from pluggy_sdk.models.status_detail_product_warning import StatusDetailProductWarning
|
154
|
+
from pluggy_sdk.models.transaction import Transaction
|
155
|
+
from pluggy_sdk.models.update_item import UpdateItem
|
156
|
+
from pluggy_sdk.models.update_item_parameters import UpdateItemParameters
|
157
|
+
from pluggy_sdk.models.update_payment_recipient import UpdatePaymentRecipient
|
158
|
+
from pluggy_sdk.models.update_payment_request import UpdatePaymentRequest
|
159
|
+
from pluggy_sdk.models.update_transaction import UpdateTransaction
|
160
|
+
from pluggy_sdk.models.weekly import WEEKLY
|
161
|
+
from pluggy_sdk.models.webhook import Webhook
|
162
|
+
from pluggy_sdk.models.webhook_creation_error_response import WebhookCreationErrorResponse
|
163
|
+
from pluggy_sdk.models.webhooks_list200_response import WebhooksList200Response
|
@@ -0,0 +1,134 @@
|
|
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
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from pluggy_sdk.models.bank_data import BankData
|
24
|
+
from pluggy_sdk.models.credit_data import CreditData
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
class Account(BaseModel):
|
29
|
+
"""
|
30
|
+
Account of type bank
|
31
|
+
""" # noqa: E501
|
32
|
+
id: StrictStr = Field(description="Primary account identifier")
|
33
|
+
type: StrictStr = Field(description="Type of account, may be BANK or CREDIT")
|
34
|
+
subtype: StrictStr = Field(description="Subtype of corresponding type of account")
|
35
|
+
number: StrictStr = Field(description="External identifier of the account")
|
36
|
+
name: StrictStr = Field(description="Name of the account in a descriptive format")
|
37
|
+
marketing_name: Optional[StrictStr] = Field(default=None, description="Name of the account as defined externally", alias="marketingName")
|
38
|
+
balance: Union[StrictFloat, StrictInt] = Field(description="Funds of the account")
|
39
|
+
item_id: StrictStr = Field(description="Attached item's primary identifier", alias="itemId")
|
40
|
+
tax_number: Optional[StrictStr] = Field(default=None, description="Tax ID of the corresponding owner", alias="taxNumber")
|
41
|
+
owner: Optional[StrictStr] = Field(default=None, description="Name of the owner of the account")
|
42
|
+
currency_code: StrictStr = Field(description="Code referencing the currency of the balance", alias="currencyCode")
|
43
|
+
bank_data: Optional[BankData] = Field(default=None, alias="bankData")
|
44
|
+
credit_data: Optional[CreditData] = Field(default=None, alias="creditData")
|
45
|
+
__properties: ClassVar[List[str]] = ["id", "type", "subtype", "number", "name", "marketingName", "balance", "itemId", "taxNumber", "owner", "currencyCode", "bankData", "creditData"]
|
46
|
+
|
47
|
+
@field_validator('type')
|
48
|
+
def type_validate_enum(cls, value):
|
49
|
+
"""Validates the enum"""
|
50
|
+
if value not in set(['BANK', 'CREDIT']):
|
51
|
+
raise ValueError("must be one of enum values ('BANK', 'CREDIT')")
|
52
|
+
return value
|
53
|
+
|
54
|
+
@field_validator('subtype')
|
55
|
+
def subtype_validate_enum(cls, value):
|
56
|
+
"""Validates the enum"""
|
57
|
+
if value not in set(['SAVINGS_ACCOUNT', 'CHECKING_ACCOUNT', 'CREDIT_CARD']):
|
58
|
+
raise ValueError("must be one of enum values ('SAVINGS_ACCOUNT', 'CHECKING_ACCOUNT', 'CREDIT_CARD')")
|
59
|
+
return value
|
60
|
+
|
61
|
+
model_config = ConfigDict(
|
62
|
+
populate_by_name=True,
|
63
|
+
validate_assignment=True,
|
64
|
+
protected_namespaces=(),
|
65
|
+
)
|
66
|
+
|
67
|
+
|
68
|
+
def to_str(self) -> str:
|
69
|
+
"""Returns the string representation of the model using alias"""
|
70
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
71
|
+
|
72
|
+
def to_json(self) -> str:
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
74
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
75
|
+
return json.dumps(self.to_dict())
|
76
|
+
|
77
|
+
@classmethod
|
78
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
79
|
+
"""Create an instance of Account from a JSON string"""
|
80
|
+
return cls.from_dict(json.loads(json_str))
|
81
|
+
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
83
|
+
"""Return the dictionary representation of the model using alias.
|
84
|
+
|
85
|
+
This has the following differences from calling pydantic's
|
86
|
+
`self.model_dump(by_alias=True)`:
|
87
|
+
|
88
|
+
* `None` is only added to the output dict for nullable fields that
|
89
|
+
were set at model initialization. Other fields with value `None`
|
90
|
+
are ignored.
|
91
|
+
"""
|
92
|
+
excluded_fields: Set[str] = set([
|
93
|
+
])
|
94
|
+
|
95
|
+
_dict = self.model_dump(
|
96
|
+
by_alias=True,
|
97
|
+
exclude=excluded_fields,
|
98
|
+
exclude_none=True,
|
99
|
+
)
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of bank_data
|
101
|
+
if self.bank_data:
|
102
|
+
_dict['bankData'] = self.bank_data.to_dict()
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of credit_data
|
104
|
+
if self.credit_data:
|
105
|
+
_dict['creditData'] = self.credit_data.to_dict()
|
106
|
+
return _dict
|
107
|
+
|
108
|
+
@classmethod
|
109
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
110
|
+
"""Create an instance of Account from a dict"""
|
111
|
+
if obj is None:
|
112
|
+
return None
|
113
|
+
|
114
|
+
if not isinstance(obj, dict):
|
115
|
+
return cls.model_validate(obj)
|
116
|
+
|
117
|
+
_obj = cls.model_validate({
|
118
|
+
"id": obj.get("id"),
|
119
|
+
"type": obj.get("type"),
|
120
|
+
"subtype": obj.get("subtype"),
|
121
|
+
"number": obj.get("number"),
|
122
|
+
"name": obj.get("name"),
|
123
|
+
"marketingName": obj.get("marketingName"),
|
124
|
+
"balance": obj.get("balance"),
|
125
|
+
"itemId": obj.get("itemId"),
|
126
|
+
"taxNumber": obj.get("taxNumber"),
|
127
|
+
"owner": obj.get("owner"),
|
128
|
+
"currencyCode": obj.get("currencyCode"),
|
129
|
+
"bankData": BankData.from_dict(obj["bankData"]) if obj.get("bankData") is not None else None,
|
130
|
+
"creditData": CreditData.from_dict(obj["creditData"]) if obj.get("creditData") is not None else None
|
131
|
+
})
|
132
|
+
return _obj
|
133
|
+
|
134
|
+
|
@@ -0,0 +1,102 @@
|
|
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
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from pluggy_sdk.models.account import Account
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class AccountsList200Response(BaseModel):
|
28
|
+
"""
|
29
|
+
AccountsList200Response
|
30
|
+
""" # noqa: E501
|
31
|
+
page: Optional[Union[StrictFloat, StrictInt]] = None
|
32
|
+
total: Optional[Union[StrictFloat, StrictInt]] = None
|
33
|
+
total_pages: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="totalPages")
|
34
|
+
results: Optional[List[Account]] = Field(default=None, description="List of retrieved accounts")
|
35
|
+
__properties: ClassVar[List[str]] = ["page", "total", "totalPages", "results"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of AccountsList200Response from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
])
|
70
|
+
|
71
|
+
_dict = self.model_dump(
|
72
|
+
by_alias=True,
|
73
|
+
exclude=excluded_fields,
|
74
|
+
exclude_none=True,
|
75
|
+
)
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of each item in results (list)
|
77
|
+
_items = []
|
78
|
+
if self.results:
|
79
|
+
for _item_results in self.results:
|
80
|
+
if _item_results:
|
81
|
+
_items.append(_item_results.to_dict())
|
82
|
+
_dict['results'] = _items
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of AccountsList200Response from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
_obj = cls.model_validate({
|
95
|
+
"page": obj.get("page"),
|
96
|
+
"total": obj.get("total"),
|
97
|
+
"totalPages": obj.get("totalPages"),
|
98
|
+
"results": [Account.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
|
99
|
+
})
|
100
|
+
return _obj
|
101
|
+
|
102
|
+
|