Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,4 @@ conf = {{{packageName}}}.Configuration(
def host(self, value):
"""Fix base path."""
self._base_path = value
self.server_index = None
self.server_index = None
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class Configuration:
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum
values before.
:param verify_ssl: bool - Set this to false to skip verifying SSL certificate
when calling API from https server.
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format.
{{#async}}
Expand All @@ -195,6 +197,16 @@ class Configuration:
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.
:param assert_hostname: Set this to True/False to enable/disable SSL hostname verification.
:param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server.
:param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync.
:param proxy: Proxy URL.
:param proxy_headers: Proxy headers.
:param safe_chars_for_path_param: Safe characters for path parameter encoding.
:param client_side_validation: Enable client-side validation. Default True.
:param socket_options: Options to pass down to the underlying urllib3 socket.
:param datetime_format: Datetime format string for serialization.
:param date_format: Date format string for serialization.

{{#hasAuthMethods}}
:Example:
Expand Down Expand Up @@ -304,6 +316,17 @@ conf = {{{packageName}}}.Configuration(
ca_cert_data: Optional[Union[str, bytes]] = None,
cert_file: Optional[str]=None,
key_file: Optional[str]=None,
verify_ssl: bool=True,
assert_hostname: Optional[bool]=None,
tls_server_name: Optional[str]=None,
connection_pool_maxsize: Optional[int]=None,
proxy: Optional[str]=None,
proxy_headers: Optional[Any]=None,
safe_chars_for_path_param: str='',
client_side_validation: bool=True,
socket_options: Optional[Any]=None,
datetime_format: str="{{{datetimeFormat}}}",
date_format: str="{{{dateFormat}}}",
*,
debug: Optional[bool] = None,
) -> None:
Expand Down Expand Up @@ -382,7 +405,7 @@ conf = {{{packageName}}}.Configuration(
"""Debug switch
"""

self.verify_ssl = True
self.verify_ssl = verify_ssl
"""SSL/TLS verification
Set this to false to skip verifying SSL certificate when calling API
from https server.
Expand All @@ -400,54 +423,51 @@ conf = {{{packageName}}}.Configuration(
self.key_file = key_file
"""client key file
"""
self.assert_hostname = None
self.assert_hostname = assert_hostname
"""Set this to True/False to enable/disable SSL hostname verification.
"""
self.tls_server_name = None
self.tls_server_name = tls_server_name
"""SSL/TLS Server Name Indication (SNI)
Set this to the SNI value expected by the server.
"""

{{#async}}
self.connection_pool_maxsize = 100
self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100
"""This value is passed to the aiohttp to limit simultaneous connections.
Default values is 100, None means no-limit.
None in the constructor is coerced to default 100.
"""
{{/async}}
{{^async}}
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
per pool. urllib3 uses 1 connection as default value, but this is
not the best value when you are making a lot of possibly parallel
requests to the same host, which is often the case here.
cpu_count * 5 is used as default value to increase performance.
per pool. None in the constructor is coerced to cpu_count * 5.
"""
{{/async}}

self.proxy: Optional[str] = None
self.proxy = proxy
"""Proxy URL
"""
self.proxy_headers = None
self.proxy_headers = proxy_headers
"""Proxy headers
"""
self.safe_chars_for_path_param = ''
self.safe_chars_for_path_param = safe_chars_for_path_param
"""Safe chars for path_param
"""
self.retries = retries
"""Retry configuration
"""
# Enable client side validation
self.client_side_validation = True
self.client_side_validation = client_side_validation

self.socket_options = None
self.socket_options = socket_options
"""Options to pass down to the underlying urllib3 socket
"""

self.datetime_format = "{{{datetimeFormat}}}"
self.datetime_format = datetime_format
"""datetime format
"""

self.date_format = "{{{dateFormat}}}"
self.date_format = date_format
"""date format
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,25 @@ class Configuration:
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum
values before.
:param verify_ssl: bool - Set this to false to skip verifying SSL certificate
when calling API from https server.
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format.
:param retries: int | urllib3.util.retry.Retry - Retry configuration.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.
:param assert_hostname: Set this to True/False to enable/disable SSL hostname verification.
:param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server.
:param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync.
:param proxy: Proxy URL.
:param proxy_headers: Proxy headers.
:param safe_chars_for_path_param: Safe characters for path parameter encoding.
:param client_side_validation: Enable client-side validation. Default True.
:param socket_options: Options to pass down to the underlying urllib3 socket.
:param datetime_format: Datetime format string for serialization.
:param date_format: Date format string for serialization.

:Example:

Expand Down Expand Up @@ -205,6 +217,17 @@ def __init__(
ca_cert_data: Optional[Union[str, bytes]] = None,
cert_file: Optional[str]=None,
key_file: Optional[str]=None,
verify_ssl: bool=True,
assert_hostname: Optional[bool]=None,
tls_server_name: Optional[str]=None,
connection_pool_maxsize: Optional[int]=None,
proxy: Optional[str]=None,
proxy_headers: Optional[Any]=None,
safe_chars_for_path_param: str='',
client_side_validation: bool=True,
socket_options: Optional[Any]=None,
datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z",
date_format: str="%Y-%m-%d",
*,
debug: Optional[bool] = None,
) -> None:
Expand Down Expand Up @@ -274,7 +297,7 @@ def __init__(
"""Debug switch
"""

self.verify_ssl = True
self.verify_ssl = verify_ssl
"""SSL/TLS verification
Set this to false to skip verifying SSL certificate when calling API
from https server.
Expand All @@ -292,46 +315,43 @@ def __init__(
self.key_file = key_file
"""client key file
"""
self.assert_hostname = None
self.assert_hostname = assert_hostname
"""Set this to True/False to enable/disable SSL hostname verification.
"""
self.tls_server_name = None
self.tls_server_name = tls_server_name
"""SSL/TLS Server Name Indication (SNI)
Set this to the SNI value expected by the server.
"""

self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
per pool. urllib3 uses 1 connection as default value, but this is
not the best value when you are making a lot of possibly parallel
requests to the same host, which is often the case here.
cpu_count * 5 is used as default value to increase performance.
per pool. None in the constructor is coerced to cpu_count * 5.
"""

self.proxy: Optional[str] = None
self.proxy = proxy
"""Proxy URL
"""
self.proxy_headers = None
self.proxy_headers = proxy_headers
"""Proxy headers
"""
self.safe_chars_for_path_param = ''
self.safe_chars_for_path_param = safe_chars_for_path_param
"""Safe chars for path_param
"""
self.retries = retries
"""Retry configuration
"""
# Enable client side validation
self.client_side_validation = True
self.client_side_validation = client_side_validation

self.socket_options = None
self.socket_options = socket_options
"""Options to pass down to the underlying urllib3 socket
"""

self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
self.datetime_format = datetime_format
"""datetime format
"""

self.date_format = "%Y-%m-%d"
self.date_format = date_format
"""date format
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,4 +463,4 @@ def host(self):
def host(self, value):
"""Fix base path."""
self._base_path = value
self.server_index = None
self.server_index = None
50 changes: 35 additions & 15 deletions samples/client/echo_api/python/openapi_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,25 @@ class Configuration:
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum
values before.
:param verify_ssl: bool - Set this to false to skip verifying SSL certificate
when calling API from https server.
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format.
:param retries: int | urllib3.util.retry.Retry - Retry configuration.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
:param cert_file: the path to a client certificate file, for mTLS.
:param key_file: the path to a client key file, for mTLS.
:param assert_hostname: Set this to True/False to enable/disable SSL hostname verification.
:param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server.
:param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync.
:param proxy: Proxy URL.
:param proxy_headers: Proxy headers.
:param safe_chars_for_path_param: Safe characters for path parameter encoding.
:param client_side_validation: Enable client-side validation. Default True.
:param socket_options: Options to pass down to the underlying urllib3 socket.
:param datetime_format: Datetime format string for serialization.
:param date_format: Date format string for serialization.

:Example:

Expand Down Expand Up @@ -205,6 +217,17 @@ def __init__(
ca_cert_data: Optional[Union[str, bytes]] = None,
cert_file: Optional[str]=None,
key_file: Optional[str]=None,
verify_ssl: bool=True,
assert_hostname: Optional[bool]=None,
tls_server_name: Optional[str]=None,
connection_pool_maxsize: Optional[int]=None,
proxy: Optional[str]=None,
proxy_headers: Optional[Any]=None,
safe_chars_for_path_param: str='',
client_side_validation: bool=True,
socket_options: Optional[Any]=None,
datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z",
date_format: str="%Y-%m-%d",
*,
debug: Optional[bool] = None,
) -> None:
Expand Down Expand Up @@ -274,7 +297,7 @@ def __init__(
"""Debug switch
"""

self.verify_ssl = True
self.verify_ssl = verify_ssl
"""SSL/TLS verification
Set this to false to skip verifying SSL certificate when calling API
from https server.
Expand All @@ -292,46 +315,43 @@ def __init__(
self.key_file = key_file
"""client key file
"""
self.assert_hostname = None
self.assert_hostname = assert_hostname
"""Set this to True/False to enable/disable SSL hostname verification.
"""
self.tls_server_name = None
self.tls_server_name = tls_server_name
"""SSL/TLS Server Name Indication (SNI)
Set this to the SNI value expected by the server.
"""

self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
per pool. urllib3 uses 1 connection as default value, but this is
not the best value when you are making a lot of possibly parallel
requests to the same host, which is often the case here.
cpu_count * 5 is used as default value to increase performance.
per pool. None in the constructor is coerced to cpu_count * 5.
"""

self.proxy: Optional[str] = None
self.proxy = proxy
"""Proxy URL
"""
self.proxy_headers = None
self.proxy_headers = proxy_headers
"""Proxy headers
"""
self.safe_chars_for_path_param = ''
self.safe_chars_for_path_param = safe_chars_for_path_param
"""Safe chars for path_param
"""
self.retries = retries
"""Retry configuration
"""
# Enable client side validation
self.client_side_validation = True
self.client_side_validation = client_side_validation

self.socket_options = None
self.socket_options = socket_options
"""Options to pass down to the underlying urllib3 socket
"""

self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
self.datetime_format = datetime_format
"""datetime format
"""

self.date_format = "%Y-%m-%d"
self.date_format = date_format
"""date format
"""

Expand Down
Loading
Loading