Skip to content

Commit 96235a2

Browse files
author
github-actions
committed
Bump version to 1.21.0
1 parent e688117 commit 96235a2

16 files changed

Lines changed: 409 additions & 178 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ No description provided (generated by Openapi Generator https://github.com/opena
44
The `cloudbeds_fiscal_document` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

66
- API version: v1
7-
- Package version: 1.20.0
8-
- Generator version: 7.11.0
7+
- Package version: 1.21.0
8+
- Generator version: 7.20.0
99
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1010

1111
## Requirements.
1212

13-
Python 3.8+
13+
Python 3.9+
1414

1515
## Installation & Usage
1616

1717
This python library package is generated without supporting files like setup.py or requirements files
1818

1919
To be able to use it, you will need these dependencies in your own package that uses this library:
2020

21-
* urllib3 >= 1.25.3, < 3.0.0
21+
* urllib3 >= 2.1.0, < 3.0.0
2222
* python-dateutil >= 2.8.2
2323
* pydantic >= 2
2424
* typing-extensions >= 4.7.1

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.20.0
1+
1.21.0

cloudbeds_fiscal_document/__init__.py

Lines changed: 228 additions & 112 deletions
Large diffs are not rendered by default.

cloudbeds_fiscal_document/api/configs_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -11,6 +9,7 @@
119
Do not edit the class manually.
1210
""" # noqa: E501
1311

12+
1413
import warnings
1514
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1615
from typing import Any, Dict, List, Optional, Tuple, Union

cloudbeds_fiscal_document/api/export_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -11,6 +9,7 @@
119
Do not edit the class manually.
1210
""" # noqa: E501
1311

12+
1413
import warnings
1514
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1615
from typing import Any, Dict, List, Optional, Tuple, Union

cloudbeds_fiscal_document/api/features_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -11,6 +9,7 @@
119
Do not edit the class manually.
1210
""" # noqa: E501
1311

12+
1413
import warnings
1514
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1615
from typing import Any, Dict, List, Optional, Tuple, Union

cloudbeds_fiscal_document/api/fiscal_documents_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -11,6 +9,7 @@
119
Do not edit the class manually.
1210
""" # noqa: E501
1311

12+
1413
import warnings
1514
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1615
from typing import Any, Dict, List, Optional, Tuple, Union

cloudbeds_fiscal_document/api/fiscalization_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -11,6 +9,7 @@
119
Do not edit the class manually.
1210
""" # noqa: E501
1311

12+
1413
import warnings
1514
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
1615
from typing import Any, Dict, List, Optional, Tuple, Union

cloudbeds_fiscal_document/api_client.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -12,6 +10,7 @@
1210
""" # noqa: E501
1311

1412

13+
1514
import datetime
1615
from dateutil.parser import parse
1716
from enum import Enum
@@ -21,6 +20,7 @@
2120
import os
2221
import re
2322
import tempfile
23+
import uuid
2424

2525
from urllib.parse import quote
2626
from typing import Tuple, Optional, List, Dict, Union
@@ -90,7 +90,7 @@ def __init__(
9090
self.default_headers[header_name] = header_value
9191
self.cookie = cookie
9292
# Set default User-Agent.
93-
self.user_agent = 'OpenAPI-Generator/1.20.0/python'
93+
self.user_agent = 'OpenAPI-Generator/1.21.0/python'
9494
self.client_side_validation = configuration.client_side_validation
9595

9696
def __enter__(self):
@@ -311,7 +311,7 @@ def response_deserialize(
311311
return_data = self.__deserialize_file(response_data)
312312
elif response_type is not None:
313313
match = None
314-
content_type = response_data.getheader('content-type')
314+
content_type = response_data.headers.get('content-type')
315315
if content_type is not None:
316316
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
317317
encoding = match.group(1) if match else "utf-8"
@@ -328,7 +328,7 @@ def response_deserialize(
328328
return ApiResponse(
329329
status_code = response_data.status,
330330
data = return_data,
331-
headers = response_data.getheaders(),
331+
headers = response_data.headers,
332332
raw_data = response_data.data
333333
)
334334

@@ -356,6 +356,8 @@ def sanitize_for_serialization(self, obj):
356356
return obj.get_secret_value()
357357
elif isinstance(obj, self.PRIMITIVE_TYPES):
358358
return obj
359+
elif isinstance(obj, uuid.UUID):
360+
return str(obj)
359361
elif isinstance(obj, list):
360362
return [
361363
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
@@ -382,6 +384,10 @@ def sanitize_for_serialization(self, obj):
382384
else:
383385
obj_dict = obj.__dict__
384386

387+
if isinstance(obj_dict, list):
388+
# here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
389+
return self.sanitize_for_serialization(obj_dict)
390+
385391
return {
386392
key: self.sanitize_for_serialization(val)
387393
for key, val in obj_dict.items()
@@ -404,7 +410,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti
404410
data = json.loads(response_text)
405411
except ValueError:
406412
data = response_text
407-
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
413+
elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
408414
if response_text == "":
409415
data = ""
410416
else:
@@ -453,13 +459,13 @@ def __deserialize(self, data, klass):
453459

454460
if klass in self.PRIMITIVE_TYPES:
455461
return self.__deserialize_primitive(data, klass)
456-
elif klass == object:
462+
elif klass is object:
457463
return self.__deserialize_object(data)
458-
elif klass == datetime.date:
464+
elif klass is datetime.date:
459465
return self.__deserialize_date(data)
460-
elif klass == datetime.datetime:
466+
elif klass is datetime.datetime:
461467
return self.__deserialize_datetime(data)
462-
elif klass == decimal.Decimal:
468+
elif klass is decimal.Decimal:
463469
return decimal.Decimal(data)
464470
elif issubclass(klass, Enum):
465471
return self.__deserialize_enum(data, klass)
@@ -694,14 +700,16 @@ def __deserialize_file(self, response):
694700
os.close(fd)
695701
os.remove(path)
696702

697-
content_disposition = response.getheader("Content-Disposition")
703+
content_disposition = response.headers.get("Content-Disposition")
698704
if content_disposition:
699705
m = re.search(
700706
r'filename=[\'"]?([^\'"\s]+)[\'"]?',
701707
content_disposition
702708
)
703709
assert m is not None, "Unexpected 'content-disposition' header value"
704-
filename = m.group(1)
710+
filename = os.path.basename(m.group(1)) # Strip any directory traversal
711+
if filename in ("", ".", ".."): # fall back to tmp filename
712+
filename = os.path.basename(path)
705713
path = os.path.join(os.path.dirname(path), filename)
706714

707715
with open(path, "wb") as f:

cloudbeds_fiscal_document/configuration.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# coding: utf-8
2-
31
"""
42
Fiscal document service API
53
@@ -18,7 +16,7 @@
1816
from logging import FileHandler
1917
import multiprocessing
2018
import sys
21-
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
19+
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
2220
from typing_extensions import NotRequired, Self
2321

2422
import urllib3
@@ -160,7 +158,11 @@ class Configuration:
160158
values before.
161159
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
162160
in PEM format.
163-
:param retries: Number of retries for API requests.
161+
:param retries: int | urllib3.util.retry.Retry - Retry configuration.
162+
:param ca_cert_data: verify the peer using concatenated CA certificate data
163+
in PEM (str) or DER (bytes) format.
164+
:param cert_file: the path to a client certificate file, for mTLS.
165+
:param key_file: the path to a client key file, for mTLS.
164166
165167
:Example:
166168
"""
@@ -175,13 +177,16 @@ def __init__(
175177
username: Optional[str]=None,
176178
password: Optional[str]=None,
177179
access_token: Optional[str]=None,
178-
server_index: Optional[int]=None,
180+
server_index: Optional[int]=None,
179181
server_variables: Optional[ServerVariablesT]=None,
180182
server_operation_index: Optional[Dict[int, int]]=None,
181183
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
182184
ignore_operation_servers: bool=False,
183185
ssl_ca_cert: Optional[str]=None,
184-
retries: Optional[int] = None,
186+
retries: Optional[Union[int, Any]] = None,
187+
ca_cert_data: Optional[Union[str, bytes]] = None,
188+
cert_file: Optional[str]=None,
189+
key_file: Optional[str]=None,
185190
*,
186191
debug: Optional[bool] = None,
187192
) -> None:
@@ -259,10 +264,14 @@ def __init__(
259264
self.ssl_ca_cert = ssl_ca_cert
260265
"""Set this to customize the certificate file to verify the peer.
261266
"""
262-
self.cert_file = None
267+
self.ca_cert_data = ca_cert_data
268+
"""Set this to verify the peer using PEM (str) or DER (bytes)
269+
certificate data.
270+
"""
271+
self.cert_file = cert_file
263272
"""client certificate file
264273
"""
265-
self.key_file = None
274+
self.key_file = key_file
266275
"""client key file
267276
"""
268277
self.assert_hostname = None
@@ -291,7 +300,7 @@ def __init__(
291300
"""Safe chars for path_param
292301
"""
293302
self.retries = retries
294-
"""Adding retries to override urllib3 default value 3
303+
"""Retry configuration
295304
"""
296305
# Enable client side validation
297306
self.client_side_validation = True
@@ -475,6 +484,7 @@ def get_basic_auth_token(self) -> Optional[str]:
475484
password = ""
476485
if self.password is not None:
477486
password = self.password
487+
478488
return urllib3.util.make_headers(
479489
basic_auth=username + ':' + password
480490
).get('authorization')
@@ -504,7 +514,7 @@ def to_debug_report(self) -> str:
504514
"OS: {env}\n"\
505515
"Python Version: {pyversion}\n"\
506516
"Version of the API: v1\n"\
507-
"SDK Package Version: 1.20.0".\
517+
"SDK Package Version: 1.21.0".\
508518
format(env=sys.platform, pyversion=sys.version)
509519

510520
def get_host_settings(self) -> List[HostSetting]:
@@ -587,6 +597,7 @@ def get_host_from_settings(
587597
variable_name, variable['default_value'])
588598

589599
if 'enum_values' in variable \
600+
and variable['enum_values'] \
590601
and used_value not in variable['enum_values']:
591602
raise ValueError(
592603
"The variable `{0}` in the host URL has invalid value "

0 commit comments

Comments
 (0)