# 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 struct_pb2 as google_dot_protobuf_dot_struct__pb2
from spaceone.api.inventory.v1 import unused_resource_pb2 as spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2


class UnusedResourceStub(object):
    """rpc create (UnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { post: "/inventory/v1/unused-resources" };
    }
    rpc update (UpdateUnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { put: "/inventory/v1/optimization_analysis/{unused_resource_id}" };
    }
    rpc delete (UnusedResourceRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = { delete: "/inventory/v1/optimization_analysis/{unused_resource_id}" };
    }
    rpc get (GetUnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { get: "/inventory/v1/unused-resource/{unused_resource_id}" };
    }
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.list = channel.unary_unary(
                '/spaceone.api.inventory.v1.UnusedResource/list',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourceQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourcesInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.inventory.v1.UnusedResource/stat',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourceStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


class UnusedResourceServicer(object):
    """rpc create (UnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { post: "/inventory/v1/unused-resources" };
    }
    rpc update (UpdateUnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { put: "/inventory/v1/optimization_analysis/{unused_resource_id}" };
    }
    rpc delete (UnusedResourceRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = { delete: "/inventory/v1/optimization_analysis/{unused_resource_id}" };
    }
    rpc get (GetUnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { get: "/inventory/v1/unused-resource/{unused_resource_id}" };
    }
    """

    def list(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 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_UnusedResourceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourceQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourcesInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourceStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.inventory.v1.UnusedResource', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class UnusedResource(object):
    """rpc create (UnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { post: "/inventory/v1/unused-resources" };
    }
    rpc update (UpdateUnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { put: "/inventory/v1/optimization_analysis/{unused_resource_id}" };
    }
    rpc delete (UnusedResourceRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = { delete: "/inventory/v1/optimization_analysis/{unused_resource_id}" };
    }
    rpc get (GetUnusedResourceRequest) returns (UnusedResourceInfo) {
    option (google.api.http) = { get: "/inventory/v1/unused-resource/{unused_resource_id}" };
    }
    """

    @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.inventory.v1.UnusedResource/list',
            spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourceQuery.SerializeToString,
            spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourcesInfo.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.inventory.v1.UnusedResource/stat',
            spaceone_dot_api_dot_inventory_dot_v1_dot_unused__resource__pb2.UnusedResourceStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
