# 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 cost_pb2 as spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2


class CostStub(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.Cost/create',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CreateCostRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostInfo.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/delete',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/get',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.GetCostRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/list',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostsInfo.FromString,
                )
        self.analyze = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/analyze',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/stat',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )
        self.invoices = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/invoices',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )
        self.invoice = channel.unary_unary(
                '/spaceone.api.cost_analysis.v1.Cost/invoice',
                request_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


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

    def create(self, request, context):
        """
        desc: Creates a new Cost. When creating a Cost, if the parameter `provider` is not entered, the default value of the parameter will be the provider information of the DataSource which collected the raw data of the Cost from the provider. The parameter `billed_at` is the data of when the cost is billed. While the DataSource collects the cost data, if the `billed_at` data does not exist, the value will be replaced with the `created_at` data indicating when the Cost is created. If the cost data collected is based on USD, the Cost is created without the currency exchange.
        request_example: >-
        {
        "original_cost": 4.50528e-08,
        "original_currency": "USD",
        "usd_cost": 4.50528e-08,
        "usage_quantity": 4.11e-07,
        "provider": "aws",
        "region_code": "ap-northeast-1",
        "product": "AWSDataTransfer",
        "account": "722069360300",
        "usage_type": "data-transfer.out",
        "additional_info": {
        "raw_usage_type": "APN1-DataTransfer-Out-Bytes"
        },
        "data_source_id": "ds-fcba92ca73b1"
        }
        response_example: >-
        {
        "cost_id": "cost-c5aae7712ec9",
        "usd_cost": 4.50528e-08,
        "original_currency": "USD",
        "original_cost": 4.50528e-08,
        "usage_quantity": 4.11e-07,
        "provider": "aws",
        "region_code": "ap-northeast-1",
        "product": "AWSDataTransfer",
        "account": "722069360300",
        "usage_type": "data-transfer.out",
        "tags": {},
        "additional_info": {
        "raw_usage_type": "APN1-DataTransfer-Out-Bytes"
        },
        "data_source_id": "ds-fcba92ca73b1",
        "domain_id": "domain-58010aa2e451",
        "billed_at": "2022-07-19T09:44:27.326Z",
        "created_at": "2022-07-19T09:44:27.373Z"
        }
        """
        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 Cost. You must specify the `cost_id` of the Cost to delete.
        request_example: >-
        {
        "cost_id": "cost-2ad052ed03d7"
        }
        """
        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 Cost. Prints detailed information about the Cost, including  `region_code` and `account`.
        request_example: >-
        {
        "cost_id": "cost-2ad052ed03d7"
        }
        response_example: >-
        {
        "cost_id": "cost-2ad052ed03d7",
        "usd_cost": 4.50528e-08,
        "original_currency": "USD",
        "original_cost": 4.50528e-08,
        "usage_quantity": 4.11e-07,
        "provider": "aws",
        "region_code": "ap-northeast-1",
        "product": "AWSDataTransfer",
        "account": "722069360300",
        "usage_type": "data-transfer.out",
        "tags": {},
        "additional_info": {
        "raw_usage_type": "APN1-DataTransfer-Out-Bytes"
        },
        "data_source_id": "ds-fcba92ca73b1",
        "domain_id": "domain-58010aa2e451",
        "billed_at": "2021-01-01T00:00:00.000Z",
        "created_at": "2022-04-06T13:49:39.669Z"
        }
        """
        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 Costs. You can use a query to get a filtered list of Costs.
        request_example: >-
        {
        "query": {}
        }
        response_example: >-
        {
        "results": [
        {
        "cost_id": "cost-2ad052ed03d7",
        "usd_cost": 4.50528e-08,
        "original_currency": "USD",
        "original_cost": 4.50528e-08,
        "usage_quantity": 4.11e-07,
        "provider": "aws",
        "region_code": "ap-northeast-1",
        "product": "AWSDataTransfer",
        "account": "722069360300",
        "usage_type": "data-transfer.out",
        "tags": {},
        "additional_info": {
        "raw_usage_type": "APN1-DataTransfer-Out-Bytes"
        },
        "data_source_id": "ds-fcba92ca73b1",
        "domain_id": "domain-58010aa2e451",
        "billed_at": "2021-01-01T00:00:00.000Z",
        "created_at": "2022-04-06T13:49:39.669Z"
        },
        {
        "cost_id": "cost-1d5e1b0dbf82",
        "usd_cost": 1.04e-05,
        "original_currency": "USD",
        "original_cost": 1.04e-05,
        "usage_quantity": 26.0,
        "provider": "aws",
        "region_code": "ap-northeast-1",
        "product": "AWSQueueService",
        "account": "722069360300",
        "tags": {},
        "additional_info": {
        "raw_usage_type": "APN1-Requests-Tier1"
        },
        "data_source_id": "ds-fcba92ca73b1",
        "domain_id": "domain-58010aa2e451",
        "billed_at": "2021-01-01T00:00:00.000Z",
        "created_at": "2022-04-06T13:49:39.675Z"
        }
        ],
        "total_count": 307066
        }
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def analyze(self, request, context):
        """
        desc: Gets the Cost information of specific `product`s based on the time granularity: `DAILY`, `MONTHLY`, or `ACCUMULATED`. For `DAILY` granularity, this method can get the Cost data of at most 31 days. For `MONTHLY` or `ACCUMULATED` granularity, this method can get the Cost data of at most 12 months.
        request_example: >-
        {
        "granularity": "MONTHLY",
        "start": "2022-05",
        "end": "2022-07",
        "group_by": ["product"],
        "filter": [],
        "limit": 15,
        "include_others": true,
        "domain_id": "domain-58010aa2e451"
        }
        response_example: >-
        {
        "results": [
        {
        "product": "AmazonEC2",
        "total_usd_cost": 20962.3114306262,
        "usd_cost": {
        "2022-07": 4644.0801750137,
        "2022-05": 7984.6560889987995,
        "2022-06": 8333.5751666137
        }
        },
        {
        "usd_cost": {
        "2022-07": 2817.0,
        "2022-06": 5439.0,
        "2022-05": 5269.0
        },
        "total_usd_cost": 13525.0,
        "product": "AWS Marketplace"
        },
        {
        "product": "AmazonDocDB",
        "usd_cost": {
        "2022-05": 6910.6140347763,
        "2022-06": 3238.7851615211,
        "2022-07": 812.2452815070001
        },
        "total_usd_cost": 10961.6444778044
        }
        ]
        }
        """
        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 invoices(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 invoice(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_CostServicer_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_cost__pb2.CreateCostRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostInfo.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostRequest.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_cost__pb2.GetCostRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostsInfo.SerializeToString,
            ),
            'analyze': grpc.unary_unary_rpc_method_handler(
                    servicer.analyze,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
            'invoices': grpc.unary_unary_rpc_method_handler(
                    servicer.invoices,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
            'invoice': grpc.unary_unary_rpc_method_handler(
                    servicer.invoice,
                    request_deserializer=spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.cost_analysis.v1.Cost', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Cost(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.Cost/create',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CreateCostRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostInfo.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.Cost/delete',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostRequest.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.Cost/get',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.GetCostRequest.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostInfo.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.Cost/list',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostQuery.SerializeToString,
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostsInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def analyze(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.Cost/analyze',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.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.Cost/stat',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def invoices(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.Cost/invoices',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def invoice(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.Cost/invoice',
            spaceone_dot_api_dot_cost__analysis_dot_v1_dot_cost__pb2.CostAnalyzeQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
