pluggy-sdk 1.0.0.post13__py3-none-any.whl → 1.0.0.post15__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 (42) hide show
  1. pluggy_sdk/__init__.py +8 -8
  2. pluggy_sdk/api/account_api.py +12 -10
  3. pluggy_sdk/api/acquirer_anticipation_api.py +12 -10
  4. pluggy_sdk/api/acquirer_receivable_api.py +12 -10
  5. pluggy_sdk/api/acquirer_sale_api.py +12 -10
  6. pluggy_sdk/api/auth_api.py +12 -10
  7. pluggy_sdk/api/benefit_api.py +12 -10
  8. pluggy_sdk/api/bill_api.py +12 -10
  9. pluggy_sdk/api/bulk_payment_api.py +18 -15
  10. pluggy_sdk/api/category_api.py +24 -20
  11. pluggy_sdk/api/connector_api.py +18 -15
  12. pluggy_sdk/api/consent_api.py +12 -10
  13. pluggy_sdk/api/identity_api.py +12 -10
  14. pluggy_sdk/api/income_report_api.py +6 -5
  15. pluggy_sdk/api/investment_api.py +18 -15
  16. pluggy_sdk/api/items_api.py +30 -25
  17. pluggy_sdk/api/loan_api.py +12 -10
  18. pluggy_sdk/api/payment_customer_api.py +30 -25
  19. pluggy_sdk/api/payment_intent_api.py +18 -15
  20. pluggy_sdk/api/payment_recipient_api.py +42 -35
  21. pluggy_sdk/api/payment_request_api.py +75 -64
  22. pluggy_sdk/api/portfolio_yield_api.py +12 -10
  23. pluggy_sdk/api/smart_account_api.py +36 -30
  24. pluggy_sdk/api/transaction_api.py +18 -15
  25. pluggy_sdk/api/webhook_api.py +30 -25
  26. pluggy_sdk/api_client.py +2 -2
  27. pluggy_sdk/configuration.py +17 -3
  28. pluggy_sdk/models/__init__.py +7 -7
  29. pluggy_sdk/models/benefit_loan.py +121 -0
  30. pluggy_sdk/models/benefit_loan_client.py +102 -0
  31. pluggy_sdk/models/benefit_response.py +10 -10
  32. pluggy_sdk/models/connector.py +6 -2
  33. pluggy_sdk/models/custom.py +100 -0
  34. pluggy_sdk/models/daily.py +101 -0
  35. pluggy_sdk/models/monthly.py +103 -0
  36. pluggy_sdk/models/payment_request_schedule.py +48 -48
  37. pluggy_sdk/models/single.py +98 -0
  38. pluggy_sdk/models/weekly.py +110 -0
  39. {pluggy_sdk-1.0.0.post13.dist-info → pluggy_sdk-1.0.0.post15.dist-info}/METADATA +13 -13
  40. {pluggy_sdk-1.0.0.post13.dist-info → pluggy_sdk-1.0.0.post15.dist-info}/RECORD +42 -35
  41. {pluggy_sdk-1.0.0.post13.dist-info → pluggy_sdk-1.0.0.post15.dist-info}/WHEEL +1 -1
  42. {pluggy_sdk-1.0.0.post13.dist-info → pluggy_sdk-1.0.0.post15.dist-info}/top_level.txt +0 -0
@@ -277,11 +277,12 @@ class PortfolioYieldApi:
277
277
 
278
278
 
279
279
  # set the HTTP header `Accept`
280
- _header_params['Accept'] = self.api_client.select_header_accept(
281
- [
282
- 'application/json'
283
- ]
284
- )
280
+ if 'Accept' not in _header_params:
281
+ _header_params['Accept'] = self.api_client.select_header_accept(
282
+ [
283
+ 'application/json'
284
+ ]
285
+ )
285
286
 
286
287
 
287
288
  # authentication setting
@@ -544,11 +545,12 @@ class PortfolioYieldApi:
544
545
 
