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

from stanza.hub.v1 import config_pb2 as stanza_dot_hub_dot_v1_dot_config__pb2


class ConfigServiceStub(object):
    """This protocol buffer definition is the source of truth for the Stanza Hub Quota API.
    There is also an OpenAPI spec, generated via https://github.com/grpc-ecosystem/grpc-gateway.

    Config is used by the language-specific Stanza SDKs and Browser SDK to fetch Service and Feature configurations.
    GuardConfig: Guard level configuration ()
    BrowserContext: Whether Feature is enabled or disabled, has centralized ratelimiting, etc
    ServiceConfig: Service level configuration (OTEL defaults, Sentinel configs, etc)

    The Config service definition.
    This service is used by the Stanza SDK to get Service and Guard configs.
    This service is used by the Browser SDK to get Browser Contexts.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetGuardConfig = channel.unary_unary(
                '/stanza.hub.v1.ConfigService/GetGuardConfig',
                request_serializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetGuardConfigRequest.SerializeToString,
                response_deserializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetGuardConfigResponse.FromString,
                )
        self.GetBrowserContext = channel.unary_unary(
                '/stanza.hub.v1.ConfigService/GetBrowserContext',
                request_serializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetBrowserContextRequest.SerializeToString,
                response_deserializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetBrowserContextResponse.FromString,
                )
        self.GetServiceConfig = channel.unary_unary(
                '/stanza.hub.v1.ConfigService/GetServiceConfig',
                request_serializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetServiceConfigRequest.SerializeToString,
                response_deserializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetServiceConfigResponse.FromString,
                )


class ConfigServiceServicer(object):
    """This protocol buffer definition is the source of truth for the Stanza Hub Quota API.
    There is also an OpenAPI spec, generated via https://github.com/grpc-ecosystem/grpc-gateway.

    Config is used by the language-specific Stanza SDKs and Browser SDK to fetch Service and Feature configurations.
    GuardConfig: Guard level configuration ()
    BrowserContext: Whether Feature is enabled or disabled, has centralized ratelimiting, etc
    ServiceConfig: Service level configuration (OTEL defaults, Sentinel configs, etc)

    The Config service definition.
    This service is used by the Stanza SDK to get Service and Guard configs.
    This service is used by the Browser SDK to get Browser Contexts.
    """

    def GetGuardConfig(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 GetBrowserContext(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 GetServiceConfig(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_ConfigServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetGuardConfig': grpc.unary_unary_rpc_method_handler(
                    servicer.GetGuardConfig,
                    request_deserializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetGuardConfigRequest.FromString,
                    response_serializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetGuardConfigResponse.SerializeToString,
            ),
            'GetBrowserContext': grpc.unary_unary_rpc_method_handler(
                    servicer.GetBrowserContext,
                    request_deserializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetBrowserContextRequest.FromString,
                    response_serializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetBrowserContextResponse.SerializeToString,
            ),
            'GetServiceConfig': grpc.unary_unary_rpc_method_handler(
                    servicer.GetServiceConfig,
                    request_deserializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetServiceConfigRequest.FromString,
                    response_serializer=stanza_dot_hub_dot_v1_dot_config__pb2.GetServiceConfigResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'stanza.hub.v1.ConfigService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ConfigService(object):
    """This protocol buffer definition is the source of truth for the Stanza Hub Quota API.
    There is also an OpenAPI spec, generated via https://github.com/grpc-ecosystem/grpc-gateway.

    Config is used by the language-specific Stanza SDKs and Browser SDK to fetch Service and Feature configurations.
    GuardConfig: Guard level configuration ()
    BrowserContext: Whether Feature is enabled or disabled, has centralized ratelimiting, etc
    ServiceConfig: Service level configuration (OTEL defaults, Sentinel configs, etc)

    The Config service definition.
    This service is used by the Stanza SDK to get Service and Guard configs.
    This service is used by the Browser SDK to get Browser Contexts.
    """

    @staticmethod
    def GetGuardConfig(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, '/stanza.hub.v1.ConfigService/GetGuardConfig',
            stanza_dot_hub_dot_v1_dot_config__pb2.GetGuardConfigRequest.SerializeToString,
            stanza_dot_hub_dot_v1_dot_config__pb2.GetGuardConfigResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetBrowserContext(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, '/stanza.hub.v1.ConfigService/GetBrowserContext',
            stanza_dot_hub_dot_v1_dot_config__pb2.GetBrowserContextRequest.SerializeToString,
            stanza_dot_hub_dot_v1_dot_config__pb2.GetBrowserContextResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetServiceConfig(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, '/stanza.hub.v1.ConfigService/GetServiceConfig',
            stanza_dot_hub_dot_v1_dot_config__pb2.GetServiceConfigRequest.SerializeToString,
            stanza_dot_hub_dot_v1_dot_config__pb2.GetServiceConfigResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
