pluggy-sdk 1.0.0.post17__py3-none-any.whl → 1.0.0.post19__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 (86) hide show
  1. pluggy_sdk/__init__.py +9 -1
  2. pluggy_sdk/api/__init__.py +1 -0
  3. pluggy_sdk/api/account_api.py +6 -2
  4. pluggy_sdk/api/acquirer_anticipation_api.py +6 -2
  5. pluggy_sdk/api/acquirer_receivable_api.py +6 -2
  6. pluggy_sdk/api/acquirer_sale_api.py +6 -2
  7. pluggy_sdk/api/auth_api.py +6 -2
  8. pluggy_sdk/api/benefit_api.py +6 -2
  9. pluggy_sdk/api/bill_api.py +6 -2
  10. pluggy_sdk/api/bulk_payment_api.py +9 -3
  11. pluggy_sdk/api/category_api.py +12 -4
  12. pluggy_sdk/api/connector_api.py +9 -3
  13. pluggy_sdk/api/consent_api.py +6 -2
  14. pluggy_sdk/api/identity_api.py +6 -2
  15. pluggy_sdk/api/income_report_api.py +3 -1
  16. pluggy_sdk/api/investment_api.py +9 -3
  17. pluggy_sdk/api/items_api.py +15 -5
  18. pluggy_sdk/api/loan_api.py +6 -2
  19. pluggy_sdk/api/payment_customer_api.py +15 -5
  20. pluggy_sdk/api/payment_intent_api.py +9 -3
  21. pluggy_sdk/api/payment_recipient_api.py +21 -7
  22. pluggy_sdk/api/payment_request_api.py +30 -10
  23. pluggy_sdk/api/payment_schedule_api.py +9 -3
  24. pluggy_sdk/api/portfolio_yield_api.py +6 -2
  25. pluggy_sdk/api/smart_account_api.py +18 -6
  26. pluggy_sdk/api/smart_transfer_api.py +1406 -0
  27. pluggy_sdk/api/transaction_api.py +9 -3
  28. pluggy_sdk/api/webhook_api.py +15 -5
  29. pluggy_sdk/api_client.py +20 -4
  30. pluggy_sdk/configuration.py +1 -1
  31. pluggy_sdk/models/__init__.py +7 -0
  32. pluggy_sdk/models/accounts_list200_response.py +3 -3
  33. pluggy_sdk/models/acquirer_receivable.py +3 -3
  34. pluggy_sdk/models/acquirer_sale.py +3 -3
  35. pluggy_sdk/models/acquirer_sale_data.py +3 -3
  36. pluggy_sdk/models/aggregated_portfolio_response.py +3 -3
  37. pluggy_sdk/models/benefit_response.py +3 -3
  38. pluggy_sdk/models/benefits_list200_response.py +3 -3
  39. pluggy_sdk/models/bill.py +3 -3
  40. pluggy_sdk/models/bills_list200_response.py +3 -3
  41. pluggy_sdk/models/bulk_payment.py +3 -3
  42. pluggy_sdk/models/bulk_payments_list200_response.py +3 -3
  43. pluggy_sdk/models/connector.py +3 -3
  44. pluggy_sdk/models/connector_credential.py +3 -3
  45. pluggy_sdk/models/connector_list_response.py +3 -3
  46. pluggy_sdk/models/create_item.py +3 -1
  47. pluggy_sdk/models/create_smart_transfer_payment.py +96 -0
  48. pluggy_sdk/models/create_smart_transfer_preauthorization.py +104 -0
  49. pluggy_sdk/models/identity_response.py +12 -12
  50. pluggy_sdk/models/income_reports_response.py +3 -3
  51. pluggy_sdk/models/investment.py +3 -3
  52. pluggy_sdk/models/investments_list200_response.py +3 -3
  53. pluggy_sdk/models/item_creation_error_response.py +3 -3
  54. pluggy_sdk/models/loan.py +12 -12
  55. pluggy_sdk/models/loan_installments.py +3 -3
  56. pluggy_sdk/models/loan_payment_release_over_parcel.py +6 -6
  57. pluggy_sdk/models/loan_payments.py +3 -3
  58. pluggy_sdk/models/loans_list200_response.py +3 -3
  59. pluggy_sdk/models/monthly_portfolio_response.py +3 -3
  60. pluggy_sdk/models/page_response_acquirer_anticipations.py +3 -3
  61. pluggy_sdk/models/page_response_acquirer_receivables.py +3 -3
  62. pluggy_sdk/models/page_response_acquirer_sales.py +3 -3
  63. pluggy_sdk/models/page_response_category_rules.py +3 -3
  64. pluggy_sdk/models/page_response_consents.py +3 -3
  65. pluggy_sdk/models/page_response_investment_transactions.py +3 -3
  66. pluggy_sdk/models/page_response_transactions.py +3 -3
  67. pluggy_sdk/models/parameter_validation_response.py +3 -3
  68. pluggy_sdk/models/payment_customers_list200_response.py +3 -3
  69. pluggy_sdk/models/payment_intents_list200_response.py +3 -3
  70. pluggy_sdk/models/payment_recipients_institution_list200_response.py +3 -3
  71. pluggy_sdk/models/payment_recipients_list200_response.py +3 -3
  72. pluggy_sdk/models/payment_request_receipt_list200_response.py +3 -3
  73. pluggy_sdk/models/payment_requests_list200_response.py +3 -3
  74. pluggy_sdk/models/payment_schedules_list200_response.py +3 -3
  75. pluggy_sdk/models/smart_accounts_list200_response.py +3 -3
  76. pluggy_sdk/models/smart_tranfers_preauthorizations_list200_response.py +102 -0
  77. pluggy_sdk/models/smart_transfer_callback_urls.py +90 -0
  78. pluggy_sdk/models/smart_transfer_payment.py +116 -0
  79. pluggy_sdk/models/smart_transfer_preauthorization.py +128 -0
  80. pluggy_sdk/models/smart_transfer_preauthorization_parameter.py +90 -0
  81. pluggy_sdk/models/status_detail_product.py +3 -3
  82. pluggy_sdk/models/webhooks_list200_response.py +3 -3
  83. {pluggy_sdk-1.0.0.post17.dist-info → pluggy_sdk-1.0.0.post19.dist-info}/METADATA +15 -3
  84. {pluggy_sdk-1.0.0.post17.dist-info → pluggy_sdk-1.0.0.post19.dist-info}/RECORD +86 -78
  85. {pluggy_sdk-1.0.0.post17.dist-info → pluggy_sdk-1.0.0.post19.dist-info}/WHEEL +1 -1
  86. {pluggy_sdk-1.0.0.post17.dist-info → pluggy_sdk-1.0.0.post19.dist-info}/top_level.txt +0 -0
