# 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.inventory.v1 import resource_group_pb2 as spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2


class ResourceGroupStub(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.inventory.v1.ResourceGroup/create',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.CreateResourceGroupRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.FromString,
                )
        self.update = channel.unary_unary(
                '/spaceone.api.inventory.v1.ResourceGroup/update',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.UpdateResourceGroupRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.FromString,
                )
        self.delete = channel.unary_unary(
                '/spaceone.api.inventory.v1.ResourceGroup/delete',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.get = channel.unary_unary(
                '/spaceone.api.inventory.v1.ResourceGroup/get',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.GetResourceGroupRequest.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.FromString,
                )
        self.list = channel.unary_unary(
                '/spaceone.api.inventory.v1.ResourceGroup/list',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupQuery.SerializeToString,
                response_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupsInfo.FromString,
                )
        self.stat = channel.unary_unary(
                '/spaceone.api.inventory.v1.ResourceGroup/stat',
                request_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupStatQuery.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_struct__pb2.Struct.FromString,
                )


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

    def create(self, request, context):
        """
        desc: Creates a new ResourceGroup. You can integrate `resource`s from different `provider`s by specifying the cloud resources to be grouped in the `resources` parameter.
        request_example: >-
        {
        "name": "azure-group-1",
        "resources": [
        {
        "resource_type": "inventory.Server?provider=azure&cloud_service_group=Compute&cloud_service_type=VirtualMachine",
        "filter": [
        {"o": "eq", "k": "provider", "v": "azure"},
        {"o": "eq", "k": "cloud_service_group", "v": "Compute"},
        {"o": "eq", "k": "cloud_service_type", "v": "VirtualMachine"}
        ]
        }
        ],
        "options": {
        "raw_filter": []
        },
        "tags": {
        "a": "b"
        }
        }
        response_example: >-
        {
        "resource_group_id": "rsc-grp-7d46a1fc7738",
        "name": "azure-group-1",
        "resources": [
        {
        "resource_type": "inventory.Server?provider=azure&cloud_service_group=Compute&cloud_service_type=VirtualMachine",
        "filter": [
        {
        "k": "provider",
        "v": "azure",
        "o": "eq"
        },
        {
        "k": "cloud_service_group",
        "v": "Compute",
        "o": "eq"
        },
        {
        "k": "cloud_service_type",
        "v": "VirtualMachine",
        "o": "eq"
        }
        ]
        }
        ],
        "options": {
        "raw_filter": []
        },
        "tags": {
        "a": "b"
        },
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-06-23T01:50:33.152Z"
        }
        """
        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 ResourceGroup. You can make changes in ResourceGroup settings, including `name`, `tags`, and grouped resources in the ResourceGroup.
        request_example: >-
        {
        "resource_group_id": "rsc-grp-7d46a1fc7738",
        "name": "azure-grp-test2",
        "resources": [
        {
        "resource_type": "inventory.Server?provider=azure&cloud_service_group=Compute&cloud_service_type=VirtualMachine",
        "filter": [
        {"k": "provider", "v": "azure", "o": "eq"},
        {"o": "eq", "k": "cloud_service_group", "v": "Compute"},
        {"v": "VirtualMachine", "k": "cloud_service_type", "o": "eq"}
        ]
        }
        ],
        "options": {},
        "tags": {
        "b": "c"
        }
        }
        response_example: >-
        {
        "resource_group_id": "rsc-grp-7d46a1fc7738",
        "name": "azure-grp-test2",
        "resources": [
        {
        "resource_type": "inventory.Server?provider=azure&cloud_service_group=Compute&cloud_service_type=VirtualMachine",
        "filter": [
        {
        "k": "provider",
        "v": "azure",
        "o": "eq"
        },
        {
        "k": "cloud_service_group",
        "v": "Compute",
        "o": "eq"
        },
        {
        "k": "cloud_service_type",
        "v": "VirtualMachine",
        "o": "eq"
        }
        ]
        }
        ],
        "options": {
        "raw_filter": []
        },
        "tags": {
        "a": "b"
        },
        "domain_id": "domain-58010aa2e451",
        "created_at": "2022-06-23T01:50:33.152Z"
        }
        """
        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 ResourceGroup. You must specify the `resource_group_id` of the ResourceGroup to delete.
        request_example: >-
        {
        "resource_group_id": "rsc-grp-aa3c4ca465b2"
        }
        """
        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 ResourceGroup. Prints detailed information about the ResourceGroup, including the information of the grouped cloud resources.
        request_example: >-
        {
        "resource_group_id": "rsc-grp-aa3c4ca465b2"
        }
        response_example: >-
        {
        "resource_group_id": "rsc-grp-aa3c4ca465b2",
        "name": "stset",
        "resources": [
        {
        "resource_type": "inventory.Server?provider=aws&cloud_service_group=EC2&cloud_service_type=Instance",
        "filter": [
        {
        "k": "provider",
        "o": "eq",
        "v": "aws"
        },
        {
        "v": "EC2",
        "k": "cloud_service_group",
        "o": "eq"
        },
        {
        "o": "eq",
        "k": "cloud_service_type",
        "v": "Instance"
        }
        ],
        "keyword": "test"
        }
        ],
        "options": {
        "raw_filter": []
        },
        "tags": {},
        "project_id": "project-18655561c535",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2021-06-01T10:23:20.537Z"
        }
        """
        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 ResourceGroups. You can use a query to get a filtered list of ResourceGroups.
        request_example: >-
        {
        "query": {
        "filter": [
        {
        "key": "name",
        "value": [
        "azure-vmss-group",
        "stset"
        ],
        "operator": "in"
        }
        ]
        }
        }
        response_example: >-
        {
        "results": [
        {
        "resource_group_id": "rsc-grp-4c86e071e0f0",
        "name": "azure-vmss-group",
        "resources": [
        {
        "resource_type": "inventory.CloudService?provider=azure&cloud_service_group=Compute&cloud_service_type=VmScaleSet",
        "filter": [
        {
        "k": "provider",
        "v": "azure",
        "o": "eq"
        },
        {
        "v": "Compute",
        "k": "cloud_service_group",
        "o": "eq"
        },
        {
        "k": "cloud_service_type",
        "v": "VmScaleSet",
        "o": "eq"
        }
        ]
        }
        ],
        "options": {
        "raw_filter": []
        },
        "tags": {},
        "project_id": "project-9074eea97d7e",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2021-04-23T03:23:40.037Z"
        },
        {
        "resource_group_id": "rsc-grp-aa3c4ca465b2",
        "name": "stset",
        "resources": [
        {
        "resource_type": "inventory.Server?provider=aws&cloud_service_group=EC2&cloud_service_type=Instance",
        "filter": [
        {
        "k": "provider",
        "v": "aws",
        "o": "eq"
        },
        {
        "v": "EC2",
        "k": "cloud_service_group",
        "o": "eq"
        },
        {
        "k": "cloud_service_type",
        "v": "Instance",
        "o": "eq"
        }
        ],
        "keyword": "test"
        }
        ],
        "options": {
        "raw_filter": [
        [
        "test"
        ]
        ]
        },
        "tags": {},
        "project_id": "project-18655561c535",
        "domain_id": "domain-58010aa2e451",
        "created_at": "2021-06-01T10:23:20.537Z"
        }
        ],
        "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_ResourceGroupServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'create': grpc.unary_unary_rpc_method_handler(
                    servicer.create,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.CreateResourceGroupRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.SerializeToString,
            ),
            'update': grpc.unary_unary_rpc_method_handler(
                    servicer.update,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.UpdateResourceGroupRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.SerializeToString,
            ),
            'delete': grpc.unary_unary_rpc_method_handler(
                    servicer.delete,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupRequest.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_inventory_dot_v1_dot_resource__group__pb2.GetResourceGroupRequest.FromString,
                    response_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.SerializeToString,
            ),
            'list': grpc.unary_unary_rpc_method_handler(
                    servicer.list,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupQuery.FromString,
                    response_serializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupsInfo.SerializeToString,
            ),
            'stat': grpc.unary_unary_rpc_method_handler(
                    servicer.stat,
                    request_deserializer=spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupStatQuery.FromString,
                    response_serializer=google_dot_protobuf_dot_struct__pb2.Struct.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spaceone.api.inventory.v1.ResourceGroup', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class ResourceGroup(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.inventory.v1.ResourceGroup/create',
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.CreateResourceGroupRequest.SerializeToString,
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.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.inventory.v1.ResourceGroup/update',
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.UpdateResourceGroupRequest.SerializeToString,
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.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.inventory.v1.ResourceGroup/delete',
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupRequest.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.inventory.v1.ResourceGroup/get',
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.GetResourceGroupRequest.SerializeToString,
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupInfo.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.inventory.v1.ResourceGroup/list',
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupQuery.SerializeToString,
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupsInfo.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.ResourceGroup/stat',
            spaceone_dot_api_dot_inventory_dot_v1_dot_resource__group__pb2.ResourceGroupStatQuery.SerializeToString,
            google_dot_protobuf_dot_struct__pb2.Struct.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
