pluggy-sdk 1.0.0.post37__py3-none-any.whl → 1.0.0.post39__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. pluggy_sdk/__init__.py +7 -1
  2. pluggy_sdk/api/boleto_management_api.py +530 -0
  3. pluggy_sdk/api/payment_recipient_api.py +1 -18
  4. pluggy_sdk/api_client.py +1 -1
  5. pluggy_sdk/configuration.py +10 -3
  6. pluggy_sdk/models/__init__.py +6 -0
  7. pluggy_sdk/models/create_boleto_boleto.py +15 -3
  8. pluggy_sdk/models/create_boleto_boleto_fine.py +98 -0
  9. pluggy_sdk/models/create_boleto_boleto_interest.py +98 -0
  10. pluggy_sdk/models/create_boleto_connection_from_item.py +88 -0
  11. pluggy_sdk/models/create_or_update_payment_customer.py +1 -1
  12. pluggy_sdk/models/create_payment_customer_request_body.py +1 -1
  13. pluggy_sdk/models/create_payment_recipient.py +2 -4
  14. pluggy_sdk/models/create_webhook.py +2 -2
  15. pluggy_sdk/models/investment.py +1 -11
  16. pluggy_sdk/models/investment_transaction.py +3 -1
  17. pluggy_sdk/models/issued_boleto.py +48 -3
  18. pluggy_sdk/models/issued_boleto_fine.py +101 -0
  19. pluggy_sdk/models/issued_boleto_interest.py +101 -0
  20. pluggy_sdk/models/issued_boleto_payer.py +18 -4
  21. pluggy_sdk/models/schedule_payment.py +9 -3
  22. pluggy_sdk/models/schedule_payment_error_detail.py +92 -0
  23. pluggy_sdk/models/smart_account.py +4 -2
  24. pluggy_sdk/models/update_payment_recipient.py +2 -4
  25. pluggy_sdk/rest.py +1 -0
  26. {pluggy_sdk-1.0.0.post37.dist-info → pluggy_sdk-1.0.0.post39.dist-info}/METADATA +11 -3
  27. {pluggy_sdk-1.0.0.post37.dist-info → pluggy_sdk-1.0.0.post39.dist-info}/RECORD +29 -23
  28. {pluggy_sdk-1.0.0.post37.dist-info → pluggy_sdk-1.0.0.post39.dist-info}/WHEEL +1 -1
  29. {pluggy_sdk-1.0.0.post37.dist-info → pluggy_sdk-1.0.0.post39.dist-info}/top_level.txt +0 -0
@@ -19,7 +19,7 @@ import logging
19
19
  from logging import FileHandler
20
20
  import multiprocessing
21
21
  import sys
22
- from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
22
+ from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
23
23
  from typing_extensions import NotRequired, Self
24
24
 
25
25
  import urllib3
@@ -162,6 +162,8 @@ class Configuration:
162
162
  :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
163
163
  in PEM format.
164
164
  :param retries: Number of retries for API requests.
165
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
166
+ in PEM (str) or DER (bytes) format.
165
167
 
166
168
  :Example:
167
169
 
@@ -195,13 +197,14 @@ conf = pluggy_sdk.Configuration(
195
197
  username: Optional[str]=None,
196
198
  password: Optional[str]=None,
197
199
  access_token: Optional[str]=None,
198
- server_index: Optional[int]=None,
200
+ server_index: Optional[int]=None,
199
201
  server_variables: Optional[ServerVariablesT]=None,
200
202
  server_operation_index: Optional[Dict[int, int]]=None,
201
203
  server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
202
204
  ignore_operation_servers: bool=False,
203
205
  ssl_ca_cert: Optional[str]=None,
204
206
  retries: Optional[int] = None,
207
+ ca_cert_data: Optional[Union[str, bytes]] = None,
205
208
  *,
206
209
  debug: Optional[bool] = None,
207
210
  ) -> None:
