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
@@ -20,8 +20,8 @@ import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from pluggy_sdk.models.benefit_loan import BenefitLoan
23
24
  from pluggy_sdk.models.benefit_response_paying_institution import BenefitResponsePayingInstitution
24
- from pluggy_sdk.models.payroll_loan import PayrollLoan
25
25
  from typing import Optional, Set
26
26
  from typing_extensions import Self
27
27
 
@@ -34,12 +34,12 @@ class BenefitResponse(BaseModel):
34
34
  beneficiary_name: StrictStr = Field(description="Beneficiary name", alias="beneficiaryName")
35
35
  available_margin_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Available margin value", alias="availableMarginValue")
36
36
  margin_base_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Base margin value", alias="marginBaseValue")
37
- payroll_deductible_available_margin_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Payroll deductible available margin value", alias="payrollDeductibleAvailableMarginValue")
37
+ deductible_available_margin_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Deductible available margin value", alias="deductibleAvailableMarginValue")
38
38
  used_margin_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Used margin value", alias="usedMarginValue")
39
39
  reserved_margin_value: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Reserved margin value", alias="reservedMarginValue")
40
40
  paying_institution: Optional[BenefitResponsePayingInstitution] = Field(default=None, alias="payingInstitution")
41
- payroll_loans: Optional[List[PayrollLoan]] = Field(default=None, description="List of payroll loans", alias="payrollLoans")
42
- __properties: ClassVar[List[str]] = ["id", "itemId", "beneficiaryName", "availableMarginValue", "marginBaseValue", "payrollDeductibleAvailableMarginValue", "usedMarginValue", "reservedMarginValue", "payingInstitution", "payrollLoans"]
41
+ loans: Optional[List[BenefitLoan]] = Field(default=None, description="List of benefit loans")
42
+ __properties: ClassVar[List[str]] = ["id", "itemId", "beneficiaryName", "availableMarginValue", "marginBaseValue", "deductibleAvailableMarginValue", "usedMarginValue", "reservedMarginValue", "payingInstitution", "loans"]
43
43
 
44
44
  model_config = ConfigDict(
45
45
  populate_by_name=True,
@@ -83,13 +83,13 @@ class BenefitResponse(BaseModel):
83
83
  # override the default output from pydantic by calling `to_dict()` of paying_institution
84
84
  if self.paying_institution:
85
85
  _dict['payingInstitution'] = self.paying_institution.to_dict()
86
- # override the default output from pydantic by calling `to_dict()` of each item in payroll_loans (list)
86
+ # override the default output from pydantic by calling `to_dict()` of each item in loans (list)
87
87
  _items = []
88
- if self.payroll_loans:
89
- for _item in self.payroll_loans:
88
+ if self.loans:
89
+ for _item in self.loans:
90
90
  if _item:
91
91
  _items.append(_item.to_dict())
92
- _dict['payrollLoans'] = _items
92
+ _dict['loans'] = _items
93
93
  return _dict
94
94
 
95
95
  @classmethod
@@ -107,11 +107,11 @@ class BenefitResponse(BaseModel):
107
107
  "beneficiaryName": obj.get("beneficiaryName"),
108
108
  "availableMarginValue": obj.get("availableMarginValue"),
109
109
  "marginBaseValue": obj.get("marginBaseValue"),
110
- "payrollDeductibleAvailableMarginValue": obj.get("payrollDeductibleAvailableMarginValue"),
110
+ "deductibleAvailableMarginValue": obj.get("deductibleAvailableMarginValue"),
111
111
  "usedMarginValue": obj.get("usedMarginValue"),
112
112
  "reservedMarginValue": obj.get("reservedMarginValue"),
113
113
  "payingInstitution": BenefitResponsePayingInstitution.from_dict(obj["payingInstitution"]) if obj.get("payingInstitution") is not None else None,
114
- "payrollLoans": [PayrollLoan.from_dict(_item) for _item in obj["payrollLoans"]] if obj.get("payrollLoans") is not None else None
114
+ "loans": [BenefitLoan.from_dict(_item) for _item in obj["loans"]] if obj.get("loans") is not None else None
115
115
  })
116
116
  return _obj
117
117
 
@@ -45,7 +45,9 @@ class Connector(BaseModel):
45
45
  health: Optional[ConnectorHealth] = None
46
46
  is_open_finance: Optional[StrictBool] = Field(default=None, description="Indicates if the connector uses the regulated Open Finance APIs", alias="isOpenFinance")
