pluggy-sdk 1.0.0.post35__py3-none-any.whl → 1.0.0.post37__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.
@@ -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 datetime
22
+ from pydantic import BaseModel, ConfigDict, Field
23
+ from typing import Any, ClassVar, Dict, List, Union
24
+ from typing_extensions import Annotated
25
+ from pluggy_sdk.models.create_boleto_boleto_payer import CreateBoletoBoletoPayer
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class CreateBoletoBoleto(BaseModel):
30
+ """
31
+ CreateBoletoBoleto
32
+ """ # noqa: E501
33
+ seu_numero: Annotated[str, Field(strict=True, max_length=10)] = Field(description="Your identifier for this boleto", alias="seuNumero")
34
+ amount: Union[Annotated[float, Field(strict=True, ge=2.5)], Annotated[int, Field(strict=True, ge=3)]] = Field(description="Boleto amount")
35
+ due_date: datetime = Field(description="Due date for the boleto. Must be today or in the future.", alias="dueDate")
36
+ payer: CreateBoletoBoletoPayer
37
+ __properties: ClassVar[List[str]] = ["seuNumero", "amount", "dueDate", "payer"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of CreateBoletoBoleto from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of payer
79
+ if self.payer:
80
+ _dict['payer'] = self.payer.to_dict()
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of CreateBoletoBoleto 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
+ "seuNumero": obj.get("seuNumero"),
94
+ "amount": obj.get("amount"),
95
+ "dueDate": obj.get("dueDate"),
96
+ "payer": CreateBoletoBoletoPayer.from_dict(obj["payer"]) if obj.get("payer") is not None else None
97
+ })
98
+ return _obj
99
+
100
+
@@ -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 pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateBoletoBoletoPayer(BaseModel):
27
+ """
28
+ CreateBoletoBoletoPayer
29
+ """ # noqa: E501
30
+ tax_number: StrictStr = Field(description="Payer tax number (CPF/CNPJ)", alias="taxNumber")
31
+ name: StrictStr = Field(description="Payer name")
32
+ address_street: Optional[StrictStr] = Field(default=None, description="Payer street address", alias="addressStreet")
33
+ address_city: Optional[StrictStr] = Field(default=None, description="Payer city", alias="addressCity")
34
+ address_state: StrictStr = Field(description="Payer state", alias="addressState")
35
+ address_zip_code: StrictStr = Field(description="Payer ZIP code", alias="addressZipCode")
36
+ __properties: ClassVar[List[str]] = ["taxNumber", "name", "addressStreet", "addressCity", "addressState", "addressZipCode"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of CreateBoletoBoletoPayer from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of CreateBoletoBoletoPayer from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "taxNumber": obj.get("taxNumber"),
90
+ "name": obj.get("name"),
91
+ "addressStreet": obj.get("addressStreet"),
92
+ "addressCity": obj.get("addressCity"),
93
+ "addressState": obj.get("addressState"),
94
+ "addressZipCode": obj.get("addressZipCode")
95
+ })
96
+ return _obj
97
+
98
+
@@ -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
+
@@ -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")
@@ -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, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
23
  from pluggy_sdk.models.payment_intent_parameter import PaymentIntentParameter
24
24
  from typing import Optional, Set
@@ -33,7 +33,8 @@ class CreatePaymentIntent(BaseModel):
33
33
  parameters: Optional[PaymentIntentParameter] = None
34
34
  connector_id: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Primary identifier of the connector associated to the payment intent", alias="connectorId")
35
35
  payment_method: Optional[StrictStr] = Field(default=None, description="Payment method can be PIS (Payment Initiation) or PIX (PIX QR flow), if PIX selected `bulkPaymentId` or a `paymentRequest` with smartAccountId attached will be accepted", alias="paymentMethod")
36
- __properties: ClassVar[List[str]] = ["paymentRequestId", "bulkPaymentId", "parameters", "connectorId", "paymentMethod"]
36
+ is_dynamic_pix: Optional[StrictBool] = Field(default=None, description="Only for PIX paymentMethod. If true, the generated PIX QR code is dynamic and one-use. This requires the customerId to be present, and the customer must have CPF/CNPJ", alias="isDynamicPix")
37
+ __properties: ClassVar[List[str]] = ["paymentRequestId", "bulkPaymentId", "parameters", "connectorId", "paymentMethod", "isDynamicPix"]
37
38
 
38
39
  @field_validator('payment_method')
39
40
  def payment_method_validate_enum(cls, value):
@@ -103,7 +104,8 @@ class CreatePaymentIntent(BaseModel):
103
104
  "bulkPaymentId": obj.get("bulkPaymentId"),
104
105
  "parameters": PaymentIntentParameter.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None,
105
106
  "connectorId": obj.get("connectorId"),
106
- "paymentMethod": obj.get("paymentMethod")
107
+ "paymentMethod": obj.get("paymentMethod"),
108
+ "isDynamicPix": obj.get("isDynamicPix")
107
109
  })
108
110
  return _obj
109
111
 
@@ -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']):
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')")
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']):
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')")
40
40
  return value
41
41
 
42
42
  model_config = ConfigDict(
@@ -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,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 pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class 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
+ __properties: ClassVar[List[str]] = ["taxNumber", "personType", "name", "addressStreet", "addressNumber", "addressComplement", "addressNeighborhood", "addressCity", "addressState", "addressZipCode", "email", "ddd", "phoneNumber"]
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 IssuedBoletoPayer 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 IssuedBoletoPayer 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
+ "taxNumber": obj.get("taxNumber"),
97
+ "personType": obj.get("personType"),
98
+ "name": obj.get("name"),
99
+ "addressStreet": obj.get("addressStreet"),
100
+ "addressNumber": obj.get("addressNumber"),
101
+ "addressComplement": obj.get("addressComplement"),
102
+ "addressNeighborhood": obj.get("addressNeighborhood"),
103
+ "addressCity": obj.get("addressCity"),
104
+ "addressState": obj.get("addressState"),
105
+ "addressZipCode": obj.get("addressZipCode"),
106
+ "email": obj.get("email"),
107
+ "ddd": obj.get("ddd"),
108
+ "phoneNumber": obj.get("phoneNumber")
109
+ })
110
+ return _obj
111
+
112
+
@@ -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
- __properties: ClassVar[List[str]] = ["id", "status", "createdAt", "updatedAt", "paymentRequest", "bulkPayment", "connector", "consentUrl", "referenceId", "paymentMethod", "pixData"]
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