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

from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2
from yandex.cloud.organizationmanager.v1 import group_mapping_service_pb2 as yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2


class GroupMappingServiceStub(object):
    """RPC service dedicated for federation group mapping.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Get = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.GroupMappingService/Get',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.GetGroupMappingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.GetGroupMappingResponse.FromString,
                )
        self.Create = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.GroupMappingService/Create',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.CreateGroupMappingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Update = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.GroupMappingService/Update',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.UpdateGroupMappingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.Delete = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.GroupMappingService/Delete',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.DeleteGroupMappingRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )
        self.ListItems = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.GroupMappingService/ListItems',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.ListGroupMappingItemsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.ListGroupMappingItemsResponse.FromString,
                )
        self.UpdateItems = channel.unary_unary(
                '/yandex.cloud.organizationmanager.v1.GroupMappingService/UpdateItems',
                request_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.UpdateGroupMappingItemsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
                )


class GroupMappingServiceServicer(object):
    """RPC service dedicated for federation group mapping.
    """

    def Get(self, request, context):
        """Returns a group mapping configured for the specific federation
        If a federation does not exist this call will return an error
        NOT_FOUND will be returned
        If a federation exist, but has not ever been configured for group mapping
        the call FAILED_PRECONDITION will be returned.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Create(self, request, context):
        """Adds a group mapping for a federation
        If mapping already exist, ALREADY_EXISTS will be returned
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Updates an existing group mapping for a federation
        Errors:
        - if federation is not found
        In case of any error, no changes are applied to existing group mapping

        This call is idempotent. The following actions do nothing:
        - enabling when already enabled
        - disabling when disabled
        Such parts of request will be ignored. Others will be applied.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Deletes a group mapping. This will remove all the mapping items
        cascade.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListItems(self, request, context):
        """Returns all the group mappings items

        Filtering is only supported by external_group_id or internal_group_id
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UpdateItems(self, request, context):
        """Updates group mapping items for a specified federation
        Errors:
        - if federation is not found
        - if internal group in the mapping added does not exist
        In case of any error, no changes are applied to existing group mapping

        This call is idempotent. The following actions do nothing:
        - adding group mapping items that are already present
        - removing group mapping items that are not present
        Such parts of request will be ignored. Others will be applied.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GroupMappingServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.GetGroupMappingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.GetGroupMappingResponse.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.CreateGroupMappingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.UpdateGroupMappingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.DeleteGroupMappingRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
            'ListItems': grpc.unary_unary_rpc_method_handler(
                    servicer.ListItems,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.ListGroupMappingItemsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.ListGroupMappingItemsResponse.SerializeToString,
            ),
            'UpdateItems': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateItems,
                    request_deserializer=yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.UpdateGroupMappingItemsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.organizationmanager.v1.GroupMappingService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class GroupMappingService(object):
    """RPC service dedicated for federation group mapping.
    """

    @staticmethod
    def Get(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, '/yandex.cloud.organizationmanager.v1.GroupMappingService/Get',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.GetGroupMappingRequest.SerializeToString,
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.GetGroupMappingResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/yandex.cloud.organizationmanager.v1.GroupMappingService/Create',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.CreateGroupMappingRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/yandex.cloud.organizationmanager.v1.GroupMappingService/Update',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.UpdateGroupMappingRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/yandex.cloud.organizationmanager.v1.GroupMappingService/Delete',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.DeleteGroupMappingRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListItems(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, '/yandex.cloud.organizationmanager.v1.GroupMappingService/ListItems',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.ListGroupMappingItemsRequest.SerializeToString,
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.ListGroupMappingItemsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def UpdateItems(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, '/yandex.cloud.organizationmanager.v1.GroupMappingService/UpdateItems',
            yandex_dot_cloud_dot_organizationmanager_dot_v1_dot_group__mapping__service__pb2.UpdateGroupMappingItemsRequest.SerializeToString,
            yandex_dot_cloud_dot_operation_dot_operation__pb2.Operation.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
