# 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.cost_analysis.v1 import custom_widget_pb2 as spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2


class CustomWidgetStub(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.cost_analysis.v1.CustomWidget/create',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CreateCustomWidgetRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.FromString,
                )
        self.update = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.CustomWidget/update',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.UpdateCustomWidgetRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.CustomWidget/delete',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.CustomWidget/get',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.GetCustomWidgetRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.CustomWidget/list',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.CustomWidget/stat',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


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

    def create(self, request, context):
        """
        desc: Creates a new CustomWidget. Based on the queries of the CostQuerySet the User made, a widget is created with the default template Cloudforet provides.
        request_example: >-
        {
        "name": "project_provider_region-f59722cf-dc03-4758-ab7f",
        "options": {
        "group_by": "project_id",
        "stack": false,
        "layout": 100.0,
        "granularity": "ACCUMULATED",
        "filters": {},
        "chart_type": "DONUT"
        }
        }
        response_example: >-
        {
        "widget_id": "widget-8b1241aff67d",
        "name": "project_provider_region-f59722cf-dc03-4758-ab7f",
        "options": {
        "filters": {},
        "group_by": "project_id",
        "granularity": "ACCUMULATED",
        "layout": 100.0,
        "stack": false,
        "chart_type": "DONUT"
        },
        "tags": {},
        "user_id": "test_user@cloudforet.io",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-07-19T06:18:55.819Z",
        "updated_at": "2022-07-19T06:18:55.819Z"
        }
        """
        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 CustomWidget. You can make changes in CustomWidget settings, including `chart_type` and queries.
        request_example: >-
        {
        "widget_id": "widget-8b1241aff67d",
        "name": "project_provider_region",
        "options": {
        "layout": 100.0,
        "chart_type": "DONUT",
        "stack": false,
        "group_by": "project_id",
        "granularity": "ACCUMULATED",
        "filters": {}
        },
        "tags": {
        "a": "b"
        }
        }
        response_example: >-
        {
        "widget_id": "widget-8b1241aff67d",
        "name": "project_provider_region",
        "options": {
        "filters": {},
        "chart_type": "DONUT",
        "stack": false,
        "layout": 100.0,
        "granularity": "ACCUMULATED",
        "group_by": "project_id"
        },
        "tags": {
        "a": "b"
        },
        "user_id": "test_user@cloudforet.io",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-07-19T06:18:55.819Z",
        "updated_at": "2022-07-19T06:18:55.819Z"
        }
        """
        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 CustomWidget. You must specify the `custom_widget_id` of the CustomWidget to delete.
        request_example: >-
        {
        "widget_id": "widget-205f743a9890"
        }
        """
        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 CustomWidget. Prints detailed information about the CustomWidget, including `chart_type` and queries.
        request_example: >-
        {
        "widget_id": "widget-205f743a9890"
        }
        response_example: >-
        {
        "widget_id": "widget-205f743a9890",
        "name": "3 month product pie chart-a6752241-0a0b-4604-9186",
        "options": {
        "chart_type": "DONUT",
        "layout": 100.0,
        "filters": {},
        "stack": false,
        "group_by": "product",
        "granularity": "ACCUMULATED"
        },
        "tags": {},
        "user_id": "test@cloudforet.io",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-03-08T03:37:42.967Z",
        "updated_at": "2022-03-08T03:37:42.967Z"
        }
        """
        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 CustomWidgets. You can use a query to get a filtered list of CustomWidgets.
        request_example: >-
        {
        "query": {}
        }
        response_example: >-
        {
        "results": [
        {
        "widget_id": "widget-205f743a9890",
        "name": "3 month product pie chart-a6752241-0a0b-4604-9186",
        "options": {
        "stack": false,
        "layout": 100.0,
        "granularity": "ACCUMULATED",
        "filters": {},
        "chart_type": "DONUT",
        "group_by": "product"
        },
        "tags": {},
        "user_id": "yuda@mz.co.kr",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-03-08T03:37:42.967Z",
        "updated_at": "2022-03-08T03:37:42.967Z"
        },
        {
        "widget_id": "widget-c672e1501066",
        "name": "6 month project group-589318f7-ee8d-4018-9d56",
        "options": {
        "stack": false,
        "layout": 100.0,
        "chart_type": "STACKED_COLUMN",
        "filters": {},
        "group_by": "project_group_id",
        "granularity": "MONTHLY"
        },
        "tags": {},
        "user_id": "yuda@mz.co.kr",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-03-14T09:30:03.115Z",
        "updated_at": "2022-03-14T09:30:03.115Z"
        }
        ],
        "total_count": 27
        }
        """
        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_CustomWidgetServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CreateCustomWidgetRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.UpdateCustomWidgetRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetRequest.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_cost__analysis_dot_v1_dot_custom__widget__pb2.GetCustomWidgetRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.cost_analysis.v1.CustomWidget', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class CustomWidget(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.cost_analysis.v1.CustomWidget/create',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CreateCustomWidgetRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.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.cost_analysis.v1.CustomWidget/update',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.UpdateCustomWidgetRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.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.cost_analysis.v1.CustomWidget/delete',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetRequest.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.cost_analysis.v1.CustomWidget/get',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.GetCustomWidgetRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetInfo.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.cost_analysis.v1.CustomWidget/list',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetQuery.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetsInfo.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.cost_analysis.v1.CustomWidget/stat',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_custom__widget__pb2.CustomWidgetStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
