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

from cs3.ocm.provider.v1beta1 import provider_api_pb2 as cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2


class ProviderAPIStub(object):
    """OCM Auth Provider API

    The Auth Provider API is meant to authenticate a sync'n'share provider regsistered in the mesh.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in
    RFC 2119.

    The following are global requirements that apply to all methods:
    Any method MUST return CODE_OK on a succesful operation.
    Any method MAY return NOT_IMPLEMENTED.
    Any method MAY return INTERNAL.
    Any method MAY return UNKNOWN.
    Any method MAY return UNAUTHENTICATED.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.IsProviderAllowed = channel.unary_unary(
                '/cs3.ocm.provider.v1beta1.ProviderAPI/IsProviderAllowed',
                request_serializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.IsProviderAllowedRequest.SerializeToString,
                response_deserializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.IsProviderAllowedResponse.FromString,
                )
        self.GetInfoByDomain = channel.unary_unary(
                '/cs3.ocm.provider.v1beta1.ProviderAPI/GetInfoByDomain',
                request_serializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.GetInfoByDomainRequest.SerializeToString,
                response_deserializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.GetInfoByDomainResponse.FromString,
                )
        self.ListAllProviders = channel.unary_unary(
                '/cs3.ocm.provider.v1beta1.ProviderAPI/ListAllProviders',
                request_serializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.ListAllProvidersRequest.SerializeToString,
                response_deserializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.ListAllProvidersResponse.FromString,
                )


class ProviderAPIServicer(object):
    """OCM Auth Provider API

    The Auth Provider API is meant to authenticate a sync'n'share provider regsistered in the mesh.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in
    RFC 2119.

    The following are global requirements that apply to all methods:
    Any method MUST return CODE_OK on a succesful operation.
    Any method MAY return NOT_IMPLEMENTED.
    Any method MAY return INTERNAL.
    Any method MAY return UNKNOWN.
    Any method MAY return UNAUTHENTICATED.
    """

    def IsProviderAllowed(self, request, context):
        """Check if a given system provider is registered in the mesh or not.
        MUST return CODE_UNAUTHENTICATED if the system is not registered
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetInfoByDomain(self, request, context):
        """Get the information of the provider identified by a specific domain.
        MUST return CODE_NOT_FOUND if the sync'n'share system provider does not exist.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListAllProviders(self, request, context):
        """Get the information of all the providers registered in the mesh.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ProviderAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'IsProviderAllowed': grpc.unary_unary_rpc_method_handler(
                    servicer.IsProviderAllowed,
                    request_deserializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.IsProviderAllowedRequest.FromString,
                    response_serializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.IsProviderAllowedResponse.SerializeToString,
            ),
            'GetInfoByDomain': grpc.unary_unary_rpc_method_handler(
                    servicer.GetInfoByDomain,
                    request_deserializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.GetInfoByDomainRequest.FromString,
                    response_serializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.GetInfoByDomainResponse.SerializeToString,
            ),
            'ListAllProviders': grpc.unary_unary_rpc_method_handler(
                    servicer.ListAllProviders,
                    request_deserializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.ListAllProvidersRequest.FromString,
                    response_serializer=cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.ListAllProvidersResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'cs3.ocm.provider.v1beta1.ProviderAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ProviderAPI(object):
    """OCM Auth Provider API

    The Auth Provider API is meant to authenticate a sync'n'share provider regsistered in the mesh.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
    "OPTIONAL" in this document are to be interpreted as described in
    RFC 2119.

    The following are global requirements that apply to all methods:
    Any method MUST return CODE_OK on a succesful operation.
    Any method MAY return NOT_IMPLEMENTED.
    Any method MAY return INTERNAL.
    Any method MAY return UNKNOWN.
    Any method MAY return UNAUTHENTICATED.
    """

    @staticmethod
    def IsProviderAllowed(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, '/cs3.ocm.provider.v1beta1.ProviderAPI/IsProviderAllowed',
            cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.IsProviderAllowedRequest.SerializeToString,
            cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.IsProviderAllowedResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetInfoByDomain(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, '/cs3.ocm.provider.v1beta1.ProviderAPI/GetInfoByDomain',
            cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.GetInfoByDomainRequest.SerializeToString,
            cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.GetInfoByDomainResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListAllProviders(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, '/cs3.ocm.provider.v1beta1.ProviderAPI/ListAllProviders',
            cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.ListAllProvidersRequest.SerializeToString,
            cs3_dot_ocm_dot_provider_dot_v1beta1_dot_provider__api__pb2.ListAllProvidersResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
