# 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.monitoring.v1 import event_pb2 as spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2


class EventStub(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.monitoring.v1.Event/create',
                request_serializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.CreateEventRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.monitoring.v1.Event/get',
                request_serializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.GetEventRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.monitoring.v1.Event/list',
                request_serializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.monitoring.v1.Event/stat',
                request_serializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


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

    def create(self, request, context):
        """
        desc: Creates a new Event. The Event creation process starts with validation checking whether the input data is from a webhook or not. After the input data is validated, the data is processed and used to create the Event.
        """
        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 Event matching the input parameters, `event_id` and `domain_id`. Prints detailed information about the Event.
        request_example: >-
        {
        "event_id": "event-4e16ba3bd384",
        "domain_id": "domain-58010aa2e451"
        }
        response_example: >-
        {
        "event_id": "event-4e16ba3bd384",
        "event_key": "cfbdd0cee08f0f2664dbef297c370017",
        "event_type": "ALERT",
        "title": "Notification of access to the SpaceONE bastion Host",
        "description": "SSH Access to stargate-dev-kubectl-amzl2 from spaceoneadm",
        "severity": "INFO",
        "resource": {
        "resource_id": "server-1187737cc0d9",
        "resource_type": "inventory.Server",
        "name": "stargate-dev-kubectl-amzl2"
        },
        "raw_data": {
        "resource": {
        "name": "stargate-dev-kubectl-amzl2",
        "resource_id": "server-1187737cc0d9",
        "resource_type": "inventory.Server"
        },
        "event_key": "cfbdd0cee08f0f2664dbef297c370017",
        "title": "Notification of access to the SpaceONE bastion Host",
        "severity": "INFO",
        "description": "SSH Access to stargate-dev-kubectl-amzl2 from spaceoneadm",
        "event_type": "ALERT",
        "additional_info": {
        "host": [],
        "user": "spaceoneadm"
        }
        },
        "additional_info": {
        "host": "[]",
        "user": "spaceoneadm"
        },
        "alert_id": "alert-06462f6cb54e",
        "webhook_id": "webhook-ff9e2eda678a",
        "project_id": "project-18655561c535",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-06-21T00:34:58.034Z"
        }
        """
        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 Events. You must specify the `domain_id`. You can use a query to get a filtered list of Events.
        request_example: >-
        {
        "query": {},
        "domain_id": "domain-58010aa2e451"
        }
        response_example: >-
        {
        "results": [
        {
        "event_id": "event-4e16ba3bd384",
        "event_key": "cfbdd0cee08f0f2664dbef297c370017",
        "event_type": "ALERT",
        "title": "Notification of access to the SpaceONE bastion Host",
        "description": "SSH Access to stargate-dev-kubectl-amzl2 from spaceoneadm",
        "severity": "INFO",
        "resource": {
        "resource_id": "server-1187737cc0d9",
        "resource_type": "inventory.Server",
        "name": "stargate-dev-kubectl-amzl2"
        },
        "raw_data": {
        "resource": {
        "name": "stargate-dev-kubectl-amzl2",
        "resource_type": "inventory.Server",
        "resource_id": "server-1187737cc0d9"
        },
        "event_key": "cfbdd0cee08f0f2664dbef297c370017",
        "additional_info": {
        "user": "spaceoneadm",
        "host": []
        },
        "severity": "INFO",
        "description": "SSH Access to stargate-dev-kubectl-amzl2 from spaceoneadm",
        "title": "Notification of access to the SpaceONE bastion Host",
        "event_type": "ALERT"
        },
        "additional_info": {
        "user": "spaceoneadm",
        "host": "[]"
        },
        "alert_id": "alert-06462f6cb54e",
        "webhook_id": "webhook-ff9e2eda678a",
        "project_id": "project-18655561c535",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-06-21T00:34:58.034Z"
        },
        {
        "event_id": "event-b178e1b71daf",
        "event_key": "abc16e5455c26ab7611bf8aa8d1020cc",
        "event_type": "ALERT",
        "title": "Notification of access to the SpaceONE bastion Host",
        "description": "SSH Access to stargate-dev-kubectl-amzl2 from glee@mz.co.kr",
        "severity": "INFO",
        "resource": {
        "resource_id": "server-1187737cc0d9",
        "resource_type": "inventory.Server",
        "name": "stargate-dev-kubectl-amzl2"
        },
        "raw_data": {
        "additional_info": {
        "host": [
        "125.131.104.40"
        ],
        "user": "glee@mz.co.kr"
        },
        "description": "SSH Access to stargate-dev-kubectl-amzl2 from glee@mz.co.kr",
        "severity": "INFO",
        "event_type": "ALERT",
        "title": "Notification of access to the SpaceONE bastion Host",
        "resource": {
        "resource_type": "inventory.Server",
        "name": "stargate-dev-kubectl-amzl2",
        "resource_id": "server-1187737cc0d9"
        },
        "event_key": "abc16e5455c26ab7611bf8aa8d1020cc"
        },
        "additional_info": {
        "user": "glee@mz.co.kr",
        "host": "['125.131.104.40']"
        },
        "alert_id": "alert-332617cf2894",
        "webhook_id": "webhook-ff9e2eda678a",
        "project_id": "project-18655561c535",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-06-21T00:34:52.822Z"
        }
        ],
        "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_EventServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.CreateEventRequest.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_monitoring_dot_v1_dot_event__pb2.GetEventRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.monitoring.v1.Event', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Event(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.monitoring.v1.Event/create',
            spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.CreateEventRequest.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.monitoring.v1.Event/get',
            spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.GetEventRequest.SerializeToString,
            spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventInfo.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.monitoring.v1.Event/list',
            spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventQuery.SerializeToString,
            spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventsInfo.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.monitoring.v1.Event/stat',
            spaceone_dot_api_dot_monitoring_dot_v1_dot_event__pb2.EventStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
