Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding retries option to override default value 3 of urllib3 #2460

Merged
merged 4 commits into from
Mar 22, 2019
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 @@ -100,6 +100,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
# Adding retries to override urllib3 default value 3
self.retries = None

@property
def logger_file(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class RESTClientObject(object):
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501

if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries

if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(self):
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
# Adding retries to override urllib3 default value 3
self.retries = None

@property
def logger_file(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(self):
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
# Adding retries to override urllib3 default value 3
self.retries = None

@property
def logger_file(self):
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/python/petstore_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(self):
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
# Adding retries to override urllib3 default value 3
self.retries = None

@property
def logger_file(self):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501

if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries

if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
**map_string** | **Hash<String, String>** | | [optional]
**map_number** | **Hash<String, Float>** | | [optional]
**map_integer** | **Hash<String, Integer>** | | [optional]
**map_boolean** | **Hash<String, BOOLEAN>** | | [optional]
**map_boolean** | **Hash<String, Boolean>** | | [optional]
**map_array_integer** | **Hash<String, Array<Integer>>** | | [optional]
**map_array_anytype** | **Hash<String, Array<Object>>** | | [optional]
**map_map_string** | **Hash<String, Hash<String, String>>** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def self.openapi_types
:'map_string' => :'Hash<String, String>',
:'map_number' => :'Hash<String, Float>',
:'map_integer' => :'Hash<String, Integer>',
:'map_boolean' => :'Hash<String, BOOLEAN>',
:'map_boolean' => :'Hash<String, Boolean>',
:'map_array_integer' => :'Hash<String, Array<Integer>>',
:'map_array_anytype' => :'Hash<String, Array<Object>>',
:'map_map_string' => :'Hash<String, Hash<String, String>>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(self):
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
# Adding retries to override urllib3 default value 3
self.retries = None

@property
def logger_file(self):
Expand Down
3 changes: 3 additions & 0 deletions samples/openapi3/client/petstore/python/petstore_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501

if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries

if maxsize is None:
if configuration.connection_pool_maxsize is not None:
maxsize = configuration.connection_pool_maxsize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer_prop** | **Integer** | | [optional]
**number_prop** | **Float** | | [optional]
**boolean_prop** | **BOOLEAN** | | [optional]
**boolean_prop** | **Boolean** | | [optional]
**string_prop** | **String** | | [optional]
**date_prop** | **Date** | | [optional]
**datetime_prop** | **DateTime** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.openapi_types
{
:'integer_prop' => :'Integer',
:'number_prop' => :'Float',
:'boolean_prop' => :'BOOLEAN',
:'boolean_prop' => :'Boolean',
:'string_prop' => :'String',
:'date_prop' => :'Date',
:'datetime_prop' => :'DateTime',
Expand Down Expand Up @@ -237,7 +237,7 @@ def _deserialize(type, value)
value.to_i
when :Float
value.to_f
when :BOOLEAN
when :Boolean
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
true
else
Expand Down