545
546
 
546
547
  # set the HTTP header `Accept`
547
- _header_params['Accept'] = self.api_client.select_header_accept(
548
- [
549
- 'application/json'
550
- ]
551
- )
548
+ if 'Accept' not in _header_params:
549
+ _header_params['Accept'] = self.api_client.select_header_accept(
550
+ [
551
+ 'application/json'
552
+ ]
553
+ )
552
554
 
553
555
 
554
556
  # authentication setting
@@ -276,11 +276,12 @@ class SmartAccountApi:
276
276
 
277
277
 
278
278
  # set the HTTP header `Accept`
279
- _header_params['Accept'] = self.api_client.select_header_accept(
280
- [
281
- 'application/json'
282
- ]
283
- )
279
+ if 'Accept' not in _header_params:
280
+ _header_params['Accept'] = self.api_client.select_header_accept(
281
+ [
282
+ 'application/json'
283
+ ]
284
+ )
284
285
 
285
286
 
286
287
  # authentication setting
@@ -537,11 +538,12 @@ class SmartAccountApi:
537
538
 
538
539
 
539
540
  # set the HTTP header `Accept`
540
- _header_params['Accept'] = self.api_client.select_header_accept(
541
- [
542
- 'application/json'
543
- ]
544
- )
541
+ if 'Accept' not in _header_params:
542
+ _header_params['Accept'] = self.api_client.select_header_accept(
543
+ [
544
+ 'application/json'
545
+ ]
546
+ )
545
547
 
546
548
  # set the HTTP header `Content-Type`
547
549
  if _content_type:
@@ -811,11 +813,12 @@ class SmartAccountApi:
811
813
 
812
814
 
813
815
  # set the HTTP header `Accept`
814
- _header_params['Accept'] = self.api_client.select_header_accept(
815
- [
816
- 'application/json'
817
- ]
818
- )
816
+ if 'Accept' not in _header_params:
817
+ _header_params['Accept'] = self.api_client.select_header_accept(
818
+ [
819
+ 'application/json'
820
+ ]
821
+ )
819
822
 
820
823
 
821
824
  # authentication setting
@@ -1090,11 +1093,12 @@ class SmartAccountApi:
1090
1093
 
1091
1094
 
1092
1095
  # set the HTTP header `Accept`
1093
- _header_params['Accept'] = self.api_client.select_header_accept(
1094
- [
1095
- 'application/json'
1096
- ]
1097
- )
1096
+ if 'Accept' not in _header_params:
1097
+ _header_params['Accept'] = self.api_client.select_header_accept(
1098
+ [
1099
+ 'application/json'
1100
+ ]
1101
+ )
1098
1102
 
1099
1103
 
1100
1104
  # authentication setting
@@ -1366,11 +1370,12 @@ class SmartAccountApi:
1366
1370
 
1367
1371
 
1368
1372
  # set the HTTP header `Accept`
1369
- _header_params['Accept'] = self.api_client.select_header_accept(
1370
- [
1371
- 'application/json'
1372
- ]
1373
- )
1373
+ if 'Accept' not in _header_params:
1374
+ _header_params['Accept'] = self.api_client.select_header_accept(
1375
+ [
1376
+ 'application/json'
1377
+ ]
1378
+ )
1374
1379
 
1375
1380
  # set the HTTP header `Content-Type`
1376
1381
  if _content_type:
@@ -1656,11 +1661,12 @@ class SmartAccountApi:
1656
1661
 
1657
1662
 
1658
1663
  # set the HTTP header `Accept`
1659
- _header_params['Accept'] = self.api_client.select_header_accept(
1660
- [
1661
- 'application/json'
1662
- ]
1663
- )
1664
+ if 'Accept' not in _header_params:
1665
+ _header_params['Accept'] = self.api_client.select_header_accept(
1666
+ [
1667
+ 'application/json'
1668
+ ]
1669
+ )
1664
1670
 
