Skip to content

Commit 61d251d

Browse files
committed
1 parent 2b1b695 commit 61d251d

File tree

14 files changed

+46
-26
lines changed

14 files changed

+46
-26
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ docs/_build/
6262
# PyBuilder
6363
target/
6464

65-
#Ipython Notebook
65+
# Ipython Notebook
6666
.ipynb_checkpoints

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.14.0-SNAPSHOT
1+
7.18.0-SNAPSHOT

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
4040

4141
- API version: 1.0.0
4242
- Package version: 1.0.0
43-
- Generator version: 7.14.0-SNAPSHOT
43+
- Generator version: 7.18.0-SNAPSHOT
4444
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
4545
For more information, please visit [https://discord.gg/3EtHskZD8h](https://discord.gg/3EtHskZD8h)
4646

docs/AlmanaxWebhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9-
**id** | **str** | | [optional]
9+
**id** | **UUID** | | [optional]
1010
**daily_settings** | [**AlmanaxWebhookDailySettings**](AlmanaxWebhookDailySettings.md) | | [optional]
1111
**bonus_whitelist** | **List[str]** | Only post when these bonuses come up. From all available bonuses (ids) from /dofus3/meta/{language}/almanax/bonuses. | [optional]
1212
**bonus_blacklist** | **List[str]** | Skip the day when these bonuses come up. From all available bonuses (ids) from /dofus3/meta/{language}/almanax/bonuses | [optional]

docs/TwitterWebhook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**id** | **str** | | [optional]
8+
**id** | **UUID** | | [optional]
99
**whitelist** | **List[str]** | | [optional]
1010
**blacklist** | **List[str]** | | [optional]
1111
**subscriptions** | **List[str]** | | [optional]

dofusdude/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,4 @@
160160
from dofusdude.models.twitter_webhook import TwitterWebhook as TwitterWebhook
161161
from dofusdude.models.version import Version as Version
162162
from dofusdude.models.weapon import Weapon as Weapon
163+

dofusdude/api_client.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import os
2323
import re
2424
import tempfile
25+
import uuid
2526

2627
from urllib.parse import quote
2728
from typing import Tuple, Optional, List, Dict, Union
@@ -312,7 +313,7 @@ def response_deserialize(
312313
return_data = self.__deserialize_file(response_data)
313314
elif response_type is not None:
314315
match = None
315-
content_type = response_data.getheader('content-type')
316+
content_type = response_data.headers.get('content-type')
316317
if content_type is not None:
317318
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
318319
encoding = match.group(1) if match else "utf-8"
@@ -329,7 +330,7 @@ def response_deserialize(
329330
return ApiResponse(
330331
status_code = response_data.status,
331332
data = return_data,
332-
headers = response_data.getheaders(),
333+
headers = response_data.headers,
333334
raw_data = response_data.data
334335
)
335336

@@ -357,6 +358,8 @@ def sanitize_for_serialization(self, obj):
357358
return obj.get_secret_value()
358359
elif isinstance(obj, self.PRIMITIVE_TYPES):
359360
return obj
361+
elif isinstance(obj, uuid.UUID):
362+
return str(obj)
360363
elif isinstance(obj, list):
361364
return [
362365
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
@@ -409,7 +412,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti
409412
data = json.loads(response_text)
410413
except ValueError:
411414
data = response_text
412-
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
415+
elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
413416
if response_text == "":
414417
data = ""
415418
else:
@@ -458,13 +461,13 @@ def __deserialize(self, data, klass):
458461

459462
if klass in self.PRIMITIVE_TYPES:
460463
return self.__deserialize_primitive(data, klass)
461-
elif klass == object:
464+
elif klass is object:
462465
return self.__deserialize_object(data)
463-
elif klass == datetime.date:
466+
elif klass is datetime.date:
464467
return self.__deserialize_date(data)
465-
elif klass == datetime.datetime:
468+
elif klass is datetime.datetime:
466469
return self.__deserialize_datetime(data)
467-
elif klass == decimal.Decimal:
470+
elif klass is decimal.Decimal:
468471
return decimal.Decimal(data)
469472
elif issubclass(klass, Enum):
470473
return self.__deserialize_enum(data, klass)
@@ -699,7 +702,7 @@ def __deserialize_file(self, response):
699702
os.close(fd)
700703
os.remove(path)
701704

702-
content_disposition = response.getheader("Content-Disposition")
705+
content_disposition = response.headers.get("Content-Disposition")
703706
if content_disposition:
704707
m = re.search(
705708
r'filename=[\'"]?([^\'"\s]+)[\'"]?',

dofusdude/configuration.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ class Configuration:
163163
:param retries: Number of retries for API requests.
164164
:param ca_cert_data: verify the peer using concatenated CA certificate data
165165
in PEM (str) or DER (bytes) format.
166+
:param cert_file: the path to a client certificate file, for mTLS.
167+
:param key_file: the path to a client key file, for mTLS.
166168
167169
"""
168170

@@ -184,6 +186,8 @@ def __init__(
184186
ssl_ca_cert: Optional[str]=None,
185187
retries: Optional[int] = None,
186188
ca_cert_data: Optional[Union[str, bytes]] = None,
189+
cert_file: Optional[str]=None,
190+
key_file: Optional[str]=None,
187191
*,
188192
debug: Optional[bool] = None,
189193
) -> None:
@@ -265,10 +269,10 @@ def __init__(
265269
"""Set this to verify the peer using PEM (str) or DER (bytes)
266270
certificate data.
267271
"""
268-
self.cert_file = None
272+
self.cert_file = cert_file
269273
"""client certificate file
270274
"""
271-
self.key_file = None
275+
self.key_file = key_file
272276
"""client key file
273277
"""
274278
self.assert_hostname = None
@@ -481,6 +485,7 @@ def get_basic_auth_token(self) -> Optional[str]:
481485
password = ""
482486
if self.password is not None:
483487
password = self.password
488+
484489
return urllib3.util.make_headers(
485490
basic_auth=username + ':' + password
486491
).get('authorization')
@@ -550,6 +555,7 @@ def get_host_from_settings(
550555
variable_name, variable['default_value'])
551556

552557
if 'enum_values' in variable \
558+
and variable['enum_values'] \
553559
and used_value not in variable['enum_values']:
554560
raise ValueError(
555561
"The variable `{0}` in the host URL has invalid value "

dofusdude/exceptions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def __init__(
129129
self.body = http_resp.data.decode('utf-8')
130130
except Exception:
131131
pass
132-
self.headers = http_resp.getheaders()
132+
self.headers = http_resp.headers
133133

134134
@classmethod
135135
def from_response(
@@ -170,8 +170,11 @@ def __str__(self):
170170
error_message += "HTTP response headers: {0}\n".format(
171171
self.headers)
172172

173-
if self.data or self.body:
174-
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
173+
if self.body:
174+
error_message += "HTTP response body: {0}\n".format(self.body)
175+
176+
if self.data:
177+
error_message += "HTTP response data: {0}\n".format(self.data)
175178

176179
return error_message
177180

dofusdude/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
Do not edit the class manually.
1414
""" # noqa: E501
1515

16-
1716
# import models into model package
1817
from dofusdude.models.almanax import Almanax
1918
from dofusdude.models.almanax_bonus import AlmanaxBonus
@@ -62,3 +61,4 @@
6261
from dofusdude.models.twitter_webhook import TwitterWebhook
6362
from dofusdude.models.version import Version
6463
from dofusdude.models.weapon import Weapon
64+

0 commit comments

Comments
 (0)