# 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 budget_pb2 as spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2


class BudgetStub(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.Budget/create',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.CreateBudgetRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.FromString,
                )
        self.update = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Budget/update',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.UpdateBudgetRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.FromString,
                )
        self.set_notification = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Budget/set_notification',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.SetBudgetNotificationRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Budget/delete',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Budget/get',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.GetBudgetRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Budget/list',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Budget/stat',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


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

    def create(self, request, context):
        """
        desc: Creates a new Budget. When creating a Budget, it should be set for a specific ProjectGroup or Project. The budgeted amount and date of the `planned_limits` should be specified on a monthly or yearly basis.
        request_example: >-
        {
        "name": "Cloudforet-Budget",
        "planned_limits": [{"date": "2022-01", "limit": 1000.0},
        {"date": "2022-02", "limit": 1100.0},
        {"date": "2022-03", "limit": 1200.0},
        {"date": "2022-04", "limit": 1300.0},
        {"date": "2022-05", "limit": 1400.0},
        {"date": "2022-06", "limit": 1500.0},
        {"date": "2022-07", "limit": 1600.0},
        {"date": "2022-08", "limit": 1700.0},
        {"date": "2022-09", "limit": 1800.0},
        {"date": "2022-10", "limit": 1900.0},
        {"date": "2022-11", "limit": 2000.0},
        {"date": "2022-12", "limit": 2100.0}],
        "time_unit": "MONTHLY",
        "start": "2022-01",
        "end": "2022-12",
        "project_group_id": "pg-812c90990877"
        }
        response_example: >-
        {
        "budget_id": "budget-d51b6b6a9910",
        "name": "Cloudforet-Budget",
        "limit": 18600.0,
        "planned_limits": [
        {
        "date": "2022-01",
        "limit": 1000.0
        },
        {
        "date": "2022-02",
        "limit": 1100.0
        },
        {
        "date": "2022-03",
        "limit": 1200.0
        },
        {
        "date": "2022-04",
        "limit": 1300.0
        },
        {
        "date": "2022-05",
        "limit": 1400.0
        },
        {
        "date": "2022-06",
        "limit": 1500.0
        },
        {
        "date": "2022-07",
        "limit": 1600.0
        },
        {
        "date": "2022-08",
        "limit": 1700.0
        },
        {
        "date": "2022-09",
        "limit": 1800.0
        },
        {
        "date": "2022-10",
        "limit": 1900.0
        },
        {
        "date": "2022-11",
        "limit": 2000.0
        },
        {
        "date": "2022-12",
        "limit": 2100.0
        }
        ],
        "total_usage_usd_cost": 43412.45,
        "time_unit": "MONTHLY",
        "start": "2022-01",
        "end": "2022-12",
        "tags": {},
        "project_group_id": "pg-812c90990877",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-07-18T09:30:56.901Z",
        "updated_at": "2022-07-18T09:30:56.901Z"
        }
        """
        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 Budget. You can make changes in the budgeted amount of the time period specified while creating the resource.
        request_example: >-
        {
        "budget_id": "budget-d51b6b6a9910",
        "name": "Cloudforet-Budget-test", "limit": 15000.0,
        "planned_limits": [{"date": "2022-01", "limit": 500.0},
        {"date": "2022-02", "limit": 500.0},
        {"date": "2022-03", "limit": 500.0},
        {"date": "2022-04", "limit": 500.0},
        {"date": "2022-05", "limit": 500.0},
        {"date": "2022-06", "limit": 500.0},
        {"date": "2022-07", "limit": 500.0},
        {"date": "2022-08", "limit": 500.0},
        {"date": "2022-09", "limit": 500.0}],
        "end": "2022-12",
        "tags": {}
        }
        response_example: >-
        {
        "budget_id": "budget-d51b6b6a9910",
        "name": "Cloudforet-Budget-test",
        "limit": 15000.0,
        "planned_limits": [
        {
        "date": "2022-01",
        "limit": 500.0
        },
        {
        "date": "2022-02",
        "limit": 500.0
        },
        {
        "date": "2022-03",
        "limit": 500.0
        },
        {
        "date": "2022-04",
        "limit": 500.0
        },
        {
        "date": "2022-05",
        "limit": 500.0
        },
        {
        "date": "2022-06",
        "limit": 500.0
        },
        {
        "date": "2022-07",
        "limit": 500.0
        },
        {
        "date": "2022-08",
        "limit": 500.0
        },
        {
        "date": "2022-09",
        "limit": 500.0
        }
        ],
        "total_usage_usd_cost": 43642.49,
        "time_unit": "MONTHLY",
        "start": "2022-01",
        "end": "2022-12",
        "tags": {},
        "project_group_id": "pg-812c90990877",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-07-18T09:30:56.901Z",
        "updated_at": "2022-07-18T09:30:56.901Z"
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def set_notification(self, request, context):
        """
        desc: Sets a notification on a specific Budget. Sets a threshold on the budget, and if the cost exceeds the threshold, a notification is raised.
        request_example: >-
        {
        "budget_id": "budget-4c8606da4521",
        "notifications": [
        {
        "threshold": 20.0,
        "unit": "PERCENT",
        "notification_type": "CRITICAL"
        },
        {
        "threshold": 1000.0,
        "unit": "ACTUAL_COST",
        "notification_type": "WARNING"
        }
        ]
        }
        response_example: >-
        {
        "budget_id": "budget-4c8606da4521",
        "name": "Cloudforet-Budget-test2",
        "limit": 5000.0,
        "time_unit": "TOTAL",
        "start": "2022-01",
        "end": "2022-12",
        "notifications": [
        {
        "threshold": 20.0,
        "unit": "PERCENT",
        "notification_type": "CRITICAL"
        },
        {
        "threshold": 1000.0,
        "unit": "ACTUAL_COST",
        "notification_type": "WARNING"
        }
        ],
        "tags": {},
        "project_id": "project-52a423012d5e",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-07-19T04:31:10.314Z",
        "updated_at": "2022-07-19T04:31:10.314Z"
        }
        """
        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 Budget. You must specify the `budget_id` of the Budget to delete.
        request_example: >-
        {
        "budget_id": "budget-d51b6b6a9910"
        }
        """
        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 Budget. Prints detailed information about the Budget, including `planned_limits` of the project group or project for the pre-defined period.
        request_example: >-
        {
        "budget_id": "budget-d51b6b6a9910"
        }
        response_example: >-
        {
        "budget_id": "budget-d51b6b6a9910",
        "name": "Cloudforet-Budget",
        "limit": 18600.0,
        "planned_limits": [
        {
        "date": "2022-01",
        "limit": 1000.0
        },
        {
        "date": "2022-02",
        "limit": 1100.0
        },
        {
        "date": "2022-03",
        "limit": 1200.0
        },
        {
        "date": "2022-04",
        "limit": 1300.0
        },
        {
        "date": "2022-05",
        "limit": 1400.0
        },
        {
        "date": "2022-06",
        "limit": 1500.0
        },
        {
        "date": "2022-07",
        "limit": 1600.0
        },
        {
        "date": "2022-08",
        "limit": 1700.0
        },
        {
        "date": "2022-09",
        "limit": 1800.0
        },
        {
        "date": "2022-10",
        "limit": 1900.0
        },
        {
        "date": "2022-11",
        "limit": 2000.0
        },
        {
        "date": "2022-12",
        "limit": 2100.0
        }
        ],
        "total_usage_usd_cost": 43412.45,
        "time_unit": "MONTHLY",
        "start": "2022-01",
        "end": "2022-12",
        "tags": {},
        "project_group_id": "pg-812c90990877",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-07-18T09:30:56.901Z",
        "updated_at": "2022-07-18T09:30:56.901Z"
        }
        """
        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 Budgets. You can use a query to get a filtered list of Budgets.
        request_example: >-
        {
        "query": {}
        }
        response_example: >-
        {
        "results": [
        {
        "budget_id": "budget-409e33836ea2",
        "name": "Budget 2 - Monthly",
        "limit": 18600.0,
        "planned_limits": [
        {
        "date": "2022-01",
        "limit": 1000.0
        },
        {
        "date": "2022-02",
        "limit": 1100.0
        },
        {
        "date": "2022-03",
        "limit": 1200.0
        },
        {
        "date": "2022-04",
        "limit": 1300.0
        },
        {
        "date": "2022-05",
        "limit": 1400.0
        },
        {
        "date": "2022-06",
        "limit": 1500.0
        },
        {
        "date": "2022-07",
        "limit": 1600.0
        },
        {
        "date": "2022-08",
        "limit": 1700.0
        },
        {
        "date": "2022-09",
        "limit": 1800.0
        },
        {
        "date": "2022-10",
        "limit": 1900.0
        },
        {
        "date": "2022-11",
        "limit": 2000.0
        },
        {
        "date": "2022-12",
        "limit": 2100.0
        }
        ],
        "total_usage_usd_cost": 43412.45,
        "time_unit": "MONTHLY",
        "start": "2022-01",
        "end": "2022-12",
        "tags": {},
        "project_group_id": "pg-812c90990877",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-04-12T06:09:56.917Z",
        "updated_at": "2022-04-12T06:09:56.917Z"
        }
        ],
        "total_count": 6
        }
        """
        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_BudgetServicer_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_budget__pb2.CreateBudgetRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.UpdateBudgetRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.SerializeToString,
            ),
            'set_notification': grpc.unary_unary_rpc_method_handler(
                    servicer.set_notification,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.SetBudgetNotificationRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetRequest.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_budget__pb2.GetBudgetRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.cost_analysis.v1.Budget', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Budget(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.Budget/create',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.CreateBudgetRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.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.Budget/update',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.UpdateBudgetRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def set_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.cost_analysis.v1.Budget/set_notification',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.SetBudgetNotificationRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.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.Budget/delete',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetRequest.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.Budget/get',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.GetBudgetRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetInfo.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.Budget/list',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetQuery.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetsInfo.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.Budget/stat',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_budget__pb2.BudgetStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
