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

from google.cloud.redis_v1beta1.proto import (
    cloud_redis_pb2 as google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2,
)
from google.longrunning import (
    operations_pb2 as google_dot_longrunning_dot_operations__pb2,
)


class CloudRedisStub(object):
    """Configures and manages Cloud Memorystore for Redis instances

  Google Cloud Memorystore for Redis v1beta1

  The `redis.googleapis.com` service implements the Google Cloud Memorystore
  for Redis API and defines the following resource model for managing Redis
  instances:
  * The service works with a collection of cloud projects, named: `/projects/*`
  * Each project has a collection of available locations, named: `/locations/*`
  * Each location has a collection of Redis instances, named: `/instances/*`
  * As such, Redis instances are resources of the form:
  `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`

  Note that location_id must be refering to a GCP `region`; for example:
  * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
  """

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

    Args:
      channel: A grpc.Channel.
    """
        self.ListInstances = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/ListInstances",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.FromString,
        )
        self.GetInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/GetInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.Instance.FromString,
        )
        self.CreateInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/CreateInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.UpdateInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/UpdateInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.ImportInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/ImportInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.ExportInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/ExportInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.FailoverInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/FailoverInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.DeleteInstance = channel.unary_unary(
            "/google.cloud.redis.v1beta1.CloudRedis/DeleteInstance",
            request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )


class CloudRedisServicer(object):
    """Configures and manages Cloud Memorystore for Redis instances

  Google Cloud Memorystore for Redis v1beta1

  The `redis.googleapis.com` service implements the Google Cloud Memorystore
  for Redis API and defines the following resource model for managing Redis
  instances:
  * The service works with a collection of cloud projects, named: `/projects/*`
  * Each project has a collection of available locations, named: `/locations/*`
  * Each location has a collection of Redis instances, named: `/instances/*`
  * As such, Redis instances are resources of the form:
  `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`

  Note that location_id must be refering to a GCP `region`; for example:
  * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
  """

    def ListInstances(self, request, context):
        """Lists all Redis instances owned by a project in either the specified
    location (region) or all locations.

    The location should have the following format:
    * `projects/{project_id}/locations/{location_id}`

    If `location_id` is specified as `-` (wildcard), then all regions
    available to the project are queried, and the results are aggregated.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetInstance(self, request, context):
        """Gets the details of a specific Redis instance.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreateInstance(self, request, context):
        """Creates a Redis instance based on the specified tier and memory size.

    By default, the instance is accessible from the project's
    [default network](/compute/docs/networks-and-firewalls#networks).

    The creation is executed asynchronously and callers may check the returned
    operation to track its progress. Once the operation is completed the Redis
    instance will be fully functional. Completed longrunning.Operation will
    contain the new instance object in the response field.

    The returned operation is automatically deleted after a few hours, so there
    is no need to call DeleteOperation.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateInstance(self, request, context):
        """Updates the metadata and configuration of a specific Redis instance.

    Completed longrunning.Operation will contain the new instance object
    in the response field. The returned operation is automatically deleted
    after a few hours, so there is no need to call DeleteOperation.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ImportInstance(self, request, context):
        """Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.

    Redis may stop serving during this operation. Instance state will be
    IMPORTING for entire operation. When complete, the instance will contain
    only data from the imported file.

    The returned operation is automatically deleted after a few hours, so
    there is no need to call DeleteOperation.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ExportInstance(self, request, context):
        """Export Redis instance data into a Redis RDB format file in Cloud Storage.

    Redis will continue serving during this operation.

    The returned operation is automatically deleted after a few hours, so
    there is no need to call DeleteOperation.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def FailoverInstance(self, request, context):
        """Initiates a failover of the master node to current replica node for a
    specific STANDARD tier Cloud Memorystore for Redis instance.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeleteInstance(self, request, context):
        """Deletes a specific Redis instance.  Instance stops serving and data is
    deleted.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_CloudRedisServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "ListInstances": grpc.unary_unary_rpc_method_handler(
            servicer.ListInstances,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.FromString,
            response_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.SerializeToString,
        ),
        "GetInstance": grpc.unary_unary_rpc_method_handler(
            servicer.GetInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.FromString,
            response_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.Instance.SerializeToString,
        ),
        "CreateInstance": grpc.unary_unary_rpc_method_handler(
            servicer.CreateInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "UpdateInstance": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "ImportInstance": grpc.unary_unary_rpc_method_handler(
            servicer.ImportInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "ExportInstance": grpc.unary_unary_rpc_method_handler(
            servicer.ExportInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "FailoverInstance": grpc.unary_unary_rpc_method_handler(
            servicer.FailoverInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "DeleteInstance": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteInstance,
            request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.redis.v1beta1.CloudRedis", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
