Skip to content

Commit

Permalink
[BUG][Python] init access token for python client configuration (#7469)
Browse files Browse the repository at this point in the history
* fix: init access token for python client configuration

* fix: remove duplicate initializations for access_token
  • Loading branch information
zilvinasu authored Feb 5, 2021
1 parent 4c3820f commit 90e25f6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ conf = {{{packageName}}}.Configuration(

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
access_token=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
Expand Down Expand Up @@ -190,6 +191,7 @@ conf = {{{packageName}}}.Configuration(
"""Temp file folder for downloading files
"""
# Authentication Settings
self.access_token = access_token
self.api_key = {}
if api_key:
self.api_key = api_key
Expand Down Expand Up @@ -218,18 +220,6 @@ conf = {{{packageName}}}.Configuration(
"""The HTTP signing configuration
"""
{{/hasHttpSignatureMethods}}
{{#hasOAuthMethods}}
self.access_token = None
"""access token for OAuth/Bearer
"""
{{/hasOAuthMethods}}
{{^hasOAuthMethods}}
{{#hasBearerMethods}}
self.access_token = None
"""access token for OAuth/Bearer
"""
{{/hasBearerMethods}}
{{/hasOAuthMethods}}
self.logger = {}
"""Logging Settings
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class Configuration(object):

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
access_token=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
Expand All @@ -146,6 +147,7 @@ def __init__(self, host=None,
"""Temp file folder for downloading files
"""
# Authentication Settings
self.access_token = access_token
self.api_key = {}
if api_key:
self.api_key = api_key
Expand All @@ -167,9 +169,6 @@ def __init__(self, host=None,
"""
self.discard_unknown_keys = discard_unknown_keys
self.disabled_client_side_validations = disabled_client_side_validations
self.access_token = None
"""access token for OAuth/Bearer
"""
self.logger = {}
"""Logging Settings
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class Configuration(object):

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
access_token=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
Expand All @@ -147,6 +148,7 @@ def __init__(self, host=None,
"""Temp file folder for downloading files
"""
# Authentication Settings
self.access_token = access_token
self.api_key = {}
if api_key:
self.api_key = api_key
Expand All @@ -168,9 +170,6 @@ def __init__(self, host=None,
"""
self.discard_unknown_keys = discard_unknown_keys
self.disabled_client_side_validations = disabled_client_side_validations
self.access_token = None
"""access token for OAuth/Bearer
"""
self.logger = {}
"""Logging Settings
"""
Expand Down
5 changes: 2 additions & 3 deletions samples/client/petstore/python/petstore_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class Configuration(object):

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
access_token=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
Expand All @@ -142,6 +143,7 @@ def __init__(self, host=None,
"""Temp file folder for downloading files
"""
# Authentication Settings
self.access_token = access_token
self.api_key = {}
if api_key:
self.api_key = api_key
Expand All @@ -163,9 +165,6 @@ def __init__(self, host=None,
"""
self.discard_unknown_keys = discard_unknown_keys
self.disabled_client_side_validations = disabled_client_side_validations
self.access_token = None
"""access token for OAuth/Bearer
"""
self.logger = {}
"""Logging Settings
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class Configuration(object):

def __init__(self, host=None,
api_key=None, api_key_prefix=None,
access_token=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
Expand All @@ -184,6 +185,7 @@ def __init__(self, host=None,
"""Temp file folder for downloading files
"""
# Authentication Settings
self.access_token = access_token
self.api_key = {}
if api_key:
self.api_key = api_key
Expand All @@ -210,9 +212,6 @@ def __init__(self, host=None,
self.signing_info = signing_info
"""The HTTP signing configuration
"""
self.access_token = None
"""access token for OAuth/Bearer
"""
self.logger = {}
"""Logging Settings
"""
Expand Down

0 comments on commit 90e25f6

Please sign in to comment.