1665
1671
 
1666
1672
  # authentication setting
@@ -365,11 +365,12 @@ class TransactionApi:
365
365
 
366
366
 
367
367
  # set the HTTP header `Accept`
368
- _header_params['Accept'] = self.api_client.select_header_accept(
369
- [
370
- 'application/json'
371
- ]
372
- )
368
+ if 'Accept' not in _header_params:
369
+ _header_params['Accept'] = self.api_client.select_header_accept(
370
+ [
371
+ 'application/json'
372
+ ]
373
+ )
373
374
 
374
375
 
375
376
  # authentication setting
@@ -629,11 +630,12 @@ class TransactionApi:
629
630
 
630
631
 
631
632
  # set the HTTP header `Accept`
632
- _header_params['Accept'] = self.api_client.select_header_accept(
633
- [
634
- 'application/json'
635
- ]
636
- )
633
+ if 'Accept' not in _header_params:
634
+ _header_params['Accept'] = self.api_client.select_header_accept(
635
+ [
636
+ 'application/json'
637
+ ]
638
+ )
637
639
 
638
640
 
639
641
  # authentication setting
@@ -911,11 +913,12 @@ class TransactionApi:
911
913
 
912
914
 
913
915
  # set the HTTP header `Accept`
914
- _header_params['Accept'] = self.api_client.select_header_accept(
915
- [
916
- 'application/json'
917
- ]
918
- )
916
+ if 'Accept' not in _header_params:
917
+ _header_params['Accept'] = self.api_client.select_header_accept(
918
+ [
919
+ 'application/json'
920
+ ]
921
+ )
919
922
 
920
923
  # set the HTTP header `Content-Type`
921
924
  if _content_type:
@@ -276,11 +276,12 @@ class WebhookApi:
276
276
 
277
277
 
278
278
  # set the HTTP header `Accept`
279
- _header_params['Accept'] = self.api_client.select_header_accept(
280
- [
281
- 'application/json'
282
- ]
283
- )
279
+ if 'Accept' not in _header_params:
280
+ _header_params['Accept'] = self.api_client.select_header_accept(
281
+ [
282
+ 'application/json'
283
+ ]
284
+ )
284
285
 
285
286
  # set the HTTP header `Content-Type`
286
287
  if _content_type:
@@ -553,11 +554,12 @@ class WebhookApi:
553
554
 
554
555
 
555
556
  # set the HTTP header `Accept`
556
- _header_params['Accept'] = self.api_client.select_header_accept(
557
- [
558
- 'application/json'
559
- ]
560
- )
557
+ if 'Accept' not in _header_params:
558
+ _header_params['Accept'] = self.api_client.select_header_accept(
559
+ [
560
+ 'application/json'
561
+ ]
562
+ )
561
563
 
562
564
 
563
565
  # authentication setting
@@ -802,11 +804,12 @@ class WebhookApi:
802
804
 
803
805
 
804
806
  # set the HTTP header `Accept`
805
- _header_params['Accept'] = self.api_client.select_header_accept(
806
- [
807
- 'application/json'
808
- ]
809
- )
807
+ if 'Accept' not in _header_params:
808
+ _header_params['Accept'] = self.api_client.select_header_accept(
809
+ [
810
+ 'application/json'
811
+ ]
812
+ )
810
813
 
811
814
 
812
815
  # authentication setting
@@ -1066,11 +1069,12 @@ class WebhookApi:
1066
1069
 
1067
1070
 
1068
1071
  # set the HTTP header `Accept`
1069
- _header_params['Accept'] = self.api_client.select_header_accept(
1070
- [
1071
- 'application/json'
1072
- ]
1073
- )
1072
+ if 'Accept' not in _header_params:
1073
+ _header_params['Accept'] = self.api_client.select_header_accept(
1074
+ [
1075
+ 'application/json'
1076
+ ]
1077
+ )
1074
1078
 
