pluggy-sdk 1.0.0.post2__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 (163) hide show
  1. pluggy_sdk/__init__.py +183 -0
  2. pluggy_sdk/api/__init__.py +26 -0
  3. pluggy_sdk/api/account_api.py +582 -0
  4. pluggy_sdk/api/acquirer_anticipation_api.py +658 -0
  5. pluggy_sdk/api/acquirer_receivable_api.py +658 -0
  6. pluggy_sdk/api/acquirer_sale_api.py +658 -0
  7. pluggy_sdk/api/auth_api.py +599 -0
  8. pluggy_sdk/api/bill_api.py +561 -0
  9. pluggy_sdk/api/bulk_payment_api.py +854 -0
  10. pluggy_sdk/api/category_api.py +1084 -0
  11. pluggy_sdk/api/connector_api.py +970 -0
  12. pluggy_sdk/api/identity_api.py +575 -0
  13. pluggy_sdk/api/income_report_api.py +308 -0
  14. pluggy_sdk/api/investment_api.py +909 -0
  15. pluggy_sdk/api/items_api.py +1441 -0
  16. pluggy_sdk/api/loan_api.py +561 -0
  17. pluggy_sdk/api/payment_customer_api.py +1399 -0
  18. pluggy_sdk/api/payment_intent_api.py +833 -0
  19. pluggy_sdk/api/payment_recipient_api.py +1976 -0
  20. pluggy_sdk/api/payment_request_api.py +1636 -0
  21. pluggy_sdk/api/portfolio_yield_api.py +574 -0
  22. pluggy_sdk/api/smart_account_api.py +1116 -0
  23. pluggy_sdk/api/transaction_api.py +954 -0
  24. pluggy_sdk/api/webhook_api.py +1391 -0
  25. pluggy_sdk/api_client.py +769 -0
  26. pluggy_sdk/api_response.py +21 -0
  27. pluggy_sdk/configuration.py +466 -0
  28. pluggy_sdk/exceptions.py +200 -0
  29. pluggy_sdk/models/__init__.py +145 -0
  30. pluggy_sdk/models/account.py +134 -0
  31. pluggy_sdk/models/accounts_list200_response.py +102 -0
  32. pluggy_sdk/models/acquirer_anticipation.py +117 -0
  33. pluggy_sdk/models/acquirer_anticipation_data.py +101 -0
  34. pluggy_sdk/models/acquirer_data.py +113 -0
  35. pluggy_sdk/models/acquirer_receivable.py +143 -0
  36. pluggy_sdk/models/acquirer_receivable_data.py +108 -0
  37. pluggy_sdk/models/acquirer_receivable_data_establishment.py +96 -0
  38. pluggy_sdk/models/acquirer_receivable_destination_account.py +92 -0
  39. pluggy_sdk/models/acquirer_receivable_related_sale.py +99 -0
  40. pluggy_sdk/models/acquirer_sale.py +171 -0
  41. pluggy_sdk/models/acquirer_sale_data.py +150 -0
  42. pluggy_sdk/models/acquirer_sale_installment.py +93 -0
  43. pluggy_sdk/models/acquirer_sale_installment_data.py +95 -0
  44. pluggy_sdk/models/address.py +110 -0
  45. pluggy_sdk/models/aggregated_portfolio.py +120 -0
  46. pluggy_sdk/models/aggregated_portfolio_response.py +102 -0
  47. pluggy_sdk/models/asset_distribution.py +88 -0
  48. pluggy_sdk/models/auth_request.py +90 -0
  49. pluggy_sdk/models/auth_response.py +88 -0
  50. pluggy_sdk/models/bank_data.py +92 -0
  51. pluggy_sdk/models/bill.py +109 -0
  52. pluggy_sdk/models/bill_finance_charge.py +103 -0
  53. pluggy_sdk/models/bills_list200_response.py +102 -0
  54. pluggy_sdk/models/bulk_payment.py +128 -0
  55. pluggy_sdk/models/bulk_payments_list200_response.py +102 -0
  56. pluggy_sdk/models/category.py +96 -0
  57. pluggy_sdk/models/client_category_rule.py +94 -0
  58. pluggy_sdk/models/company.py +90 -0
  59. pluggy_sdk/models/connect_token_request.py +94 -0
  60. pluggy_sdk/models/connect_token_response.py +88 -0
  61. pluggy_sdk/models/connector.py +141 -0
  62. pluggy_sdk/models/connector_credential.py +121 -0
  63. pluggy_sdk/models/connector_health.py +96 -0
  64. pluggy_sdk/models/connector_health_details.py +90 -0
  65. pluggy_sdk/models/connector_list_response.py +102 -0
  66. pluggy_sdk/models/connector_user_action.py +93 -0
  67. pluggy_sdk/models/create_bulk_payment.py +96 -0
  68. pluggy_sdk/models/create_client_category_rule.py +92 -0
  69. pluggy_sdk/models/create_item.py +111 -0
  70. pluggy_sdk/models/create_item_parameters.py +144 -0
  71. pluggy_sdk/models/create_or_update_payment_customer.py +105 -0
  72. pluggy_sdk/models/create_payment_customer_request_body.py +103 -0
  73. pluggy_sdk/models/create_payment_intent.py +94 -0
  74. pluggy_sdk/models/create_payment_recipient.py +100 -0
  75. pluggy_sdk/models/create_payment_request.py +102 -0
  76. pluggy_sdk/models/create_pix_qr_payment_request.py +96 -0
  77. pluggy_sdk/models/create_smart_account_request.py +102 -0
  78. pluggy_sdk/models/create_webhook.py +99 -0
  79. pluggy_sdk/models/credential_select_option.py +90 -0
  80. pluggy_sdk/models/credit_card_metadata.py +101 -0
  81. pluggy_sdk/models/credit_data.py +127 -0
  82. pluggy_sdk/models/document.py +100 -0
  83. pluggy_sdk/models/email.py +100 -0
  84. pluggy_sdk/models/global_error_response.py +94 -0
  85. pluggy_sdk/models/i_count_response.py +88 -0
  86. pluggy_sdk/models/identity_relation.py +102 -0
  87. pluggy_sdk/models/identity_response.py +149 -0
  88. pluggy_sdk/models/income_report.py +90 -0
  89. pluggy_sdk/models/income_reports_response.py +102 -0
  90. pluggy_sdk/models/investment.py +192 -0
  91. pluggy_sdk/models/investment_expenses.py +108 -0
  92. pluggy_sdk/models/investment_metadata.py +99 -0
  93. pluggy_sdk/models/investment_transaction.py +124 -0
  94. pluggy_sdk/models/investments_list200_response.py +102 -0
  95. pluggy_sdk/models/item.py +148 -0
  96. pluggy_sdk/models/item_creation_error_response.py +102 -0
  97. pluggy_sdk/models/item_error.py +94 -0
  98. pluggy_sdk/models/item_options.py +90 -0
  99. pluggy_sdk/models/loan.py +199 -0
  100. pluggy_sdk/models/loan_contracted_fee.py +118 -0
  101. pluggy_sdk/models/loan_contracted_finance_charge.py +92 -0
  102. pluggy_sdk/models/loan_installment_balloon_payment.py +95 -0
  103. pluggy_sdk/models/loan_installment_balloon_payment_amount.py +90 -0
  104. pluggy_sdk/models/loan_installments.py +130 -0
  105. pluggy_sdk/models/loan_interest_rate.py +136 -0
  106. pluggy_sdk/models/loan_payment_release.py +103 -0
  107. pluggy_sdk/models/loan_payment_release_over_parcel.py +106 -0
  108. pluggy_sdk/models/loan_payment_release_over_parcel_charge.py +92 -0
  109. pluggy_sdk/models/loan_payment_release_over_parcel_fee.py +92 -0
  110. pluggy_sdk/models/loan_payments.py +98 -0
  111. pluggy_sdk/models/loan_warranty.py +94 -0
  112. pluggy_sdk/models/loans_list200_response.py +102 -0
  113. pluggy_sdk/models/merchant.py +96 -0
  114. pluggy_sdk/models/monthly_portfolio.py +100 -0
  115. pluggy_sdk/models/monthly_portfolio_response.py +102 -0
  116. pluggy_sdk/models/not_authenticated_response.py +90 -0
  117. pluggy_sdk/models/page_response_acquirer_anticipations.py +102 -0
  118. pluggy_sdk/models/page_response_acquirer_receivables.py +102 -0
  119. pluggy_sdk/models/page_response_acquirer_sales.py +102 -0
  120. pluggy_sdk/models/page_response_category_rules.py +102 -0
  121. pluggy_sdk/models/page_response_investment_transactions.py +102 -0
  122. pluggy_sdk/models/page_response_transactions.py +102 -0
  123. pluggy_sdk/models/parameter_validation_error.py +92 -0
  124. pluggy_sdk/models/parameter_validation_response.py +98 -0
  125. pluggy_sdk/models/payment_customer.py +105 -0
  126. pluggy_sdk/models/payment_customers_list200_response.py +102 -0
  127. pluggy_sdk/models/payment_data.py +105 -0
  128. pluggy_sdk/models/payment_data_participant.py +101 -0
  129. pluggy_sdk/models/payment_institution.py +101 -0
  130. pluggy_sdk/models/payment_intent.py +145 -0
  131. pluggy_sdk/models/payment_intents_list200_response.py +102 -0
  132. pluggy_sdk/models/payment_recipient.py +106 -0
  133. pluggy_sdk/models/payment_recipient_account.py +99 -0
  134. pluggy_sdk/models/payment_recipients_institution_list200_response.py +102 -0
  135. pluggy_sdk/models/payment_recipients_list200_response.py +102 -0
  136. pluggy_sdk/models/payment_request.py +118 -0
  137. pluggy_sdk/models/payment_request_callback_urls.py +92 -0
  138. pluggy_sdk/models/payment_requests_list200_response.py +102 -0
  139. pluggy_sdk/models/percentage_over_index.py +90 -0
  140. pluggy_sdk/models/phone_number.py +100 -0
  141. pluggy_sdk/models/pix_data.py +90 -0
  142. pluggy_sdk/models/smart_account.py +107 -0
  143. pluggy_sdk/models/smart_account_address.py +112 -0
  144. pluggy_sdk/models/smart_account_balance.py +95 -0
  145. pluggy_sdk/models/smart_accounts_list200_response.py +102 -0
  146. pluggy_sdk/models/status_detail.py +142 -0
  147. pluggy_sdk/models/status_detail_product.py +101 -0
  148. pluggy_sdk/models/status_detail_product_warning.py +92 -0
  149. pluggy_sdk/models/transaction.py +145 -0
  150. pluggy_sdk/models/update_item.py +109 -0
  151. pluggy_sdk/models/update_item_parameters.py +144 -0
  152. pluggy_sdk/models/update_payment_recipient.py +100 -0
  153. pluggy_sdk/models/update_payment_request.py +102 -0
  154. pluggy_sdk/models/update_transaction.py +88 -0
  155. pluggy_sdk/models/webhook.py +106 -0
  156. pluggy_sdk/models/webhook_creation_error_response.py +90 -0
  157. pluggy_sdk/models/webhooks_list200_response.py +102 -0
  158. pluggy_sdk/py.typed +0 -0
  159. pluggy_sdk/rest.py +258 -0
  160. pluggy_sdk-1.0.0.post2.dist-info/METADATA +336 -0
  161. pluggy_sdk-1.0.0.post2.dist-info/RECORD +163 -0
  162. pluggy_sdk-1.0.0.post2.dist-info/WHEEL +5 -0
  163. pluggy_sdk-1.0.0.post2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,92 @@
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 StatusDetailProductWarning(BaseModel):
27
+ """
28
+ StatusDetailProductWarning
29
+ """ # noqa: E501
30
+ code: StrictStr = Field(description="The warning code generated by Pluggy")
31
+ message: StrictStr = Field(description="The warning message in english generated by Pluggy")
32
+ provider_message: Optional[StrictStr] = Field(default=None, description="The warning message from the FI if provided", alias="providerMessage")
33
+ __properties: ClassVar[List[str]] = ["code", "message", "providerMessage"]
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 StatusDetailProductWarning 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 StatusDetailProductWarning 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
+ "code": obj.get("code"),
87
+ "message": obj.get("message"),
88
+ "providerMessage": obj.get("providerMessage")
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,145 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pluggy API
5
+
6
+ Pluggy's main API to review data and execute connectors
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: hello@pluggy.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional, Union
24
+ from pluggy_sdk.models.acquirer_data import AcquirerData
25
+ from pluggy_sdk.models.credit_card_metadata import CreditCardMetadata
26
+ from pluggy_sdk.models.merchant import Merchant
27
+ from pluggy_sdk.models.payment_data import PaymentData
28
+ from typing import Optional, Set
29
+ from typing_extensions import Self
30
+
31
+ class Transaction(BaseModel):
32
+ """
33
+ Transaction product
34
+ """ # noqa: E501
35
+ id: StrictStr = Field(description="Primary identifier of the transaction")
36
+ description: StrictStr = Field(description="Clean description of the transaction")
37
+ currency_code: StrictStr = Field(description="Currency ISO code", alias="currencyCode")
38
+ amount: Union[StrictFloat, StrictInt] = Field(description="Transaction amount")
39
+ amount_in_account_currency: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Transaction amount in Account's Currency. Only present if the transaction is in a different currency than the account's currency", alias="amountInAccountCurrency")
40
+ var_date: datetime = Field(description="Date when the transaction was made", alias="date")
41
+ type: Optional[StrictStr] = Field(default=None, description="Type of the transaction. DEBIT (outflow) or CREDIT (inflow)")
42
+ balance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Balance after the transaction")
43
+ provider_code: Optional[StrictStr] = Field(default=None, description="Institution provided code", alias="providerCode")
44
+ status: Optional[StrictStr] = Field(default=None, description="Status of the movement. POSTED / PENDING")
45
+ category: Optional[StrictStr] = Field(default=None, description="Category of the transaction (e.g. Restaurants, Education). See the Transaction Categorization section in our guides.")
46
+ category_id: Optional[StrictStr] = Field(default=None, description="Id of the transaction category. Can be used to identify the category in the Categories endpoint", alias="categoryId")
47
+ payment_data: Optional[PaymentData] = Field(default=None, alias="paymentData")
48
+ acquirer_data: Optional[AcquirerData] = Field(default=None, alias="acquirerData")
49
+ credit_card_metadata: Optional[CreditCardMetadata] = Field(default=None, alias="creditCardMetadata")
50
+ merchant: Optional[Merchant] = None
51
+ __properties: ClassVar[List[str]] = ["id", "description", "currencyCode", "amount", "amountInAccountCurrency", "date", "type", "balance", "providerCode", "status", "category", "categoryId", "paymentData", "acquirerData", "creditCardMetadata", "merchant"]
52
+
53
+ @field_validator('type')
54
+ def type_validate_enum(cls, value):
55
+ """Validates the enum"""
56
+ if value is None:
57
+ return value
58
+
59
+ if value not in set(['DEBIT', 'CREDIT']):
60
+ raise ValueError("must be one of enum values ('DEBIT', 'CREDIT')")
61
+ return value
62
+
63
+ model_config = ConfigDict(
64
+ populate_by_name=True,
65
+ validate_assignment=True,
66
+ protected_namespaces=(),
67
+ )
68
+
69
+
70
+ def to_str(self) -> str:
71
+ """Returns the string representation of the model using alias"""
72
+ return pprint.pformat(self.model_dump(by_alias=True))
73
+
74
+ def to_json(self) -> str:
75
+ """Returns the JSON representation of the model using alias"""
76
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
77
+ return json.dumps(self.to_dict())
78
+
79
+ @classmethod
80
+ def from_json(cls, json_str: str) -> Optional[Self]:
81
+ """Create an instance of Transaction from a JSON string"""
82
+ return cls.from_dict(json.loads(json_str))
83
+
84
+ def to_dict(self) -> Dict[str, Any]:
85
+ """Return the dictionary representation of the model using alias.
86
+
87
+ This has the following differences from calling pydantic's
88
+ `self.model_dump(by_alias=True)`:
89
+
90
+ * `None` is only added to the output dict for nullable fields that
91
+ were set at model initialization. Other fields with value `None`
92
+ are ignored.
93
+ """
94
+ excluded_fields: Set[str] = set([
95
+ ])
96
+
97
+ _dict = self.model_dump(
98
+ by_alias=True,
99
+ exclude=excluded_fields,
100
+ exclude_none=True,
101
+ )
102
+ # override the default output from pydantic by calling `to_dict()` of payment_data
103
+ if self.payment_data:
104
+ _dict['paymentData'] = self.payment_data.to_dict()
105
+ # override the default output from pydantic by calling `to_dict()` of acquirer_data
106
+ if self.acquirer_data:
107
+ _dict['acquirerData'] = self.acquirer_data.to_dict()
108
+ # override the default output from pydantic by calling `to_dict()` of credit_card_metadata
109
+ if self.credit_card_metadata:
110
+ _dict['creditCardMetadata'] = self.credit_card_metadata.to_dict()
111
+ # override the default output from pydantic by calling `to_dict()` of merchant
112
+ if self.merchant:
113
+ _dict['merchant'] = self.merchant.to_dict()
114
+ return _dict
115
+
116
+ @classmethod
117
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
118
+ """Create an instance of Transaction from a dict"""
119
+ if obj is None:
120
+ return None
121
+
122
+ if not isinstance(obj, dict):
123
+ return cls.model_validate(obj)
124
+
125
+ _obj = cls.model_validate({
126
+ "id": obj.get("id"),
127
+ "description": obj.get("description"),
128
+ "currencyCode": obj.get("currencyCode"),
129
+ "amount": obj.get("amount"),
130
+ "amountInAccountCurrency": obj.get("amountInAccountCurrency"),
131
+ "date": obj.get("date"),
132
+ "type": obj.get("type"),
133
+ "balance": obj.get("balance"),
134
+ "providerCode": obj.get("providerCode"),
135
+ "status": obj.get("status"),
136
+ "category": obj.get("category"),
137
+ "categoryId": obj.get("categoryId"),
138
+ "paymentData": PaymentData.from_dict(obj["paymentData"]) if obj.get("paymentData") is not None else None,
139
+ "acquirerData": AcquirerData.from_dict(obj["acquirerData"]) if obj.get("acquirerData") is not None else None,
140
+ "creditCardMetadata": CreditCardMetadata.from_dict(obj["creditCardMetadata"]) if obj.get("creditCardMetadata") is not None else None,
141
+ "merchant": Merchant.from_dict(obj["merchant"]) if obj.get("merchant") is not None else None
142
+ })
143
+ return _obj
144
+
145
+
@@ -0,0 +1,109 @@
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, Optional
23
+ from pluggy_sdk.models.update_item_parameters import UpdateItemParameters
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class UpdateItem(BaseModel):
28
+ """
29
+ Update Item Request
30
+ """ # noqa: E501
31
+ parameters: Optional[UpdateItemParameters] = None
32
+ 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")
33
+ webhook_url: Optional[StrictStr] = Field(default=None, description="Url to be notified of item changes", alias="webhookUrl")
34
+ products: Optional[List[StrictStr]] = Field(default=None, description="Products to be collected in the connection")
35
+ __properties: ClassVar[List[str]] = ["parameters", "clientUserId", "webhookUrl", "products"]
36
+
37
+ @field_validator('products')
38
+ def products_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value is None:
41
+ return value
42
+
43
+ for i in value:
44
+ if i not in set(['ACCOUNTS', 'TRANSACTIONS', 'CREDIT_CARDS', 'INVESTMENTS', 'INVESTMENTS_TRANSACTIONS', 'PAYMENT_DATA', 'IDENTITY', 'BROKERAGE_NOTE', 'OPPORTUNITIES', 'PORTFOLIO', 'INCOME_REPORTS']):
45
+ raise ValueError("each list item must be one of ('ACCOUNTS', 'TRANSACTIONS', 'CREDIT_CARDS', 'INVESTMENTS', 'INVESTMENTS_TRANSACTIONS', 'PAYMENT_DATA', 'IDENTITY', 'BROKERAGE_NOTE', 'OPPORTUNITIES', 'PORTFOLIO', 'INCOME_REPORTS')")
46
+ return value
47
+
48
+ model_config = ConfigDict(
49
+ populate_by_name=True,
50
+ validate_assignment=True,
51
+ protected_namespaces=(),
52
+ )
53
+
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.model_dump(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
62
+ return json.dumps(self.to_dict())
63
+
64
+ @classmethod
65
+ def from_json(cls, json_str: str) -> Optional[Self]:
66
+ """Create an instance of UpdateItem from a JSON string"""
67
+ return cls.from_dict(json.loads(json_str))
68
+
69
+ def to_dict(self) -> Dict[str, Any]:
70
+ """Return the dictionary representation of the model using alias.
71
+
72
+ This has the following differences from calling pydantic's
73
+ `self.model_dump(by_alias=True)`:
74
+
75
+ * `None` is only added to the output dict for nullable fields that
76
+ were set at model initialization. Other fields with value `None`
77
+ are ignored.
78
+ """
79
+ excluded_fields: Set[str] = set([
80
+ ])
81
+
82
+ _dict = self.model_dump(
83
+ by_alias=True,
84
+ exclude=excluded_fields,
85
+ exclude_none=True,
86
+ )
87
+ # override the default output from pydantic by calling `to_dict()` of parameters
88
+ if self.parameters:
89
+ _dict['parameters'] = self.parameters.to_dict()
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of UpdateItem from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate({
102
+ "parameters": UpdateItemParameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None,
103
+ "clientUserId": obj.get("clientUserId"),
104
+ "webhookUrl": obj.get("webhookUrl"),
105
+ "products": obj.get("products")
106
+ })
107
+ return _obj
108
+
109
+
@@ -0,0 +1,144 @@
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 json
18
+ import pprint
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
+ from typing import Any, Dict, List, Optional
21
+ from pydantic import StrictStr, Field
22
+ from typing import Union, List, Set, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+
25
+ UPDATEITEMPARAMETERS_ONE_OF_SCHEMAS = ["object", "str"]
26
+
27
+ class UpdateItemParameters(BaseModel):
28
+ """
29
+ Parameters to update on the item stored credentials.
30
+ """
31
+ # data type: object
32
+ oneof_schema_1_validator: Optional[Dict[str, Any]] = None
33
+ # data type: str
34
+ oneof_schema_2_validator: Optional[StrictStr] = None
35
+ actual_instance: Optional[Union[object, str]] = None
36
+ one_of_schemas: Set[str] = { "object", "str" }
37
+
38
+ model_config = ConfigDict(
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def __init__(self, *args, **kwargs) -> None:
45
+ if args:
46
+ if len(args) > 1:
47
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
48
+ if kwargs:
49
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
50
+ super().__init__(actual_instance=args[0])
51
+ else:
52
+ super().__init__(**kwargs)
53
+
54
+ @field_validator('actual_instance')
55
+ def actual_instance_must_validate_oneof(cls, v):
56
+ instance = UpdateItemParameters.model_construct()
57
+ error_messages = []
58
+ match = 0
59
+ # validate data type: object
60
+ try:
61
+ instance.oneof_schema_1_validator = v
62
+ match += 1
63
+ except (ValidationError, ValueError) as e:
64
+ error_messages.append(str(e))
65
+ # validate data type: str
66
+ try:
67
+ instance.oneof_schema_2_validator = v
68
+ match += 1
69
+ except (ValidationError, ValueError) as e:
70
+ error_messages.append(str(e))
71
+ if match > 1:
72
+ # more than 1 match
73
+ raise ValueError("Multiple matches found when setting `actual_instance` in UpdateItemParameters with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
74
+ elif match == 0:
75
+ # no match
76
+ raise ValueError("No match found when setting `actual_instance` in UpdateItemParameters with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
77
+ else:
78
+ return v
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
82
+ return cls.from_json(json.dumps(obj))
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Self:
86
+ """Returns the object represented by the json string"""
87
+ instance = cls.model_construct()
88
+ error_messages = []
89
+ match = 0
90
+
91
+ # deserialize data into object
92
+ try:
93
+ # validation
94
+ instance.oneof_schema_1_validator = json.loads(json_str)
95
+ # assign value to actual_instance
96
+ instance.actual_instance = instance.oneof_schema_1_validator
97
+ match += 1
98
+ except (ValidationError, ValueError) as e:
99
+ error_messages.append(str(e))
100
+ # deserialize data into str
101
+ try:
102
+ # validation
103
+ instance.oneof_schema_2_validator = json.loads(json_str)
104
+ # assign value to actual_instance
105
+ instance.actual_instance = instance.oneof_schema_2_validator
106
+ match += 1
107
+ except (ValidationError, ValueError) as e:
108
+ error_messages.append(str(e))
109
+
110
+ if match > 1:
111
+ # more than 1 match
112
+ raise ValueError("Multiple matches found when deserializing the JSON string into UpdateItemParameters with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
113
+ elif match == 0:
114
+ # no match
115
+ raise ValueError("No match found when deserializing the JSON string into UpdateItemParameters with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
116
+ else:
117
+ return instance
118
+
119
+ def to_json(self) -> str:
120
+ """Returns the JSON representation of the actual instance"""
121
+ if self.actual_instance is None:
122
+ return "null"
123
+
124
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
125
+ return self.actual_instance.to_json()
126
+ else:
127
+ return json.dumps(self.actual_instance)
128
+
129
+ def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]:
130
+ """Returns the dict representation of the actual instance"""
131
+ if self.actual_instance is None:
132
+ return None
133
+
134
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
135
+ return self.actual_instance.to_dict()
136
+ else:
137
+ # primitive type
138
+ return self.actual_instance
139
+
140
+ def to_str(self) -> str:
141
+ """Returns the string representation of the actual instance"""
142
+ return pprint.pformat(self.model_dump())
143
+
144
+
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pluggy API
5
+
6
+ Pluggy's main API to review data and execute connectors
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: hello@pluggy.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from pluggy_sdk.models.payment_recipient_account import PaymentRecipientAccount
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class UpdatePaymentRecipient(BaseModel):
28
+ """
29
+ Request with information to update a payment recipient
30
+ """ # noqa: E501
31
+ tax_number: Optional[StrictStr] = Field(default=None, description="Account owner tax number. Can be CPF or CNPJ (only numbers)", alias="taxNumber")
32
+ name: Optional[StrictStr] = Field(default=None, description="Account owner name")
33
+ payment_institution_id: Optional[StrictStr] = Field(default=None, description="Primary identifier of the institution associated to the payment recipient", alias="paymentInstitutionId")
34
+ account: Optional[PaymentRecipientAccount] = None
35
+ is_default: Optional[StrictBool] = Field(default=None, description="Indicates if the recipient is the default one", alias="isDefault")
36
+ __properties: ClassVar[List[str]] = ["taxNumber", "name", "paymentInstitutionId", "account", "isDefault"]
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 UpdatePaymentRecipient 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
+ # override the default output from pydantic by calling `to_dict()` of account
78
+ if self.account:
79
+ _dict['account'] = self.account.to_dict()
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of UpdatePaymentRecipient from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "taxNumber": obj.get("taxNumber"),
93
+ "name": obj.get("name"),
94
+ "paymentInstitutionId": obj.get("paymentInstitutionId"),
95
+ "account": PaymentRecipientAccount.from_dict(obj["account"]) if obj.get("account") is not None else None,
96
+ "isDefault": obj.get("isDefault")
97
+ })
98
+ return _obj
99
+
100
+