pluggy-sdk 1.0.0.post20__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 +220 -0
- pluggy_sdk/api/__init__.py +30 -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 +480 -0
- pluggy_sdk/exceptions.py +200 -0
- pluggy_sdk/models/__init__.py +178 -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 +94 -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 +92 -0
- pluggy_sdk/models/create_item.py +113 -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 +110 -0
- pluggy_sdk/models/create_pix_qr_payment_request.py +96 -0
- pluggy_sdk/models/create_smart_account_request.py +102 -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 +149 -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 +90 -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 +105 -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 +142 -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 +145 -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.post20.dist-info/METADATA +388 -0
- pluggy_sdk-1.0.0.post20.dist-info/RECORD +213 -0
- pluggy_sdk-1.0.0.post20.dist-info/WHEEL +5 -0
- pluggy_sdk-1.0.0.post20.dist-info/top_level.txt +1 -0
@@ -0,0 +1,150 @@
|
|
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 datetime import datetime
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
|
+
from pluggy_sdk.models.connector import Connector
|
25
|
+
from pluggy_sdk.models.connector_credential import ConnectorCredential
|
26
|
+
from pluggy_sdk.models.connector_user_action import ConnectorUserAction
|
27
|
+
from pluggy_sdk.models.item_error import ItemError
|
28
|
+
from pluggy_sdk.models.status_detail import StatusDetail
|
29
|
+
from typing import Optional, Set
|
30
|
+
from typing_extensions import Self
|
31
|
+
|
32
|
+
class Item(BaseModel):
|
33
|
+
"""
|
34
|
+
Item object
|
35
|
+
""" # noqa: E501
|
36
|
+
id: StrictStr = Field(description="Primary identifier")
|
37
|
+
connector: Optional[Connector] = None
|
38
|
+
status: StrictStr = Field(description="Status of the Item")
|
39
|
+
execution_status: StrictStr = Field(description="Status of the sync execution", alias="executionStatus")
|
40
|
+
error: Optional[ItemError] = None
|
41
|
+
parameter: Optional[ConnectorCredential] = None
|
42
|
+
user_action: Optional[ConnectorUserAction] = Field(default=None, alias="userAction")
|
43
|
+
webhook_url: Optional[StrictStr] = Field(default=None, description="Url to be notified of item changes", alias="webhookUrl")
|
44
|
+
created_at: Optional[datetime] = Field(default=None, description="Date of creation", alias="createdAt")
|
45
|
+
updated_at: Optional[datetime] = Field(default=None, description="Date of last modification", alias="updatedAt")
|
46
|
+
last_updated_at: Optional[datetime] = Field(default=None, description="Date of last syncronization", alias="lastUpdatedAt")
|
47
|
+
status_detail: Optional[StatusDetail] = Field(default=None, alias="statusDetail")
|
48
|
+
next_auto_sync_at: Optional[datetime] = Field(default=None, description="Date of next auto-sync, or null if auto-sync is disabled for this Item", alias="nextAutoSyncAt")
|
49
|
+
consecutive_failed_login_attempts: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Consecutives execution that ends up with a LOGIN_ERROR status", alias="consecutiveFailedLoginAttempts")
|
50
|
+
consent_expires_at: Optional[datetime] = Field(default=None, description="Consent expiration date", alias="consentExpiresAt")
|
51
|
+
products: Optional[List[StrictStr]] = Field(default=None, description="Products collected by the item")
|
52
|
+
__properties: ClassVar[List[str]] = ["id", "connector", "status", "executionStatus", "error", "parameter", "userAction", "webhookUrl", "createdAt", "updatedAt", "lastUpdatedAt", "statusDetail", "nextAutoSyncAt", "consecutiveFailedLoginAttempts", "consentExpiresAt", "products"]
|
53
|
+
|
54
|
+
@field_validator('products')
|
55
|
+
def products_validate_enum(cls, value):
|
56
|
+
"""Validates the enum"""
|
57
|
+
if value is None:
|
58
|
+
return value
|
59
|
+
|
60
|
+
for i in value:
|
61
|
+
if i not in set(['ACCOUNTS', 'CREDIT_CARDS', 'TRANSACTIONS', 'PAYMENT_DATA', 'INVESTMENTS', 'INVESTMENTS_TRANSACTIONS', 'IDENTITY', 'BROKERAGE_NOTE', 'OPPORTUNITIES', 'PORTFOLIO', 'INCOME_REPORTS', 'MOVE_SECURITY', 'LOANS', 'ACQUIRER_OPERATIONS']):
|
62
|
+
raise ValueError("each list item must be one of ('ACCOUNTS', 'CREDIT_CARDS', 'TRANSACTIONS', 'PAYMENT_DATA', 'INVESTMENTS', 'INVESTMENTS_TRANSACTIONS', 'IDENTITY', 'BROKERAGE_NOTE', 'OPPORTUNITIES', 'PORTFOLIO', 'INCOME_REPORTS', 'MOVE_SECURITY', 'LOANS', 'ACQUIRER_OPERATIONS')")
|
63
|
+
return value
|
64
|
+
|
65
|
+
model_config = ConfigDict(
|
66
|
+
populate_by_name=True,
|
67
|
+
validate_assignment=True,
|
68
|
+
protected_namespaces=(),
|
69
|
+
)
|
70
|
+
|
71
|
+
|
72
|
+
def to_str(self) -> str:
|
73
|
+
"""Returns the string representation of the model using alias"""
|
74
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
75
|
+
|
76
|
+
def to_json(self) -> str:
|
77
|
+
"""Returns the JSON representation of the model using alias"""
|
78
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
79
|
+
return json.dumps(self.to_dict())
|
80
|
+
|
81
|
+
@classmethod
|
82
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
83
|
+
"""Create an instance of Item from a JSON string"""
|
84
|
+
return cls.from_dict(json.loads(json_str))
|
85
|
+
|
86
|
+
def to_dict(self) -> Dict[str, Any]:
|
87
|
+
"""Return the dictionary representation of the model using alias.
|
88
|
+
|
89
|
+
This has the following differences from calling pydantic's
|
90
|
+
`self.model_dump(by_alias=True)`:
|
91
|
+
|
92
|
+
* `None` is only added to the output dict for nullable fields that
|
93
|
+
were set at model initialization. Other fields with value `None`
|
94
|
+
are ignored.
|
95
|
+
"""
|
96
|
+
excluded_fields: Set[str] = set([
|
97
|
+
])
|
98
|
+
|
99
|
+
_dict = self.model_dump(
|
100
|
+
by_alias=True,
|
101
|
+
exclude=excluded_fields,
|
102
|
+
exclude_none=True,
|
103
|
+
)
|
104
|
+
# override the default output from pydantic by calling `to_dict()` of connector
|
105
|
+
if self.connector:
|
106
|
+
_dict['connector'] = self.connector.to_dict()
|
107
|
+
# override the default output from pydantic by calling `to_dict()` of error
|
108
|
+
if self.error:
|
109
|
+
_dict['error'] = self.error.to_dict()
|
110
|
+
# override the default output from pydantic by calling `to_dict()` of parameter
|
111
|
+
if self.parameter:
|
112
|
+
_dict['parameter'] = self.parameter.to_dict()
|
113
|
+
# override the default output from pydantic by calling `to_dict()` of user_action
|
114
|
+
if self.user_action:
|
115
|
+
_dict['userAction'] = self.user_action.to_dict()
|
116
|
+
# override the default output from pydantic by calling `to_dict()` of status_detail
|
117
|
+
if self.status_detail:
|
118
|
+
_dict['statusDetail'] = self.status_detail.to_dict()
|
119
|
+
return _dict
|
120
|
+
|
121
|
+
@classmethod
|
122
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
123
|
+
"""Create an instance of Item from a dict"""
|
124
|
+
if obj is None:
|
125
|
+
return None
|
126
|
+
|
127
|
+
if not isinstance(obj, dict):
|
128
|
+
return cls.model_validate(obj)
|
129
|
+
|
130
|
+
_obj = cls.model_validate({
|
131
|
+
"id": obj.get("id"),
|
132
|
+
"connector": Connector.from_dict(obj["connector"]) if obj.get("connector") is not None else None,
|
133
|
+
"status": obj.get("status"),
|
134
|
+
"executionStatus": obj.get("executionStatus"),
|
135
|
+
"error": ItemError.from_dict(obj["error"]) if obj.get("error") is not None else None,
|
136
|
+
"parameter": ConnectorCredential.from_dict(obj["parameter"]) if obj.get("parameter") is not None else None,
|
137
|
+
"userAction": ConnectorUserAction.from_dict(obj["userAction"]) if obj.get("userAction") is not None else None,
|
138
|
+
"webhookUrl": obj.get("webhookUrl"),
|
139
|
+
"createdAt": obj.get("createdAt"),
|
140
|
+
"updatedAt": obj.get("updatedAt"),
|
141
|
+
"lastUpdatedAt": obj.get("lastUpdatedAt"),
|
142
|
+
"statusDetail": StatusDetail.from_dict(obj["statusDetail"]) if obj.get("statusDetail") is not None else None,
|
143
|
+
"nextAutoSyncAt": obj.get("nextAutoSyncAt"),
|
144
|
+
"consecutiveFailedLoginAttempts": obj.get("consecutiveFailedLoginAttempts"),
|
145
|
+
"consentExpiresAt": obj.get("consentExpiresAt"),
|
146
|
+
"products": obj.get("products")
|
147
|
+
})
|
148
|
+
return _obj
|
149
|
+
|
150
|
+
|
@@ -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, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from pluggy_sdk.models.parameter_validation_error import ParameterValidationError
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class ItemCreationErrorResponse(BaseModel):
|
28
|
+
"""
|
29
|
+
ItemCreationErrorResponse
|
30
|
+
""" # noqa: E501
|
31
|
+
code: Optional[Union[StrictFloat, StrictInt]] = None
|
32
|
+
code_description: Optional[StrictStr] = Field(default=None, description="Distinctive code description, useful to identify the error.", alias="codeDescription")
|
33
|
+
message: Optional[StrictStr] = None
|
34
|
+
errors: Optional[List[ParameterValidationError]] = Field(default=None, description="List of errors related to parameter validations")
|
35
|
+
__properties: ClassVar[List[str]] = ["code", "codeDescription", "message", "errors"]
|
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 ItemCreationErrorResponse 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 errors (list)
|
77
|
+
_items = []
|
78
|
+
if self.errors:
|
79
|
+
for _item_errors in self.errors:
|
80
|
+
if _item_errors:
|
81
|
+
_items.append(_item_errors.to_dict())
|
82
|
+
_dict['errors'] = _items
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of ItemCreationErrorResponse 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
|
+
"code": obj.get("code"),
|
96
|
+
"codeDescription": obj.get("codeDescription"),
|
97
|
+
"message": obj.get("message"),
|
98
|
+
"errors": [ParameterValidationError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
|
99
|
+
})
|
100
|
+
return _obj
|
101
|
+
|
102
|
+
|
@@ -0,0 +1,94 @@
|
|
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, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class ItemError(BaseModel):
|
27
|
+
"""
|
28
|
+
Detailed error message
|
29
|
+
""" # noqa: E501
|
30
|
+
code: StrictStr = Field(description="Error code")
|
31
|
+
message: StrictStr = Field(description="Detailed error message")
|
32
|
+
provider_message: Optional[StrictStr] = Field(default=None, description="Information provider by the institution mainly when user needs to perform an action", alias="providerMessage")
|
33
|
+
attributes: Optional[Dict[str, Any]] = Field(default=None, description="'{ [key]:[value] }'. Additional information necessary for future executions, used for example in some device authorization flow")
|
34
|
+
__properties: ClassVar[List[str]] = ["code", "message", "providerMessage", "attributes"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
def to_str(self) -> str:
|
44
|
+
"""Returns the string representation of the model using alias"""
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
+
|
47
|
+
def to_json(self) -> str:
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
+
return json.dumps(self.to_dict())
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
+
"""Create an instance of ItemError from a JSON string"""
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
56
|
+
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
59
|
+
|
60
|
+
This has the following differences from calling pydantic's
|
61
|
+
`self.model_dump(by_alias=True)`:
|
62
|
+
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
64
|
+
were set at model initialization. Other fields with value `None`
|
65
|
+
are ignored.
|
66
|
+
"""
|
67
|
+
excluded_fields: Set[str] = set([
|
68
|
+
])
|
69
|
+
|
70
|
+
_dict = self.model_dump(
|
71
|
+
by_alias=True,
|
72
|
+
exclude=excluded_fields,
|
73
|
+
exclude_none=True,
|
74
|
+
)
|
75
|
+
return _dict
|
76
|
+
|
77
|
+
@classmethod
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
79
|
+
"""Create an instance of ItemError from a dict"""
|
80
|
+
if obj is None:
|
81
|
+
return None
|
82
|
+
|
83
|
+
if not isinstance(obj, dict):
|
84
|
+
return cls.model_validate(obj)
|
85
|
+
|
86
|
+
_obj = cls.model_validate({
|
87
|
+
"code": obj.get("code"),
|
88
|
+
"message": obj.get("message"),
|
89
|
+
"providerMessage": obj.get("providerMessage"),
|
90
|
+
"attributes": obj.get("attributes")
|
91
|
+
})
|
92
|
+
return _obj
|
93
|
+
|
94
|
+
|
@@ -0,0 +1,90 @@
|
|
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, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class ItemOptions(BaseModel):
|
27
|
+
"""
|
28
|
+
Item options available to send through connect tokens
|
29
|
+
""" # noqa: E501
|
30
|
+
client_user_id: Optional[StrictStr] = Field(default=None, description="Client's identifier for the user, it can be a ID, UUID or even an email.", alias="clientUserId")
|
31
|
+
webhook_url: Optional[StrictStr] = Field(default=None, description="Url to be notified of this specific item changes", alias="webhookUrl")
|
32
|
+
__properties: ClassVar[List[str]] = ["clientUserId", "webhookUrl"]
|
33
|
+
|
34
|
+
model_config = ConfigDict(
|
35
|
+
populate_by_name=True,
|
36
|
+
validate_assignment=True,
|
37
|
+
protected_namespaces=(),
|
38
|
+
)
|
39
|
+
|
40
|
+
|
41
|
+
def to_str(self) -> str:
|
42
|
+
"""Returns the string representation of the model using alias"""
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
44
|
+
|
45
|
+
def to_json(self) -> str:
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
|
+
return json.dumps(self.to_dict())
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
+
"""Create an instance of ItemOptions from a JSON string"""
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
54
|
+
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
57
|
+
|
58
|
+
This has the following differences from calling pydantic's
|
59
|
+
`self.model_dump(by_alias=True)`:
|
60
|
+
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
62
|
+
were set at model initialization. Other fields with value `None`
|
63
|
+
are ignored.
|
64
|
+
"""
|
65
|
+
excluded_fields: Set[str] = set([
|
66
|
+
])
|
67
|
+
|
68
|
+
_dict = self.model_dump(
|
69
|
+
by_alias=True,
|
70
|
+
exclude=excluded_fields,
|
71
|
+
exclude_none=True,
|
72
|
+
)
|
73
|
+
return _dict
|
74
|
+
|
75
|
+
@classmethod
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
+
"""Create an instance of ItemOptions from a dict"""
|
78
|
+
if obj is None:
|
79
|
+
return None
|
80
|
+
|
81
|
+
if not isinstance(obj, dict):
|
82
|
+
return cls.model_validate(obj)
|
83
|
+
|
84
|
+
_obj = cls.model_validate({
|
85
|
+
"clientUserId": obj.get("clientUserId"),
|
86
|
+
"webhookUrl": obj.get("webhookUrl")
|
87
|
+
})
|
88
|
+
return _obj
|
89
|
+
|
90
|
+
|
@@ -0,0 +1,199 @@
|
|
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 datetime import date, datetime
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
|
+
from pluggy_sdk.models.loan_contracted_fee import LoanContractedFee
|
25
|
+
from pluggy_sdk.models.loan_contracted_finance_charge import LoanContractedFinanceCharge
|
26
|
+
from pluggy_sdk.models.loan_installments import LoanInstallments
|
27
|
+
from pluggy_sdk.models.loan_interest_rate import LoanInterestRate
|
28
|
+
from pluggy_sdk.models.loan_payments import LoanPayments
|
29
|
+
from pluggy_sdk.models.loan_warranty import LoanWarranty
|
30
|
+
from typing import Optional, Set
|
31
|
+
from typing_extensions import Self
|
32
|
+
|
33
|
+
class Loan(BaseModel):
|
34
|
+
"""
|
35
|
+
Response with information related to a loan
|
36
|
+
""" # noqa: E501
|
37
|
+
id: StrictStr = Field(description="Primary identifier")
|
38
|
+
item_id: StrictStr = Field(description="Identifier of the item linked to the loan", alias="itemId")
|
39
|
+
contract_number: Optional[StrictStr] = Field(default=None, description="Contract number given by the contracting institution", alias="contractNumber")
|
40
|
+
ipoc_code: Optional[StrictStr] = Field(default=None, description="Standard contract number - IPOC (Identificação Padronizada da Operação de Crédito)", alias="ipocCode")
|
41
|
+
product_name: StrictStr = Field(description="Denomination/Identification of the name of the credit operation disclosed to the customer", alias="productName")
|
42
|
+
type: Optional[StrictStr] = Field(default=None, description="Loan type (https://openbanking-brasil.github.io/openapi/swagger-apis/loans/?urls.primaryName=2.0.1#model-EnumContractProductSubTypeLoans)")
|
43
|
+
var_date: datetime = Field(description="Date when the loan data was collected", alias="date")
|
44
|
+
contract_date: Optional[datetime] = Field(default=None, description="Date when the loan was contracted", alias="contractDate")
|
45
|
+
disbursement_dates: Optional[List[date]] = Field(default=None, description="Disbursement date of the contracted amount", alias="disbursementDates")
|
46
|
+
settlement_date: Optional[datetime] = Field(default=None, description="Loan settlement date", alias="settlementDate")
|
47
|
+
contract_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Loan contracted value", alias="contractAmount")
|
48
|
+
currency_code: StrictStr = Field(description="Code referencing the currency of the loan", alias="currencyCode")
|
49
|
+
due_date: Optional[datetime] = Field(default=None, description="Loan due date", alias="dueDate")
|
50
|
+
installment_periodicity: Optional[StrictStr] = Field(default=None, description="Installments regular frequency", alias="installmentPeriodicity")
|
51
|
+
installment_periodicity_additional_info: Optional[StrictStr] = Field(default=None, description="Mandatory field to complement the information regarding the regular payment frequency when installmentPeriodicity has value 'OTHERS'", alias="installmentPeriodicityAdditionalInfo")
|
52
|
+
first_installment_due_date: Optional[datetime] = Field(default=None, description="First installment due date", alias="firstInstallmentDueDate")
|
53
|
+
cet: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CET - Custo Efetivo Total must be expressed as an annual percentage rate and incorporates all charges and expenses incurred in credit operations (interest rate, but also tariffs, taxes, insurance and other expenses charged)", alias="CET")
|
54
|
+
amortization_scheduled: Optional[StrictStr] = Field(default=None, description="Amortization system (https://openbanking-brasil.github.io/openapi/swagger-apis/loans/?urls.primaryName=2.0.1#model-EnumContractAmortizationScheduled)", alias="amortizationScheduled")
|
55
|
+
amortization_scheduled_additional_info: Optional[StrictStr] = Field(default=None, description="Mandatory field to complement the information regarding the scheduled amortization when it has value 'OTHERS'", alias="amortizationScheduledAdditionalInfo")
|
56
|
+
cnpj_consignee: Optional[StrictStr] = Field(default=None, description="Consignor CNPJ", alias="cnpjConsignee")
|
57
|
+
interest_rates: Optional[List[LoanInterestRate]] = Field(default=None, alias="interestRates")
|
58
|
+
contracted_fees: Optional[List[LoanContractedFee]] = Field(default=None, description="List that brings the information of the tariffs agreed in the contract.", alias="contractedFees")
|
59
|
+
contracted_finance_charges: Optional[List[LoanContractedFinanceCharge]] = Field(default=None, description="List that brings the charges agreed in the contract", alias="contractedFinanceCharges")
|
60
|
+
warranties: Optional[List[LoanWarranty]] = None
|
61
|
+
installments: Optional[LoanInstallments] = None
|
62
|
+
payments: Optional[LoanPayments] = Field(default=None, description="Loan contract payment data")
|
63
|
+
__properties: ClassVar[List[str]] = ["id", "itemId", "contractNumber", "ipocCode", "productName", "type", "date", "contractDate", "disbursementDates", "settlementDate", "contractAmount", "currencyCode", "dueDate", "installmentPeriodicity", "installmentPeriodicityAdditionalInfo", "firstInstallmentDueDate", "CET", "amortizationScheduled", "amortizationScheduledAdditionalInfo", "cnpjConsignee", "interestRates", "contractedFees", "contractedFinanceCharges", "warranties", "installments", "payments"]
|
64
|
+
|
65
|
+
@field_validator('installment_periodicity')
|
66
|
+
def installment_periodicity_validate_enum(cls, value):
|
67
|
+
"""Validates the enum"""
|
68
|
+
if value is None:
|
69
|
+
return value
|
70
|
+
|
71
|
+
if value not in set(['WITHOUT_REGULAR_PERIODICITY', 'WEEKLY', 'FORTNIGHTLY', 'MONTHLY', 'BIMONTHLY', 'QUARTERLY', 'SEMESTERLY', 'YEARLY', 'OTHERS']):
|
72
|
+
raise ValueError("must be one of enum values ('WITHOUT_REGULAR_PERIODICITY', 'WEEKLY', 'FORTNIGHTLY', 'MONTHLY', 'BIMONTHLY', 'QUARTERLY', 'SEMESTERLY', 'YEARLY', 'OTHERS')")
|
73
|
+
return value
|
74
|
+
|
75
|
+
@field_validator('amortization_scheduled')
|
76
|
+
def amortization_scheduled_validate_enum(cls, value):
|
77
|
+
"""Validates the enum"""
|
78
|
+
if value is None:
|
79
|
+
return value
|
80
|
+
|
81
|
+
if value not in set(['SAC', 'PRICE', 'SAM', 'WITHOUT_AMORTIZATION_SYSTEM', 'OTHERS']):
|
82
|
+
raise ValueError("must be one of enum values ('SAC', 'PRICE', 'SAM', 'WITHOUT_AMORTIZATION_SYSTEM', 'OTHERS')")
|
83
|
+
return value
|
84
|
+
|
85
|
+
model_config = ConfigDict(
|
86
|
+
populate_by_name=True,
|
87
|
+
validate_assignment=True,
|
88
|
+
protected_namespaces=(),
|
89
|
+
)
|
90
|
+
|
91
|
+
|
92
|
+
def to_str(self) -> str:
|
93
|
+
"""Returns the string representation of the model using alias"""
|
94
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
95
|
+
|
96
|
+
def to_json(self) -> str:
|
97
|
+
"""Returns the JSON representation of the model using alias"""
|
98
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
99
|
+
return json.dumps(self.to_dict())
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
103
|
+
"""Create an instance of Loan from a JSON string"""
|
104
|
+
return cls.from_dict(json.loads(json_str))
|
105
|
+
|
106
|
+
def to_dict(self) -> Dict[str, Any]:
|
107
|
+
"""Return the dictionary representation of the model using alias.
|
108
|
+
|
109
|
+
This has the following differences from calling pydantic's
|
110
|
+
`self.model_dump(by_alias=True)`:
|
111
|
+
|
112
|
+
* `None` is only added to the output dict for nullable fields that
|
113
|
+
were set at model initialization. Other fields with value `None`
|
114
|
+
are ignored.
|
115
|
+
"""
|
116
|
+
excluded_fields: Set[str] = set([
|
117
|
+
])
|
118
|
+
|
119
|
+
_dict = self.model_dump(
|
120
|
+
by_alias=True,
|
121
|
+
exclude=excluded_fields,
|
122
|
+
exclude_none=True,
|
123
|
+
)
|
124
|
+
# override the default output from pydantic by calling `to_dict()` of each item in interest_rates (list)
|
125
|
+
_items = []
|
126
|
+
if self.interest_rates:
|
127
|
+
for _item_interest_rates in self.interest_rates:
|
128
|
+
if _item_interest_rates:
|
129
|
+
_items.append(_item_interest_rates.to_dict())
|
130
|
+
_dict['interestRates'] = _items
|
131
|
+
# override the default output from pydantic by calling `to_dict()` of each item in contracted_fees (list)
|
132
|
+
_items = []
|
133
|
+
if self.contracted_fees:
|
134
|
+
for _item_contracted_fees in self.contracted_fees:
|
135
|
+
if _item_contracted_fees:
|
136
|
+
_items.append(_item_contracted_fees.to_dict())
|
137
|
+
_dict['contractedFees'] = _items
|
138
|
+
# override the default output from pydantic by calling `to_dict()` of each item in contracted_finance_charges (list)
|
139
|
+
_items = []
|
140
|
+
if self.contracted_finance_charges:
|
141
|
+
for _item_contracted_finance_charges in self.contracted_finance_charges:
|
142
|
+
if _item_contracted_finance_charges:
|
143
|
+
_items.append(_item_contracted_finance_charges.to_dict())
|
144
|
+
_dict['contractedFinanceCharges'] = _items
|
145
|
+
# override the default output from pydantic by calling `to_dict()` of each item in warranties (list)
|
146
|
+
_items = []
|
147
|
+
if self.warranties:
|
148
|
+
for _item_warranties in self.warranties:
|
149
|
+
if _item_warranties:
|
150
|
+
_items.append(_item_warranties.to_dict())
|
151
|
+
_dict['warranties'] = _items
|
152
|
+
# override the default output from pydantic by calling `to_dict()` of installments
|
153
|
+
if self.installments:
|
154
|
+
_dict['installments'] = self.installments.to_dict()
|
155
|
+
# override the default output from pydantic by calling `to_dict()` of payments
|
156
|
+
if self.payments:
|
157
|
+
_dict['payments'] = self.payments.to_dict()
|
158
|
+
return _dict
|
159
|
+
|
160
|
+
@classmethod
|
161
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
162
|
+
"""Create an instance of Loan from a dict"""
|
163
|
+
if obj is None:
|
164
|
+
return None
|
165
|
+
|
166
|
+
if not isinstance(obj, dict):
|
167
|
+
return cls.model_validate(obj)
|
168
|
+
|
169
|
+
_obj = cls.model_validate({
|
170
|
+
"id": obj.get("id"),
|
171
|
+
"itemId": obj.get("itemId"),
|
172
|
+
"contractNumber": obj.get("contractNumber"),
|
173
|
+
"ipocCode": obj.get("ipocCode"),
|
174
|
+
"productName": obj.get("productName"),
|
175
|
+
"type": obj.get("type"),
|
176
|
+
"date": obj.get("date"),
|
177
|
+
"contractDate": obj.get("contractDate"),
|
178
|
+
"disbursementDates": obj.get("disbursementDates"),
|
179
|
+
"settlementDate": obj.get("settlementDate"),
|
180
|
+
"contractAmount": obj.get("contractAmount"),
|
181
|
+
"currencyCode": obj.get("currencyCode"),
|
182
|
+
"dueDate": obj.get("dueDate"),
|
183
|
+
"installmentPeriodicity": obj.get("installmentPeriodicity"),
|
184
|
+
"installmentPeriodicityAdditionalInfo": obj.get("installmentPeriodicityAdditionalInfo"),
|
185
|
+
"firstInstallmentDueDate": obj.get("firstInstallmentDueDate"),
|
186
|
+
"CET": obj.get("CET"),
|
187
|
+
"amortizationScheduled": obj.get("amortizationScheduled"),
|
188
|
+
"amortizationScheduledAdditionalInfo": obj.get("amortizationScheduledAdditionalInfo"),
|
189
|
+
"cnpjConsignee": obj.get("cnpjConsignee"),
|
190
|
+
"interestRates": [LoanInterestRate.from_dict(_item) for _item in obj["interestRates"]] if obj.get("interestRates") is not None else None,
|
191
|
+
"contractedFees": [LoanContractedFee.from_dict(_item) for _item in obj["contractedFees"]] if obj.get("contractedFees") is not None else None,
|
192
|
+
"contractedFinanceCharges": [LoanContractedFinanceCharge.from_dict(_item) for _item in obj["contractedFinanceCharges"]] if obj.get("contractedFinanceCharges") is not None else None,
|
193
|
+
"warranties": [LoanWarranty.from_dict(_item) for _item in obj["warranties"]] if obj.get("warranties") is not None else None,
|
194
|
+
"installments": LoanInstallments.from_dict(obj["installments"]) if obj.get("installments") is not None else None,
|
195
|
+
"payments": LoanPayments.from_dict(obj["payments"]) if obj.get("payments") is not None else None
|
196
|
+
})
|
197
|
+
return _obj
|
198
|
+
|
199
|
+
|