47
47
  supports_payment_initiation: Optional[StrictBool] = Field(default=None, description="Indicates if the connector supports the payment initiation API", alias="supportsPaymentInitiation")
48
- __properties: ClassVar[List[str]] = ["id", "name", "institutionUrl", "imageUrl", "primaryColor", "type", "country", "credentials", "hasMFA", "products", "oauth", "oauthUrl", "resetPasswordUrl", "health", "isOpenFinance", "supportsPaymentInitiation"]
48
+ supports_scheduled_payments: Optional[StrictBool] = Field(default=None, description="Indicates if the connector supports scheduled payments", alias="supportsScheduledPayments")
49
+ supports_smart_transfers: Optional[StrictBool] = Field(default=None, description="Indicates if the connector supports smart transfers", alias="supportsSmartTransfers")
50
+ __properties: ClassVar[List[str]] = ["id", "name", "institutionUrl", "imageUrl", "primaryColor", "type", "country", "credentials", "hasMFA", "products", "oauth", "oauthUrl", "resetPasswordUrl", "health", "isOpenFinance", "supportsPaymentInitiation", "supportsScheduledPayments", "supportsSmartTransfers"]
49
51
 
50
52
  @field_validator('products')
51
53
  def products_validate_enum(cls, value):
@@ -134,7 +136,9 @@ class Connector(BaseModel):
134
136
  "resetPasswordUrl": obj.get("resetPasswordUrl"),
135
137
  "health": ConnectorHealth.from_dict(obj["health"]) if obj.get("health") is not None else None,
136
138
  "isOpenFinance": obj.get("isOpenFinance"),
137
- "supportsPaymentInitiation": obj.get("supportsPaymentInitiation")
139
+ "supportsPaymentInitiation": obj.get("supportsPaymentInitiation"),
140
+ "supportsScheduledPayments": obj.get("supportsScheduledPayments"),
141
+ "supportsSmartTransfers": obj.get("supportsSmartTransfers")
138
142
  })
139
143
  return _obj
140
144
 
@@ -0,0 +1,100 @@
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
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CUSTOM(BaseModel):
28
+ """
29
+ Schedule atribute to generate custom payments in the future
30
+ """ # noqa: E501
31
+ type: StrictStr = Field(description="Scheduled type")
32
+ dates: List[date]
33
+ additional_information: Optional[StrictStr] = Field(default=None, description="Additional information about the custom schedule", alias="additionalInformation")
34
+ __properties: ClassVar[List[str]] = ["type", "dates", "additionalInformation"]
35
+
36
+ @field_validator('type')
37
+ def type_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['CUSTOM']):
40
+ raise ValueError("must be one of enum values ('CUSTOM')")
41
+ return value
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of CUSTOM from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of CUSTOM from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "type": obj.get("type"),
95
+ "dates": obj.get("dates"),
96
+ "additionalInformation": obj.get("additionalInformation")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,101 @@
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
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
+ from typing_extensions import Annotated
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class DAILY(BaseModel):
29
+ """
30
+ Schedule atribute to generate daily payments
31
+ """ # noqa: E501
32
+ type: StrictStr = Field(description="Scheduled type")
33
+ start_date: date = Field(description="The start date of the validity of the scheduled payment authorization.", alias="startDate")
34
+ occurrences: Optional[Union[Annotated[float, Field(le=59, strict=True, ge=3)], Annotated[int, Field(le=59, strict=True, ge=3)]]] = Field(default=None, description="Under the specified schedule frequency, how many payments will be scheduled to occur.")
35
+ __properties: ClassVar[List[str]] = ["type", "startDate", "occurrences"]
36
+
37
+ @field_validator('type')
38
+ def type_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in set(['DAILY']):
41
+ raise ValueError("must be one of enum values ('DAILY')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of DAILY from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of DAILY 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
+ "type": obj.get("type"),
96
+ "startDate": obj.get("startDate"),
97
+ "occurrences": obj.get("occurrences")
98
+ })
99
+ return _obj
100
+
101
+
@@ -0,0 +1,103 @@
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
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
+ from typing_extensions import Annotated
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class MONTHLY(BaseModel):
29
+ """
30
+ Schedule atribute to generate monthly payments
31
+ """ # noqa: E501
32
+ type: StrictStr = Field(description="Scheduled type")
33
+ start_date: date = Field(alias="startDate")
34
+ day_of_month: Union[Annotated[float, Field(le=30, strict=True, ge=2)], Annotated[int, Field(le=30, strict=True, ge=2)]] = Field(description="Day of the month on which each payment will occur. For example, if '10', the first payment will occur on the next 10th day of the month after the start date, or the same day if it is already 10th, and every 10th day after that.", alias="dayOfMonth")
35
+ occurrences: Optional[Union[Annotated[float, Field(le=23, strict=True, ge=3)], Annotated[int, Field(le=23, strict=True, ge=3)]]] = Field(default=None, description="Under the specified schedule frequency, how many payments will be scheduled to occur.")
36
+ __properties: ClassVar[List[str]] = ["type", "startDate", "dayOfMonth", "occurrences"]
37
+
38
+ @field_validator('type')
39
+ def type_validate_enum(cls, value):
40
+ """Validates the enum"""
41
+ if value not in set(['MONTHLY']):
42
+ raise ValueError("must be one of enum values ('MONTHLY')")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of MONTHLY from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of MONTHLY from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "type": obj.get("type"),
97
+ "startDate": obj.get("startDate"),
98
+ "dayOfMonth": obj.get("dayOfMonth"),
99
+ "occurrences": obj.get("occurrences")
100
+ })
101
+ return _obj
102
+
103
+
@@ -18,33 +18,33 @@ import json
18
18
  import pprint
