pluggy-sdk 1.0.0.post11__py3-none-any.whl → 1.0.0.post13__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 (38) hide show
  1. pluggy_sdk/__init__.py +18 -1
  2. pluggy_sdk/api/__init__.py +2 -0
  3. pluggy_sdk/api/benefit_api.py +561 -0
  4. pluggy_sdk/api/consent_api.py +570 -0
  5. pluggy_sdk/api/payment_request_api.py +259 -0
  6. pluggy_sdk/api/payroll_loan_api.py +561 -0
  7. pluggy_sdk/api_client.py +1 -1
  8. pluggy_sdk/configuration.py +1 -1
  9. pluggy_sdk/models/__init__.py +15 -0
  10. pluggy_sdk/models/benefit_response.py +118 -0
  11. pluggy_sdk/models/benefit_response_paying_institution.py +94 -0
  12. pluggy_sdk/models/benefits_list200_response.py +102 -0
  13. pluggy_sdk/models/connector.py +2 -2
  14. pluggy_sdk/models/consent.py +120 -0
  15. pluggy_sdk/models/create_item.py +2 -2
  16. pluggy_sdk/models/create_payment_request.py +8 -2
  17. pluggy_sdk/models/item.py +2 -2
  18. pluggy_sdk/models/page_response_consents.py +102 -0
  19. pluggy_sdk/models/payment_recipient_account.py +2 -9
  20. pluggy_sdk/models/payment_request.py +10 -4
  21. pluggy_sdk/models/payment_request_schedule.py +183 -0
  22. pluggy_sdk/models/payment_schedules_list200_response.py +102 -0
  23. pluggy_sdk/models/payroll_loan.py +121 -0
  24. pluggy_sdk/models/payroll_loan_client.py +102 -0
  25. pluggy_sdk/models/payroll_loan_response.py +125 -0
  26. pluggy_sdk/models/payroll_loan_response_client.py +102 -0
  27. pluggy_sdk/models/payroll_loans_list200_response.py +102 -0
  28. pluggy_sdk/models/schedule_payment.py +102 -0
  29. pluggy_sdk/models/schedule_type_custom.py +100 -0
  30. pluggy_sdk/models/schedule_type_daily.py +101 -0
  31. pluggy_sdk/models/schedule_type_monthly.py +103 -0
  32. pluggy_sdk/models/schedule_type_single.py +98 -0
  33. pluggy_sdk/models/schedule_type_weekly.py +110 -0
  34. pluggy_sdk/models/update_item.py +2 -2
  35. {pluggy_sdk-1.0.0.post11.dist-info → pluggy_sdk-1.0.0.post13.dist-info}/METADATA +22 -2
  36. {pluggy_sdk-1.0.0.post11.dist-info → pluggy_sdk-1.0.0.post13.dist-info}/RECORD +38 -17
  37. {pluggy_sdk-1.0.0.post11.dist-info → pluggy_sdk-1.0.0.post13.dist-info}/WHEEL +1 -1
  38. {pluggy_sdk-1.0.0.post11.dist-info → pluggy_sdk-1.0.0.post13.dist-info}/top_level.txt +0 -0
@@ -23,6 +23,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
23
23
  from typing import Any, ClassVar, Dict, List, Optional, Union
24
24
  from pluggy_sdk.models.boleto import Boleto
25
25
  from pluggy_sdk.models.payment_request_callback_urls import PaymentRequestCallbackUrls
26
+ from pluggy_sdk.models.payment_request_schedule import PaymentRequestSchedule
26
27
  from typing import Optional, Set
27
28
  from typing_extensions import Self
28
29
 
@@ -42,13 +43,14 @@ class PaymentRequest(BaseModel):
42
43
  payment_url: StrictStr = Field(description="URL to begin the payment intent creation flow for this payment request", alias="paymentUrl")
43
44
  pix_qr_code: Optional[StrictStr] = Field(default=None, description="Pix QR code generated by the payment receiver", alias="pixQrCode")
44
45
  boleto: Optional[Boleto] = None
