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

import policy_pb2 as policy__pb2

GRPC_GENERATED_VERSION = '1.71.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in policy_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class PolicyServiceStub(object):
    """Policy Service - Manages recovery policies
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreatePolicy = channel.unary_unary(
                '/omium.policy.v1.PolicyService/CreatePolicy',
                request_serializer=policy__pb2.CreatePolicyRequest.SerializeToString,
                response_deserializer=policy__pb2.CreatePolicyResponse.FromString,
                _registered_method=True)
        self.GetPolicy = channel.unary_unary(
                '/omium.policy.v1.PolicyService/GetPolicy',
                request_serializer=policy__pb2.GetPolicyRequest.SerializeToString,
                response_deserializer=policy__pb2.GetPolicyResponse.FromString,
                _registered_method=True)
        self.ListPolicies = channel.unary_unary(
                '/omium.policy.v1.PolicyService/ListPolicies',
                request_serializer=policy__pb2.ListPoliciesRequest.SerializeToString,
                response_deserializer=policy__pb2.ListPoliciesResponse.FromString,
                _registered_method=True)
        self.UpdatePolicy = channel.unary_unary(
                '/omium.policy.v1.PolicyService/UpdatePolicy',
                request_serializer=policy__pb2.UpdatePolicyRequest.SerializeToString,
                response_deserializer=policy__pb2.UpdatePolicyResponse.FromString,
                _registered_method=True)
        self.DeletePolicy = channel.unary_unary(
                '/omium.policy.v1.PolicyService/DeletePolicy',
                request_serializer=policy__pb2.DeletePolicyRequest.SerializeToString,
                response_deserializer=policy__pb2.DeletePolicyResponse.FromString,
                _registered_method=True)
        self.EvaluatePolicy = channel.unary_unary(
                '/omium.policy.v1.PolicyService/EvaluatePolicy',
                request_serializer=policy__pb2.EvaluatePolicyRequest.SerializeToString,
                response_deserializer=policy__pb2.EvaluatePolicyResponse.FromString,
                _registered_method=True)


class PolicyServiceServicer(object):
    """Policy Service - Manages recovery policies
    """

    def CreatePolicy(self, request, context):
        """Create a policy
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetPolicy(self, request, context):
        """Get a policy
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListPolicies(self, request, context):
        """List policies
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdatePolicy(self, request, context):
        """Update a policy
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeletePolicy(self, request, context):
        """Delete a policy
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def EvaluatePolicy(self, request, context):
        """Evaluate a policy
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PolicyServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreatePolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.CreatePolicy,
                    request_deserializer=policy__pb2.CreatePolicyRequest.FromString,
                    response_serializer=policy__pb2.CreatePolicyResponse.SerializeToString,
            ),
            'GetPolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPolicy,
                    request_deserializer=policy__pb2.GetPolicyRequest.FromString,
                    response_serializer=policy__pb2.GetPolicyResponse.SerializeToString,
            ),
            'ListPolicies': grpc.unary_unary_rpc_method_handler(
                    servicer.ListPolicies,
                    request_deserializer=policy__pb2.ListPoliciesRequest.FromString,
                    response_serializer=policy__pb2.ListPoliciesResponse.SerializeToString,
            ),
            'UpdatePolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdatePolicy,
                    request_deserializer=policy__pb2.UpdatePolicyRequest.FromString,
                    response_serializer=policy__pb2.UpdatePolicyResponse.SerializeToString,
            ),
            'DeletePolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.DeletePolicy,
                    request_deserializer=policy__pb2.DeletePolicyRequest.FromString,
                    response_serializer=policy__pb2.DeletePolicyResponse.SerializeToString,
            ),
            'EvaluatePolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.EvaluatePolicy,
                    request_deserializer=policy__pb2.EvaluatePolicyRequest.FromString,
                    response_serializer=policy__pb2.EvaluatePolicyResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'omium.policy.v1.PolicyService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('omium.policy.v1.PolicyService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class PolicyService(object):
    """Policy Service - Manages recovery policies
    """

    @staticmethod
    def CreatePolicy(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,
            '/omium.policy.v1.PolicyService/CreatePolicy',
            policy__pb2.CreatePolicyRequest.SerializeToString,
            policy__pb2.CreatePolicyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetPolicy(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,
            '/omium.policy.v1.PolicyService/GetPolicy',
            policy__pb2.GetPolicyRequest.SerializeToString,
            policy__pb2.GetPolicyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListPolicies(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,
            '/omium.policy.v1.PolicyService/ListPolicies',
            policy__pb2.ListPoliciesRequest.SerializeToString,
            policy__pb2.ListPoliciesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdatePolicy(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,
            '/omium.policy.v1.PolicyService/UpdatePolicy',
            policy__pb2.UpdatePolicyRequest.SerializeToString,
            policy__pb2.UpdatePolicyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeletePolicy(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,
            '/omium.policy.v1.PolicyService/DeletePolicy',
            policy__pb2.DeletePolicyRequest.SerializeToString,
            policy__pb2.DeletePolicyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def EvaluatePolicy(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,
            '/omium.policy.v1.PolicyService/EvaluatePolicy',
            policy__pb2.EvaluatePolicyRequest.SerializeToString,
            policy__pb2.EvaluatePolicyResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