1075
1079
 
1076
1080
  # authentication setting
@@ -1348,11 +1352,12 @@ class WebhookApi:
1348
1352
 
1349
1353
 
1350
1354
  # set the HTTP header `Accept`
1351
- _header_params['Accept'] = self.api_client.select_header_accept(
1352
- [
1353
- 'application/json'
1354
- ]
1355
- )
1355
+ if 'Accept' not in _header_params:
1356
+ _header_params['Accept'] = self.api_client.select_header_accept(
1357
+ [
1358
+ 'application/json'
1359
+ ]
1360
+ )
1356
1361
 
1357
1362
  # set the HTTP header `Content-Type`
1358
1363
  if _content_type:
pluggy_sdk/api_client.py CHANGED
@@ -89,7 +89,7 @@ class ApiClient:
89
89
  self.default_headers[header_name] = header_value
90
90
  self.cookie = cookie
91
91
  # Set default User-Agent.
92
- self.user_agent = 'OpenAPI-Generator/1.0.0.post13/python'
92
+ self.user_agent = 'OpenAPI-Generator/1.0.0.post15/python'
93
93
  self.client_side_validation = configuration.client_side_validation
94
94
 
95
95
  def __enter__(self):
@@ -228,7 +228,7 @@ class ApiClient:
228
228
  body = self.sanitize_for_serialization(body)
229
229
 
230
230
  # request url
231
- if _host is None:
231
+ if _host is None or self.configuration.ignore_operation_servers:
232
232
  url = self.configuration.host + resource_path
233
233
  else:
234
234
  # use server/host defined in path or operation instead
@@ -33,6 +33,9 @@ class Configuration:
33
33
  """This class contains various settings of the API client.
34
34
 
35
35
  :param host: Base url.
36
+ :param ignore_operation_servers
37
+ Boolean to ignore operation servers for the API client.
38
+ Config will use `host` as the base url regardless of the operation servers.
36
39
  :param api_key: Dict to store API key(s).
37
40
  Each entry in the dict specifies an API key.
38
41
  The dict key is the name of the security scheme in the OAS specification.
@@ -55,6 +58,7 @@ class Configuration:
55
58
  values before.
56
59
  :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
57
60
  in PEM format.
61
+ :param retries: Number of retries for API requests.
58
62
 
59
63
  :Example:
60
64
 
@@ -86,7 +90,11 @@ conf = pluggy_sdk.Configuration(
86
90
  access_token=None,
87
91
  server_index=None, server_variables=None,
88
92
  server_operation_index=None, server_operation_variables=None,
93
+ ignore_operation_servers=False,
89
94
  ssl_ca_cert=None,
95
+ retries=None,
96
+ *,
97
+ debug: Optional[bool] = None
90
98
  ) -> None:
91
99
  """Constructor
92
100
  """
@@ -101,6 +109,9 @@ conf = pluggy_sdk.Configuration(
101
109
  self.server_operation_variables = server_operation_variables or {}
102
110
  """Default server variables
103
111
  """
112
+ self.ignore_operation_servers = ignore_operation_servers
113
+ """Ignore operation servers
114
+ """
104
115
  self.temp_folder_path = None
105
116
  """Temp file folder for downloading files
106
117
  """
@@ -144,7 +155,10 @@ conf = pluggy_sdk.Configuration(
144
155
  self.logger_file = None
145
156
  """Debug file location
146
157
  """
147
- self.debug = False
158
+ if debug is not None:
159
+ self.debug = debug
160
+ else:
161
+ self.__debug = False
148
162
  """Debug switch
149
163
  """
150
164
 
@@ -187,7 +201,7 @@ conf = pluggy_sdk.Configuration(
187
201
  self.safe_chars_for_path_param = ''
188
202
  """Safe chars for path_param
189
203
  """
190
- self.retries = None
204
+ self.retries = retries
191
205
  """Adding retries to override urllib3 default value 3
