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

from ai.stigmer.commons.apiresource import io_pb2 as ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2
from ai.stigmer.iam.identityprovider.v1 import api_pb2 as ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2


class IdentityProviderCommandControllerStub(object):
    """IdentityProviderCommandController provides write operations for identity providers.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.apply = channel.unary_unary(
                '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/apply',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                _registered_method=True)
        self.create = channel.unary_unary(
                '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/create',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                _registered_method=True)
        self.update = channel.unary_unary(
                '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/update',
                request_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                _registered_method=True)
        self.delete = channel.unary_unary(
                '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/delete',
                request_serializer=ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2.ApiResourceDeleteInput.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                _registered_method=True)


class IdentityProviderCommandControllerServicer(object):
    """IdentityProviderCommandController provides write operations for identity providers.
    """

    def apply(self, request, context):
        """Create or update an identity provider (Kubernetes-style apply).
        If the resource doesn't exist: creates a new identity provider.
        If the resource exists: updates the existing identity provider.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def create(self, request, context):
        """Create a new identity provider.
        The creator's organization owns the identity provider.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update(self, request, context):
        """Update an existing identity provider.
        Requires can_edit permission on the identity provider.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """Delete an identity provider.
        Deletion is blocked if any platform-managed organizations reference this identity provider.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_IdentityProviderCommandControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'apply': grpc.unary_unary_rpc_method_handler(
                    servicer.apply,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ),
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2.ApiResourceDeleteInput.FromString,
                    response_serializer=ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class IdentityProviderCommandController(object):
    """IdentityProviderCommandController provides write operations for identity providers.
    """

    @staticmethod
    def apply(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,
            '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/apply',
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def create(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,
            '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/create',
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def update(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,
            '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/update',
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def delete(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,
            '/ai.stigmer.iam.identityprovider.v1.IdentityProviderCommandController/delete',
            ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2.ApiResourceDeleteInput.SerializeToString,
            ai_dot_stigmer_dot_iam_dot_identityprovider_dot_v1_dot_api__pb2.IdentityProvider.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
