fix(knext): set token in request of write_graph (#409)

* fix(knext)set token in request of write_graph

* refine code
This commit is contained in:
bingchu 2025-03-12 10:13:03 +08:00 committed by GitHub
parent 31b895a3fa
commit c6b107ce56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 68 additions and 12 deletions

View File

@ -31,6 +31,7 @@ class BuilderClient(Client):
sub_graph=sub_graph,
operation=operation,
enable_lead_to=lead_to_builder,
token="openspg@8380255d4e49_"
)
self._rest_client.builder_job_writer_graph_post(writer_graph_request=request)

View File

@ -48,6 +48,7 @@ class WriterGraphRequest(object):
"operation": "str",
"sub_graph": "object",
"enable_lead_to": "bool",
"token": "str"
}
attribute_map = {
@ -55,6 +56,7 @@ class WriterGraphRequest(object):
"operation": "operation",
"sub_graph": "subGraph",
"enable_lead_to": "enableLeadTo",
"token": "token"
}
def __init__(
@ -63,6 +65,7 @@ class WriterGraphRequest(object):
operation=None,
sub_graph=None,
enable_lead_to=None,
token=None,
local_vars_configuration=None,
): # noqa: E501
"""WriterGraphRequest - a model defined in OpenAPI""" # noqa: E501
@ -74,6 +77,7 @@ class WriterGraphRequest(object):
self._operation = None
self._sub_graph = None
self._enable_lead_to = None
self._token = None
self.discriminator = None
if project_id is not None:
@ -84,6 +88,8 @@ class WriterGraphRequest(object):
self.sub_graph = sub_graph
if enable_lead_to is not None:
self.enable_lead_to = enable_lead_to
if token is not None:
self.token = token
@property
def project_id(self):
@ -169,6 +175,27 @@ class WriterGraphRequest(object):
self._enable_lead_to = enable_lead_to
@property
def token(self):
"""Gets the token of this WriterGraphRequest. # noqa: E501
:return: The token of this WriterGraphRequest. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this WriterGraphRequest.
:param token: The token of this WriterGraphRequest. # noqa: E501
:type: str
"""
self._token = token
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

View File

@ -67,6 +67,7 @@ class GraphClient(Client):
sub_graph=sub_graph,
operation=operation,
enable_lead_to=lead_to_builder,
token="openspg@8380255d4e49_"
)
self._rest_client.graph_writer_graph_post(writer_graph_request=request)

View File

@ -48,6 +48,7 @@ class WriterGraphRequest(object):
"operation": "str",
"sub_graph": "object",
"enable_lead_to": "bool",
"token": "str"
}
attribute_map = {
@ -55,6 +56,7 @@ class WriterGraphRequest(object):
"operation": "operation",
"sub_graph": "subGraph",
"enable_lead_to": "enableLeadTo",
"token": "token"
}
def __init__(
@ -63,6 +65,7 @@ class WriterGraphRequest(object):
operation=None,
sub_graph=None,
enable_lead_to=None,
token=None,
local_vars_configuration=None,
): # noqa: E501
"""WriterGraphRequest - a model defined in OpenAPI""" # noqa: E501
@ -74,6 +77,7 @@ class WriterGraphRequest(object):
self._operation = None
self._sub_graph = None
self._enable_lead_to = None
self._token = None
self.discriminator = None
if project_id is not None:
@ -84,6 +88,8 @@ class WriterGraphRequest(object):
self.sub_graph = sub_graph
if enable_lead_to is not None:
self.enable_lead_to = enable_lead_to
if token is not None:
self.token = token
@property
def project_id(self):
@ -169,6 +175,27 @@ class WriterGraphRequest(object):
self._enable_lead_to = enable_lead_to
@property
def token(self):
"""Gets the token of this WriterGraphRequest. # noqa: E501
:return: The token of this WriterGraphRequest. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this WriterGraphRequest.
:param token: The token of this WriterGraphRequest. # noqa: E501
:type: str
"""
self._token = token
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}