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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1940,6 +1940,270 @@ class PaymentRequestApi:
1940
1940
 
1941
1941
 
1942
1942
 
1943
+ @validate_call
1944
+ def payment_request_refund(
1945
+ self,
1946
+ id: Annotated[StrictStr, Field(description="Payment request primary identifier")],
1947
+ _request_timeout: Union[
1948
+ None,
1949
+ Annotated[StrictFloat, Field(gt=0)],
1950
+ Tuple[
1951
+ Annotated[StrictFloat, Field(gt=0)],
1952
+ Annotated[StrictFloat, Field(gt=0)]
1953
+ ]
1954
+ ] = None,
1955
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1956
+ _content_type: Optional[StrictStr] = None,
1957
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1958
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1959
+ ) -> None:
1960
+ """Refund Payment Request
1961
+
1962
+ Refund a COMPLETED payment request payed using payment method PIX. Not available for Payment Initiation (PIS)
1963
+
1964
+ :param id: Payment request primary identifier (required)
1965
+ :type id: str
1966
+ :param _request_timeout: timeout setting for this request. If one
1967
+ number provided, it will be total request
1968
+ timeout. It can also be a pair (tuple) of
1969
+ (connection, read) timeouts.
1970
+ :type _request_timeout: int, tuple(int, int), optional
1971
+ :param _request_auth: set to override the auth_settings for an a single
1972
+ request; this effectively ignores the
1973
+ authentication in the spec for a single request.
1974
+ :type _request_auth: dict, optional
1975
+ :param _content_type: force content-type for the request.
1976
+ :type _content_type: str, Optional
1977
+ :param _headers: set to override the headers for a single
1978
+ request; this effectively ignores the headers
1979
+ in the spec for a single request.
1980
+ :type _headers: dict, optional
1981
+ :param _host_index: set to override the host_index for a single
1982
+ request; this effectively ignores the host_index
1983
+ in the spec for a single request.
1984
+ :type _host_index: int, optional
1985
+ :return: Returns the result object.
1986
+ """ # noqa: E501
1987
+
1988
+ _param = self._payment_request_refund_serialize(
1989
+ id=id,
1990
+ _request_auth=_request_auth,
1991
+ _content_type=_content_type,
1992
+ _headers=_headers,
1993
+ _host_index=_host_index
1994
+ )
1995
+
1996
+ _response_types_map: Dict[str, Optional[str]] = {
1997
+ '200': None,
1998
+ '404': "GlobalErrorResponse",
1999
+ }
2000
+ response_data = self.api_client.call_api(
2001
+ *_param,
2002
+ _request_timeout=_request_timeout
2003
+ )
2004
+ response_data.read()
2005
+ return self.api_client.response_deserialize(
2006
+ response_data=response_data,
2007
+ response_types_map=_response_types_map,
2008
+ ).data
2009
+
2010
+
2011
+ @validate_call
2012
+ def payment_request_refund_with_http_info(
2013
+ self,
2014
+ id: Annotated[StrictStr, Field(description="Payment request primary identifier")],
2015
+ _request_timeout: Union[
2016
+ None,
2017
+ Annotated[StrictFloat, Field(gt=0)],
2018
+ Tuple[
2019
+ Annotated[StrictFloat, Field(gt=0)],
2020
+ Annotated[StrictFloat, Field(gt=0)]
2021
+ ]
2022
+ ] = None,
2023
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2024
+ _content_type: Optional[StrictStr] = None,
2025
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2026
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2027
+ ) -> ApiResponse[None]:
2028
+ """Refund Payment Request
2029
+
2030
+ Refund a COMPLETED payment request payed using payment method PIX. Not available for Payment Initiation (PIS)
2031
+
2032
+ :param id: Payment request primary identifier (required)
2033
+ :type id: str
2034
+ :param _request_timeout: timeout setting for this request. If one
2035
+ number provided, it will be total request
2036
+ timeout. It can also be a pair (tuple) of
2037
+ (connection, read) timeouts.
2038
+ :type _request_timeout: int, tuple(int, int), optional
2039
+ :param _request_auth: set to override the auth_settings for an a single
2040
+ request; this effectively ignores the
2041
+ authentication in the spec for a single request.
2042
+ :type _request_auth: dict, optional
2043
+ :param _content_type: force content-type for the request.
2044
+ :type _content_type: str, Optional
2045
+ :param _headers: set to override the headers for a single
2046
+ request; this effectively ignores the headers
2047
+ in the spec for a single request.
2048
+ :type _headers: dict, optional
2049
+ :param _host_index: set to override the host_index for a single
2050
+ request; this effectively ignores the host_index
2051
+ in the spec for a single request.
2052
+ :type _host_index: int, optional
2053
+ :return: Returns the result object.
2054
+ """ # noqa: E501
2055
+
2056
+ _param = self._payment_request_refund_serialize(
2057
+ id=id,
2058
+ _request_auth=_request_auth,
2059
+ _content_type=_content_type,
2060
+ _headers=_headers,
2061
+ _host_index=_host_index
2062
+ )
2063
+
2064
+ _response_types_map: Dict[str, Optional[str]] = {
2065
+ '200': None,
2066
+ '404': "GlobalErrorResponse",
2067
+ }
2068
+ response_data = self.api_client.call_api(
2069
+ *_param,
2070
+ _request_timeout=_request_timeout
2071
+ )
2072
+ response_data.read()
2073
+ return self.api_client.response_deserialize(
2074
+ response_data=response_data,
2075
+ response_types_map=_response_types_map,
2076
+ )
2077
+
2078
+
2079
+ @validate_call
2080
+ def payment_request_refund_without_preload_content(
2081
+ self,
2082
+ id: Annotated[StrictStr, Field(description="Payment request primary identifier")],
2083
+ _request_timeout: Union[
2084
+ None,
2085
+ Annotated[StrictFloat, Field(gt=0)],
2086
+ Tuple[
2087
+ Annotated[StrictFloat, Field(gt=0)],
2088
+ Annotated[StrictFloat, Field(gt=0)]
2089
+ ]
2090
+ ] = None,
2091
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2092
+ _content_type: Optional[StrictStr] = None,
2093
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2094
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2095
+ ) -> RESTResponseType:
2096
+ """Refund Payment Request
2097
+
2098
+ Refund a COMPLETED payment request payed using payment method PIX. Not available for Payment Initiation (PIS)
2099
+
2100
+ :param id: Payment request primary identifier (required)
2101
+ :type id: str
2102
+ :param _request_timeout: timeout setting for this request. If one
2103
+ number provided, it will be total request
2104
+ timeout. It can also be a pair (tuple) of
2105
+ (connection, read) timeouts.
2106
+ :type _request_timeout: int, tuple(int, int), optional
2107
+ :param _request_auth: set to override the auth_settings for an a single
2108
+ request; this effectively ignores the
2109
+ authentication in the spec for a single request.
2110
+ :type _request_auth: dict, optional
2111
+ :param _content_type: force content-type for the request.
2112
+ :type _content_type: str, Optional
2113
+ :param _headers: set to override the headers for a single
2114
+ request; this effectively ignores the headers
2115
+ in the spec for a single request.
2116
+ :type _headers: dict, optional
2117
+ :param _host_index: set to override the host_index for a single
2118
+ request; this effectively ignores the host_index
2119
+ in the spec for a single request.
2120
+ :type _host_index: int, optional
2121
+ :return: Returns the result object.
2122
+ """ # noqa: E501
2123
+
2124
+ _param = self._payment_request_refund_serialize(
2125
+ id=id,
2126
+ _request_auth=_request_auth,
2127
+ _content_type=_content_type,
2128
+ _headers=_headers,
2129
+ _host_index=_host_index
2130
+ )
2131
+
2132
+ _response_types_map: Dict[str, Optional[str]] = {
2133
+ '200': None,
2134
+ '404': "GlobalErrorResponse",
2135
+ }
2136
+ response_data = self.api_client.call_api(
2137
+ *_param,
2138
+ _request_timeout=_request_timeout
2139
+ )
2140
+ return response_data.response
2141
+
2142
+
2143
+ def _payment_request_refund_serialize(
2144
+ self,
2145
+ id,
2146
+ _request_auth,
2147
+ _content_type,
2148
+ _headers,
2149
+ _host_index,
2150
+ ) -> RequestSerialized:
2151
+
2152
+ _host = None
2153
+
2154
+ _collection_formats: Dict[str, str] = {
2155
+ }
2156
+
2157
+ _path_params: Dict[str, str] = {}
2158
+ _query_params: List[Tuple[str, str]] = []
2159
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2160
+ _form_params: List[Tuple[str, str]] = []
2161
+ _files: Dict[
2162
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2163
+ ] = {}
2164
+ _body_params: Optional[bytes] = None
2165
+
2166
+ # process the path parameters
2167
+ if id is not None:
2168
+ _path_params['id'] = id
2169
+ # process the query parameters
2170
+ # process the header parameters
2171
+ # process the form parameters
2172
+ # process the body parameter
2173
+
2174
+
2175
+ # set the HTTP header `Accept`
2176
+ if 'Accept' not in _header_params:
2177
+ _header_params['Accept'] = self.api_client.select_header_accept(
2178
+ [
2179
+ 'application/json'
2180
+ ]
2181
+ )
2182
+
2183
+
2184
+ # authentication setting
2185
+ _auth_settings: List[str] = [
2186
+ 'default'
2187
+ ]
2188
+
2189
+ return self.api_client.param_serialize(
2190
+ method='POST',
2191
+ resource_path='/payments/requests/{id}/refund',
2192
+ path_params=_path_params,
2193
+ query_params=_query_params,
2194
+ header_params=_header_params,
2195
+ body=_body_params,
2196
+ post_params=_form_params,
2197
+ files=_files,
2198
+ auth_settings=_auth_settings,
2199
+ collection_formats=_collection_formats,
2200
+ _host=_host,
2201
+ _request_auth=_request_auth
2202
+ )
2203
+
2204
+
2205
+
2206
+
1943
2207
  @validate_call