45
- __properties: ClassVar[List[str]] = ["id", "amount", "description", "status", "clientPaymentId", "createdAt", "updatedAt", "callbackUrls", "recipientId", "paymentUrl", "pixQrCode", "boleto"]
46
+ schedule: Optional[PaymentRequestSchedule] = None
47
+ __properties: ClassVar[List[str]] = ["id", "amount", "description", "status", "clientPaymentId", "createdAt", "updatedAt", "callbackUrls", "recipientId", "paymentUrl", "pixQrCode", "boleto", "schedule"]
46
48
 
47
49
  @field_validator('status')
48
50
  def status_validate_enum(cls, value):
49
51
  """Validates the enum"""
50
- if value not in set(['CREATED', 'IN_PROGRESS', 'COMPLETED', 'ERROR']):
51
- raise ValueError("must be one of enum values ('CREATED', 'IN_PROGRESS', 'COMPLETED', 'ERROR')")
52
+ if value not in set(['CREATED', 'IN_PROGRESS', 'COMPLETED', 'SCHEDULED', 'WAITING_PAYER_AUTHORIZATION', 'ERROR', 'REFUND_IN_PROGRESS', 'REFUNDED', 'REFUND_ERROR']):
53
+ raise ValueError("must be one of enum values ('CREATED', 'IN_PROGRESS', 'COMPLETED', 'SCHEDULED', 'WAITING_PAYER_AUTHORIZATION', 'ERROR', 'REFUND_IN_PROGRESS', 'REFUNDED', 'REFUND_ERROR')")
52
54
  return value
53
55
 
54
56
  model_config = ConfigDict(
@@ -96,6 +98,9 @@ class PaymentRequest(BaseModel):
96
98
  # override the default output from pydantic by calling `to_dict()` of boleto
97
99
  if self.boleto:
98
100
  _dict['boleto'] = self.boleto.to_dict()
101
+ # override the default output from pydantic by calling `to_dict()` of schedule
102
+ if self.schedule:
103
+ _dict['schedule'] = self.schedule.to_dict()
99
104
  return _dict
100
105
 
101
106
  @classmethod
@@ -119,7 +124,8 @@ class PaymentRequest(BaseModel):
119
124
  "recipientId": obj.get("recipientId"),
120
125
  "paymentUrl": obj.get("paymentUrl"),
121
126
  "pixQrCode": obj.get("pixQrCode"),
122
- "boleto": Boleto.from_dict(obj["boleto"]) if obj.get("boleto") is not None else None
127
+ "boleto": Boleto.from_dict(obj["boleto"]) if obj.get("boleto") is not None else None,
128
+ "schedule": PaymentRequestSchedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None
123
129
  })
124
130
  return _obj
125
131
 
