Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Generate Python Code from plugin-pb #97

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions cloudquery/plugin_v3/plugin_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions cloudquery/plugin_v3/plugin_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,20 @@ class Write(_message.Message):
def __init__(self) -> None: ...
def __init__(self) -> None: ...

class Transform(_message.Message):
__slots__ = ()
class Request(_message.Message):
__slots__ = ("record",)
RECORD_FIELD_NUMBER: _ClassVar[int]
record: bytes
def __init__(self, record: _Optional[bytes] = ...) -> None: ...
class Response(_message.Message):
__slots__ = ("record",)
RECORD_FIELD_NUMBER: _ClassVar[int]
record: bytes
def __init__(self, record: _Optional[bytes] = ...) -> None: ...
def __init__(self) -> None: ...

class Close(_message.Message):
__slots__ = ()
class Request(_message.Message):
Expand Down
44 changes: 44 additions & 0 deletions cloudquery/plugin_v3/plugin_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def __init__(self, channel):
request_serializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Write.Request.SerializeToString,
response_deserializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Write.Response.FromString,
_registered_method=True)
self.Transform = channel.stream_stream(
'/cloudquery.plugin.v3.Plugin/Transform',
request_serializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Transform.Request.SerializeToString,
response_deserializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Transform.Response.FromString,
_registered_method=True)
self.Close = channel.unary_unary(
'/cloudquery.plugin.v3.Plugin/Close',
request_serializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Close.Request.SerializeToString,
Expand Down Expand Up @@ -153,6 +158,13 @@ def Write(self, request_iterator, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def Transform(self, request_iterator, context):
"""Transform resources.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def Close(self, request, context):
"""Send signal to flush and close open connections
"""
Expand Down Expand Up @@ -210,6 +222,11 @@ def add_PluginServicer_to_server(servicer, server):
request_deserializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Write.Request.FromString,
response_serializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Write.Response.SerializeToString,
),
'Transform': grpc.stream_stream_rpc_method_handler(
servicer.Transform,
request_deserializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Transform.Request.FromString,
response_serializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Transform.Response.SerializeToString,
),
'Close': grpc.unary_unary_rpc_method_handler(
servicer.Close,
request_deserializer=cloudquery_dot_plugin__v3_dot_plugin__pb2.Close.Request.FromString,
Expand Down Expand Up @@ -447,6 +464,33 @@ def Write(request_iterator,
metadata,
_registered_method=True)

@staticmethod
def Transform(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(
request_iterator,
target,
'/cloudquery.plugin.v3.Plugin/Transform',
cloudquery_dot_plugin__v3_dot_plugin__pb2.Transform.Request.SerializeToString,
cloudquery_dot_plugin__v3_dot_plugin__pb2.Transform.Response.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

@staticmethod
def Close(request,
target,
Expand Down