1944
2208
  def payment_request_retrieve(
1945
2209
  self,
@@ -50,8 +50,10 @@ class TransactionApi:
50
50
  ids: Annotated[Optional[List[StrictStr]], Field(description="Array of transaction identifiers. If defined, 'from' and 'to' parameters will be discarded")] = None,
51
51
  var_from: Annotated[Optional[datetime], Field(description="Filter greater than date. Format (yyyy-mm-dd)")] = None,
52
52
  to: Annotated[Optional[datetime], Field(description="Filter lower than date. Format (yyyy-mm-dd)")] = None,
53
- page_size: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page size for the paging request, default: 20")] = None,
53
+ page_size: Annotated[Optional[Union[Annotated[float, Field(le=500, strict=True, ge=1)], Annotated[int, Field(le=500, strict=True, ge=1)]]], Field(description="Page size for the paging request, default: 20")] = None,
54
54
  page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number for the paging request, default: 1")] = None,
55
+ bill_id: Annotated[Optional[StrictStr], Field(description="Credit Card Bill's primary identifier, if account is a credit card.")] = None,
56
+ created_at_from: Annotated[Optional[datetime], Field(description="Filter greater than createdAt. Format (yyyy-mm-ddThh:mm:ss.000Z)")] = None,
55
57
  _request_timeout: Union[
56
58
  None,
57
59
  Annotated[StrictFloat, Field(gt=0)],
@@ -81,6 +83,10 @@ class TransactionApi:
81
83
  :type page_size: float
82
84
  :param page: Page number for the paging request, default: 1
83
85
  :type page: float
86
+ :param bill_id: Credit Card Bill's primary identifier, if account is a credit card.
87
+ :type bill_id: str
88
+ :param created_at_from: Filter greater than createdAt. Format (yyyy-mm-ddThh:mm:ss.000Z)
89
+ :type created_at_from: datetime
84
90
  :param _request_timeout: timeout setting for this request. If one
85
91
  number provided, it will be total request
86
92
  timeout. It can also be a pair (tuple) of
@@ -110,6 +116,8 @@ class TransactionApi:
110
116
  to=to,
111
117
  page_size=page_size,
112
118
  page=page,
119
+ bill_id=bill_id,
120
+ created_at_from=created_at_from,
113
121
  _request_auth=_request_auth,
114
122
  _content_type=_content_type,
115
123
  _headers=_headers,
@@ -139,8 +147,10 @@ class TransactionApi:
139
147
  ids: Annotated[Optional[List[StrictStr]], Field(description="Array of transaction identifiers. If defined, 'from' and 'to' parameters will be discarded")] = None,
140
148
  var_from: Annotated[Optional[datetime], Field(description="Filter greater than date. Format (yyyy-mm-dd)")] = None,
141
149
  to: Annotated[Optional[datetime], Field(description="Filter lower than date. Format (yyyy-mm-dd)")] = None,
142
- page_size: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page size for the paging request, default: 20")] = None,
150
+ page_size: Annotated[Optional[Union[Annotated[float, Field(le=500, strict=True, ge=1)], Annotated[int, Field(le=500, strict=True, ge=1)]]], Field(description="Page size for the paging request, default: 20")] = None,
143
151
  page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number for the paging request, default: 1")] = None,
152
+ bill_id: Annotated[Optional[StrictStr], Field(description="Credit Card Bill's primary identifier, if account is a credit card.")] = None,
153
+ created_at_from: Annotated[Optional[datetime], Field(description="Filter greater than createdAt. Format (yyyy-mm-ddThh:mm:ss.000Z)")] = None,
144
154
  _request_timeout: Union[
145
155
  None,
146
156
  Annotated[StrictFloat, Field(gt=0)],
@@ -170,6 +180,10 @@ class TransactionApi:
170
180
  :type page_size: float
171
181
  :param page: Page number for the paging request, default: 1
172
182
  :type page: float
183
+ :param bill_id: Credit Card Bill's primary identifier, if account is a credit card.
184
+ :type bill_id: str
185
+ :param created_at_from: Filter greater than createdAt. Format (yyyy-mm-ddThh:mm:ss.000Z)
186
+ :type created_at_from: datetime
173
187
  :param _request_timeout: timeout setting for this request. If one
174
188
  number provided, it will be total request
175
189
  timeout. It can also be a pair (tuple) of
@@ -199,6 +213,8 @@ class TransactionApi:
199
213
  to=to,
200
214
  page_size=page_size,
201
215
  page=page,
216
+ bill_id=bill_id,
217
+ created_at_from=created_at_from,
202
218
  _request_auth=_request_auth,
203
219
  _content_type=_content_type,
204
220
  _headers=_headers,
@@ -228,8 +244,10 @@ class TransactionApi:
228
244
  ids: Annotated[Optional[List[StrictStr]], Field(description="Array of transaction identifiers. If defined, 'from' and 'to' parameters will be discarded")] = None,
229
245
  var_from: Annotated[Optional[datetime], Field(description="Filter greater than date. Format (yyyy-mm-dd)")] = None,
230
246
  to: Annotated[Optional[datetime], Field(description="Filter lower than date. Format (yyyy-mm-dd)")] = None,
231
- page_size: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page size for the paging request, default: 20")] = None,
247
+ page_size: Annotated[Optional[Union[Annotated[float, Field(le=500, strict=True, ge=1)], Annotated[int, Field(le=500, strict=True, ge=1)]]], Field(description="Page size for the paging request, default: 20")] = None,
232
248
  page: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Page number for the paging request, default: 1")] = None,
249
+ bill_id: Annotated[Optional[StrictStr], Field(description="Credit Card Bill's primary identifier, if account is a credit card.")] = None,
250
+ created_at_from: Annotated[Optional[datetime], Field(description="Filter greater than createdAt. Format (yyyy-mm-ddThh:mm:ss.000Z)")] = None,
233
251
  _request_timeout: Union[
234
252
  None,
235
253
  Annotated[StrictFloat, Field(gt=0)],
@@ -259,6 +277,10 @@ class TransactionApi:
259
277
  :type page_size: float
260
278
  :param page: Page number for the paging request, default: 1
261
279
  :type page: float
280
+ :param bill_id: Credit Card Bill's primary identifier, if account is a credit card.
281
+ :type bill_id: str
282
+ :param created_at_from: Filter greater than createdAt. Format (yyyy-mm-ddThh:mm:ss.000Z)
283
+ :type created_at_from: datetime
262
284
  :param _request_timeout: timeout setting for this request. If one
263
285
  number provided, it will be total request
264
286
  timeout. It can also be a pair (tuple) of
@@ -288,6 +310,8 @@ class TransactionApi:
288
310
  to=to,
289
311
  page_size=page_size,
290
312
  page=page,
313
+ bill_id=bill_id,
314
+ created_at_from=created_at_from,
291
315
  _request_auth=_request_auth,
292
316
  _content_type=_content_type,
293
317
  _headers=_headers,
@@ -314,6 +338,8 @@ class TransactionApi:
314
338
  to,
315
339
  page_size,
316
340
  page,
341
+ bill_id,
342
+ created_at_from,
317
343
  _request_auth,
318
344
  _content_type,
319
345
  _headers,
@@ -379,6 +405,23 @@ class TransactionApi:
379
405
 
380
406
  _query_params.append(('page', page))
381
407
 
408
+ if bill_id is not None:
409
+
410
+ _query_params.append(('billId', bill_id))
411
+
412
+ if created_at_from is not None:
413
+ if isinstance(created_at_from, datetime):
414
+ _query_params.append(
415
+ (
416
+ 'createdAtFrom',
417
+ created_at_from.strftime(
418
+ self.api_client.configuration.datetime_format
419
+ )
420
+ )
421
+ )
422
+ else:
423
+ _query_params.append(('createdAtFrom', created_at_from))
424
+
382
425
  # process the header parameters
383
426
  # process the form parameters
384
427
  # process the body parameter
pluggy_sdk/api_client.py CHANGED
@@ -91,7 +91,7 @@ class ApiClient:
91
91
  self.default_headers[header_name] = header_value
92
92
  self.cookie = cookie
93
93
  # Set default User-Agent.
94
- self.user_agent = 'OpenAPI-Generator/1.0.0.post35/python'
94
+ self.user_agent = 'OpenAPI-Generator/1.0.0.post37/python'
95
95
  self.client_side_validation = configuration.client_side_validation
96
96
 
97
97
  def __enter__(self):
@@ -525,7 +525,7 @@ conf = pluggy_sdk.Configuration(
525
525
  "OS: {env}\n"\
526
526
  "Python Version: {pyversion}\n"\
527
527
  "Version of the API: 1.0.0\n"\
528
- "SDK Package Version: 1.0.0.post35".\
528
+ "SDK Package Version: 1.0.0.post37".\
529
529
  format(env=sys.platform, pyversion=sys.version)
530
530
 
531
531
  def get_host_settings(self) -> List[HostSetting]:
@@ -30,6 +30,7 @@ from pluggy_sdk.models.bill import Bill
30
30
  from pluggy_sdk.models.bill_finance_charge import BillFinanceCharge
31
31
  from pluggy_sdk.models.bills_list200_response import BillsList200Response
32
32
  from pluggy_sdk.models.boleto import Boleto
33
+ from pluggy_sdk.models.boleto_connection import BoletoConnection
33
34
  from pluggy_sdk.models.boleto_payer import BoletoPayer
34
35
  from pluggy_sdk.models.boleto_recipient import BoletoRecipient
35
36
  from pluggy_sdk.models.bulk_payment import BulkPayment
@@ -47,6 +48,10 @@ from pluggy_sdk.models.connector_health_details import ConnectorHealthDetails
47
48
  from pluggy_sdk.models.connector_list_response import ConnectorListResponse
48
49
  from pluggy_sdk.models.connector_user_action import ConnectorUserAction
49
50
  from pluggy_sdk.models.consent import Consent
51
+ from pluggy_sdk.models.create_boleto import CreateBoleto
52
+ from pluggy_sdk.models.create_boleto_boleto import CreateBoletoBoleto
53
+ from pluggy_sdk.models.create_boleto_boleto_payer import CreateBoletoBoletoPayer
54
+ from pluggy_sdk.models.create_boleto_connection import CreateBoletoConnection
50
55
  from pluggy_sdk.models.create_boleto_payment_request import CreateBoletoPaymentRequest
51
56
  from pluggy_sdk.models.create_bulk_payment import CreateBulkPayment
52
57
  from pluggy_sdk.models.create_client_category_rule import CreateClientCategoryRule
@@ -85,6 +90,8 @@ from pluggy_sdk.models.investment_expenses import InvestmentExpenses
85
90
  from pluggy_sdk.models.investment_metadata import InvestmentMetadata
86
91
  from pluggy_sdk.models.investment_transaction import InvestmentTransaction
87
92
  from pluggy_sdk.models.investments_list200_response import InvestmentsList200Response
93
+ from pluggy_sdk.models.issued_boleto import IssuedBoleto
94
+ from pluggy_sdk.models.issued_boleto_payer import IssuedBoletoPayer
88
95
  from pluggy_sdk.models.item import Item
89
96
  from pluggy_sdk.models.item_creation_error_response import ItemCreationErrorResponse
90
97
  from pluggy_sdk.models.item_error import ItemError
@@ -119,6 +126,7 @@ from pluggy_sdk.models.payment_data_boleto_metadata import PaymentDataBoletoMeta
119
126
  from pluggy_sdk.models.payment_data_participant import PaymentDataParticipant
120
127
  from pluggy_sdk.models.payment_institution import PaymentInstitution
121
128
  from pluggy_sdk.models.payment_intent import PaymentIntent
129
+ from pluggy_sdk.models.payment_intent_error_detail import PaymentIntentErrorDetail
122
130
  from pluggy_sdk.models.payment_intent_parameter import PaymentIntentParameter
123
131
  from pluggy_sdk.models.payment_intents_list200_response import PaymentIntentsList200Response
124
132
  from pluggy_sdk.models.payment_receipt import PaymentReceipt
@@ -130,6 +138,7 @@ from pluggy_sdk.models.payment_recipients_institution_list200_response import Pa
130
138
  from pluggy_sdk.models.payment_recipients_list200_response import PaymentRecipientsList200Response
131
139
  from pluggy_sdk.models.payment_request import PaymentRequest
132
140
  from pluggy_sdk.models.payment_request_callback_urls import PaymentRequestCallbackUrls
141
+ from pluggy_sdk.models.payment_request_error_detail import PaymentRequestErrorDetail
133
142
  from pluggy_sdk.models.payment_request_receipt_list200_response import PaymentRequestReceiptList200Response
134
143
  from pluggy_sdk.models.payment_request_schedule import PaymentRequestSchedule
135
144
  from pluggy_sdk.models.payment_requests_list200_response import PaymentRequestsList200Response
@@ -0,0 +1,95 @@
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, StrictInt, StrictStr
23
+ from typing import Any, ClassVar, Dict, List
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class BoletoConnection(BaseModel):
28
+ """
29
+ Response with information related to a boleto connection
30
+ """ # noqa: E501
31
+ id: StrictStr = Field(description="Primary identifier")
32
+ connector_id: StrictInt = Field(description="Primary identifier of the connector associated with this connection", alias="connectorId")
33
+ created_at: datetime = Field(description="Date when the connection was created", alias="createdAt")
34
+ updated_at: datetime = Field(description="Date when the connection was last updated", alias="updatedAt")
35
+ __properties: ClassVar[List[str]] = ["id", "connectorId", "createdAt", "updatedAt"]
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 BoletoConnection 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 BoletoConnection 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
+ "id": obj.get("id"),
89
+ "connectorId": obj.get("connectorId"),
90
+ "createdAt": obj.get("createdAt"),
91
+ "updatedAt": obj.get("updatedAt")
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,94 @@
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 pluggy_sdk.models.create_boleto_boleto import CreateBoletoBoleto
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CreateBoleto(BaseModel):
28
+ """
29
+ Request with information to create a boleto
30
+ """ # noqa: E501
31
+ boleto_connection_id: StrictStr = Field(description="Primary identifier of the boleto connection", alias="boletoConnectionId")
32
+ boleto: CreateBoletoBoleto
33
+ __properties: ClassVar[List[str]] = ["boletoConnectionId", "boleto"]
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 CreateBoleto 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
+ # override the default output from pydantic by calling `to_dict()` of boleto
75
+ if self.boleto:
76
+ _dict['boleto'] = self.boleto.to_dict()
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of CreateBoleto from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "boletoConnectionId": obj.get("boletoConnectionId"),
90
+ "boleto": CreateBoletoBoleto.from_dict(obj["boleto"]) if obj.get("boleto") is not None else None
91
+ })
92
+ return _obj
93
+
94
+