19
19
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
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
21
+ from pluggy_sdk.models.custom import CUSTOM
22
+ from pluggy_sdk.models.daily import DAILY
23
+ from pluggy_sdk.models.monthly import MONTHLY
24
+ from pluggy_sdk.models.single import SINGLE
25
+ from pluggy_sdk.models.weekly import WEEKLY
26
26
  from pydantic import StrictStr, Field
27
27
  from typing import Union, List, Set, Optional, Dict
28
28
  from typing_extensions import Literal, Self
29
29
 
30
- PAYMENTREQUESTSCHEDULE_ONE_OF_SCHEMAS = ["ScheduleTypeCustom", "ScheduleTypeDaily", "ScheduleTypeMonthly", "ScheduleTypeSingle", "ScheduleTypeWeekly"]
30
+ PAYMENTREQUESTSCHEDULE_ONE_OF_SCHEMAS = ["CUSTOM", "DAILY", "MONTHLY", "SINGLE", "WEEKLY"]
31
31
 
32
32
  class PaymentRequestSchedule(BaseModel):
33
33
  """
34
34
  PaymentRequestSchedule
35
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" }
36
+ # data type: SINGLE
37
+ oneof_schema_1_validator: Optional[SINGLE] = None
38
+ # data type: DAILY
39
+ oneof_schema_2_validator: Optional[DAILY] = None
40
+ # data type: WEEKLY
41
+ oneof_schema_3_validator: Optional[WEEKLY] = None
42
+ # data type: MONTHLY
43
+ oneof_schema_4_validator: Optional[MONTHLY] = None
44
+ # data type: CUSTOM
45
+ oneof_schema_5_validator: Optional[CUSTOM] = None
46
+ actual_instance: Optional[Union[CUSTOM, DAILY, MONTHLY, SINGLE, WEEKLY]] = None
47
+ one_of_schemas: Set[str] = { "CUSTOM", "DAILY", "MONTHLY", "SINGLE", "WEEKLY" }
48
48
 
49
49
  model_config = ConfigDict(
50
50
  validate_assignment=True,
@@ -70,37 +70,37 @@ class PaymentRequestSchedule(BaseModel):
70
70
  instance = PaymentRequestSchedule.model_construct()
71
71
  error_messages = []
72
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`")
73
+ # validate data type: SINGLE
74
+ if not isinstance(v, SINGLE):
75
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SINGLE`")
76
76
  else:
77
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`")
78
+ # validate data type: DAILY
79
+ if not isinstance(v, DAILY):
80
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DAILY`")
81
81
  else:
82
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`")
83
+ # validate data type: WEEKLY
84
+ if not isinstance(v, WEEKLY):
85
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WEEKLY`")
86
86
  else:
87
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`")
88
+ # validate data type: MONTHLY
89
+ if not isinstance(v, MONTHLY):
90
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MONTHLY`")
91
91
  else:
92
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`")
93
+ # validate data type: CUSTOM
94
+ if not isinstance(v, CUSTOM):
95
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CUSTOM`")
96
96
  else:
97
97
  match += 1
98
98
  if match > 1:
99
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))
100
+ raise ValueError("Multiple matches found when setting `actual_instance` in PaymentRequestSchedule with oneOf schemas: CUSTOM, DAILY, MONTHLY, SINGLE, WEEKLY. Details: " + ", ".join(error_messages))
101
101
  elif match == 0:
102
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))
103
+ raise ValueError("No match found when setting `actual_instance` in PaymentRequestSchedule with oneOf schemas: CUSTOM, DAILY, MONTHLY, SINGLE, WEEKLY. Details: " + ", ".join(error_messages))
104
104
  else:
105
105
  return v
106
106
 
@@ -115,43 +115,43 @@ class PaymentRequestSchedule(BaseModel):
115
115
  error_messages = []
116
116
  match = 0
117
117
 
118
- # deserialize data into ScheduleTypeSingle
118
+ # deserialize data into SINGLE
119
119
  try:
120
- instance.actual_instance = ScheduleTypeSingle.from_json(json_str)
120
+ instance.actual_instance = SINGLE.from_json(json_str)
121
121
  match += 1
122
122
  except (ValidationError, ValueError) as e:
123
123
  error_messages.append(str(e))
124
- # deserialize data into ScheduleTypeDaily
124
+ # deserialize data into DAILY
125
125
  try:
126
- instance.actual_instance = ScheduleTypeDaily.from_json(json_str)
126
+ instance.actual_instance = DAILY.from_json(json_str)
127
127
  match += 1
128
128
  except (ValidationError, ValueError) as e:
129
129
  error_messages.append(str(e))
130
- # deserialize data into ScheduleTypeWeekly
130
+ # deserialize data into WEEKLY
131
131
  try:
132
- instance.actual_instance = ScheduleTypeWeekly.from_json(json_str)
132
+ instance.actual_instance = WEEKLY.from_json(json_str)
133
133
  match += 1
134
134
  except (ValidationError, ValueError) as e:
135
135
  error_messages.append(str(e))
136
- # deserialize data into ScheduleTypeMonthly
136
+ # deserialize data into MONTHLY
137
137
  try:
138
- instance.actual_instance = ScheduleTypeMonthly.from_json(json_str)
138
+ instance.actual_instance = MONTHLY.from_json(json_str)
139
139
  match += 1
140
140
  except (ValidationError, ValueError) as e:
141
141
  error_messages.append(str(e))
142
- # deserialize data into ScheduleTypeCustom
142
+ # deserialize data into CUSTOM
143
143
  try:
144
- instance.actual_instance = ScheduleTypeCustom.from_json(json_str)
144
+ instance.actual_instance = CUSTOM.from_json(json_str)
145
145
  match += 1
146
146
  except (ValidationError, ValueError) as e:
147
147
  error_messages.append(str(e))
148
148
 
149
149
  if match > 1:
150
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))
151
+ raise ValueError("Multiple matches found when deserializing the JSON string into PaymentRequestSchedule with oneOf schemas: CUSTOM, DAILY, MONTHLY, SINGLE, WEEKLY. Details: " + ", ".join(error_messages))
152
152
  elif match == 0:
153
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))
154
+ raise ValueError("No match found when deserializing the JSON string into PaymentRequestSchedule with oneOf schemas: CUSTOM, DAILY, MONTHLY, SINGLE, WEEKLY. Details: " + ", ".join(error_messages))
155
155
  else:
156
156
  return instance
157
157
 
@@ -165,7 +165,7 @@ class PaymentRequestSchedule(BaseModel):
165
165
  else:
166
166
  return json.dumps(self.actual_instance)
167
167
 
168
- def to_dict(self) -> Optional[Union[Dict[str, Any], ScheduleTypeCustom, ScheduleTypeDaily, ScheduleTypeMonthly, ScheduleTypeSingle, ScheduleTypeWeekly]]:
168
+ def to_dict(self) -> Optional[Union[Dict[str, Any], CUSTOM, DAILY, MONTHLY, SINGLE, WEEKLY]]:
169
169
  """Returns the dict representation of the actual instance"""
170
170
  if self.actual_instance is None:
171
171
  return None
@@ -0,0 +1,98 @@
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
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class SINGLE(BaseModel):
28
+ """
29
+ Schedule atribute to generate one payment in the future
30
+ """ # noqa: E501
31
+ type: StrictStr = Field(description="Scheduled type")
32
+ var_date: date = Field(alias="date")
33
+ __properties: ClassVar[List[str]] = ["type", "date"]
34
+
35
+ @field_validator('type')
36
+ def type_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['SINGLE']):
39
+ raise ValueError("must be one of enum values ('SINGLE')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of SINGLE from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of SINGLE from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "type": obj.get("type"),
94
+ "date": obj.get("date")
95
+ })
96
+ return _obj
97
+
98
+