192
206
  """
193
207
  # Enable client side validation
@@ -400,7 +414,7 @@ conf = pluggy_sdk.Configuration(
400
414
  "OS: {env}\n"\
401
415
  "Python Version: {pyversion}\n"\
402
416
  "Version of the API: 1.0.0\n"\
403
- "SDK Package Version: 1.0.0.post13".\
417
+ "SDK Package Version: 1.0.0.post15".\
404
418
  format(env=sys.platform, pyversion=sys.version)
405
419
 
406
420
  def get_host_settings(self):
@@ -36,6 +36,8 @@ from pluggy_sdk.models.asset_distribution import AssetDistribution
36
36
  from pluggy_sdk.models.auth_request import AuthRequest
37
37
  from pluggy_sdk.models.auth_response import AuthResponse
38
38
  from pluggy_sdk.models.bank_data import BankData
39
+ from pluggy_sdk.models.benefit_loan import BenefitLoan
40
+ from pluggy_sdk.models.benefit_loan_client import BenefitLoanClient
39
41
  from pluggy_sdk.models.benefit_response import BenefitResponse
40
42
  from pluggy_sdk.models.benefit_response_paying_institution import BenefitResponsePayingInstitution
41
43
  from pluggy_sdk.models.benefits_list200_response import BenefitsList200Response
@@ -47,6 +49,7 @@ from pluggy_sdk.models.boleto_payer import BoletoPayer
47
49
  from pluggy_sdk.models.boleto_recipient import BoletoRecipient
48
50
  from pluggy_sdk.models.bulk_payment import BulkPayment
49
51
  from pluggy_sdk.models.bulk_payments_list200_response import BulkPaymentsList200Response
52
+ from pluggy_sdk.models.custom import CUSTOM
50
53
  from pluggy_sdk.models.category import Category
51
54
  from pluggy_sdk.models.client_category_rule import ClientCategoryRule
52
55
  from pluggy_sdk.models.company import Company
@@ -76,6 +79,7 @@ from pluggy_sdk.models.create_webhook import CreateWebhook
76
79
  from pluggy_sdk.models.credential_select_option import CredentialSelectOption
77
80
  from pluggy_sdk.models.credit_card_metadata import CreditCardMetadata
78
81
  from pluggy_sdk.models.credit_data import CreditData
82
+ from pluggy_sdk.models.daily import DAILY
79
83
  from pluggy_sdk.models.document import Document
80
84
  from pluggy_sdk.models.email import Email
81
85
  from pluggy_sdk.models.global_error_response import GlobalErrorResponse
@@ -107,6 +111,7 @@ from pluggy_sdk.models.loan_payment_release_over_parcel_fee import LoanPaymentRe
107
111
  from pluggy_sdk.models.loan_payments import LoanPayments
108
112
  from pluggy_sdk.models.loan_warranty import LoanWarranty
109
113
  from pluggy_sdk.models.loans_list200_response import LoansList200Response
114
+ from pluggy_sdk.models.monthly import MONTHLY
110
115
  from pluggy_sdk.models.merchant import Merchant
111
116
  from pluggy_sdk.models.monthly_portfolio import MonthlyPortfolio
112
117
  from pluggy_sdk.models.monthly_portfolio_response import MonthlyPortfolioResponse
@@ -141,17 +146,11 @@ from pluggy_sdk.models.payment_request_receipt_list200_response import PaymentRe
141
146
  from pluggy_sdk.models.payment_request_schedule import PaymentRequestSchedule
142
147
  from pluggy_sdk.models.payment_requests_list200_response import PaymentRequestsList200Response
143
148
  from pluggy_sdk.models.payment_schedules_list200_response import PaymentSchedulesList200Response
144
- from pluggy_sdk.models.payroll_loan import PayrollLoan
145
- from pluggy_sdk.models.payroll_loan_client import PayrollLoanClient
146
149
  from pluggy_sdk.models.percentage_over_index import PercentageOverIndex
147
150
  from pluggy_sdk.models.phone_number import PhoneNumber
148
151
  from pluggy_sdk.models.pix_data import PixData
152
+ from pluggy_sdk.models.single import SINGLE
149
153
  from pluggy_sdk.models.schedule_payment import SchedulePayment
150
- from pluggy_sdk.models.schedule_type_custom import ScheduleTypeCustom
151
- from pluggy_sdk.models.schedule_type_daily import ScheduleTypeDaily
152
- from pluggy_sdk.models.schedule_type_monthly import ScheduleTypeMonthly
153
- from pluggy_sdk.models.schedule_type_single import ScheduleTypeSingle
154
- from pluggy_sdk.models.schedule_type_weekly import ScheduleTypeWeekly
155
154
  from pluggy_sdk.models.smart_account import SmartAccount
156
155
  from pluggy_sdk.models.smart_account_address import SmartAccountAddress
157
156
  from pluggy_sdk.models.smart_account_balance import SmartAccountBalance
@@ -166,6 +165,7 @@ from pluggy_sdk.models.update_item_parameters import UpdateItemParameters
166
165
  from pluggy_sdk.models.update_payment_recipient import UpdatePaymentRecipient
167
166
  from pluggy_sdk.models.update_payment_request import UpdatePaymentRequest
168
167
  from pluggy_sdk.models.update_transaction import UpdateTransaction
168
+ from pluggy_sdk.models.weekly import WEEKLY
169
169
  from pluggy_sdk.models.webhook import Webhook
170
170
  from pluggy_sdk.models.webhook_creation_error_response import WebhookCreationErrorResponse
171
171
  from pluggy_sdk.models.webhooks_list200_response import WebhooksList200Response
@@ -0,0 +1,121 @@
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
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
+ from pluggy_sdk.models.benefit_loan_client import BenefitLoanClient
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class BenefitLoan(BaseModel):
29
+ """
30
+ Information related to a benefit loan
31
+ """ # noqa: E501
32
+ contract_code: Optional[StrictStr] = Field(default=None, description="Contract code given by the contracting institution", alias="contractCode")
33
+ hiscon_contract_code: StrictStr = Field(description="Contract code given in the hiscon file", alias="hisconContractCode")
34
+ cnpj_original_contract_creditor: Optional[StrictStr] = Field(default=None, description="CNPJ of the original creditor of the contract", alias="cnpjOriginalContractCreditor")
35
+ effective_interest_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Effective interest rate", alias="effectiveInterestRate")
36
+ cet_annual_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CET annual rate", alias="cetAnnualRate")
37
+ cet_month_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CET monthly rate", alias="cetMonthRate")
38
+ currency_code: Optional[StrictStr] = Field(default=None, description="Code referencing the currency of the loan", alias="currencyCode")
39
+ amortization_regime: Optional[StrictStr] = Field(default=None, description="Amortization regime", alias="amortizationRegime")
40
+ installments_quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Number of installments", alias="installmentsQuantity")
41
+ installments_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Installment value", alias="installmentsValue")
42
+ due_date_first_installment: Optional[datetime] = Field(default=None, description="Due date of the first installment", alias="dueDateFirstInstallment")
43
+ due_date_last_installment: Optional[datetime] = Field(default=None, description="Due date of the last installment", alias="dueDateLastInstallment")
44
+ cnpj_correspondent_banking: Optional[StrictStr] = Field(default=None, description="CNPJ of the correspondent banking", alias="cnpjCorrespondentBanking")
45
+ operation_hiring_date: Optional[datetime] = Field(default=None, description="Operation hiring date", alias="operationHiringDate")
46
+ client: BenefitLoanClient
47
+ __properties: ClassVar[List[str]] = ["contractCode", "hisconContractCode", "cnpjOriginalContractCreditor", "effectiveInterestRate", "cetAnnualRate", "cetMonthRate", "currencyCode", "amortizationRegime", "installmentsQuantity", "installmentsValue", "dueDateFirstInstallment", "dueDateLastInstallment", "cnpjCorrespondentBanking", "operationHiringDate", "client"]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> Optional[Self]:
67
+ """Create an instance of BenefitLoan from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self) -> Dict[str, Any]:
71
+ """Return the dictionary representation of the model using alias.
72
+
73
+ This has the following differences from calling pydantic's
74
+ `self.model_dump(by_alias=True)`:
75
+
76
+ * `None` is only added to the output dict for nullable fields that
77
+ were set at model initialization. Other fields with value `None`
78
+ are ignored.
79
+ """
80
+ excluded_fields: Set[str] = set([
81
+ ])
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ # override the default output from pydantic by calling `to_dict()` of client
89
+ if self.client:
90
+ _dict['client'] = self.client.to_dict()
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95
+ """Create an instance of BenefitLoan from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return cls.model_validate(obj)
101
+
102
+ _obj = cls.model_validate({
103
+ "contractCode": obj.get("contractCode"),
104
+ "hisconContractCode": obj.get("hisconContractCode"),
105
+ "cnpjOriginalContractCreditor": obj.get("cnpjOriginalContractCreditor"),
106
+ "effectiveInterestRate": obj.get("effectiveInterestRate"),
107
+ "cetAnnualRate": obj.get("cetAnnualRate"),
108
+ "cetMonthRate": obj.get("cetMonthRate"),
109
+ "currencyCode": obj.get("currencyCode"),
110
+ "amortizationRegime": obj.get("amortizationRegime"),
111
+ "installmentsQuantity": obj.get("installmentsQuantity"),
112
+ "installmentsValue": obj.get("installmentsValue"),
113
+ "dueDateFirstInstallment": obj.get("dueDateFirstInstallment"),
114
+ "dueDateLastInstallment": obj.get("dueDateLastInstallment"),
115
+ "cnpjCorrespondentBanking": obj.get("cnpjCorrespondentBanking"),
116
+ "operationHiringDate": obj.get("operationHiringDate"),
117
+ "client": BenefitLoanClient.from_dict(obj["client"]) if obj.get("client") is not None else None
118
+ })
119
+ return _obj
120
+
121
+
@@ -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, 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 BenefitLoanClient(BaseModel):
27
+ """
28
+ Client information
29
+ """ # noqa: E501
30
+ name: Optional[StrictStr] = Field(default=None, description="Client name")
31
+ document: Optional[StrictStr] = Field(default=None, description="Client CPF")
32
+ phone: Optional[StrictStr] = Field(default=None, description="Client phone")
33
+ address_street: Optional[StrictStr] = Field(default=None, description="Client email", alias="addressStreet")
34
+ address_number: Optional[StrictStr] = Field(default=None, description="Client address number", alias="addressNumber")
35
+ address_city: Optional[StrictStr] = Field(default=None, description="Client address city", alias="addressCity")
36
+ address_zip_code: Optional[StrictStr] = Field(default=None, description="Client address zip code", alias="addressZipCode")
37
+ address_state: Optional[StrictStr] = Field(default=None, description="Client address state", alias="addressState")
38
+ __properties: ClassVar[List[str]] = ["name", "document", "phone", "addressStreet", "addressNumber", "addressCity", "addressZipCode", "addressState"]
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of BenefitLoanClient from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of BenefitLoanClient from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "name": obj.get("name"),
92
+ "document": obj.get("document"),
93
+ "phone": obj.get("phone"),
94
+ "addressStreet": obj.get("addressStreet"),
95
+ "addressNumber": obj.get("addressNumber"),
96
+ "addressCity": obj.get("addressCity"),
97
+ "addressZipCode": obj.get("addressZipCode"),
98
+ "addressState": obj.get("addressState")
99
+ })
100
+ return _obj
101
+
102
+