@@ -316,7 +316,9 @@ class TransactionApi:
316
316
  _query_params: List[Tuple[str, str]] = []
317
317
  _header_params: Dict[str, Optional[str]] = _headers or {}
318
318
  _form_params: List[Tuple[str, str]] = []
319
- _files: Dict[str, Union[str, bytes]] = {}
319
+ _files: Dict[
320
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
321
+ ] = {}
320
322
  _body_params: Optional[bytes] = None
321
323
 
322
324
  # process the path parameters
@@ -617,7 +619,9 @@ class TransactionApi:
617
619
  _query_params: List[Tuple[str, str]] = []
618
620
  _header_params: Dict[str, Optional[str]] = _headers or {}
619
621
  _form_params: List[Tuple[str, str]] = []
620
- _files: Dict[str, Union[str, bytes]] = {}
622
+ _files: Dict[
623
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
624
+ ] = {}
621
625
  _body_params: Optional[bytes] = None
622
626
 
623
627
  # process the path parameters
@@ -898,7 +902,9 @@ class TransactionApi:
898
902
  _query_params: List[Tuple[str, str]] = []
899
903
  _header_params: Dict[str, Optional[str]] = _headers or {}
900
904
  _form_params: List[Tuple[str, str]] = []
901
- _files: Dict[str, Union[str, bytes]] = {}
905
+ _files: Dict[
906
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
907
+ ] = {}
902
908
  _body_params: Optional[bytes] = None
