# 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.notification.v1 import notification_pb2 as spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2


class NotificationStub(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.notification.v1.Notification/create',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.CreateNotificationRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.push = channel.unary_unary(
                '/spaceone.api.notification.v1.Notification/push',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.PushNotificationRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.notification.v1.Notification/delete',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.set_read = channel.unary_unary(
                '/spaceone.api.notification.v1.Notification/set_read',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.SetReadNotificationRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.notification.v1.Notification/get',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.GetNotificationRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.notification.v1.Notification/list',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.notification.v1.Notification/stat',
                request_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


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

    def create(self, request, context):
        """
        desc: Creates a new Notification. When a Notification is created, it is delivered to a UserChannel or a ProjectChannel depending on the parameter `resource_type`. If a Notification is delivered to a UserChannel, the `resource_type` is `identity.User`, and if a Notification is delivered to a ProjectChannel, the `resource_type` is `identity.Project`.
        request_example: >-
        {
        "resource_type": "identity.Project",
        "resource_id": "resource-123456789012",
        "topic": "monitoring.Alert",
        "message": {
        "title": "[Alerting] Not Running Pods 0:OK alert",
        "description": "[spaceone-dev] Not Running Pods 0 is OK\n\nFailure level : WorkerNode\nPanel ... ",
        "tags": {
        "urgency": "LOW",
        "resource_id": "pod",
        "assignee": "user1@email.com",
        "created_at": "2022-01-01T17:12:45.990Z",
        "state": "ACKNOWLEDGED",
        "project_id": "project-123456789012"
        }
        },
        "notification_type": "INFO",
        "notification_level": "LV2"
        }
        response_example: >-
        {
        "notification_id": "notification-123456789012",
        "topic": "monitoring.Alert",
        "message": {
        "title": "[Alerting] Not Running Pods 0:OK alert",
        "description": "[spaceone-dev] Not Running Pods 0 is OK\n\nFailure level : WorkerNode\nPanel ... ",
        "tags": {
        "urgency": "LOW",
        "resource_id": "pod",
        "assignee": "user1@email.com",
        "created_at": "2022-01-01T17:12:45.990Z",
        "state": "ACKNOWLEDGED",
        "project_id": "project-123456789012"
        }
        },
        "notification_type": "INFO",
        "notification_level": "LV2",
        "is_read": true,
        "user_id": "Cloudforet@mz.co.kr",
        "domain_id": "domain-123456789012",
        "created_at": "2022-01-01T17:12:40.990Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def push(self, request, context):
        """
        desc: Manually raises a Notification. A Notification is raised with a message to be sent using a valid specific Protocol, and data used for a specific Protocol such as a phone number.
        request_example: >-
        {
        "protocol_id": "protocol-fb30cb6c28d6",
        "data": {
        "phone_number": "01012345678"
        },
        "message": {
        "tags": [
        {
        "key": "project_id",
        "value": "project-xxxx"
        },
        {
        "key": "project_name",
        "value": "Test Project"
        },
        {
        "key": "resource_id",
        "value": "server-yyyyy"
        },
        {
        "key": "resource_name",
        "value": "web-server-001"
        }
        ],
        "description": "This is Sample Message",
        "title": "Sample"
        }
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def delete(self, request, context):
        """
        desc: Deletes multiple Notifications. You must specify `notifications` of the list of Notifications to delete.
        request_example: >-
        {
        "notifications": [
        "notification-4025c1b61225",
        "notification-13hk3fh32534",
        "notification-4kth40jth5jy"
        ]
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def set_read(self, request, context):
        """
        desc: Marks a Notification as read. When a Notification is raised and if the Notification has been acknowledged, it can be marked as read with the method.
        request_example: >-
        {
        "notifications": [
        "notification-6c548a37ee77",
        "notification-4j3jt9384fnf"
        ]
        }
        """
        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 Notification. Prints detailed information about the Notification, including not only the message contents(`title`, `description`) but also related data such as created time and urgency.
        request_example: >-
        {
        "notification_id": "notification-4025c1b61225"
        }
        response_example: >-
        {
        "notification_id": "notification-4025c1b61225",
        "topic": "monitoring.Alert",
        "message": {
        "tags": {
        "project_id": "project-18655561c535",
        "created_at": null,
        "urgency": "LOW",
        "state": "TRIGGERED",
        "resource_id": "AWS/NetworkELB",
        "resource_name": "[Asia Pacific (Seoul)]:[AWS/NetworkELB]: net/af83f347171a044af46453ebb34c8225/743a23562a96c595"
        },
        "title": "[Asia Pacific (Seoul)]: NLB-TCP_Target_Reset_Count-Alert",
        "description": "Threshold Crossed: 1 out of the last 1 datapoints [200.0 (25/06/21 06:38:00)] was not greater than the threshold (200.0)"
        },
        "notification_type": "INFO",
        "notification_level": "ALL",
        "is_read": true,
        "user_id": "user1@spaceone.dev",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2021-06-25T06:42:05.867Z"
        }
        """
        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 Notifications. You can use a query to get a filtered list of Notifications.
        request_example: >-
        {
        "query": {
        "filter": [
        {
        "key": "notification_type",
        "value": "INFO",
        "operator": "eq"
        }
        ]
        }
        }
        response_example: >-
        {
        "results": [
        {
        "notification_id": "notification-9f1476af11b7",
        "topic": "monitoring.Alert",
        "message": {
        "tags": {
        "state": "ACKNOWLEDGED",
        "resource_id": "pod",
        "project_id": "project-18655561c535",
        "urgency": "LOW",
        "created_at": null,
        "assignee": "yuda@test.co"
        },
        "title": "[Alerting] Not Running Pods 0:OK alert",
        "description": "[cloudone-dev-v1-eks-cluster] Not Running Pods 0 is OK"
        },
        "notification_type": "INFO",
        "notification_level": "LV2",
        "is_read": true,
        "user_id": "user33@spaceone.dev",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2021-06-21T17:13:39.570Z"
        },
        {
        "notification_id": "notification-4025c1b61225",
        "topic": "monitoring.Alert",
        "message": {
        "title": "[Asia Pacific (Seoul)]: NLB-TCP_Target_Reset_Count-Alert",
        "description": "Threshold Crossed: 1 out of the last 1 datapoints [200.0 (25/06/21 06:38:00)] was not greater than the threshold (200.0)",
        "tags": {
        "resource_id": "AWS/NetworkELB",
        "resource_name": "[Asia Pacific (Seoul)]:[AWS/NetworkELB]: net/dfsbvs/advdr32rwqdsvzc",
        "created_at": null,
        "state": "TRIGGERED",
        "project_id": "project-18655561c535",
        "urgency": "LOW"
        }
        },
        "notification_type": "INFO",
        "notification_level": "ALL",
        "is_read": true,
        "user_id": "user1@cloudforet.io",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2021-06-25T06:42:05.867Z"
        }
        ],
        "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_NotificationServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.CreateNotificationRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'push': grpc.unary_unary_rpc_method_handler(
                    servicer.push,
                    request_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.PushNotificationRequest.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_notification_dot_v1_dot_notification__pb2.NotificationRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'set_read': grpc.unary_unary_rpc_method_handler(
                    servicer.set_read,
                    request_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.SetReadNotificationRequest.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_notification_dot_v1_dot_notification__pb2.GetNotificationRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.notification.v1.Notification', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Notification(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.notification.v1.Notification/create',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.CreateNotificationRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def push(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.notification.v1.Notification/push',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.PushNotificationRequest.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.notification.v1.Notification/delete',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def set_read(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.notification.v1.Notification/set_read',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.SetReadNotificationRequest.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.notification.v1.Notification/get',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.GetNotificationRequest.SerializeToString,
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationInfo.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.notification.v1.Notification/list',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationQuery.SerializeToString,
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationsInfo.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.notification.v1.Notification/stat',
            spaceone_dot_api_dot_notification_dot_v1_dot_notification__pb2.NotificationStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
