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

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
from spaceone.api.board.v1 import post_pb2 as spaceone_dot_api_dot_board_dot_v1_dot_post__pb2


class PostStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.create = channel.unary_unary(
                '/spaceone.api.board.v1.Post/create',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.CreatePostRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.FromString,
                )
        self.update = channel.unary_unary(
                '/spaceone.api.board.v1.Post/update',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.UpdatePostRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.FromString,
                )
        self.send_notification = channel.unary_unary(
                '/spaceone.api.board.v1.Post/send_notification',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.SendNotificationRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.board.v1.Post/delete',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.board.v1.Post/get',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.GetPostRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.board.v1.Post/list',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.board.v1.Post/stat',
                request_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


class PostServicer(object):
    """Missing associated documentation comment in .proto file."""

    def create(self, request, context):
        """
        desc: Creates a new Post under a specific Board. You must specify the `board_id`, `title`, and `contents`. The parameter `category` is not required but can be set in the scope of `categories` specified in the parent Board. You can make the new Post pinned or pop up by adjusting the parameters.
        request_example: >-
        {
        "board_id": "board-123456789012",
        "category": "developer",
        "title": "title",
        "contents": "This is contents.",
        "options": {"is_popup": true},
        "writer": "user1",
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "board_id": "board-123456789012",
        "post_id": "post-123456789012",
        "post_type": "INTERNAL",
        "category": "developer",
        "title": "title",
        "contents": "This is contents.",
        "options": {
        "is_pinned": false,
        "is_popup": true
        },
        "view_count": 0,
        "writer": "user1",
        "scope": "DOMAIN",
        "domain_id": "domain-123456789012",
        "user_id": "user1@email.com",
        "created_at": "2022-01-01T01:06:23.732Z",
        "updated_at": "2022-01-01T01:06:23.732Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def update(self, request, context):
        """
        desc: Updates a specific Post. You can make changes in Post settings, except `board_id`, `post_id`, and `domain_id`.
        request_example: >-
        {
        "board_id": "board-123456789012",
        "post_id": "post-2118473ce15e",
        "category": "developer",
        "title": "title2",
        "contents": "this is contents2.",
        "options": {
        "is_popup": false,
        "is_pinned": true
        },
        "writer": "user1",
        "domain_id": "domain-123456789012"
        }
        response_example: >-
        {
        "board_id": "board-123456789012",
        "post_id": "post-123456789012",
        "post_type": "INTERNAL",
        "category": "developer",
        "title": "title2",
        "contents": "this is contents2.",
        "options": {
        "is_popup": false,
        "is_pinned": true
        },
        "view_count": 1,
        "writer": "user1",
        "scope": "DOMAIN",
        "domain_id": "domain-123456789012",
        "user_id": "user1@email.com",
        "created_at": "2022-06-13T01:06:23.732Z",
        "updated_at": "2022-06-13T01:06:23.732Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def send_notification(self, request, context):
        """
        desc: Not Implemented
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        desc: Deletes a specific Post. You must specify the `post_id` of the Post to delete, and the `board_id` of the Board where the child Post to delete belongs.
        request_example: >-
        {
        "board_id": "board-b9aa34e65c60",
        "post_id": "post-2118473ce15e",
        "domain_id": "domain-123456789012"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def get(self, request, context):
        """
        desc: Gets a specific Post. You must specify the `post_id` of the Post to get, and the `board_id` of the Board where the child Post to get belongs. Prints detailed information about the Post.
        request_example: >-
        {
        "board_id": "board-b9aa34e65c60",
        "post_id": "post-2118473ce15e",
        "domain_id": "domain-58010aa2e451"
        }
        response_example: >-
        {
        "board_id": "board-b9aa34e65c60",
        "post_id": "post-2118473ce15e",
        "post_type": "INTERNAL",
        "category": "flower",
        "title": "title",
        "contents": "this is contents.",
        "options": {
        "is_pinned": false,
        "is_popup": true
        },
        "view_count": 2,
        "writer": "seolmin",
        "scope": "DOMAIN",
        "domain_id": "domain-58010aa2e451",
        "user_id": "supervisor",
        "created_at": "2022-06-13T01:06:23.732Z",
        "updated_at": "2022-06-13T01:06:23.732Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def list(self, request, context):
        """
        desc: Gets a list of all Posts. You can use a query to get a filtered list of Posts.
        request_example: >-
        {
        "board_id": "board-b9aa34e65c60",
        "query": {}
        }
        response_example: >-
        {
        "results": [
        {
        "board_id": "board-b9aa34e65c60",
        "post_id": "post-2118473ce15e",
        "post_type": "INTERNAL",
        "category": "spaceone",
        "title": "title2",
        "contents": "this is contents2.",
        "options": {
        "is_popup": false,
        "is_pinned": true
        },
        "view_count": 3,
        "writer": "seolmin2",
        "scope": "DOMAIN",
        "domain_id": "domain-58010aa2e451",
        "user_id": "user1@email.com",
        "created_at": "2022-06-13T01:06:23.732Z",
        "updated_at": "2022-06-13T01:06:23.732Z"
        },
        {
        "board_id": "board-b9aa34e65c60",
        "post_id": "post-532ae1191233",
        "post_type": "INTERNAL",
        "category": "flower",
        "title": "작업공지",
        "contents": "This is description",
        "options": {
        "is_pinned": true,
        "is_popup": true
        },
        "writer": "권설민",
        "scope": "PUBLIC",
        "user_id": "supervisor",
        "created_at": "2022-06-10T07:01:44.384Z",
        "updated_at": "2022-06-10T07:01:44.384Z"
        }
        ],
        "total_count": 2
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def stat(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_PostServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.CreatePostRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.UpdatePostRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.SerializeToString,
            ),
            'send_notification': grpc.unary_unary_rpc_method_handler(
                    servicer.send_notification,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.SendNotificationRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.GetPostRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.board.v1.Post', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Post(object):
    """Missing associated documentation comment in .proto file."""

    @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, '/spaceone.api.board.v1.Post/create',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.CreatePostRequest.SerializeToString,
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.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, '/spaceone.api.board.v1.Post/update',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.UpdatePostRequest.SerializeToString,
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def send_notification(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, '/spaceone.api.board.v1.Post/send_notification',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.SendNotificationRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.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, '/spaceone.api.board.v1.Post/delete',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/spaceone.api.board.v1.Post/get',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.GetPostRequest.SerializeToString,
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def list(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, '/spaceone.api.board.v1.Post/list',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostQuery.SerializeToString,
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostsInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def stat(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, '/spaceone.api.board.v1.Post/stat',
            spaceone_dot_api_dot_board_dot_v1_dot_post__pb2.PostStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
