mirror of
https://github.com/OpenSPG/openspg.git
synced 2025-12-17 18:26:36 +00:00
bugfix
This commit is contained in:
parent
79e35676fc
commit
5b0a99c51b
@ -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.page_rule import PageRule
|
||||||
from knext.graph.rest.models.path_match_request import PathMatchRequest
|
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 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.property_filter import PropertyFilter
|
||||||
from knext.graph.rest.models.sort_rule import SortRule
|
from knext.graph.rest.models.sort_rule import SortRule
|
||||||
from knext.graph.rest.models.vertex_match_rule import VertexMatchRule
|
from knext.graph.rest.models.vertex_match_rule import VertexMatchRule
|
||||||
|
|||||||
@ -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.page_rule import PageRule
|
||||||
from knext.graph.rest.models.path_match_request import PathMatchRequest
|
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 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.property_filter import PropertyFilter
|
||||||
from knext.graph.rest.models.sort_rule import SortRule
|
from knext.graph.rest.models.sort_rule import SortRule
|
||||||
from knext.graph.rest.models.vertex_match_rule import VertexMatchRule
|
from knext.graph.rest.models.vertex_match_rule import VertexMatchRule
|
||||||
|
|||||||
@ -1011,7 +1011,7 @@ class GraphApi(object):
|
|||||||
If the method is called asynchronously,
|
If the method is called asynchronously,
|
||||||
returns the request thread.
|
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
|
return self.graph_match_path_post_with_http_info(**kwargs) # noqa: E501
|
||||||
|
|
||||||
def graph_match_path_post_with_http_info(self, **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()
|
local_var_params = locals()
|
||||||
|
|
||||||
all_params = ["path_match_request"]
|
all_params = [
|
||||||
|
'path_match_request'
|
||||||
|
]
|
||||||
all_params.extend(
|
all_params.extend(
|
||||||
[
|
[
|
||||||
"async_req",
|
'async_req',
|
||||||
"_return_http_data_only",
|
'_return_http_data_only',
|
||||||
"_preload_content",
|
'_preload_content',
|
||||||
"_request_timeout",
|
'_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:
|
if key not in all_params:
|
||||||
raise ApiTypeError(
|
raise ApiTypeError(
|
||||||
"Got an unexpected keyword argument '%s'"
|
"Got an unexpected keyword argument '%s'"
|
||||||
" to method graph_match_path_post" % key
|
" to method graph_match_path_post" % key
|
||||||
)
|
)
|
||||||
local_var_params[key] = val
|
local_var_params[key] = val
|
||||||
del local_var_params["kwargs"]
|
del local_var_params['kwargs']
|
||||||
|
|
||||||
collection_formats = {}
|
collection_formats = {}
|
||||||
|
|
||||||
@ -1071,39 +1073,31 @@ class GraphApi(object):
|
|||||||
local_var_files = {}
|
local_var_files = {}
|
||||||
|
|
||||||
body_params = None
|
body_params = None
|
||||||
if "path_match_request" in local_var_params:
|
if 'path_match_request' in local_var_params:
|
||||||
body_params = local_var_params["path_match_request"]
|
body_params = local_var_params['path_match_request']
|
||||||
# HTTP header `Accept`
|
# HTTP header `Accept`
|
||||||
header_params["Accept"] = self.api_client.select_header_accept(
|
header_params['Accept'] = self.api_client.select_header_accept(
|
||||||
["application/json"]
|
['application/json']) # noqa: E501
|
||||||
) # noqa: E501
|
|
||||||
|
|
||||||
# HTTP header `Content-Type`
|
# HTTP header `Content-Type`
|
||||||
header_params[
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||||
"Content-Type"
|
['application/json']) # noqa: E501
|
||||||
] = self.api_client.select_header_content_type( # noqa: E501
|
|
||||||
["application/json"]
|
|
||||||
) # noqa: E501
|
|
||||||
|
|
||||||
# Authentication setting
|
# Authentication setting
|
||||||
auth_settings = [] # noqa: E501
|
auth_settings = [] # noqa: E501
|
||||||
|
|
||||||
return self.api_client.call_api(
|
return self.api_client.call_api(
|
||||||
"/graph/matchPath",
|
'/graph/matchPath', 'POST',
|
||||||
"POST",
|
|
||||||
path_params,
|
path_params,
|
||||||
query_params,
|
query_params,
|
||||||
header_params,
|
header_params,
|
||||||
body=body_params,
|
body=body_params,
|
||||||
post_params=form_params,
|
post_params=form_params,
|
||||||
files=local_var_files,
|
files=local_var_files,
|
||||||
response_type="PathMatchResponse", # noqa: E501
|
response_type='PathMatchResponse', # noqa: E501
|
||||||
auth_settings=auth_settings,
|
auth_settings=auth_settings,
|
||||||
async_req=local_var_params.get("async_req"),
|
async_req=local_var_params.get('async_req'),
|
||||||
_return_http_data_only=local_var_params.get(
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
"_return_http_data_only"
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
), # noqa: E501
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
_preload_content=local_var_params.get("_preload_content", True),
|
collection_formats=collection_formats)
|
||||||
_request_timeout=local_var_params.get("_request_timeout"),
|
|
||||||
collection_formats=collection_formats,
|
|
||||||
)
|
|
||||||
|
|||||||
@ -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.page_rule import PageRule
|
||||||
from knext.graph.rest.models.path_match_request import PathMatchRequest
|
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 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.property_filter import PropertyFilter
|
||||||
from knext.graph.rest.models.sort_rule import SortRule
|
from knext.graph.rest.models.sort_rule import SortRule
|
||||||
from knext.graph.rest.models.vertex_match_rule import VertexMatchRule
|
from knext.graph.rest.models.vertex_match_rule import VertexMatchRule
|
||||||
|
|||||||
@ -43,9 +43,13 @@ class PathMatchResponse(object):
|
|||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
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
|
def __init__(self, paths=None, local_vars_configuration=None): # noqa: E501
|
||||||
"""PathMatchResponse - a model defined in OpenAPI""" # 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
|
:return: The paths of this PathMatchResponse. # noqa: E501
|
||||||
:rtype: list[list[object]]
|
:rtype: list[PathMatchResponsePaths]
|
||||||
"""
|
"""
|
||||||
return self._paths
|
return self._paths
|
||||||
|
|
||||||
@ -74,14 +78,10 @@ class PathMatchResponse(object):
|
|||||||
|
|
||||||
|
|
||||||
:param paths: The paths of this PathMatchResponse. # noqa: E501
|
:param paths: The paths of this PathMatchResponse. # noqa: E501
|
||||||
:type: list[list[object]]
|
:type: list[PathMatchResponsePaths]
|
||||||
"""
|
"""
|
||||||
if (
|
if self.local_vars_configuration.client_side_validation and paths is None: # noqa: E501
|
||||||
self.local_vars_configuration.client_side_validation and paths is None
|
raise ValueError("Invalid value for `paths`, must not be `None`") # noqa: E501
|
||||||
): # noqa: E501
|
|
||||||
raise ValueError(
|
|
||||||
"Invalid value for `paths`, must not be `None`"
|
|
||||||
) # noqa: E501
|
|
||||||
|
|
||||||
self._paths = paths
|
self._paths = paths
|
||||||
|
|
||||||
@ -92,20 +92,18 @@ class PathMatchResponse(object):
|
|||||||
for attr, _ in six.iteritems(self.openapi_types):
|
for attr, _ in six.iteritems(self.openapi_types):
|
||||||
value = getattr(self, attr)
|
value = getattr(self, attr)
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
result[attr] = list(
|
result[attr] = list(map(
|
||||||
map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)
|
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||||
)
|
value
|
||||||
|
))
|
||||||
elif hasattr(value, "to_dict"):
|
elif hasattr(value, "to_dict"):
|
||||||
result[attr] = value.to_dict()
|
result[attr] = value.to_dict()
|
||||||
elif isinstance(value, dict):
|
elif isinstance(value, dict):
|
||||||
result[attr] = dict(
|
result[attr] = dict(map(
|
||||||
map(
|
lambda item: (item[0], item[1].to_dict())
|
||||||
lambda item: (item[0], item[1].to_dict())
|
if hasattr(item[1], "to_dict") else item,
|
||||||
if hasattr(item[1], "to_dict")
|
value.items()
|
||||||
else item,
|
))
|
||||||
value.items(),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
result[attr] = value
|
result[attr] = value
|
||||||
|
|
||||||
|
|||||||
@ -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()
|
||||||
Loading…
x
Reference in New Issue
Block a user