diff --git a/python/knext/knext/graph/__init__.py b/python/knext/knext/graph/__init__.py index aeb3d7fd..9103e663 100644 --- a/python/knext/knext/graph/__init__.py +++ b/python/knext/knext/graph/__init__.py @@ -59,6 +59,7 @@ from knext.graph.rest.models.hop_match_rule import HopMatchRule from knext.graph.rest.models.page_rule import PageRule from knext.graph.rest.models.path_match_request import PathMatchRequest from knext.graph.rest.models.path_match_response import PathMatchResponse +from knext.graph.rest.models.path_match_response_paths import PathMatchResponsePaths from knext.graph.rest.models.property_filter import PropertyFilter from knext.graph.rest.models.sort_rule import SortRule from knext.graph.rest.models.vertex_match_rule import VertexMatchRule diff --git a/python/knext/knext/graph/rest/__init__.py b/python/knext/knext/graph/rest/__init__.py index aeb3d7fd..9103e663 100644 --- a/python/knext/knext/graph/rest/__init__.py +++ b/python/knext/knext/graph/rest/__init__.py @@ -59,6 +59,7 @@ from knext.graph.rest.models.hop_match_rule import HopMatchRule from knext.graph.rest.models.page_rule import PageRule from knext.graph.rest.models.path_match_request import PathMatchRequest from knext.graph.rest.models.path_match_response import PathMatchResponse +from knext.graph.rest.models.path_match_response_paths import PathMatchResponsePaths from knext.graph.rest.models.property_filter import PropertyFilter from knext.graph.rest.models.sort_rule import SortRule from knext.graph.rest.models.vertex_match_rule import VertexMatchRule diff --git a/python/knext/knext/graph/rest/graph_api.py b/python/knext/knext/graph/rest/graph_api.py index 830326b2..fccb899c 100644 --- a/python/knext/knext/graph/rest/graph_api.py +++ b/python/knext/knext/graph/rest/graph_api.py @@ -1011,7 +1011,7 @@ class GraphApi(object): If the method is called asynchronously, returns the request thread. """ - kwargs["_return_http_data_only"] = True + kwargs['_return_http_data_only'] = True return self.graph_match_path_post_with_http_info(**kwargs) # noqa: E501 def graph_match_path_post_with_http_info(self, **kwargs): # noqa: E501 @@ -1040,24 +1040,26 @@ class GraphApi(object): local_var_params = locals() - all_params = ["path_match_request"] + all_params = [ + 'path_match_request' + ] all_params.extend( [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' ] ) - for key, val in six.iteritems(local_var_params["kwargs"]): + for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method graph_match_path_post" % key ) local_var_params[key] = val - del local_var_params["kwargs"] + del local_var_params['kwargs'] collection_formats = {} @@ -1071,39 +1073,31 @@ class GraphApi(object): local_var_files = {} body_params = None - if "path_match_request" in local_var_params: - body_params = local_var_params["path_match_request"] + if 'path_match_request' in local_var_params: + body_params = local_var_params['path_match_request'] # HTTP header `Accept` - header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 # HTTP header `Content-Type` - header_params[ - "Content-Type" - ] = self.api_client.select_header_content_type( # noqa: E501 - ["application/json"] - ) # noqa: E501 + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( - "/graph/matchPath", - "POST", + '/graph/matchPath', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type="PathMatchResponse", # noqa: E501 + response_type='PathMatchResponse', # noqa: E501 auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/python/knext/knext/graph/rest/models/__init__.py b/python/knext/knext/graph/rest/models/__init__.py index f86303a9..879a5f3d 100644 --- a/python/knext/knext/graph/rest/models/__init__.py +++ b/python/knext/knext/graph/rest/models/__init__.py @@ -43,6 +43,7 @@ from knext.graph.rest.models.hop_match_rule import HopMatchRule from knext.graph.rest.models.page_rule import PageRule from knext.graph.rest.models.path_match_request import PathMatchRequest from knext.graph.rest.models.path_match_response import PathMatchResponse +from knext.graph.rest.models.path_match_response_paths import PathMatchResponsePaths from knext.graph.rest.models.property_filter import PropertyFilter from knext.graph.rest.models.sort_rule import SortRule from knext.graph.rest.models.vertex_match_rule import VertexMatchRule diff --git a/python/knext/knext/graph/rest/models/path_match_response.py b/python/knext/knext/graph/rest/models/path_match_response.py index ff9ef401..5e907006 100644 --- a/python/knext/knext/graph/rest/models/path_match_response.py +++ b/python/knext/knext/graph/rest/models/path_match_response.py @@ -43,9 +43,13 @@ class PathMatchResponse(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"paths": "list[list[object]]"} + openapi_types = { + 'paths': 'list[PathMatchResponsePaths]' + } - attribute_map = {"paths": "paths"} + attribute_map = { + 'paths': 'paths' + } def __init__(self, paths=None, local_vars_configuration=None): # noqa: E501 """PathMatchResponse - a model defined in OpenAPI""" # noqa: E501 @@ -64,7 +68,7 @@ class PathMatchResponse(object): :return: The paths of this PathMatchResponse. # noqa: E501 - :rtype: list[list[object]] + :rtype: list[PathMatchResponsePaths] """ return self._paths @@ -74,14 +78,10 @@ class PathMatchResponse(object): :param paths: The paths of this PathMatchResponse. # noqa: E501 - :type: list[list[object]] + :type: list[PathMatchResponsePaths] """ - if ( - self.local_vars_configuration.client_side_validation and paths is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `paths`, must not be `None`" - ) # noqa: E501 + if self.local_vars_configuration.client_side_validation and paths is None: # noqa: E501 + raise ValueError("Invalid value for `paths`, must not be `None`") # noqa: E501 self._paths = paths @@ -92,20 +92,18 @@ class PathMatchResponse(object): for attr, _ in six.iteritems(self.openapi_types): value = getattr(self, attr) if isinstance(value, list): - result[attr] = list( - map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value) - ) + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): - result[attr] = dict( - map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") - else item, - value.items(), - ) - ) + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) else: result[attr] = value diff --git a/python/knext/knext/graph/rest/models/path_match_response_paths.py b/python/knext/knext/graph/rest/models/path_match_response_paths.py new file mode 100644 index 00000000..d91a5d76 --- /dev/null +++ b/python/knext/knext/graph/rest/models/path_match_response_paths.py @@ -0,0 +1,132 @@ +# coding: utf-8 +# Copyright 2023 OpenSPG Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. + + +""" + knext + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from knext.common.rest.configuration import Configuration + + +class PathMatchResponsePaths(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'records': 'list[object]' + } + + attribute_map = { + 'records': 'records' + } + + def __init__(self, records=None, local_vars_configuration=None): # noqa: E501 + """PathMatchResponsePaths - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._records = None + self.discriminator = None + + self.records = records + + @property + def records(self): + """Gets the records of this PathMatchResponsePaths. # noqa: E501 + + + :return: The records of this PathMatchResponsePaths. # noqa: E501 + :rtype: list[object] + """ + return self._records + + @records.setter + def records(self, records): + """Sets the records of this PathMatchResponsePaths. + + + :param records: The records of this PathMatchResponsePaths. # noqa: E501 + :type: list[object] + """ + if self.local_vars_configuration.client_side_validation and records is None: # noqa: E501 + raise ValueError("Invalid value for `records`, must not be `None`") # noqa: E501 + + self._records = records + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PathMatchResponsePaths): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PathMatchResponsePaths): + return True + + return self.to_dict() != other.to_dict()