@@ -0,0 +1,183 @@
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 json
18
+ import pprint
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
+ from typing import Any, List, Optional
21
+ from pluggy_sdk.models.schedule_type_custom import ScheduleTypeCustom
22
+ from pluggy_sdk.models.schedule_type_daily import ScheduleTypeDaily
23
+ from pluggy_sdk.models.schedule_type_monthly import ScheduleTypeMonthly
24
+ from pluggy_sdk.models.schedule_type_single import ScheduleTypeSingle
25
+ from pluggy_sdk.models.schedule_type_weekly import ScheduleTypeWeekly
26
+ from pydantic import StrictStr, Field
27
+ from typing import Union, List, Set, Optional, Dict
28
+ from typing_extensions import Literal, Self
29
+
30
+ PAYMENTREQUESTSCHEDULE_ONE_OF_SCHEMAS = ["ScheduleTypeCustom", "ScheduleTypeDaily", "ScheduleTypeMonthly", "ScheduleTypeSingle", "ScheduleTypeWeekly"]
31
+
32
+ class PaymentRequestSchedule(BaseModel):
33
+ """
34
+ PaymentRequestSchedule
35
+ """
36
+ # data type: ScheduleTypeSingle
37
+ oneof_schema_1_validator: Optional[ScheduleTypeSingle] = None
38
+ # data type: ScheduleTypeDaily
39
+ oneof_schema_2_validator: Optional[ScheduleTypeDaily] = None
40
+ # data type: ScheduleTypeWeekly
41
+ oneof_schema_3_validator: Optional[ScheduleTypeWeekly] = None
42
+ # data type: ScheduleTypeMonthly
43
+ oneof_schema_4_validator: Optional[ScheduleTypeMonthly] = None
44
+ # data type: ScheduleTypeCustom
45
+ oneof_schema_5_validator: Optional[ScheduleTypeCustom] = None
46
+ actual_instance: Optional[Union[ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly]] = None
47
+ one_of_schemas: Set[str] = { "ScheduleTypeCustom", "ScheduleTypeDaily", "ScheduleTypeMonthly", "ScheduleTypeSingle", "ScheduleTypeWeekly" }
48
+
49
+ model_config = ConfigDict(
50
+ validate_assignment=True,
51
+ protected_namespaces=(),
52
+ )
53
+
54
+
55
+ discriminator_value_class_map: Dict[str, str] = {
56
+ }
57
+
58
+ def __init__(self, *args, **kwargs) -> None:
59
+ if args:
60
+ if len(args) > 1:
61
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
62
+ if kwargs:
63
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
64
+ super().__init__(actual_instance=args[0])
65
+ else:
66
+ super().__init__(**kwargs)
67
+
68
+ @field_validator('actual_instance')
69
+ def actual_instance_must_validate_oneof(cls, v):
70
+ instance = PaymentRequestSchedule.model_construct()
71
+ error_messages = []
72
+ match = 0
73
+ # validate data type: ScheduleTypeSingle
74
+ if not isinstance(v, ScheduleTypeSingle):
75
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScheduleTypeSingle`")
76
+ else:
77
+ match += 1
78
+ # validate data type: ScheduleTypeDaily
79
+ if not isinstance(v, ScheduleTypeDaily):
80
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScheduleTypeDaily`")
81
+ else:
82
+ match += 1
83
+ # validate data type: ScheduleTypeWeekly
84
+ if not isinstance(v, ScheduleTypeWeekly):
85
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScheduleTypeWeekly`")
86
+ else:
87
+ match += 1
88
+ # validate data type: ScheduleTypeMonthly
89
+ if not isinstance(v, ScheduleTypeMonthly):
90
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScheduleTypeMonthly`")
91
+ else:
92
+ match += 1
93
+ # validate data type: ScheduleTypeCustom
94
+ if not isinstance(v, ScheduleTypeCustom):
95
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ScheduleTypeCustom`")
96
+ else:
97
+ match += 1
98
+ if match > 1:
99
+ # more than 1 match
100
+ raise ValueError("Multiple matches found when setting `actual_instance` in PaymentRequestSchedule with oneOf schemas: ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly. Details: " + ", ".join(error_messages))
101
+ elif match == 0:
102
+ # no match
103
+ raise ValueError("No match found when setting `actual_instance` in PaymentRequestSchedule with oneOf schemas: ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly. Details: " + ", ".join(error_messages))
104
+ else:
105
+ return v
106
+
107
+ @classmethod
108
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
109
+ return cls.from_json(json.dumps(obj))
110
+
111
+ @classmethod
112
+ def from_json(cls, json_str: str) -> Self:
113
+ """Returns the object represented by the json string"""
114
+ instance = cls.model_construct()
115
+ error_messages = []
116
+ match = 0
117
+
118
+ # deserialize data into ScheduleTypeSingle
119
+ try:
120
+ instance.actual_instance = ScheduleTypeSingle.from_json(json_str)
121
+ match += 1
122
+ except (ValidationError, ValueError) as e:
123
+ error_messages.append(str(e))
124
+ # deserialize data into ScheduleTypeDaily
125
+ try:
126
+ instance.actual_instance = ScheduleTypeDaily.from_json(json_str)
127
+ match += 1
128
+ except (ValidationError, ValueError) as e:
129
+ error_messages.append(str(e))
130
+ # deserialize data into ScheduleTypeWeekly
131
+ try:
132
+ instance.actual_instance = ScheduleTypeWeekly.from_json(json_str)
133
+ match += 1
134
+ except (ValidationError, ValueError) as e:
135
+ error_messages.append(str(e))
136
+ # deserialize data into ScheduleTypeMonthly
137
+ try:
138
+ instance.actual_instance = ScheduleTypeMonthly.from_json(json_str)
139
+ match += 1
140
+ except (ValidationError, ValueError) as e:
141
+ error_messages.append(str(e))
142
+ # deserialize data into ScheduleTypeCustom
143
+ try:
144
+ instance.actual_instance = ScheduleTypeCustom.from_json(json_str)
145
+ match += 1
146
+ except (ValidationError, ValueError) as e:
147
+ error_messages.append(str(e))
148
+
149
+ if match > 1:
150
+ # more than 1 match
151
+ raise ValueError("Multiple matches found when deserializing the JSON string into PaymentRequestSchedule with oneOf schemas: ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly. Details: " + ", ".join(error_messages))
152
+ elif match == 0:
153
+ # no match
154
+ raise ValueError("No match found when deserializing the JSON string into PaymentRequestSchedule with oneOf schemas: ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly. Details: " + ", ".join(error_messages))
155
+ else:
156
+ return instance
157
+
158
+ def to_json(self) -> str:
159
+ """Returns the JSON representation of the actual instance"""
160
+ if self.actual_instance is None:
161
+ return "null"
162
+
163
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
164
+ return self.actual_instance.to_json()
165
+ else:
166
+ return json.dumps(self.actual_instance)
167
+
168
+ def to_dict(self) -> Optional[Union[Dict[str, Any], ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly]]:
169
+ """Returns the dict representation of the actual instance"""
170
+ if self.actual_instance is None:
171
+ return None
172
+
173
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
174
+ return self.actual_instance.to_dict()
175
+ else:
176
+ # primitive type
177
+ return self.actual_instance
178
+
179
+ def to_str(self) -> str:
180
+ """Returns the string representation of the actual instance"""
181
+ return pprint.pformat(self.model_dump())
182
+
183
+
@@ -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.schedule_payment import SchedulePayment
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class PaymentSchedulesList200Response(BaseModel):
28
+ """
29
+ PaymentSchedulesList200Response
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[SchedulePayment]] = Field(default=None, description="List of scheduled payments from a payment request")
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 PaymentSchedulesList200Response 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 in self.results:
80
+ if _item:
81
+ _items.append(_item.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 PaymentSchedulesList200Response 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": [SchedulePayment.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
99
+ })
100
+ return _obj
101
+
102
+
@@ -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.payroll_loan_client import PayrollLoanClient
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class PayrollLoan(BaseModel):
29
+ """
30
+ Information related to a payroll loan
31
+ """ # noqa: E501
32
+ contract_code: StrictStr = Field(description="Contract code given by the contracting institution", alias="contractCode")
33
+ cnpj_original_contract_creditor: Optional[StrictStr] = Field(default=None, description="CNPJ of the original creditor of the contract", alias="cnpjOriginalContractCreditor")
34
+ nominal_interest_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Nominal interest rate", alias="nominalInterestRate")
35
+ efective_interest_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Effective interest rate", alias="efectiveInterestRate")
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: PayrollLoanClient
47
+ __properties: ClassVar[List[str]] = ["contractCode", "cnpjOriginalContractCreditor", "nominalInterestRate", "efectiveInterestRate", "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 PayrollLoan 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 PayrollLoan 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
+ "cnpjOriginalContractCreditor": obj.get("cnpjOriginalContractCreditor"),
105
+ "nominalInterestRate": obj.get("nominalInterestRate"),
106
+ "efectiveInterestRate": obj.get("efectiveInterestRate"),
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": PayrollLoanClient.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 PayrollLoanClient(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
+ addres_street: Optional[StrictStr] = Field(default=None, description="Client email", alias="addresStreet")
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", "addresStreet", "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 PayrollLoanClient 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 PayrollLoanClient 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
+ "addresStreet": obj.get("addresStreet"),
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
+