@@ -279,6 +282,10 @@ conf = pluggy_sdk.Configuration(
279
282
  self.ssl_ca_cert = ssl_ca_cert
280
283
  """Set this to customize the certificate file to verify the peer.
281
284
  """
285
+ self.ca_cert_data = ca_cert_data
286
+ """Set this to verify the peer using PEM (str) or DER (bytes)
287
+ certificate data.
288
+ """
282
289
  self.cert_file = None
283
290
  """client certificate file
284
291
  """
@@ -525,7 +532,7 @@ conf = pluggy_sdk.Configuration(
525
532
  "OS: {env}\n"\
526
533
  "Python Version: {pyversion}\n"\
527
534
  "Version of the API: 1.0.0\n"\
528
- "SDK Package Version: 1.0.0.post37".\
535
+ "SDK Package Version: 1.0.0.post39".\
529
536
  format(env=sys.platform, pyversion=sys.version)
530
537
 
531
538
  def get_host_settings(self) -> List[HostSetting]:
@@ -50,8 +50,11 @@ from pluggy_sdk.models.connector_user_action import ConnectorUserAction
50
50
  from pluggy_sdk.models.consent import Consent
51
51
  from pluggy_sdk.models.create_boleto import CreateBoleto
52
52
  from pluggy_sdk.models.create_boleto_boleto import CreateBoletoBoleto
53
+ from pluggy_sdk.models.create_boleto_boleto_fine import CreateBoletoBoletoFine
54
+ from pluggy_sdk.models.create_boleto_boleto_interest import CreateBoletoBoletoInterest
53
55
  from pluggy_sdk.models.create_boleto_boleto_payer import CreateBoletoBoletoPayer
54
56
  from pluggy_sdk.models.create_boleto_connection import CreateBoletoConnection
57
+ from pluggy_sdk.models.create_boleto_connection_from_item import CreateBoletoConnectionFromItem
55
58
  from pluggy_sdk.models.create_boleto_payment_request import CreateBoletoPaymentRequest
56
59
  from pluggy_sdk.models.create_bulk_payment import CreateBulkPayment
57
60
  from pluggy_sdk.models.create_client_category_rule import CreateClientCategoryRule
@@ -91,6 +94,8 @@ from pluggy_sdk.models.investment_metadata import InvestmentMetadata
91
94
  from pluggy_sdk.models.investment_transaction import InvestmentTransaction
92
95
  from pluggy_sdk.models.investments_list200_response import InvestmentsList200Response
93
96
  from pluggy_sdk.models.issued_boleto import IssuedBoleto
97
+ from pluggy_sdk.models.issued_boleto_fine import IssuedBoletoFine
98
+ from pluggy_sdk.models.issued_boleto_interest import IssuedBoletoInterest
94
99
  from pluggy_sdk.models.issued_boleto_payer import IssuedBoletoPayer
95
100
  from pluggy_sdk.models.item import Item
96
101
  from pluggy_sdk.models.item_creation_error_response import ItemCreationErrorResponse
@@ -147,6 +152,7 @@ from pluggy_sdk.models.phone_number import PhoneNumber
147
152
  from pluggy_sdk.models.pix_data import PixData
148
153
  from pluggy_sdk.models.single import SINGLE
149
154
  from pluggy_sdk.models.schedule_payment import SchedulePayment
155
+ from pluggy_sdk.models.schedule_payment_error_detail import SchedulePaymentErrorDetail
150
156
  from pluggy_sdk.models.smart_account import SmartAccount
151
157
  from pluggy_sdk.models.smart_account_address import SmartAccountAddress
152
158
  from pluggy_sdk.models.smart_account_balance import SmartAccountBalance
@@ -20,8 +20,10 @@ import json
20
20
 
21
21
  from datetime import datetime
22
22
  from pydantic import BaseModel, ConfigDict, Field
23
- from typing import Any, ClassVar, Dict, List, Union
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
24
  from typing_extensions import Annotated
25
+ from pluggy_sdk.models.create_boleto_boleto_fine import CreateBoletoBoletoFine
26
+ from pluggy_sdk.models.create_boleto_boleto_interest import CreateBoletoBoletoInterest
25
27
  from pluggy_sdk.models.create_boleto_boleto_payer import CreateBoletoBoletoPayer
26
28
  from typing import Optional, Set
27
29
  from typing_extensions import Self
@@ -34,7 +36,9 @@ class CreateBoletoBoleto(BaseModel):
34
36
  amount: Union[Annotated[float, Field(strict=True, ge=2.5)], Annotated[int, Field(strict=True, ge=3)]] = Field(description="Boleto amount")
35
37
  due_date: datetime = Field(description="Due date for the boleto. Must be today or in the future.", alias="dueDate")
36
38
  payer: CreateBoletoBoletoPayer
37
- __properties: ClassVar[List[str]] = ["seuNumero", "amount", "dueDate", "payer"]
39
+ fine: Optional[CreateBoletoBoletoFine] = None
40
+ interest: Optional[CreateBoletoBoletoInterest] = None
41
+ __properties: ClassVar[List[str]] = ["seuNumero", "amount", "dueDate", "payer", "fine", "interest"]
38
42
 
39
43
  model_config = ConfigDict(
40
44
  populate_by_name=True,
@@ -78,6 +82,12 @@ class CreateBoletoBoleto(BaseModel):
78
82
  # override the default output from pydantic by calling `to_dict()` of payer
79
83
  if self.payer:
80
84
  _dict['payer'] = self.payer.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of fine
86
+ if self.fine:
87
+ _dict['fine'] = self.fine.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of interest
89
+ if self.interest:
90
+ _dict['interest'] = self.interest.to_dict()
81
91
  return _dict
82
92
 
83
93
  @classmethod
@@ -93,7 +103,9 @@ class CreateBoletoBoleto(BaseModel):
93
103
  "seuNumero": obj.get("seuNumero"),
94
104
  "amount": obj.get("amount"),
95
105
  "dueDate": obj.get("dueDate"),
96
- "payer": CreateBoletoBoletoPayer.from_dict(obj["payer"]) if obj.get("payer") is not None else None
106
+ "payer": CreateBoletoBoletoPayer.from_dict(obj["payer"]) if obj.get("payer") is not None else None,
107
+ "fine": CreateBoletoBoletoFine.from_dict(obj["fine"]) if obj.get("fine") is not None else None,
108
+ "interest": CreateBoletoBoletoInterest.from_dict(obj["interest"]) if obj.get("interest") is not None else None
97
109
  })
98
110
  return _obj
99
111
 
@@ -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, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CreateBoletoBoletoFine(BaseModel):
28
+ """
29
+ Fine information for late payment
30
+ """ # noqa: E501
31
+ value: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="Fine value")
32
+ type: StrictStr = Field(description="Type of fine calculation")
33
+ __properties: ClassVar[List[str]] = ["value", "type"]
34
+
35
+ @field_validator('type')
36
+ def type_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['PERCENTAGE', 'FIXED']):
39
+ raise ValueError("must be one of enum values ('PERCENTAGE', 'FIXED')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of CreateBoletoBoletoFine from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of CreateBoletoBoletoFine 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
+ "value": obj.get("value"),
94
+ "type": obj.get("type")
95
+ })
96
+ return _obj
97
+
98
+
@@ -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, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CreateBoletoBoletoInterest(BaseModel):
28
+ """
29
+ Interest information for late payment
30
+ """ # noqa: E501
31
+ value: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="Interest value")
32
+ type: StrictStr = Field(description="Type of interest calculation")
33
+ __properties: ClassVar[List[str]] = ["value", "type"]
34
+
35
+ @field_validator('type')
36
+ def type_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['PERCENTAGE']):
39
+ raise ValueError("must be one of enum values ('PERCENTAGE')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of CreateBoletoBoletoInterest from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of CreateBoletoBoletoInterest 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
+ "value": obj.get("value"),
94
+ "type": obj.get("type")
95
+ })
96
+ return _obj
97
+
98
+
@@ -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
+
@@ -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, StrictBool, StrictStr
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", "isDefault", "pixKey", "smartAccountId"]
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/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')")
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(
@@ -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", "transactions", "dueDate", "issuer", "issuerCNPJ", "issueDate", "rate", "rateType", "fixedAnnualRate", "status"]
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"),
@@ -29,6 +29,7 @@ class InvestmentTransaction(BaseModel):
29
29
  """
30
30
  Movement of the investment
31
31
  """ # noqa: E501
32
+ id: StrictStr = Field(description="Primary investment transaction identifier")
32
33
  type: StrictStr = Field(description="Type of transactions")
33
34
  movement_type: Optional[StrictStr] = Field(default=None, description="Type of movement of the transaction", alias="movementType")
34
35
  quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Quantity of the transaction")
@@ -38,7 +39,7 @@ class InvestmentTransaction(BaseModel):
38
39
  var_date: datetime = Field(description="Date when the transaction was made", alias="date")
39
40
  trade_date: Optional[datetime] = Field(default=None, description="Date when the transaction was confirmed", alias="tradeDate")
40
41
  expenses: Optional[InvestmentExpenses] = None
41
- __properties: ClassVar[List[str]] = ["type", "movementType", "quantity", "value", "amount", "agreedRate", "date", "tradeDate", "expenses"]
42
+ __properties: ClassVar[List[str]] = ["id", "type", "movementType", "quantity", "value", "amount", "agreedRate", "date", "tradeDate", "expenses"]
42
43
 
43
44
  @field_validator('type')
44
45
  def type_validate_enum(cls, value):
@@ -111,6 +112,7 @@ class InvestmentTransaction(BaseModel):
111
112
  return cls.model_validate(obj)
112
113
 
113
114
  _obj = cls.model_validate({
115
+ "id": obj.get("id"),
114
116
  "type": obj.get("type"),
115
117
  "movementType": obj.get("movementType"),
116
118
  "quantity": obj.get("quantity"),
@@ -19,9 +19,11 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from datetime import datetime
22
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
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 typing_extensions import Annotated
25
+ from pluggy_sdk.models.issued_boleto_fine import IssuedBoletoFine
26
+ from pluggy_sdk.models.issued_boleto_interest import IssuedBoletoInterest
25
27
  from pluggy_sdk.models.issued_boleto_payer import IssuedBoletoPayer
26
28
  from typing import Optional, Set
27
29
  from typing_extensions import Self
@@ -41,7 +43,13 @@ class IssuedBoleto(BaseModel):
41
43
  nosso_numero: Optional[StrictStr] = Field(default=None, description="Bank's internal identifier for the boleto", alias="nossoNumero")
42
44
  barcode: StrictStr = Field(description="Boleto barcode")
43
45
  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"]
46
+ created_at: datetime = Field(description="Date when the boleto was created", alias="createdAt")
47
+ amount_paid: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Amount that was paid for this boleto", alias="amountPaid")
48
+ payment_origin: Optional[StrictStr] = Field(default=None, description="Origin of the payment when the boleto is paid", alias="paymentOrigin")
49
+ fine: Optional[IssuedBoletoFine] = None
50
+ interest: Optional[IssuedBoletoInterest] = None
51
+ paid_at: Optional[datetime] = Field(default=None, description="Date when the boleto was paid", alias="paidAt")
52
+ __properties: ClassVar[List[str]] = ["id", "amount", "status", "seuNumero", "dueDate", "payer", "pixQr", "digitableLine", "nossoNumero", "barcode", "boletoConnectionId", "createdAt", "amountPaid", "paymentOrigin", "fine", "interest", "paidAt"]
45
53
 
46
54
  @field_validator('status')
47
55
  def status_validate_enum(cls, value):
@@ -50,6 +58,16 @@ class IssuedBoleto(BaseModel):
50
58
  raise ValueError("must be one of enum values ('OPEN', 'PAID', 'OVERDUE', 'CANCELLED')")
51
59
  return value
52
60
 
61
+ @field_validator('payment_origin')
62
+ def payment_origin_validate_enum(cls, value):
63
+ """Validates the enum"""
64
+ if value is None:
65
+ return value
66
+
67
+ if value not in set(['PIX', 'BOLETO']):
68
+ raise ValueError("must be one of enum values ('PIX', 'BOLETO')")
69
+ return value
70
+
53
71
  model_config = ConfigDict(
54
72
  populate_by_name=True,
55
73
  validate_assignment=True,
@@ -92,6 +110,27 @@ class IssuedBoleto(BaseModel):
92
110
  # override the default output from pydantic by calling `to_dict()` of payer
93
111
  if self.payer:
94
112
  _dict['payer'] = self.payer.to_dict()
113
+ # override the default output from pydantic by calling `to_dict()` of fine
114
+ if self.fine:
115
+ _dict['fine'] = self.fine.to_dict()
116
+ # override the default output from pydantic by calling `to_dict()` of interest
117
+ if self.interest:
118
+ _dict['interest'] = self.interest.to_dict()
119
+ # set to None if amount_paid (nullable) is None
120
+ # and model_fields_set contains the field
121
+ if self.amount_paid is None and "amount_paid" in self.model_fields_set:
122
+ _dict['amountPaid'] = None
123
+
124
+ # set to None if payment_origin (nullable) is None
125
+ # and model_fields_set contains the field
126
+ if self.payment_origin is None and "payment_origin" in self.model_fields_set:
127
+ _dict['paymentOrigin'] = None
128
+
129
+ # set to None if fine (nullable) is None
130
+ # and model_fields_set contains the field
131
+ if self.fine is None and "fine" in self.model_fields_set:
132
+ _dict['fine'] = None
133
+
95
134
  return _dict
96
135
 
97
136
  @classmethod
@@ -114,7 +153,13 @@ class IssuedBoleto(BaseModel):
114
153
  "digitableLine": obj.get("digitableLine"),
115
154
  "nossoNumero": obj.get("nossoNumero"),
116
155
  "barcode": obj.get("barcode"),
117
- "boletoConnectionId": obj.get("boletoConnectionId")
156
+ "boletoConnectionId": obj.get("boletoConnectionId"),
157
+ "createdAt": obj.get("createdAt"),
158
+ "amountPaid": obj.get("amountPaid"),
159
+ "paymentOrigin": obj.get("paymentOrigin"),
160
+ "fine": IssuedBoletoFine.from_dict(obj["fine"]) if obj.get("fine") is not None else None,
161
+ "interest": IssuedBoletoInterest.from_dict(obj["interest"]) if obj.get("interest") is not None else None,
162
+ "paidAt": obj.get("paidAt")
118
163
  })
119
164
  return _obj
120
165