# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from protopia.api.iam.v1beta1 import iam_policy_pb2 as protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2
from protopia.api.iam.v1beta1 import policy_pb2 as protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2


class IAMPolicyStub(object):
    """IAM policy services handles the identity and access management policy. 
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.SetIamPolicy = channel.unary_unary(
                '/protopia.cloud.iam.v1beta1.IAMPolicy/SetIamPolicy',
                request_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString,
                response_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2.Policy.FromString,
                )
        self.GetIamPolicy = channel.unary_unary(
                '/protopia.cloud.iam.v1beta1.IAMPolicy/GetIamPolicy',
                request_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString,
                response_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2.Policy.FromString,
                )
        self.ListIamPolicies = channel.unary_unary(
                '/protopia.cloud.iam.v1beta1.IAMPolicy/ListIamPolicies',
                request_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.ListIamPoliciesRequest.SerializeToString,
                response_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.ListIamPoliciesResponse.FromString,
                )
        self.DeleteIamPolicy = channel.unary_unary(
                '/protopia.cloud.iam.v1beta1.IAMPolicy/DeleteIamPolicy',
                request_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.DeleteIamPolicyRequest.SerializeToString,
                response_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.DeleteIamPolicyResponse.FromString,
                )
        self.TestIamPermissions = channel.unary_unary(
                '/protopia.cloud.iam.v1beta1.IAMPolicy/TestIamPermissions',
                request_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString,
                response_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString,
                )


class IAMPolicyServicer(object):
    """IAM policy services handles the identity and access management policy. 
    """

    def SetIamPolicy(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 GetIamPolicy(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 ListIamPolicies(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 DeleteIamPolicy(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 TestIamPermissions(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_IAMPolicyServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SetIamPolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.SetIamPolicy,
                    request_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.SetIamPolicyRequest.FromString,
                    response_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2.Policy.SerializeToString,
            ),
            'GetIamPolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.GetIamPolicy,
                    request_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.GetIamPolicyRequest.FromString,
                    response_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2.Policy.SerializeToString,
            ),
            'ListIamPolicies': grpc.unary_unary_rpc_method_handler(
                    servicer.ListIamPolicies,
                    request_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.ListIamPoliciesRequest.FromString,
                    response_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.ListIamPoliciesResponse.SerializeToString,
            ),
            'DeleteIamPolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteIamPolicy,
                    request_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.DeleteIamPolicyRequest.FromString,
                    response_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.DeleteIamPolicyResponse.SerializeToString,
            ),
            'TestIamPermissions': grpc.unary_unary_rpc_method_handler(
                    servicer.TestIamPermissions,
                    request_deserializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.TestIamPermissionsRequest.FromString,
                    response_serializer=protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.TestIamPermissionsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'protopia.cloud.iam.v1beta1.IAMPolicy', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class IAMPolicy(object):
    """IAM policy services handles the identity and access management policy. 
    """

    @staticmethod
    def SetIamPolicy(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, '/protopia.cloud.iam.v1beta1.IAMPolicy/SetIamPolicy',
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString,
            protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2.Policy.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetIamPolicy(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, '/protopia.cloud.iam.v1beta1.IAMPolicy/GetIamPolicy',
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString,
            protopia_dot_api_dot_iam_dot_v1beta1_dot_policy__pb2.Policy.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListIamPolicies(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, '/protopia.cloud.iam.v1beta1.IAMPolicy/ListIamPolicies',
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.ListIamPoliciesRequest.SerializeToString,
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.ListIamPoliciesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteIamPolicy(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, '/protopia.cloud.iam.v1beta1.IAMPolicy/DeleteIamPolicy',
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.DeleteIamPolicyRequest.SerializeToString,
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.DeleteIamPolicyResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def TestIamPermissions(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, '/protopia.cloud.iam.v1beta1.IAMPolicy/TestIamPermissions',
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString,
            protopia_dot_api_dot_iam_dot_v1beta1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