903
909
 
904
910
  # process the path parameters
@@ -263,7 +263,9 @@ class WebhookApi:
263
263
  _query_params: List[Tuple[str, str]] = []
264
264
  _header_params: Dict[str, Optional[str]] = _headers or {}
265
265
  _form_params: List[Tuple[str, str]] = []
266
- _files: Dict[str, Union[str, bytes]] = {}
266
+ _files: Dict[
267
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
268
+ ] = {}
267
269
  _body_params: Optional[bytes] = None
268
270
 
269
271
  # process the path parameters
@@ -541,7 +543,9 @@ class WebhookApi:
541
543
  _query_params: List[Tuple[str, str]] = []
542
544
  _header_params: Dict[str, Optional[str]] = _headers or {}
543
545
  _form_params: List[Tuple[str, str]] = []
544
- _files: Dict[str, Union[str, bytes]] = {}
546
+ _files: Dict[
547
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
548
+ ] = {}
545
549
  _body_params: Optional[bytes] = None
546
550
 
547
551
  # process the path parameters
@@ -793,7 +797,9 @@ class WebhookApi:
793
797
  _query_params: List[Tuple[str, str]] = []
794
798
  _header_params: Dict[str, Optional[str]] = _headers or {}
795
799
  _form_params: List[Tuple[str, str]] = []
796
- _files: Dict[str, Union[str, bytes]] = {}
800
+ _files: Dict[
801
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
802
+ ] = {}
797
803
  _body_params: Optional[bytes] = None
798
804
 
799
805
  # process the path parameters
@@ -1056,7 +1062,9 @@ class WebhookApi:
1056
1062
  _query_params: List[Tuple[str, str]] = []
1057
1063
  _header_params: Dict[str, Optional[str]] = _headers or {}
1058
1064
  _form_params: List[Tuple[str, str]] = []
1059
- _files: Dict[str, Union[str, bytes]] = {}
1065
+ _files: Dict[
1066
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1067
+ ] = {}
1060
1068
  _body_params: Optional[bytes] = None
1061
1069
 
1062
1070
  # process the path parameters
@@ -1337,7 +1345,9 @@ class WebhookApi:
1337
1345
  _query_params: List[Tuple[str, str]] = []
1338
1346
  _header_params: Dict[str, Optional[str]] = _headers or {}
1339
1347
  _form_params: List[Tuple[str, str]] = []
1340
- _files: Dict[str, Union[str, bytes]] = {}
1348
+ _files: Dict[
1349
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1350
+ ] = {}
1341
1351
  _body_params: Optional[bytes] = None
1342
1352
 
1343
1353
  # process the path parameters
pluggy_sdk/api_client.py CHANGED
@@ -16,6 +16,7 @@
16
16
  import datetime
17
17
  from dateutil.parser import parse
18
18
  from enum import Enum
19
+ import decimal
19
20
  import json
20
21
  import mimetypes
21
22
  import os
@@ -67,6 +68,7 @@ class ApiClient:
67
68
  'bool': bool,
68
69
  'date': datetime.date,
69
70
  'datetime': datetime.datetime,
71
+ 'decimal': decimal.Decimal,
70
72
  'object': object,
71
73
  }
72
74
  _pool = None
@@ -89,7 +91,7 @@ class ApiClient:
89
91
  self.default_headers[header_name] = header_value
90
92
  self.cookie = cookie
91
93
  # Set default User-Agent.
92
- self.user_agent = 'OpenAPI-Generator/1.0.0.post17/python'
94
+ self.user_agent = 'OpenAPI-Generator/1.0.0.post19/python'
93
95
  self.client_side_validation = configuration.client_side_validation
94
96
 
95
97
  def __enter__(self):
@@ -339,6 +341,7 @@ class ApiClient:
339
341
  If obj is str, int, long, float, bool, return directly.
