Skip to content

Commit 1b0f0d2

Browse files
authored
Merge pull request #151 from conductor-sdk/generated-code-improvements
Updated models to remove unnecessary validations
2 parents 6a20258 + 85dd1f3 commit 1b0f0d2

17 files changed

Lines changed: 10 additions & 90 deletions

src/conductor/client/http/api_client.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,11 @@ def deserialize(self, response, response_type):
216216
except Exception:
217217
data = response.resp.text
218218

219-
return self.__deserialize(data, response_type)
219+
try:
220+
return self.__deserialize(data, response_type)
221+
except ValueError as e:
222+
logger.debug(f'failed to deserialize data {data} into class {response_type}, reason: {e}')
223+
return None
220224

221225
def __deserialize(self, data, klass):
222226
"""Deserializes dict, list, str into an object.
@@ -300,11 +304,11 @@ def call_api(self, resource_path, method,
300304
then the method will return the response directly.
301305
"""
302306
return self.__call_api(resource_path, method,
303-
path_params, query_params, header_params,
304-
body, post_params, files,
305-
response_type, auth_settings,
306-
_return_http_data_only, collection_formats,
307-
_preload_content, _request_timeout)
307+
path_params, query_params, header_params,
308+
body, post_params, files,
309+
response_type, auth_settings,
310+
_return_http_data_only, collection_formats,
311+
_preload_content, _request_timeout)
308312

309313
def request(self, method, url, query_params=None, headers=None,
310314
post_params=None, body=None, _preload_content=True,

src/conductor/client/http/models/authorization_request.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ def subject(self, subject):
5555
:param subject: The subject of this AuthorizationRequest. # noqa: E501
5656
:type: SubjectRef
5757
"""
58-
if subject is None:
59-
raise ValueError("Invalid value for `subject`, must not be `None`") # noqa: E501
60-
6158
self._subject = subject
6259

6360
@property
@@ -78,9 +75,6 @@ def target(self, target):
7875
:param target: The target of this AuthorizationRequest. # noqa: E501
7976
:type: TargetRef
8077
"""
81-
if target is None:
82-
raise ValueError("Invalid value for `target`, must not be `None`") # noqa: E501
83-
8478
self._target = target
8579

8680
@property
@@ -103,8 +97,6 @@ def access(self, access):
10397
:param access: The access of this AuthorizationRequest. # noqa: E501
10498
:type: list[str]
10599
"""
106-
if access is None:
107-
raise ValueError("Invalid value for `access`, must not be `None`") # noqa: E501
108100
allowed_values = ["CREATE", "READ", "UPDATE", "DELETE", "EXECUTE"] # noqa: E501
109101
if not set(access).issubset(set(allowed_values)):
110102
raise ValueError(

src/conductor/client/http/models/correlation_ids_search_request.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ def correlation_ids(self, correlation_ids):
5151
:param correlation_ids: The correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501
5252
:type: list[str]
5353
"""
54-
if correlation_ids is None:
55-
raise ValueError("Invalid value for `correlation_ids`, must not be `None`") # noqa: E501
56-
5754
self._correlation_ids = correlation_ids
5855

5956
@property
@@ -74,9 +71,6 @@ def workflow_names(self, workflow_names):
7471
:param workflow_names: The workflow_names of this CorrelationIdsSearchRequest. # noqa: E501
7572
:type: list[str]
7673
"""
77-
if workflow_names is None:
78-
raise ValueError("Invalid value for `workflow_names`, must not be `None`") # noqa: E501
79-
8074
self._workflow_names = workflow_names
8175

8276
def to_dict(self):

src/conductor/client/http/models/create_or_update_application_request.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ def name(self, name):
4949
:param name: The name of this CreateOrUpdateApplicationRequest. # noqa: E501
5050
:type: str
5151
"""
52-
if name is None:
53-
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
54-
5552
self._name = name
5653

5754
def to_dict(self):

src/conductor/client/http/models/event_handler.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ def name(self, name):
7070
:param name: The name of this EventHandler. # noqa: E501
7171
:type: str
7272
"""
73-
if name is None:
74-
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
75-
7673
self._name = name
7774

7875
@property
@@ -93,9 +90,6 @@ def event(self, event):
9390
:param event: The event of this EventHandler. # noqa: E501
9491
:type: str
9592
"""
96-
if event is None:
97-
raise ValueError("Invalid value for `event`, must not be `None`") # noqa: E501
98-
9993
self._event = event
10094

10195
@property
@@ -137,9 +131,6 @@ def actions(self, actions):
137131
:param actions: The actions of this EventHandler. # noqa: E501
138132
:type: list[Action]
139133
"""
140-
if actions is None:
141-
raise ValueError("Invalid value for `actions`, must not be `None`") # noqa: E501
142-
143134
self._actions = actions
144135

145136
@property

src/conductor/client/http/models/generate_token_request.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ def key_id(self, key_id):
5151
:param key_id: The key_id of this GenerateTokenRequest. # noqa: E501
5252
:type: str
5353
"""
54-
if key_id is None:
55-
raise ValueError("Invalid value for `key_id`, must not be `None`") # noqa: E501
56-
5754
self._key_id = key_id
5855

5956
@property
@@ -74,9 +71,6 @@ def key_secret(self, key_secret):
7471
:param key_secret: The key_secret of this GenerateTokenRequest. # noqa: E501
7572
:type: str
7673
"""
77-
if key_secret is None:
78-
raise ValueError("Invalid value for `key_secret`, must not be `None`") # noqa: E501
79-
8074
self._key_secret = key_secret
8175

8276
def to_dict(self):

src/conductor/client/http/models/save_schedule_request.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ def name(self, name):
8686
:param name: The name of this SaveScheduleRequest. # noqa: E501
8787
:type: str
8888
"""
89-
if name is None:
90-
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
91-
9289
self._name = name
9390

9491
@property
@@ -109,9 +106,6 @@ def cron_expression(self, cron_expression):
109106
:param cron_expression: The cron_expression of this SaveScheduleRequest. # noqa: E501
110107
:type: str
111108
"""
112-
if cron_expression is None:
113-
raise ValueError("Invalid value for `cron_expression`, must not be `None`") # noqa: E501
114-
115109
self._cron_expression = cron_expression
116110

117111
@property

src/conductor/client/http/models/start_workflow_request.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ def name(self, name):
8787
:param name: The name of this StartWorkflowRequest. # noqa: E501
8888
:type: str
8989
"""
90-
if name is None:
91-
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
92-
9390
self._name = name
9491

9592
@property

src/conductor/client/http/models/sub_workflow_params.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ def name(self, name):
6262
:param name: The name of this SubWorkflowParams. # noqa: E501
6363
:type: str
6464
"""
65-
if name is None:
66-
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
67-
6865
self._name = name
6966

7067
@property

src/conductor/client/http/models/subject_ref.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ def id(self, id):
8181
:param id: The id of this SubjectRef. # noqa: E501
8282
:type: str
8383
"""
84-
if id is None:
85-
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
86-
8784
self._id = id
8885

8986
def to_dict(self):

0 commit comments

Comments
 (0)