# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from google.cloud.asset_v1p1beta1.proto import (
    asset_service_pb2 as google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2,
)


class AssetServiceStub(object):
    """Asset service definition.
  """

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

    Args:
      channel: A grpc.Channel.
    """
        self.SearchAllResources = channel.unary_unary(
            "/google.cloud.asset.v1p1beta1.AssetService/SearchAllResources",
            request_serializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllResourcesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllResourcesResponse.FromString,
        )
        self.SearchAllIamPolicies = channel.unary_unary(
            "/google.cloud.asset.v1p1beta1.AssetService/SearchAllIamPolicies",
            request_serializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllIamPoliciesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllIamPoliciesResponse.FromString,
        )


class AssetServiceServicer(object):
    """Asset service definition.
  """

    def SearchAllResources(self, request, context):
        """Searches all the resources under a given accessible CRM scope
    (project/folder/organization). This RPC gives callers
    especially admins the ability to search all the resources under a scope,
    even if they don't have .get permission of all the resources. Callers
    should have cloud.assets.SearchAllResources permission on the requested
    scope, otherwise it will be rejected.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SearchAllIamPolicies(self, request, context):
        """Searches all the IAM policies under a given accessible CRM scope
    (project/folder/organization). This RPC gives callers
    especially admins the ability to search all the IAM policies under a scope,
    even if they don't have .getIamPolicy permission of all the IAM policies.
    Callers should have cloud.assets.SearchAllIamPolicies permission on the
    requested scope, otherwise it will be rejected.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_AssetServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "SearchAllResources": grpc.unary_unary_rpc_method_handler(
            servicer.SearchAllResources,
            request_deserializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllResourcesRequest.FromString,
            response_serializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllResourcesResponse.SerializeToString,
        ),
        "SearchAllIamPolicies": grpc.unary_unary_rpc_method_handler(
            servicer.SearchAllIamPolicies,
            request_deserializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllIamPoliciesRequest.FromString,
            response_serializer=google_dot_cloud_dot_asset__v1p1beta1_dot_proto_dot_asset__service__pb2.SearchAllIamPoliciesResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.asset.v1p1beta1.AssetService", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
