pluggy-sdk 1.0.0.post43__py3-none-any.whl → 1.0.0.post48__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 +190 -172
- pluggy_sdk/api/__init__.py +1 -0
- pluggy_sdk/api/automatic_pix_api.py +1965 -0
- pluggy_sdk/api/payment_customer_api.py +68 -0
- pluggy_sdk/api/payment_recipient_api.py +52 -1
- pluggy_sdk/api/payment_request_api.py +123 -276
- pluggy_sdk/api/payment_schedule_api.py +3 -3
- pluggy_sdk/api_client.py +5 -1
- pluggy_sdk/configuration.py +1 -1
- pluggy_sdk/models/__init__.py +9 -1
- pluggy_sdk/models/additional_card.py +88 -0
- pluggy_sdk/models/automatic_pix_first_payment.py +93 -0
- pluggy_sdk/models/automatic_pix_payment.py +112 -0
- pluggy_sdk/models/create_automatic_pix_payment_request.py +128 -0
- pluggy_sdk/models/create_payment_recipient.py +4 -4
- pluggy_sdk/models/credit_data.py +22 -2
- pluggy_sdk/models/disaggregated_credit_limit.py +110 -0
- pluggy_sdk/models/payment_intent.py +2 -2
- pluggy_sdk/models/payment_intent_automatic_pix.py +114 -0
- pluggy_sdk/models/payment_intent_parameter.py +4 -2
- pluggy_sdk/models/payment_request.py +10 -4
- pluggy_sdk/models/payment_request_get_automatic_pix_schedules200_response.py +102 -0
- pluggy_sdk/models/retry_automatic_pix_payment_request.py +89 -0
- pluggy_sdk/models/schedule_automatic_pix_payment_request.py +93 -0
- pluggy_sdk/models/schedule_payment.py +3 -1
- pluggy_sdk/models/update_payment_recipient.py +4 -4
- {pluggy_sdk-1.0.0.post43.dist-info → pluggy_sdk-1.0.0.post48.dist-info}/METADATA +25 -16
- {pluggy_sdk-1.0.0.post43.dist-info → pluggy_sdk-1.0.0.post48.dist-info}/RECORD +30 -20
- {pluggy_sdk-1.0.0.post43.dist-info → pluggy_sdk-1.0.0.post48.dist-info}/WHEEL +1 -1
- {pluggy_sdk-1.0.0.post43.dist-info → pluggy_sdk-1.0.0.post48.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,88 @@
|
|
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
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class AdditionalCard(BaseModel):
|
27
|
+
"""
|
28
|
+
Additional credit card data
|
29
|
+
""" # noqa: E501
|
30
|
+
number: StrictStr = Field(description="Number of the additional credit card")
|
31
|
+
__properties: ClassVar[List[str]] = ["number"]
|
32
|
+
|
33
|
+
model_config = ConfigDict(
|
34
|
+
populate_by_name=True,
|
35
|
+
validate_assignment=True,
|
36
|
+
protected_namespaces=(),
|
37
|
+
)
|
38
|
+
|
39
|
+
|
40
|
+
def to_str(self) -> str:
|
41
|
+
"""Returns the string representation of the model using alias"""
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
43
|
+
|
44
|
+
def to_json(self) -> str:
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
47
|
+
return json.dumps(self.to_dict())
|
48
|
+
|
49
|
+
@classmethod
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
51
|
+
"""Create an instance of AdditionalCard from a JSON string"""
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
53
|
+
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
56
|
+
|
57
|
+
This has the following differences from calling pydantic's
|
58
|
+
`self.model_dump(by_alias=True)`:
|
59
|
+
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
61
|
+
were set at model initialization. Other fields with value `None`
|
62
|
+
are ignored.
|
63
|
+
"""
|
64
|
+
excluded_fields: Set[str] = set([
|
65
|
+
])
|
66
|
+
|
67
|
+
_dict = self.model_dump(
|
68
|
+
by_alias=True,
|
69
|
+
exclude=excluded_fields,
|
70
|
+
exclude_none=True,
|
71
|
+
)
|
72
|
+
return _dict
|
73
|
+
|
74
|
+
@classmethod
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
76
|
+
"""Create an instance of AdditionalCard from a dict"""
|
77
|
+
if obj is None:
|
78
|
+
return None
|
79
|
+
|
80
|
+
if not isinstance(obj, dict):
|
81
|
+
return cls.model_validate(obj)
|
82
|
+
|
83
|
+
_obj = cls.model_validate({
|
84
|
+
"number": obj.get("number")
|
85
|
+
})
|
86
|
+
return _obj
|
87
|
+
|
88
|
+
|
@@ -0,0 +1,93 @@
|
|
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 typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class AutomaticPixFirstPayment(BaseModel):
|
28
|
+
"""
|
29
|
+
Definitions for the first payment. It is considered as the user's enrollment payment for the service.
|
30
|
+
""" # noqa: E501
|
31
|
+
var_date: Optional[datetime] = Field(default=None, description="Defines the target settlement date of the first payment. If not provided, it will be settled immediately. Date format must be YYYY-MM-DD (for example: 2025-06-16)", alias="date")
|
32
|
+
description: Optional[StrictStr] = Field(default=None, description="Description for the first payment. If not provided, the description will be the same as the description of the payment request")
|
33
|
+
amount: Union[StrictFloat, StrictInt] = Field(description="Amount for the first payment.")
|
34
|
+
__properties: ClassVar[List[str]] = ["date", "description", "amount"]
|
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 AutomaticPixFirstPayment 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 AutomaticPixFirstPayment 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
|
+
"date": obj.get("date"),
|
88
|
+
"description": obj.get("description"),
|
89
|
+
"amount": obj.get("amount")
|
90
|
+
})
|
91
|
+
return _obj
|
92
|
+
|
93
|
+
|
@@ -0,0 +1,112 @@
|
|
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, StrictFloat, StrictInt, StrictStr, field_validator
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
|
+
from pluggy_sdk.models.schedule_payment_error_detail import SchedulePaymentErrorDetail
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
class AutomaticPixPayment(BaseModel):
|
29
|
+
"""
|
30
|
+
Automatic PIX payment
|
31
|
+
""" # noqa: E501
|
32
|
+
id: StrictStr = Field(description="Payment primary identifier")
|
33
|
+
status: StrictStr = Field(description="Payment status")
|
34
|
+
amount: Union[StrictFloat, StrictInt] = Field(description="Payment amount")
|
35
|
+
description: Optional[StrictStr] = Field(default=None, description="Payment description")
|
36
|
+
var_date: date = Field(description="Payment scheduled date", alias="date")
|
37
|
+
end_to_end_id: Optional[StrictStr] = Field(default=None, description="Payment end to end identifier", alias="endToEndId")
|
38
|
+
error_detail: Optional[SchedulePaymentErrorDetail] = Field(default=None, alias="errorDetail")
|
39
|
+
__properties: ClassVar[List[str]] = ["id", "status", "amount", "description", "date", "endToEndId", "errorDetail"]
|
40
|
+
|
41
|
+
@field_validator('status')
|
42
|
+
def status_validate_enum(cls, value):
|
43
|
+
"""Validates the enum"""
|
44
|
+
if value not in set(['SCHEDULED', 'CREATED', 'COMPLETED', 'CANCELED', 'ERROR']):
|
45
|
+
raise ValueError("must be one of enum values ('SCHEDULED', 'CREATED', 'COMPLETED', 'CANCELED', 'ERROR')")
|
46
|
+
return value
|
47
|
+
|
48
|
+
model_config = ConfigDict(
|
49
|
+
populate_by_name=True,
|
50
|
+
validate_assignment=True,
|
51
|
+
protected_namespaces=(),
|
52
|
+
)
|
53
|
+
|
54
|
+
|
55
|
+
def to_str(self) -> str:
|
56
|
+
"""Returns the string representation of the model using alias"""
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
58
|
+
|
59
|
+
def to_json(self) -> str:
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
62
|
+
return json.dumps(self.to_dict())
|
63
|
+
|
64
|
+
@classmethod
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
66
|
+
"""Create an instance of AutomaticPixPayment from a JSON string"""
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
68
|
+
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
71
|
+
|
72
|
+
This has the following differences from calling pydantic's
|
73
|
+
`self.model_dump(by_alias=True)`:
|
74
|
+
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
76
|
+
were set at model initialization. Other fields with value `None`
|
77
|
+
are ignored.
|
78
|
+
"""
|
79
|
+
excluded_fields: Set[str] = set([
|
80
|
+
])
|
81
|
+
|
82
|
+
_dict = self.model_dump(
|
83
|
+
by_alias=True,
|
84
|
+
exclude=excluded_fields,
|
85
|
+
exclude_none=True,
|
86
|
+
)
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of error_detail
|
88
|
+
if self.error_detail:
|
89
|
+
_dict['errorDetail'] = self.error_detail.to_dict()
|
90
|
+
return _dict
|
91
|
+
|
92
|
+
@classmethod
|
93
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
94
|
+
"""Create an instance of AutomaticPixPayment from a dict"""
|
95
|
+
if obj is None:
|
96
|
+
return None
|
97
|
+
|
98
|
+
if not isinstance(obj, dict):
|
99
|
+
return cls.model_validate(obj)
|
100
|
+
|
101
|
+
_obj = cls.model_validate({
|
102
|
+
"id": obj.get("id"),
|
103
|
+
"status": obj.get("status"),
|
104
|
+
"amount": obj.get("amount"),
|
105
|
+
"description": obj.get("description"),
|
106
|
+
"date": obj.get("date"),
|
107
|
+
"endToEndId": obj.get("endToEndId"),
|
108
|
+
"errorDetail": SchedulePaymentErrorDetail.from_dict(obj["errorDetail"]) if obj.get("errorDetail") is not None else None
|
109
|
+
})
|
110
|
+
return _obj
|
111
|
+
|
112
|
+
|
@@ -0,0 +1,128 @@
|
|
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, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
|
+
from pluggy_sdk.models.automatic_pix_first_payment import AutomaticPixFirstPayment
|
25
|
+
from pluggy_sdk.models.payment_request_callback_urls import PaymentRequestCallbackUrls
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
28
|
+
|
29
|
+
class CreateAutomaticPixPaymentRequest(BaseModel):
|
30
|
+
"""
|
31
|
+
Automatic PIX data
|
32
|
+
""" # noqa: E501
|
33
|
+
fixed_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Fixed charge amount; if filled in, it represents consent for payments of fixed amounts, not subject to change during the validity of the consent. If it's sent, minimumVariableAmount and maximumVariableAmount cannot be provided.", alias="fixedAmount")
|
34
|
+
minimum_variable_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Minimum amount allowed per charge; if filled in, it represents consent for payments of variable amounts. If it's sent, fixedAmount cannot be provided.", alias="minimumVariableAmount")
|
35
|
+
maximum_variable_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum amount allowed per charge; if filled in, it represents consent for payments of variable amounts. If it's sent, fixedAmount cannot be provided.", alias="maximumVariableAmount")
|
36
|
+
description: Optional[StrictStr] = Field(default=None, description="Description for the automatic pix authorization")
|
37
|
+
start_date: datetime = Field(description="Represents the expected date for the first occurrence of a payment associated with the recurrence. Date format must be YYYY-MM-DD (for example: 2025-06-16)", alias="startDate")
|
38
|
+
expires_at: Optional[datetime] = Field(default=None, description="Expiration date for the automatic pix authorization. The date must be in UTC and the format must follow the following pattern: YYYY-MM-DDTHH:MM:SSZ (for example: 2025-06-16T03:00:00Z).", alias="expiresAt")
|
39
|
+
is_retry_accepted: Optional[StrictBool] = Field(default=None, description="Indicates whether the receiving customer is allowed to make payment attempts, according to the rules established in the Pix arrangement.", alias="isRetryAccepted")
|
40
|
+
first_payment: Optional[AutomaticPixFirstPayment] = Field(default=None, alias="firstPayment")
|
41
|
+
interval: StrictStr = Field(description="Defines the permitted frequency for carrying out transactions.")
|
42
|
+
callback_urls: Optional[PaymentRequestCallbackUrls] = Field(default=None, alias="callbackUrls")
|
43
|
+
recipient_id: StrictStr = Field(description="Primary identifier of the payment recipient", alias="recipientId")
|
44
|
+
client_payment_id: Optional[StrictStr] = Field(default=None, description="Client payment identifier", alias="clientPaymentId")
|
45
|
+
customer_id: Optional[StrictStr] = Field(default=None, description="Primary identifier of the customer", alias="customerId")
|
46
|
+
__properties: ClassVar[List[str]] = ["fixedAmount", "minimumVariableAmount", "maximumVariableAmount", "description", "startDate", "expiresAt", "isRetryAccepted", "firstPayment", "interval", "callbackUrls", "recipientId", "clientPaymentId", "customerId"]
|
47
|
+
|
48
|
+
@field_validator('interval')
|
49
|
+
def interval_validate_enum(cls, value):
|
50
|
+
"""Validates the enum"""
|
51
|
+
if value not in set(['WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMESTER', 'YEARLY']):
|
52
|
+
raise ValueError("must be one of enum values ('WEEKLY', 'MONTHLY', 'QUARTERLY', 'SEMESTER', 'YEARLY')")
|
53
|
+
return value
|
54
|
+
|
55
|
+
model_config = ConfigDict(
|
56
|
+
populate_by_name=True,
|
57
|
+
validate_assignment=True,
|
58
|
+
protected_namespaces=(),
|
59
|
+
)
|
60
|
+
|
61
|
+
|
62
|
+
def to_str(self) -> str:
|
63
|
+
"""Returns the string representation of the model using alias"""
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
65
|
+
|
66
|
+
def to_json(self) -> str:
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
69
|
+
return json.dumps(self.to_dict())
|
70
|
+
|
71
|
+
@classmethod
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
73
|
+
"""Create an instance of CreateAutomaticPixPaymentRequest from a JSON string"""
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
75
|
+
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
78
|
+
|
79
|
+
This has the following differences from calling pydantic's
|
80
|
+
`self.model_dump(by_alias=True)`:
|
81
|
+
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
83
|
+
were set at model initialization. Other fields with value `None`
|
84
|
+
are ignored.
|
85
|
+
"""
|
86
|
+
excluded_fields: Set[str] = set([
|
87
|
+
])
|
88
|
+
|
89
|
+
_dict = self.model_dump(
|
90
|
+
by_alias=True,
|
91
|
+
exclude=excluded_fields,
|
92
|
+
exclude_none=True,
|
93
|
+
)
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of first_payment
|
95
|
+
if self.first_payment:
|
96
|
+
_dict['firstPayment'] = self.first_payment.to_dict()
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of callback_urls
|
98
|
+
if self.callback_urls:
|
99
|
+
_dict['callbackUrls'] = self.callback_urls.to_dict()
|
100
|
+
return _dict
|
101
|
+
|
102
|
+
@classmethod
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
104
|
+
"""Create an instance of CreateAutomaticPixPaymentRequest from a dict"""
|
105
|
+
if obj is None:
|
106
|
+
return None
|
107
|
+
|
108
|
+
if not isinstance(obj, dict):
|
109
|
+
return cls.model_validate(obj)
|
110
|
+
|
111
|
+
_obj = cls.model_validate({
|
112
|
+
"fixedAmount": obj.get("fixedAmount"),
|
113
|
+
"minimumVariableAmount": obj.get("minimumVariableAmount"),
|
114
|
+
"maximumVariableAmount": obj.get("maximumVariableAmount"),
|
115
|
+
"description": obj.get("description"),
|
116
|
+
"startDate": obj.get("startDate"),
|
117
|
+
"expiresAt": obj.get("expiresAt"),
|
118
|
+
"isRetryAccepted": obj.get("isRetryAccepted"),
|
119
|
+
"firstPayment": AutomaticPixFirstPayment.from_dict(obj["firstPayment"]) if obj.get("firstPayment") is not None else None,
|
120
|
+
"interval": obj.get("interval"),
|
121
|
+
"callbackUrls": PaymentRequestCallbackUrls.from_dict(obj["callbackUrls"]) if obj.get("callbackUrls") is not None else None,
|
122
|
+
"recipientId": obj.get("recipientId"),
|
123
|
+
"clientPaymentId": obj.get("clientPaymentId"),
|
124
|
+
"customerId": obj.get("customerId")
|
125
|
+
})
|
126
|
+
return _obj
|
127
|
+
|
128
|
+
|
@@ -28,12 +28,12 @@ class CreatePaymentRecipient(BaseModel):
|
|
28
28
|
"""
|
29
29
|
Request with information to create a payment recipient, there is two form to create a payment recipient, one with pixKey and other with taxNumber, name, paymentInstitutionId and account
|
30
30
|
""" # noqa: E501
|
31
|
+
pix_key: Optional[StrictStr] = Field(default=None, description="Pix key associated with the payment recipient. When sending this fields, the rest of the fields are ignored and use DICT to create the payment recipient.", alias="pixKey")
|
31
32
|
tax_number: Optional[StrictStr] = Field(default=None, description="Account owner tax number. Can be CPF or CNPJ (only numbers). Send only when the pixKey is not sent.", alias="taxNumber")
|
32
33
|
name: Optional[StrictStr] = Field(default=None, description="Account owner name. Send only this when the pixKey is not sent.")
|
33
34
|
payment_institution_id: Optional[StrictStr] = Field(default=None, description="Primary identifier of the institution associated to the payment recipient. Send only when the pixKey is not sent.", alias="paymentInstitutionId")
|
34
35
|
account: Optional[PaymentRecipientAccount] = Field(default=None, description="Recipient's bank account destination. Send only if the pixKey is not sent.")
|
35
|
-
|
36
|
-
__properties: ClassVar[List[str]] = ["taxNumber", "name", "paymentInstitutionId", "account", "pixKey"]
|
36
|
+
__properties: ClassVar[List[str]] = ["pixKey", "taxNumber", "name", "paymentInstitutionId", "account"]
|
37
37
|
|
38
38
|
model_config = ConfigDict(
|
39
39
|
populate_by_name=True,
|
@@ -89,11 +89,11 @@ class CreatePaymentRecipient(BaseModel):
|
|
89
89
|
return cls.model_validate(obj)
|
90
90
|
|
91
91
|
_obj = cls.model_validate({
|
92
|
+
"pixKey": obj.get("pixKey"),
|
92
93
|
"taxNumber": obj.get("taxNumber"),
|
93
94
|
"name": obj.get("name"),
|
94
95
|
"paymentInstitutionId": obj.get("paymentInstitutionId"),
|
95
|
-
"account": PaymentRecipientAccount.from_dict(obj["account"]) if obj.get("account") is not None else None
|
96
|
-
"pixKey": obj.get("pixKey")
|
96
|
+
"account": PaymentRecipientAccount.from_dict(obj["account"]) if obj.get("account") is not None else None
|
97
97
|
})
|
98
98
|
return _obj
|
99
99
|
|
pluggy_sdk/models/credit_data.py
CHANGED
@@ -21,6 +21,8 @@ import json
|
|
21
21
|
from datetime import datetime
|
22
22
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
23
23
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
|
+
from pluggy_sdk.models.additional_card import AdditionalCard
|
25
|
+
from pluggy_sdk.models.disaggregated_credit_limit import DisaggregatedCreditLimit
|
24
26
|
from typing import Optional, Set
|
25
27
|
from typing_extensions import Self
|
26
28
|
|
@@ -38,7 +40,9 @@ class CreditData(BaseModel):
|
|
38
40
|
credit_limit: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Maximum amount that can be spent", alias="creditLimit")
|
39
41
|
status: Optional[StrictStr] = Field(default=None, description="Credit card status")
|
40
42
|
holder_type: Optional[StrictStr] = Field(default=None, description="Credit card holder type", alias="holderType")
|
41
|
-
|
43
|
+
disaggregated_credit_limits: Optional[List[DisaggregatedCreditLimit]] = Field(default=None, description="Disaggregated credit card limits", alias="disaggregatedCreditLimits")
|
44
|
+
additional_cards: Optional[List[AdditionalCard]] = Field(default=None, description="Additional credit cards associated with the main one", alias="additionalCards")
|
45
|
+
__properties: ClassVar[List[str]] = ["level", "brand", "balanceCloseDate", "balanceDueDate", "availableCreditLimit", "balanceForeignCurrency", "minimumPayment", "creditLimit", "status", "holderType", "disaggregatedCreditLimits", "additionalCards"]
|
42
46
|
|
43
47
|
@field_validator('status')
|
44
48
|
def status_validate_enum(cls, value):
|
@@ -99,6 +103,20 @@ class CreditData(BaseModel):
|
|
99
103
|
exclude=excluded_fields,
|
100
104
|
exclude_none=True,
|
101
105
|
)
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of each item in disaggregated_credit_limits (list)
|
107
|
+
_items = []
|
108
|
+
if self.disaggregated_credit_limits:
|
109
|
+
for _item_disaggregated_credit_limits in self.disaggregated_credit_limits:
|
110
|
+
if _item_disaggregated_credit_limits:
|
111
|
+
_items.append(_item_disaggregated_credit_limits.to_dict())
|
112
|
+
_dict['disaggregatedCreditLimits'] = _items
|
113
|
+
# override the default output from pydantic by calling `to_dict()` of each item in additional_cards (list)
|
114
|
+
_items = []
|
115
|
+
if self.additional_cards:
|
116
|
+
for _item_additional_cards in self.additional_cards:
|
117
|
+
if _item_additional_cards:
|
118
|
+
_items.append(_item_additional_cards.to_dict())
|
119
|
+
_dict['additionalCards'] = _items
|
102
120
|
return _dict
|
103
121
|
|
104
122
|
@classmethod
|
@@ -120,7 +138,9 @@ class CreditData(BaseModel):
|
|
120
138
|
"minimumPayment": obj.get("minimumPayment"),
|
121
139
|
"creditLimit": obj.get("creditLimit"),
|
122
140
|
"status": obj.get("status"),
|
123
|
-
"holderType": obj.get("holderType")
|
141
|
+
"holderType": obj.get("holderType"),
|
142
|
+
"disaggregatedCreditLimits": [DisaggregatedCreditLimit.from_dict(_item) for _item in obj["disaggregatedCreditLimits"]] if obj.get("disaggregatedCreditLimits") is not None else None,
|
143
|
+
"additionalCards": [AdditionalCard.from_dict(_item) for _item in obj["additionalCards"]] if obj.get("additionalCards") is not None else None
|
124
144
|
})
|
125
145
|
return _obj
|
126
146
|
|
@@ -0,0 +1,110 @@
|
|
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, StrictBool, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class DisaggregatedCreditLimit(BaseModel):
|
27
|
+
"""
|
28
|
+
Disaggregated credit card limit
|
29
|
+
""" # noqa: E501
|
30
|
+
credit_line_limit_type: StrictStr = Field(description="Limit type (LIMITE_CREDITO_TOTAL or LIMITE_CREDITO_MODALIDADE_OPERACAO)", alias="creditLineLimitType")
|
31
|
+
consolidation_type: StrictStr = Field(description="Indicates if the limit is consolidated or individual", alias="consolidationType")
|
32
|
+
identification_number: StrictStr = Field(description="Identification number of the additional credit card", alias="identificationNumber")
|
33
|
+
is_limit_flexible: StrictBool = Field(description="Indicates if the limit is flexible", alias="isLimitFlexible")
|
34
|
+
used_amount: Union[StrictFloat, StrictInt] = Field(description="Used amount of the additional credit card", alias="usedAmount")
|
35
|
+
used_amount_currency_code: StrictStr = Field(description="Used amount currency code (for example, BRL)", alias="usedAmountCurrencyCode")
|
36
|
+
line_name: Optional[StrictStr] = Field(default=None, description="Name of the line (for example, 'Limite de Crédito')", alias="lineName")
|
37
|
+
line_name_additional_info: Optional[StrictStr] = Field(default=None, description="Additional information about the line name", alias="lineNameAdditionalInfo")
|
38
|
+
limit_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Limit amount of the additional credit card", alias="limitAmount")
|
39
|
+
limit_amount_currency_code: Optional[StrictStr] = Field(default=None, description="Limit amount currency code (for example, BRL)", alias="limitAmountCurrencyCode")
|
40
|
+
available_amount: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Available amount of the additional credit card", alias="availableAmount")
|
41
|
+
available_amount_currency_code: Optional[StrictStr] = Field(default=None, description="Available amount currency code (for example, BRL)", alias="availableAmountCurrencyCode")
|
42
|
+
__properties: ClassVar[List[str]] = ["creditLineLimitType", "consolidationType", "identificationNumber", "isLimitFlexible", "usedAmount", "usedAmountCurrencyCode", "lineName", "lineNameAdditionalInfo", "limitAmount", "limitAmountCurrencyCode", "availableAmount", "availableAmountCurrencyCode"]
|
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 DisaggregatedCreditLimit 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 DisaggregatedCreditLimit 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
|
+
"creditLineLimitType": obj.get("creditLineLimitType"),
|
96
|
+
"consolidationType": obj.get("consolidationType"),
|
97
|
+
"identificationNumber": obj.get("identificationNumber"),
|
98
|
+
"isLimitFlexible": obj.get("isLimitFlexible"),
|
99
|
+
"usedAmount": obj.get("usedAmount"),
|
100
|
+
"usedAmountCurrencyCode": obj.get("usedAmountCurrencyCode"),
|
101
|
+
"lineName": obj.get("lineName"),
|
102
|
+
"lineNameAdditionalInfo": obj.get("lineNameAdditionalInfo"),
|
103
|
+
"limitAmount": obj.get("limitAmount"),
|
104
|
+
"limitAmountCurrencyCode": obj.get("limitAmountCurrencyCode"),
|
105
|
+
"availableAmount": obj.get("availableAmount"),
|
106
|
+
"availableAmountCurrencyCode": obj.get("availableAmountCurrencyCode")
|
107
|
+
})
|
108
|
+
return _obj
|
109
|
+
|
110
|
+
|
@@ -51,8 +51,8 @@ class PaymentIntent(BaseModel):
|
|
51
51
|
if value is None:
|
52
52
|
return value
|
53
53
|
|
54
|
-
if value not in set(['PAYMENT_REJECTED', 'ERROR', 'CANCELED', 'CONSENT_REJECTED', 'STARTED', 'ENQUEUED', 'CONSENT_AWAITING_AUTHORIZATION', 'CONSENT_AUTHORIZED', 'PAYMENT_PENDING', 'PAYMENT_PARTIALLY_ACCEPTED', 'PAYMENT_SETTLEMENT_PROCESSING', 'PAYMENT_SETTLEMENT_DEBTOR_ACCOUNT', 'PAYMENT_COMPLETED', 'POSSIBLE_FRAUD', 'TOP_UP_CNPJ_MISMATCH']):
|
55
|
-
raise ValueError("must be one of enum values ('PAYMENT_REJECTED', 'ERROR', 'CANCELED', 'CONSENT_REJECTED', 'STARTED', 'ENQUEUED', 'CONSENT_AWAITING_AUTHORIZATION', 'CONSENT_AUTHORIZED', 'PAYMENT_PENDING', 'PAYMENT_PARTIALLY_ACCEPTED', 'PAYMENT_SETTLEMENT_PROCESSING', 'PAYMENT_SETTLEMENT_DEBTOR_ACCOUNT', 'PAYMENT_COMPLETED', 'POSSIBLE_FRAUD', 'TOP_UP_CNPJ_MISMATCH')")
|
54
|
+
if value not in set(['PAYMENT_REJECTED', 'ERROR', 'CANCELED', 'CONSENT_REJECTED', 'STARTED', 'ENQUEUED', 'CONSENT_AWAITING_AUTHORIZATION', 'CONSENT_AUTHORIZED', 'PAYMENT_PENDING', 'PAYMENT_PARTIALLY_ACCEPTED', 'PAYMENT_SETTLEMENT_PROCESSING', 'PAYMENT_SETTLEMENT_DEBTOR_ACCOUNT', 'PAYMENT_COMPLETED', 'POSSIBLE_FRAUD', 'TOP_UP_CNPJ_MISMATCH', 'REVOKED']):
|
55
|
+
raise ValueError("must be one of enum values ('PAYMENT_REJECTED', 'ERROR', 'CANCELED', 'CONSENT_REJECTED', 'STARTED', 'ENQUEUED', 'CONSENT_AWAITING_AUTHORIZATION', 'CONSENT_AUTHORIZED', 'PAYMENT_PENDING', 'PAYMENT_PARTIALLY_ACCEPTED', 'PAYMENT_SETTLEMENT_PROCESSING', 'PAYMENT_SETTLEMENT_DEBTOR_ACCOUNT', 'PAYMENT_COMPLETED', 'POSSIBLE_FRAUD', 'TOP_UP_CNPJ_MISMATCH', 'REVOKED')")
|
56
56
|
return value
|
57
57
|
|
58
58
|
@field_validator('payment_method')
|