Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
fix: update swagger client
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar committed Sep 7, 2021
1 parent f2e25ac commit 1930016
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
7 changes: 7 additions & 0 deletions cli/config_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ def get_scope_for_endpoint(self, endpoint):
def unmap_model(self, model, data_dict=None):
if data_dict is None:
data_dict = {}

for key_ in model.attribute_map:

val = getattr(model, key_)
Expand Down Expand Up @@ -785,13 +786,19 @@ def process_get(self, endpoint, return_value=False):
selections = ['q', 'b']
item_counters = []
tabulated = False

if api_response:
if 'response' in api_response:
api_response = api_response['response']

selections.append('w')
api_response_unmapped = []
if isinstance(api_response, list):
for model in api_response:
data_dict = self.unmap_model(model)
api_response_unmapped.append(data_dict)
elif isinstance(api_response, dict):
api_response_unmapped = api_response
else:
data_dict = self.unmap_model(api_response)
api_response_unmapped = data_dict
Expand Down
35 changes: 7 additions & 28 deletions cli/jca/swagger_client/models/stat_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import six

class StatResponse(object):
class StatResponse(dict):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Expand All @@ -28,40 +28,19 @@ class StatResponse(object):
and the value is json key in definition.
"""
swagger_types = {
'response': 'dict(str, StatResponseItem)'
}
if hasattr(dict, "swagger_types"):
swagger_types.update(dict.swagger_types)

attribute_map = {
'response': 'response'
}
if hasattr(dict, "attribute_map"):
attribute_map.update(dict.attribute_map)

def __init__(self, response=None): # noqa: E501
def __init__(self, *args, **kwargs): # noqa: E501
"""StatResponse - a model defined in Swagger""" # noqa: E501
self._response = None
self.discriminator = None
if response is not None:
self.response = response

@property
def response(self):
"""Gets the response of this StatResponse. # noqa: E501
:return: The response of this StatResponse. # noqa: E501
:rtype: dict(str, StatResponseItem)
"""
return self._response

@response.setter
def response(self, response):
"""Sets the response of this StatResponse.
:param response: The response of this StatResponse. # noqa: E501
:type: dict(str, StatResponseItem)
"""

self._response = response
dict.__init__(self, *args, **kwargs)

def to_dict(self):
"""Returns the model properties as a dict"""
Expand Down

0 comments on commit 1930016

Please sign in to comment.