pluggy-sdk 1.0.0.post36__py3-none-any.whl → 1.0.0.post38__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 +12 -1
- pluggy_sdk/api/__init__.py +1 -0
- pluggy_sdk/api/boleto_management_api.py +1375 -0
- pluggy_sdk/api/payment_recipient_api.py +1 -18
- pluggy_sdk/api/transaction_api.py +46 -3
- pluggy_sdk/api_client.py +1 -1
- pluggy_sdk/configuration.py +1 -1
- pluggy_sdk/models/__init__.py +10 -0
- pluggy_sdk/models/boleto_connection.py +95 -0
- pluggy_sdk/models/create_boleto.py +94 -0
- pluggy_sdk/models/create_boleto_boleto.py +100 -0
- pluggy_sdk/models/create_boleto_boleto_payer.py +98 -0
- pluggy_sdk/models/create_boleto_connection.py +91 -0
- pluggy_sdk/models/create_boleto_connection_from_item.py +88 -0
- pluggy_sdk/models/create_item.py +1 -1
- pluggy_sdk/models/create_or_update_payment_customer.py +1 -1
- pluggy_sdk/models/create_payment_customer_request_body.py +1 -1
- pluggy_sdk/models/create_payment_recipient.py +2 -4
- pluggy_sdk/models/create_webhook.py +2 -2
- pluggy_sdk/models/investment.py +1 -11
- pluggy_sdk/models/issued_boleto.py +121 -0
- pluggy_sdk/models/issued_boleto_payer.py +126 -0
- pluggy_sdk/models/item_options.py +1 -1
- pluggy_sdk/models/payment_intent.py +8 -2
- pluggy_sdk/models/payment_intent_error_detail.py +94 -0
- pluggy_sdk/models/payment_request.py +8 -2
- pluggy_sdk/models/payment_request_error_detail.py +90 -0
- pluggy_sdk/models/update_item.py +1 -1
- pluggy_sdk/models/update_payment_recipient.py +2 -4
- {pluggy_sdk-1.0.0.post36.dist-info → pluggy_sdk-1.0.0.post38.dist-info}/METADATA +17 -2
- {pluggy_sdk-1.0.0.post36.dist-info → pluggy_sdk-1.0.0.post38.dist-info}/RECORD +33 -22
- {pluggy_sdk-1.0.0.post36.dist-info → pluggy_sdk-1.0.0.post38.dist-info}/WHEEL +0 -0
- {pluggy_sdk-1.0.0.post36.dist-info → pluggy_sdk-1.0.0.post38.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,91 @@
|
|
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_extensions import Annotated
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class CreateBoletoConnection(BaseModel):
|
28
|
+
"""
|
29
|
+
Request with information to create a boleto connection
|
30
|
+
""" # noqa: E501
|
31
|
+
connector_id: Annotated[int, Field(strict=True, ge=1)] = Field(description="Connector identifier. Check out the list of connectors, and if it has the flag 'supportsBoletoManagement' as true, it means it's possible to create a boleto connection with it.", alias="connectorId")
|
32
|
+
credentials: Dict[str, StrictStr] = Field(description="Credentials required for the connection. For Inter, they are clientId, clientSecret, certificate and privateKey, follow: https://docs.pluggy.ai/docs/connect-an-account#inter-pj")
|
33
|
+
__properties: ClassVar[List[str]] = ["connectorId", "credentials"]
|
34
|
+
|
35
|
+
model_config = ConfigDict(
|
36
|
+
populate_by_name=True,
|
37
|
+
validate_assignment=True,
|
38
|
+
protected_namespaces=(),
|
39
|
+
)
|
40
|
+
|
41
|
+
|
42
|
+
def to_str(self) -> str:
|
43
|
+
"""Returns the string representation of the model using alias"""
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
+
|
46
|
+
def to_json(self) -> str:
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
+
return json.dumps(self.to_dict())
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
+
"""Create an instance of CreateBoletoConnection from a JSON string"""
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
55
|
+
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
58
|
+
|
59
|
+
This has the following differences from calling pydantic's
|
60
|
+
`self.model_dump(by_alias=True)`:
|
61
|
+
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
63
|
+
were set at model initialization. Other fields with value `None`
|
64
|
+
are ignored.
|
65
|
+
"""
|
66
|
+
excluded_fields: Set[str] = set([
|
67
|
+
])
|
68
|
+
|
69
|
+
_dict = self.model_dump(
|
70
|
+
by_alias=True,
|
71
|
+
exclude=excluded_fields,
|
72
|
+
exclude_none=True,
|
73
|
+
)
|
74
|
+
return _dict
|
75
|
+
|
76
|
+
@classmethod
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
78
|
+
"""Create an instance of CreateBoletoConnection from a dict"""
|
79
|
+
if obj is None:
|
80
|
+
return None
|
81
|
+
|
82
|
+
if not isinstance(obj, dict):
|
83
|
+
return cls.model_validate(obj)
|
84
|
+
|
85
|
+
_obj = cls.model_validate({
|
86
|
+
"connectorId": obj.get("connectorId"),
|
87
|
+
"credentials": obj.get("credentials")
|
88
|
+
})
|
89
|
+
return _obj
|
90
|
+
|
91
|
+
|
@@ -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 CreateBoletoConnectionFromItem(BaseModel):
|
27
|
+
"""
|
28
|
+
Request with information to create a boleto connection from an Item
|
29
|
+
""" # noqa: E501
|
30
|
+
item_id: StrictStr = Field(description="Item ID", alias="itemId")
|
31
|
+
__properties: ClassVar[List[str]] = ["itemId"]
|
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 CreateBoletoConnectionFromItem 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 CreateBoletoConnectionFromItem 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
|
+
"itemId": obj.get("itemId")
|
85
|
+
})
|
86
|
+
return _obj
|
87
|
+
|
88
|
+
|
pluggy_sdk/models/create_item.py
CHANGED
@@ -31,7 +31,7 @@ class CreateItem(BaseModel):
|
|
31
31
|
connector_id: Union[StrictFloat, StrictInt] = Field(description="Primary identifier of the connector", alias="connectorId")
|
32
32
|
parameters: CreateItemParameters
|
33
33
|
webhook_url: Optional[StrictStr] = Field(default=None, description="Url to be notified of item changes", alias="webhookUrl")
|
34
|
-
client_user_id: Optional[StrictStr] = Field(default=None, description="Client's identifier for the user, it can be a ID, UUID or even an email.", alias="clientUserId")
|
34
|
+
client_user_id: Optional[StrictStr] = Field(default=None, description="Client's external identifier for the user, it can be a ID, UUID or even an email. This is free for clients to use.", alias="clientUserId")
|
35
35
|
oauth_redirect_uri: Optional[StrictStr] = Field(default=None, description="Redirect URI required for the Oauth flow", alias="oauthRedirectUri")
|
36
36
|
products: Optional[List[StrictStr]] = Field(default=None, description="Products to be collected in the connection")
|
37
37
|
avoid_duplicates: Optional[StrictBool] = Field(default=None, description="Avoids creating a new item if there is already one with the same credentials", alias="avoidDuplicates")
|
@@ -30,7 +30,7 @@ class CreateOrUpdatePaymentCustomer(BaseModel):
|
|
30
30
|
id: StrictStr = Field(description="Primary identifier")
|
31
31
|
type: StrictStr = Field(description="Customer type")
|
32
32
|
name: StrictStr = Field(description="Customer name")
|
33
|
-
email: StrictStr = Field(description="Customer email")
|
33
|
+
email: Optional[StrictStr] = Field(default=None, description="Customer email")
|
34
34
|
cpf: Optional[StrictStr] = Field(default=None, description="Customer CPF")
|
35
35
|
cnpj: Optional[StrictStr] = Field(default=None, description="Customer CNPJ, if type is `BUSINESS`")
|
36
36
|
__properties: ClassVar[List[str]] = ["id", "type", "name", "email", "cpf", "cnpj"]
|
@@ -29,7 +29,7 @@ class CreatePaymentCustomerRequestBody(BaseModel):
|
|
29
29
|
""" # noqa: E501
|
30
30
|
type: StrictStr = Field(description="Customer type")
|
31
31
|
name: StrictStr = Field(description="Customer name")
|
32
|
-
email: StrictStr = Field(description="Customer email")
|
32
|
+
email: Optional[StrictStr] = Field(default=None, description="Customer email")
|
33
33
|
cpf: Optional[StrictStr] = Field(default=None, description="Customer CPF")
|
34
34
|
cnpj: Optional[StrictStr] = Field(default=None, description="Customer CNPJ, if type is `BUSINESS`")
|
35
35
|
__properties: ClassVar[List[str]] = ["type", "name", "email", "cpf", "cnpj"]
|
@@ -18,7 +18,7 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field,
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
23
23
|
from pluggy_sdk.models.payment_recipient_account import PaymentRecipientAccount
|
24
24
|
from typing import Optional, Set
|
@@ -32,10 +32,9 @@ class CreatePaymentRecipient(BaseModel):
|
|
32
32
|
name: Optional[StrictStr] = Field(default=None, description="Account owner name. Send only this when the pixKey is not sent.")
|
33
33
|
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
34
|
account: Optional[PaymentRecipientAccount] = Field(default=None, description="Recipient's bank account destination. Send only if the pixKey is not sent.")
|
35
|
-
is_default: Optional[StrictBool] = Field(default=None, description="Indicates if the recipient is the default one", alias="isDefault")
|
36
35
|
pix_key: Optional[StrictStr] = Field(default=None, description="Pix key associated with the payment recipient", alias="pixKey")
|
37
36
|
smart_account_id: Optional[StrictStr] = Field(default=None, description="Smart account identifier associated to the payment recipient, used to be able to use PIX Qr method", alias="smartAccountId")
|
38
|
-
__properties: ClassVar[List[str]] = ["taxNumber", "name", "paymentInstitutionId", "account", "
|
37
|
+
__properties: ClassVar[List[str]] = ["taxNumber", "name", "paymentInstitutionId", "account", "pixKey", "smartAccountId"]
|
39
38
|
|
40
39
|
model_config = ConfigDict(
|
41
40
|
populate_by_name=True,
|
@@ -95,7 +94,6 @@ class CreatePaymentRecipient(BaseModel):
|
|
95
94
|
"name": obj.get("name"),
|
96
95
|
"paymentInstitutionId": obj.get("paymentInstitutionId"),
|
97
96
|
"account": PaymentRecipientAccount.from_dict(obj["account"]) if obj.get("account") is not None else None,
|
98
|
-
"isDefault": obj.get("isDefault"),
|
99
97
|
"pixKey": obj.get("pixKey"),
|
100
98
|
"smartAccountId": obj.get("smartAccountId")
|
101
99
|
})
|
@@ -35,8 +35,8 @@ class CreateWebhook(BaseModel):
|
|
35
35
|
@field_validator('event')
|
36
36
|
def event_validate_enum(cls, value):
|
37
37
|
"""Validates the enum"""
|
38
|
-
if value not in set(['all', 'item/created', 'item/updated', 'item/error', 'item/deleted', 'item/waiting_user_input', 'item/waiting_user_action', 'item/login_succeeded', 'connector/status_updated', 'transactions/updated', 'transactions/deleted', 'payment_intent/created', 'payment_intent/completed', 'payment_intent/waiting_payer_authorization', 'payment_intent/error', 'scheduled_payment/created', 'scheduled_payment/completed', 'scheduled_payment/error', 'scheduled_payment/canceled', 'scheduled_payment/all_completed', 'payment_refund/completed', 'payment_refund/error']):
|
39
|
-
raise ValueError("must be one of enum values ('all', 'item/created', 'item/updated', 'item/error', 'item/deleted', 'item/waiting_user_input', 'item/waiting_user_action', 'item/login_succeeded', 'connector/status_updated', 'transactions/updated', 'transactions/deleted', 'payment_intent/created', 'payment_intent/completed', 'payment_intent/waiting_payer_authorization', 'payment_intent/error', 'scheduled_payment/created', 'scheduled_payment/completed', 'scheduled_payment/error', 'scheduled_payment/canceled', 'scheduled_payment/all_completed', 'payment_refund/completed', 'payment_refund/error')")
|
38
|
+
if value not in set(['all', 'item/created', 'item/updated', 'item/error', 'item/deleted', 'item/waiting_user_input', 'item/waiting_user_action', 'item/login_succeeded', 'connector/status_updated', 'transactions/created', 'transactions/updated', 'transactions/deleted', 'payment_intent/created', 'payment_intent/completed', 'payment_intent/waiting_payer_authorization', 'payment_intent/error', 'scheduled_payment/created', 'scheduled_payment/completed', 'scheduled_payment/error', 'scheduled_payment/canceled', 'scheduled_payment/all_completed', 'payment_refund/completed', 'payment_refund/error', 'boleto/updated']):
|
39
|
+
raise ValueError("must be one of enum values ('all', 'item/created', 'item/updated', 'item/error', 'item/deleted', 'item/waiting_user_input', 'item/waiting_user_action', 'item/login_succeeded', 'connector/status_updated', 'transactions/created', 'transactions/updated', 'transactions/deleted', 'payment_intent/created', 'payment_intent/completed', 'payment_intent/waiting_payer_authorization', 'payment_intent/error', 'scheduled_payment/created', 'scheduled_payment/completed', 'scheduled_payment/error', 'scheduled_payment/canceled', 'scheduled_payment/all_completed', 'payment_refund/completed', 'payment_refund/error', 'boleto/updated')")
|
40
40
|
return value
|
41
41
|
|
42
42
|
model_config = ConfigDict(
|
pluggy_sdk/models/investment.py
CHANGED
@@ -22,7 +22,6 @@ 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
24
|
from pluggy_sdk.models.investment_metadata import InvestmentMetadata
|
25
|
-
from pluggy_sdk.models.investment_transaction import InvestmentTransaction
|
26
25
|
from typing import Optional, Set
|
27
26
|
from typing_extensions import Self
|
28
27
|
|
@@ -54,7 +53,6 @@ class Investment(BaseModel):
|
|
54
53
|
amount_withdrawal: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The amount available to withdraw", alias="amountWithdrawal")
|
55
54
|
amount_original: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Amount originally invested", alias="amountOriginal")
|
56
55
|
metadata: Optional[InvestmentMetadata] = Field(default=None, description="Security Portability details")
|
57
|
-
transactions: Optional[List[InvestmentTransaction]] = Field(default=None, description="(DEPRECATED: this field will be removed for new applications created from 21st March 2023 onward. Use the paginated `GET /investment/{id}/transactions` endpoint instead.) Transactions made on the investment (Buy, Sell, Transfer, Tax)")
|
58
56
|
due_date: Optional[datetime] = Field(default=None, description="Expiration Date", alias="dueDate")
|
59
57
|
issuer: Optional[StrictStr] = Field(default=None, description="The entity that issued the investment")
|
60
58
|
issuer_cnpj: Optional[StrictStr] = Field(default=None, description="The entity CNPJ that issued the investment", alias="issuerCNPJ")
|
@@ -63,7 +61,7 @@ class Investment(BaseModel):
|
|
63
61
|
rate_type: Optional[StrictStr] = Field(default=None, description="Type of fixed-rate", alias="rateType")
|
64
62
|
fixed_annual_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Fixed income annual rate", alias="fixedAnnualRate")
|
65
63
|
status: Optional[StrictStr] = Field(default=None, description="Current status of the investment enum value")
|
66
|
-
__properties: ClassVar[List[str]] = ["id", "itemId", "type", "subtype", "number", "balance", "name", "lastMonthRate", "lastTwelveMonthsRate", "annualRate", "currencyCode", "code", "isin", "value", "quantity", "amount", "taxes", "taxes2", "date", "owner", "amountProfit", "amountWithdrawal", "amountOriginal", "metadata", "
|
64
|
+
__properties: ClassVar[List[str]] = ["id", "itemId", "type", "subtype", "number", "balance", "name", "lastMonthRate", "lastTwelveMonthsRate", "annualRate", "currencyCode", "code", "isin", "value", "quantity", "amount", "taxes", "taxes2", "date", "owner", "amountProfit", "amountWithdrawal", "amountOriginal", "metadata", "dueDate", "issuer", "issuerCNPJ", "issueDate", "rate", "rateType", "fixedAnnualRate", "status"]
|
67
65
|
|
68
66
|
@field_validator('type')
|
69
67
|
def type_validate_enum(cls, value):
|
@@ -134,13 +132,6 @@ class Investment(BaseModel):
|
|
134
132
|
# override the default output from pydantic by calling `to_dict()` of metadata
|
135
133
|
if self.metadata:
|
136
134
|
_dict['metadata'] = self.metadata.to_dict()
|
137
|
-
# override the default output from pydantic by calling `to_dict()` of each item in transactions (list)
|
138
|
-
_items = []
|
139
|
-
if self.transactions:
|
140
|
-
for _item_transactions in self.transactions:
|
141
|
-
if _item_transactions:
|
142
|
-
_items.append(_item_transactions.to_dict())
|
143
|
-
_dict['transactions'] = _items
|
144
135
|
return _dict
|
145
136
|
|
146
137
|
@classmethod
|
@@ -177,7 +168,6 @@ class Investment(BaseModel):
|
|
177
168
|
"amountWithdrawal": obj.get("amountWithdrawal"),
|
178
169
|
"amountOriginal": obj.get("amountOriginal"),
|
179
170
|
"metadata": InvestmentMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None,
|
180
|
-
"transactions": [InvestmentTransaction.from_dict(_item) for _item in obj["transactions"]] if obj.get("transactions") is not None else None,
|
181
171
|
"dueDate": obj.get("dueDate"),
|
182
172
|
"issuer": obj.get("issuer"),
|
183
173
|
"issuerCNPJ": obj.get("issuerCNPJ"),
|
@@ -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, StrictStr, field_validator
|
23
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
24
|
+
from typing_extensions import Annotated
|
25
|
+
from pluggy_sdk.models.issued_boleto_payer import IssuedBoletoPayer
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
28
|
+
|
29
|
+
class IssuedBoleto(BaseModel):
|
30
|
+
"""
|
31
|
+
Response with information related to an issued boleto
|
32
|
+
""" # noqa: E501
|
33
|
+
id: StrictStr = Field(description="Primary identifier")
|
34
|
+
amount: Union[Annotated[float, Field(strict=True, ge=2.5)], Annotated[int, Field(strict=True, ge=3)]] = Field(description="Boleto amount")
|
35
|
+
status: StrictStr = Field(description="Current status of the boleto")
|
36
|
+
seu_numero: Annotated[str, Field(strict=True, max_length=10)] = Field(description="Your identifier for this boleto", alias="seuNumero")
|
37
|
+
due_date: datetime = Field(description="Due date of the boleto", alias="dueDate")
|
38
|
+
payer: IssuedBoletoPayer
|
39
|
+
pix_qr: Optional[StrictStr] = Field(default=None, description="PIX QR code for payment", alias="pixQr")
|
40
|
+
digitable_line: StrictStr = Field(description="Boleto digitable line", alias="digitableLine")
|
41
|
+
nosso_numero: Optional[StrictStr] = Field(default=None, description="Bank's internal identifier for the boleto", alias="nossoNumero")
|
42
|
+
barcode: StrictStr = Field(description="Boleto barcode")
|
43
|
+
boleto_connection_id: StrictStr = Field(description="ID of the boleto connection used to create this boleto", alias="boletoConnectionId")
|
44
|
+
__properties: ClassVar[List[str]] = ["id", "amount", "status", "seuNumero", "dueDate", "payer", "pixQr", "digitableLine", "nossoNumero", "barcode", "boletoConnectionId"]
|
45
|
+
|
46
|
+
@field_validator('status')
|
47
|
+
def status_validate_enum(cls, value):
|
48
|
+
"""Validates the enum"""
|
49
|
+
if value not in set(['OPEN', 'PAID', 'OVERDUE', 'CANCELLED']):
|
50
|
+
raise ValueError("must be one of enum values ('OPEN', 'PAID', 'OVERDUE', 'CANCELLED')")
|
51
|
+
return value
|
52
|
+
|
53
|
+
model_config = ConfigDict(
|
54
|
+
populate_by_name=True,
|
55
|
+
validate_assignment=True,
|
56
|
+
protected_namespaces=(),
|
57
|
+
)
|
58
|
+
|
59
|
+
|
60
|
+
def to_str(self) -> str:
|
61
|
+
"""Returns the string representation of the model using alias"""
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
63
|
+
|
64
|
+
def to_json(self) -> str:
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
67
|
+
return json.dumps(self.to_dict())
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
71
|
+
"""Create an instance of IssuedBoleto from a JSON string"""
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
73
|
+
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
76
|
+
|
77
|
+
This has the following differences from calling pydantic's
|
78
|
+
`self.model_dump(by_alias=True)`:
|
79
|
+
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
81
|
+
were set at model initialization. Other fields with value `None`
|
82
|
+
are ignored.
|
83
|
+
"""
|
84
|
+
excluded_fields: Set[str] = set([
|
85
|
+
])
|
86
|
+
|
87
|
+
_dict = self.model_dump(
|
88
|
+
by_alias=True,
|
89
|
+
exclude=excluded_fields,
|
90
|
+
exclude_none=True,
|
91
|
+
)
|
92
|
+
# override the default output from pydantic by calling `to_dict()` of payer
|
93
|
+
if self.payer:
|
94
|
+
_dict['payer'] = self.payer.to_dict()
|
95
|
+
return _dict
|
96
|
+
|
97
|
+
@classmethod
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
|
+
"""Create an instance of IssuedBoleto from a dict"""
|
100
|
+
if obj is None:
|
101
|
+
return None
|
102
|
+
|
103
|
+
if not isinstance(obj, dict):
|
104
|
+
return cls.model_validate(obj)
|
105
|
+
|
106
|
+
_obj = cls.model_validate({
|
107
|
+
"id": obj.get("id"),
|
108
|
+
"amount": obj.get("amount"),
|
109
|
+
"status": obj.get("status"),
|
110
|
+
"seuNumero": obj.get("seuNumero"),
|
111
|
+
"dueDate": obj.get("dueDate"),
|
112
|
+
"payer": IssuedBoletoPayer.from_dict(obj["payer"]) if obj.get("payer") is not None else None,
|
113
|
+
"pixQr": obj.get("pixQr"),
|
114
|
+
"digitableLine": obj.get("digitableLine"),
|
115
|
+
"nossoNumero": obj.get("nossoNumero"),
|
116
|
+
"barcode": obj.get("barcode"),
|
117
|
+
"boletoConnectionId": obj.get("boletoConnectionId")
|
118
|
+
})
|
119
|
+
return _obj
|
120
|
+
|
121
|
+
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Pluggy API
|
5
|
+
|
6
|
+
Pluggy's main API to review data and execute connectors
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Contact: hello@pluggy.ai
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
|
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 IssuedBoletoPayer(BaseModel):
|
27
|
+
"""
|
28
|
+
IssuedBoletoPayer
|
29
|
+
""" # noqa: E501
|
30
|
+
tax_number: StrictStr = Field(description="Payer tax number (CPF/CNPJ)", alias="taxNumber")
|
31
|
+
person_type: Optional[StrictStr] = Field(default=None, description="Type of person (individual or business)", alias="personType")
|
32
|
+
name: StrictStr = Field(description="Payer name")
|
33
|
+
address_street: Optional[StrictStr] = Field(default=None, description="Payer street address", alias="addressStreet")
|
34
|
+
address_number: Optional[StrictStr] = Field(default=None, description="Payer address number", alias="addressNumber")
|
35
|
+
address_complement: Optional[StrictStr] = Field(default=None, description="Additional address information", alias="addressComplement")
|
36
|
+
address_neighborhood: Optional[StrictStr] = Field(default=None, description="Payer neighborhood", alias="addressNeighborhood")
|
37
|
+
address_city: Optional[StrictStr] = Field(default=None, description="Payer city", alias="addressCity")
|
38
|
+
address_state: StrictStr = Field(description="Payer state", alias="addressState")
|
39
|
+
address_zip_code: StrictStr = Field(description="Payer ZIP code", alias="addressZipCode")
|
40
|
+
email: Optional[StrictStr] = Field(default=None, description="Payer email")
|
41
|
+
ddd: Optional[StrictStr] = Field(default=None, description="Payer area code")
|
42
|
+
phone_number: Optional[StrictStr] = Field(default=None, description="Payer phone number", alias="phoneNumber")
|
43
|
+
amount_paid: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Amount paid or null if it hasn't been paid yet", alias="amountPaid")
|
44
|
+
payment_origin: Optional[StrictStr] = Field(default=None, description="Payment origin for the boleto", alias="paymentOrigin")
|
45
|
+
__properties: ClassVar[List[str]] = ["taxNumber", "personType", "name", "addressStreet", "addressNumber", "addressComplement", "addressNeighborhood", "addressCity", "addressState", "addressZipCode", "email", "ddd", "phoneNumber", "amountPaid", "paymentOrigin"]
|
46
|
+
|
47
|
+
@field_validator('payment_origin')
|
48
|
+
def payment_origin_validate_enum(cls, value):
|
49
|
+
"""Validates the enum"""
|
50
|
+
if value is None:
|
51
|
+
return value
|
52
|
+
|
53
|
+
if value not in set(['PIX', 'BOLETO']):
|
54
|
+
raise ValueError("must be one of enum values ('PIX', 'BOLETO')")
|
55
|
+
return value
|
56
|
+
|
57
|
+
model_config = ConfigDict(
|
58
|
+
populate_by_name=True,
|
59
|
+
validate_assignment=True,
|
60
|
+
protected_namespaces=(),
|
61
|
+
)
|
62
|
+
|
63
|
+
|
64
|
+
def to_str(self) -> str:
|
65
|
+
"""Returns the string representation of the model using alias"""
|
66
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
67
|
+
|
68
|
+
def to_json(self) -> str:
|
69
|
+
"""Returns the JSON representation of the model using alias"""
|
70
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
71
|
+
return json.dumps(self.to_dict())
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
75
|
+
"""Create an instance of IssuedBoletoPayer from a JSON string"""
|
76
|
+
return cls.from_dict(json.loads(json_str))
|
77
|
+
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
79
|
+
"""Return the dictionary representation of the model using alias.
|
80
|
+
|
81
|
+
This has the following differences from calling pydantic's
|
82
|
+
`self.model_dump(by_alias=True)`:
|
83
|
+
|
84
|
+
* `None` is only added to the output dict for nullable fields that
|
85
|
+
were set at model initialization. Other fields with value `None`
|
86
|
+
are ignored.
|
87
|
+
"""
|
88
|
+
excluded_fields: Set[str] = set([
|
89
|
+
])
|
90
|
+
|
91
|
+
_dict = self.model_dump(
|
92
|
+
by_alias=True,
|
93
|
+
exclude=excluded_fields,
|
94
|
+
exclude_none=True,
|
95
|
+
)
|
96
|
+
return _dict
|
97
|
+
|
98
|
+
@classmethod
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
100
|
+
"""Create an instance of IssuedBoletoPayer from a dict"""
|
101
|
+
if obj is None:
|
102
|
+
return None
|
103
|
+
|
104
|
+
if not isinstance(obj, dict):
|
105
|
+
return cls.model_validate(obj)
|
106
|
+
|
107
|
+
_obj = cls.model_validate({
|
108
|
+
"taxNumber": obj.get("taxNumber"),
|
109
|
+
"personType": obj.get("personType"),
|
110
|
+
"name": obj.get("name"),
|
111
|
+
"addressStreet": obj.get("addressStreet"),
|
112
|
+
"addressNumber": obj.get("addressNumber"),
|
113
|
+
"addressComplement": obj.get("addressComplement"),
|
114
|
+
"addressNeighborhood": obj.get("addressNeighborhood"),
|
115
|
+
"addressCity": obj.get("addressCity"),
|
116
|
+
"addressState": obj.get("addressState"),
|
117
|
+
"addressZipCode": obj.get("addressZipCode"),
|
118
|
+
"email": obj.get("email"),
|
119
|
+
"ddd": obj.get("ddd"),
|
120
|
+
"phoneNumber": obj.get("phoneNumber"),
|
121
|
+
"amountPaid": obj.get("amountPaid"),
|
122
|
+
"paymentOrigin": obj.get("paymentOrigin")
|
123
|
+
})
|
124
|
+
return _obj
|
125
|
+
|
126
|
+
|
@@ -27,7 +27,7 @@ class ItemOptions(BaseModel):
|
|
27
27
|
"""
|
28
28
|
Item options available to send through connect tokens
|
29
29
|
""" # noqa: E501
|
30
|
-
client_user_id: Optional[StrictStr] = Field(default=None, description="Client's identifier for the user, it can be a ID, UUID or even an email.", alias="clientUserId")
|
30
|
+
client_user_id: Optional[StrictStr] = Field(default=None, description="Client's external identifier for the user, it can be a ID, UUID or even an email. This is free for clients to use.", alias="clientUserId")
|
31
31
|
webhook_url: Optional[StrictStr] = Field(default=None, description="Url to be notified of this specific item changes", alias="webhookUrl")
|
32
32
|
oauth_redirect_uri: Optional[StrictStr] = Field(default=None, description="Url to redirect the user after the connect flow", alias="oauthRedirectUri")
|
33
33
|
avoid_duplicates: Optional[StrictBool] = Field(default=None, description="Avoids creating a new item if there is already one with the same credentials", alias="avoidDuplicates")
|
@@ -23,6 +23,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
23
23
|
from typing import Any, ClassVar, Dict, List, Optional
|
24
24
|
from pluggy_sdk.models.bulk_payment import BulkPayment
|
25
25
|
from pluggy_sdk.models.connector import Connector
|
26
|
+
from pluggy_sdk.models.payment_intent_error_detail import PaymentIntentErrorDetail
|
26
27
|
from pluggy_sdk.models.payment_request import PaymentRequest
|
27
28
|
from pluggy_sdk.models.pix_data import PixData
|
28
29
|
from typing import Optional, Set
|
@@ -43,7 +44,8 @@ class PaymentIntent(BaseModel):
|
|
43
44
|
reference_id: Optional[StrictStr] = Field(default=None, description="Pix id related to the payment intent", alias="referenceId")
|
44
45
|
payment_method: Optional[StrictStr] = Field(default='PIS', description="Payment method can be PIS (Payment Initiation) or PIX", alias="paymentMethod")
|
45
46
|
pix_data: Optional[PixData] = Field(default=None, description="Pix data related to the payment intent (only applies for PIX payment method)", alias="pixData")
|
46
|
-
|
47
|
+
error_detail: Optional[PaymentIntentErrorDetail] = Field(default=None, alias="errorDetail")
|
48
|
+
__properties: ClassVar[List[str]] = ["id", "status", "createdAt", "updatedAt", "paymentRequest", "bulkPayment", "connector", "consentUrl", "referenceId", "paymentMethod", "pixData", "errorDetail"]
|
47
49
|
|
48
50
|
@field_validator('status')
|
49
51
|
def status_validate_enum(cls, value):
|
@@ -116,6 +118,9 @@ class PaymentIntent(BaseModel):
|
|
116
118
|
# override the default output from pydantic by calling `to_dict()` of pix_data
|
117
119
|
if self.pix_data:
|
118
120
|
_dict['pixData'] = self.pix_data.to_dict()
|
121
|
+
# override the default output from pydantic by calling `to_dict()` of error_detail
|
122
|
+
if self.error_detail:
|
123
|
+
_dict['errorDetail'] = self.error_detail.to_dict()
|
119
124
|
return _dict
|
120
125
|
|
121
126
|
@classmethod
|
@@ -138,7 +143,8 @@ class PaymentIntent(BaseModel):
|
|
138
143
|
"consentUrl": obj.get("consentUrl"),
|
139
144
|
"referenceId": obj.get("referenceId"),
|
140
145
|
"paymentMethod": obj.get("paymentMethod") if obj.get("paymentMethod") is not None else 'PIS',
|
141
|
-
"pixData": PixData.from_dict(obj["pixData"]) if obj.get("pixData") is not None else None
|
146
|
+
"pixData": PixData.from_dict(obj["pixData"]) if obj.get("pixData") is not None else None,
|
147
|
+
"errorDetail": PaymentIntentErrorDetail.from_dict(obj["errorDetail"]) if obj.get("errorDetail") is not None else None
|
142
148
|
})
|
143
149
|
return _obj
|
144
150
|
|