340
342
  If obj is datetime.datetime, datetime.date
341
343
  convert to string in iso8601 format.
344
+ If obj is decimal.Decimal return string representation.
342
345
  If obj is list, sanitize each element in the list.
343
346
  If obj is dict, return the dict.
344
347
  If obj is OpenAPI model, return the properties dict.
@@ -364,6 +367,8 @@ class ApiClient:
364
367
  )
365
368
  elif isinstance(obj, (datetime.datetime, datetime.date)):
366
369
  return obj.isoformat()
370
+ elif isinstance(obj, decimal.Decimal):
371
+ return str(obj)
367
372
 
368
373
  elif isinstance(obj, dict):
369
374
  obj_dict = obj
@@ -400,12 +405,12 @@ class ApiClient:
400
405
  data = json.loads(response_text)
401
406
  except ValueError:
402
407
  data = response_text
403
- elif content_type.startswith("application/json"):
408
+ elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
404
409
  if response_text == "":
405
410
  data = ""
406
411
  else:
407
412
  data = json.loads(response_text)
408
- elif content_type.startswith("text/plain"):
413
+ elif re.match(r'^text/plain\s*(;|$)', content_type, re.IGNORECASE):
409
414
  data = response_text
410
415
  else:
411
416
  raise ApiException(
@@ -455,6 +460,8 @@ class ApiClient:
455
460
  return self.__deserialize_date(data)
456
461
  elif klass == datetime.datetime:
457
462
  return self.__deserialize_datetime(data)
463
+ elif klass == decimal.Decimal:
464
+ return decimal.Decimal(data)
458
465
  elif issubclass(klass, Enum):
459
466
  return self.__deserialize_enum(data, klass)
460
467
  else:
@@ -529,7 +536,10 @@ class ApiClient:
529
536
 
530
537
  return "&".join(["=".join(map(str, item)) for item in new_params])
531
538
 
532
- def files_parameters(self, files: Dict[str, Union[str, bytes]]):
539
+ def files_parameters(
540
+ self,
541
+ files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
542
+ ):
533
543
  """Builds form parameters.
534
544
 
535
545
  :param files: File parameters.
@@ -544,6 +554,12 @@ class ApiClient:
544
554
  elif isinstance(v, bytes):
545
555
  filename = k
546
556
  filedata = v
557
+ elif isinstance(v, tuple):
558
+ filename, filedata = v
559
+ elif isinstance(v, list):
560
+ for file_param in v:
561
+ params.extend(self.files_parameters({k: file_param}))
562
+ continue
547
563
  else:
548
564
  raise ValueError("Unsupported file value")
549
565
  mimetype = (
@@ -414,7 +414,7 @@ conf = pluggy_sdk.Configuration(
414
414
  "OS: {env}\n"\
415
415
  "Python Version: {pyversion}\n"\
416
416
  "Version of the API: 1.0.0\n"\
417
- "SDK Package Version: 1.0.0.post17".\
417
+ "SDK Package Version: 1.0.0.post19".\
418
418
  format(env=sys.platform, pyversion=sys.version)
419
419
 
420
420
  def get_host_settings(self):
@@ -75,6 +75,8 @@ from pluggy_sdk.models.create_payment_request import CreatePaymentRequest
75
75
  from pluggy_sdk.models.create_pix_qr_payment_request import CreatePixQrPaymentRequest
76
76
  from pluggy_sdk.models.create_smart_account_request import CreateSmartAccountRequest
77
77
  from pluggy_sdk.models.create_smart_account_transfer_request import CreateSmartAccountTransferRequest
78
+ from pluggy_sdk.models.create_smart_transfer_payment import CreateSmartTransferPayment
79
+ from pluggy_sdk.models.create_smart_transfer_preauthorization import CreateSmartTransferPreauthorization
78
80
  from pluggy_sdk.models.create_webhook import CreateWebhook
79
81
  from pluggy_sdk.models.credential_select_option import CredentialSelectOption
80
82
  from pluggy_sdk.models.credit_card_metadata import CreditCardMetadata
@@ -156,6 +158,11 @@ from pluggy_sdk.models.smart_account_address import SmartAccountAddress
156
158
  from pluggy_sdk.models.smart_account_balance import SmartAccountBalance
157
159
  from pluggy_sdk.models.smart_account_transfer import SmartAccountTransfer
158
160
  from pluggy_sdk.models.smart_accounts_list200_response import SmartAccountsList200Response
161
+ from pluggy_sdk.models.smart_tranfers_preauthorizations_list200_response import SmartTranfersPreauthorizationsList200Response
162
+ from pluggy_sdk.models.smart_transfer_callback_urls import SmartTransferCallbackUrls
163
+ from pluggy_sdk.models.smart_transfer_payment import SmartTransferPayment
164
+ from pluggy_sdk.models.smart_transfer_preauthorization import SmartTransferPreauthorization
165
+ from pluggy_sdk.models.smart_transfer_preauthorization_parameter import SmartTransferPreauthorizationParameter
159
166
  from pluggy_sdk.models.status_detail import StatusDetail
160
167
  from pluggy_sdk.models.status_detail_product import StatusDetailProduct
161
168
  from pluggy_sdk.models.status_detail_product_warning import StatusDetailProductWarning
@@ -76,9 +76,9 @@ class AccountsList200Response(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
77
  _items = []
78
78
  if self.results:
79
- for _item in self.results:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
82
  _dict['results'] = _items
83
83
  return _dict
84
84
 
@@ -109,9 +109,9 @@ class AcquirerReceivable(BaseModel):
109
109
  # override the default output from pydantic by calling `to_dict()` of each item in related_sales (list)
110
110
  _items = []
111
111
  if self.related_sales:
112
- for _item in self.related_sales:
113
- if _item:
114
- _items.append(_item.to_dict())
112
+ for _item_related_sales in self.related_sales:
113
+ if _item_related_sales:
114
+ _items.append(_item_related_sales.to_dict())
115
115
  _dict['relatedSales'] = _items
116
116
  return _dict
117
117
 
@@ -131,9 +131,9 @@ class AcquirerSale(BaseModel):
131
131
  # override the default output from pydantic by calling `to_dict()` of each item in installments (list)
132
132
  _items = []
133
133
  if self.installments:
134
- for _item in self.installments:
135
- if _item:
136
- _items.append(_item.to_dict())
134
+ for _item_installments in self.installments:
135
+ if _item_installments:
136
+ _items.append(_item_installments.to_dict())
137
137
  _dict['installments'] = _items
138
138
  return _dict
139
139
 
@@ -115,9 +115,9 @@ class AcquirerSaleData(BaseModel):
115
115
  # override the default output from pydantic by calling `to_dict()` of each item in installments (list)
116
116
  _items = []
117
117
  if self.installments:
118
- for _item in self.installments:
119
- if _item:
120
- _items.append(_item.to_dict())
118
+ for _item_installments in self.installments:
119
+ if _item_installments:
120
+ _items.append(_item_installments.to_dict())
121
121
  _dict['installments'] = _items
122
122
  return _dict
123
123
 
@@ -76,9 +76,9 @@ class AggregatedPortfolioResponse(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
77
  _items = []
78
78
  if self.results:
79
- for _item in self.results:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
82
  _dict['results'] = _items
83
83
  return _dict
84
84
 
@@ -86,9 +86,9 @@ class BenefitResponse(BaseModel):
86
86
  # override the default output from pydantic by calling `to_dict()` of each item in loans (list)
87
87
  _items = []
88
88
  if self.loans:
89
- for _item in self.loans:
90
- if _item:
91
- _items.append(_item.to_dict())
89
+ for _item_loans in self.loans:
90
+ if _item_loans:
91
+ _items.append(_item_loans.to_dict())
92
92
  _dict['loans'] = _items
93
93
  return _dict
94
94
 
@@ -76,9 +76,9 @@ class BenefitsList200Response(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
77
  _items = []
78
78
  if self.results:
79
- for _item in self.results:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
82
  _dict['results'] = _items
83
83
  return _dict
84
84
 
pluggy_sdk/models/bill.py CHANGED
@@ -80,9 +80,9 @@ class Bill(BaseModel):
80
80
  # override the default output from pydantic by calling `to_dict()` of each item in finance_charges (list)
81
81
  _items = []
82
82
  if self.finance_charges:
83
- for _item in self.finance_charges:
84
- if _item:
85
- _items.append(_item.to_dict())
83
+ for _item_finance_charges in self.finance_charges:
84
+ if _item_finance_charges:
85
+ _items.append(_item_finance_charges.to_dict())
86
86
  _dict['financeCharges'] = _items
87
87
  return _dict
88
88
 
@@ -76,9 +76,9 @@ class BillsList200Response(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
77
  _items = []
78
78
  if self.results:
79
- for _item in self.results:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
82
  _dict['results'] = _items
83
83
  return _dict
84
84
 
@@ -94,9 +94,9 @@ class BulkPayment(BaseModel):
94
94
  # override the default output from pydantic by calling `to_dict()` of each item in payment_requests (list)
95
95
  _items = []
96
96
  if self.payment_requests:
97
- for _item in self.payment_requests:
98
- if _item:
99
- _items.append(_item.to_dict())
97
+ for _item_payment_requests in self.payment_requests:
98
+ if _item_payment_requests:
99
+ _items.append(_item_payment_requests.to_dict())
100
100
  _dict['paymentRequests'] = _items
101
101
  # override the default output from pydantic by calling `to_dict()` of smart_account
102
102
  if self.smart_account:
@@ -76,9 +76,9 @@ class BulkPaymentsList200Response(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
77
  _items = []
78
78
  if self.results:
79
- for _item in self.results:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
82
  _dict['results'] = _items
83
83
  return _dict
84
84
 
@@ -102,9 +102,9 @@ class Connector(BaseModel):
102
102
  # override the default output from pydantic by calling `to_dict()` of each item in credentials (list)
103
103
  _items = []
104
104
  if self.credentials:
105
- for _item in self.credentials:
106
- if _item:
107
- _items.append(_item.to_dict())
105
+ for _item_credentials in self.credentials:
106
+ if _item_credentials:
107
+ _items.append(_item_credentials.to_dict())
108
108
  _dict['credentials'] = _items
109
109
  # override the default output from pydantic by calling `to_dict()` of health
110
110
  if self.health:
@@ -89,9 +89,9 @@ class ConnectorCredential(BaseModel):
89
89
  # override the default output from pydantic by calling `to_dict()` of each item in options (list)
90
90
  _items = []
91
91
  if self.options:
92
- for _item in self.options:
93
- if _item:
94
- _items.append(_item.to_dict())
92
+ for _item_options in self.options:
93
+ if _item_options:
94
+ _items.append(_item_options.to_dict())
95
95
  _dict['options'] = _items
96
96
  return _dict
97
97
 
@@ -76,9 +76,9 @@ class ConnectorListResponse(BaseModel):
76
76
  # override the default output from pydantic by calling `to_dict()` of each item in results (list)
77
77
  _items = []
78
78
  if self.results:
79
- for _item in self.results:
80
- if _item:
81
- _items.append(_item.to_dict())
79
+ for _item_results in self.results:
80
+ if _item_results:
81
+ _items.append(_item_results.to_dict())
82
82
  _dict['results'] = _items
83
83
  return _dict
84
84
 
@@ -32,8 +32,9 @@ class CreateItem(BaseModel):
32
32
  parameters: CreateItemParameters
33
33
  webhook_url: Optional[StrictStr] = Field(default=None, description="Url to be notified of item changes", alias="webhookUrl")
34
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")
35
+ oauth_redirect_uri: Optional[StrictStr] = Field(default=None, description="Redirect URI required for the Oauth flow", alias="oauthRedirectUri")
35
36
  products: Optional[List[StrictStr]] = Field(default=None, description="Products to be collected in the connection")
36
- __properties: ClassVar[List[str]] = ["connectorId", "parameters", "webhookUrl", "clientUserId", "products"]
37
+ __properties: ClassVar[List[str]] = ["connectorId", "parameters", "webhookUrl", "clientUserId", "oauthRedirectUri", "products"]
37
38
 
38
39
  @field_validator('products')
39
40
  def products_validate_enum(cls, value):
@@ -104,6 +105,7 @@ class CreateItem(BaseModel):
104
105
  "parameters": CreateItemParameters.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None,
105
106
  "webhookUrl": obj.get("webhookUrl"),
106
107
  "clientUserId": obj.get("clientUserId"),
108
+ "oauthRedirectUri": obj.get("oauthRedirectUri"),
107
109
  "products": obj.get("products")
108
110
  })
109
111
  return _obj
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Pluggy API
5
+
6
+ Pluggy's main API to review data and execute connectors
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: hello@pluggy.ai
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateSmartTransferPayment(BaseModel):
27
+ """
28
+ Create smart transfer payment request data
29
+ """ # noqa: E501
30
+ preauthorization_id: StrictStr = Field(description="Primary identifier of the preauthorization", alias="preauthorizationId")
31
+ recipient_id: StrictStr = Field(description="Primary identifier of the paymen recipient", alias="recipientId")
32
+ amount: Union[StrictFloat, StrictInt] = Field(description="Payment amount")
33
+ description: Optional[StrictStr] = Field(default=None, description="Payment description")
34
+ client_payment_id: Optional[StrictStr] = Field(default=None, description="Client payment identifier", alias="clientPaymentId")
35
+ __properties: ClassVar[List[str]] = ["preauthorizationId", "recipientId", "amount", "description", "clientPaymentId"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of CreateSmartTransferPayment from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of CreateSmartTransferPayment from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "preauthorizationId": obj.get("preauthorizationId"),
89
+ "recipientId": obj.get("recipientId"),
90
+ "amount": obj.get("amount"),
91
+ "description": obj.get("description"),
92
+ "clientPaymentId": obj.get("clientPaymentId")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,104 @@
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 pluggy_sdk.models.smart_transfer_callback_urls import SmartTransferCallbackUrls
24
+ from pluggy_sdk.models.smart_transfer_preauthorization_parameter import SmartTransferPreauthorizationParameter
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class CreateSmartTransferPreauthorization(BaseModel):
29
+ """
30
+ Create smart transfer preauthorization request data
31
+ """ # noqa: E501
32
+ connector_id: StrictStr = Field(description="Primary identifier of the connector", alias="connectorId")
33
+ parameters: SmartTransferPreauthorizationParameter
34
+ recipient_ids: List[StrictStr] = Field(alias="recipientIds")
35
+ callback_urls: Optional[SmartTransferCallbackUrls] = Field(default=None, alias="callbackUrls")
36
+ client_preauthorization_id: Optional[StrictStr] = Field(default=None, description="Client preauthorization identifier", alias="clientPreauthorizationId")
37
+ __properties: ClassVar[List[str]] = ["connectorId", "parameters", "recipientIds", "callbackUrls", "clientPreauthorizationId"]
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 CreateSmartTransferPreauthorization 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 parameters
79
+ if self.parameters:
80
+ _dict['parameters'] = self.parameters.to_dict()
81
+ # override the default output from pydantic by calling `to_dict()` of callback_urls
82
+ if self.callback_urls:
83
+ _dict['callbackUrls'] = self.callback_urls.to_dict()
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of CreateSmartTransferPreauthorization 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
+ "connectorId": obj.get("connectorId"),
97
+ "parameters": SmartTransferPreauthorizationParameter.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None,
98
+ "recipientIds": obj.get("recipientIds"),
99
+ "callbackUrls": SmartTransferCallbackUrls.from_dict(obj["callbackUrls"]) if obj.get("callbackUrls") is not None else None,
100
+ "clientPreauthorizationId": obj.get("clientPreauthorizationId")
101
+ })
102
+ return _obj
103
+
104
+