Skip to content

Commit

Permalink
Merge pull request #31 from Ilhasoft/feature/integrations-user-permis…
Browse files Browse the repository at this point in the history
…sion

Add weni-integrations user permission protobuffer
  • Loading branch information
Sandro-Meireles authored Sep 28, 2021
2 parents 4186c60 + a7b338b commit bf55d29
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 0 deletions.
Empty file.
164 changes: 164 additions & 0 deletions python/weni/protobuf/integrations/user_pb2.py

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

66 changes: 66 additions & 0 deletions python/weni/protobuf/integrations/user_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from weni.protobuf.integrations import user_pb2 as weni_dot_protobuf_dot_integrations_dot_user__pb2


class UserPermissionControllerStub(object):
"""Missing associated documentation comment in .proto file."""

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Update = channel.unary_unary(
'/weni.integrations.user.UserPermissionController/Update',
request_serializer=weni_dot_protobuf_dot_integrations_dot_user__pb2.UserPermissionUpdateRequest.SerializeToString,
response_deserializer=weni_dot_protobuf_dot_integrations_dot_user__pb2.Permission.FromString,
)


class UserPermissionControllerServicer(object):
"""Missing associated documentation comment in .proto file."""

def Update(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_UserPermissionControllerServicer_to_server(servicer, server):
rpc_method_handlers = {
'Update': grpc.unary_unary_rpc_method_handler(
servicer.Update,
request_deserializer=weni_dot_protobuf_dot_integrations_dot_user__pb2.UserPermissionUpdateRequest.FromString,
response_serializer=weni_dot_protobuf_dot_integrations_dot_user__pb2.Permission.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'weni.integrations.user.UserPermissionController', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class UserPermissionController(object):
"""Missing associated documentation comment in .proto file."""

@staticmethod
def Update(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/weni.integrations.user.UserPermissionController/Update',
weni_dot_protobuf_dot_integrations_dot_user__pb2.UserPermissionUpdateRequest.SerializeToString,
weni_dot_protobuf_dot_integrations_dot_user__pb2.Permission.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
19 changes: 19 additions & 0 deletions src/weni/protobuf/integrations/user.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package weni.integrations.user;

service UserPermissionController {
rpc Update(UserPermissionUpdateRequest) returns (Permission) {}
}

message UserPermissionUpdateRequest {
string project_uuid = 1;
string user = 2;
int32 role = 3;
}

message Permission {
string project_uuid = 1;
string user = 2;
int32 role = 3;
}

0 comments on commit bf55d29

Please sign in to comment.