# -*- coding: utf-8 -*-
# Generated by https://github.com/verloop/twirpy/protoc-gen-twirpy.  DO NOT EDIT!
# source: permissions/permissions_v1_rpc/permissions.proto

from google.protobuf import symbol_database as _symbol_database

from twirp.base import Endpoint
from twirp.server import TwirpServer
from twirp.client import TwirpClient

_sym_db = _symbol_database.Default()

class PermissionsRPCServer(TwirpServer):

	def __init__(self, *args, service, server_path_prefix="/twirp"):
		super().__init__(service=service)
		self._prefix = F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC"
		self._endpoints = {
			"CreateRole": Endpoint(
				service_name="PermissionsRPC",
				name="CreateRole",
				function=getattr(service, "CreateRole"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.CreateRoleRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.CreateRoleResponse"),
			),
			"DeleteRole": Endpoint(
				service_name="PermissionsRPC",
				name="DeleteRole",
				function=getattr(service, "DeleteRole"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.DeleteRoleRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.DeleteRoleResponse"),
			),
			"QueryRoles": Endpoint(
				service_name="PermissionsRPC",
				name="QueryRoles",
				function=getattr(service, "QueryRoles"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryRolesRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryRolesResponse"),
			),
			"QueryScopes": Endpoint(
				service_name="PermissionsRPC",
				name="QueryScopes",
				function=getattr(service, "QueryScopes"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryScopesRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryScopesResponse"),
			),
			"UpdateScope": Endpoint(
				service_name="PermissionsRPC",
				name="UpdateScope",
				function=getattr(service, "UpdateScope"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.UpdateScopeRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.UpdateScopeResponse"),
			),
			"ResetScope": Endpoint(
				service_name="PermissionsRPC",
				name="ResetScope",
				function=getattr(service, "ResetScope"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.ResetScopeRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.ResetScopeResponse"),
			),
			"QueryActions": Endpoint(
				service_name="PermissionsRPC",
				name="QueryActions",
				function=getattr(service, "QueryActions"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryActionsRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryActionsResponse"),
			),
			"QueryPermissions": Endpoint(
				service_name="PermissionsRPC",
				name="QueryPermissions",
				function=getattr(service, "QueryPermissions"),
				input=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryPermissionsRequest"),
				output=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryPermissionsResponse"),
			),
		}

class PermissionsRPCClient(TwirpClient):

	def CreateRole(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/CreateRole",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.CreateRoleResponse"),
			**kwargs,
		)

	def DeleteRole(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/DeleteRole",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.DeleteRoleResponse"),
			**kwargs,
		)

	def QueryRoles(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/QueryRoles",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryRolesResponse"),
			**kwargs,
		)

	def QueryScopes(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/QueryScopes",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryScopesResponse"),
			**kwargs,
		)

	def UpdateScope(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/UpdateScope",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.UpdateScopeResponse"),
			**kwargs,
		)

	def ResetScope(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/ResetScope",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.ResetScopeResponse"),
			**kwargs,
		)

	def QueryActions(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/QueryActions",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryActionsResponse"),
			**kwargs,
		)

	def QueryPermissions(self, *args, ctx, request, server_path_prefix="/twirp", **kwargs):
		return self._make_request(
			url=F"{server_path_prefix}/stream.permissions.permissions_v1_rpc.PermissionsRPC/QueryPermissions",
			ctx=ctx,
			request=request,
			response_obj=_sym_db.GetSymbol("stream.permissions.permissions_v1_rpc.QueryPermissionsResponse"),
			**kwargs,
		)
