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

from google.cloud.iot_v1.proto import (
    device_manager_pb2 as google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2,
)
from google.cloud.iot_v1.proto import (
    resources_pb2 as google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2,
)
from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2
from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class DeviceManagerStub(object):
    """Internet of Things (IoT) service. Securely connect and manage IoT devices.
  """

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

    Args:
      channel: A grpc.Channel.
    """
        self.CreateDeviceRegistry = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/CreateDeviceRegistry",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.CreateDeviceRegistryRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceRegistry.FromString,
        )
        self.GetDeviceRegistry = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/GetDeviceRegistry",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.GetDeviceRegistryRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceRegistry.FromString,
        )
        self.UpdateDeviceRegistry = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/UpdateDeviceRegistry",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UpdateDeviceRegistryRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceRegistry.FromString,
        )
        self.DeleteDeviceRegistry = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/DeleteDeviceRegistry",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.DeleteDeviceRegistryRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.ListDeviceRegistries = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/ListDeviceRegistries",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceRegistriesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceRegistriesResponse.FromString,
        )
        self.CreateDevice = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/CreateDevice",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.CreateDeviceRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.Device.FromString,
        )
        self.GetDevice = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/GetDevice",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.GetDeviceRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.Device.FromString,
        )
        self.UpdateDevice = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/UpdateDevice",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UpdateDeviceRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.Device.FromString,
        )
        self.DeleteDevice = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/DeleteDevice",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.DeleteDeviceRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.ListDevices = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/ListDevices",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDevicesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDevicesResponse.FromString,
        )
        self.ModifyCloudToDeviceConfig = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/ModifyCloudToDeviceConfig",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ModifyCloudToDeviceConfigRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceConfig.FromString,
        )
        self.ListDeviceConfigVersions = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/ListDeviceConfigVersions",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceConfigVersionsRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceConfigVersionsResponse.FromString,
        )
        self.ListDeviceStates = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/ListDeviceStates",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceStatesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceStatesResponse.FromString,
        )
        self.SetIamPolicy = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/SetIamPolicy",
            request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString,
        )
        self.GetIamPolicy = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/GetIamPolicy",
            request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString,
        )
        self.TestIamPermissions = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/TestIamPermissions",
            request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.SerializeToString,
            response_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.FromString,
        )
        self.SendCommandToDevice = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/SendCommandToDevice",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.SendCommandToDeviceRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.SendCommandToDeviceResponse.FromString,
        )
        self.BindDeviceToGateway = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/BindDeviceToGateway",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.BindDeviceToGatewayRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.BindDeviceToGatewayResponse.FromString,
        )
        self.UnbindDeviceFromGateway = channel.unary_unary(
            "/google.cloud.iot.v1.DeviceManager/UnbindDeviceFromGateway",
            request_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UnbindDeviceFromGatewayRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UnbindDeviceFromGatewayResponse.FromString,
        )


class DeviceManagerServicer(object):
    """Internet of Things (IoT) service. Securely connect and manage IoT devices.
  """

    def CreateDeviceRegistry(self, request, context):
        """Creates a device registry that contains devices.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetDeviceRegistry(self, request, context):
        """Gets a device registry configuration.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateDeviceRegistry(self, request, context):
        """Updates a device registry configuration.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeleteDeviceRegistry(self, request, context):
        """Deletes a device registry configuration.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListDeviceRegistries(self, request, context):
        """Lists device registries.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def CreateDevice(self, request, context):
        """Creates a device in a device registry.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetDevice(self, request, context):
        """Gets details about a device.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateDevice(self, request, context):
        """Updates a device.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeleteDevice(self, request, context):
        """Deletes a device.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListDevices(self, request, context):
        """List devices in a device registry.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ModifyCloudToDeviceConfig(self, request, context):
        """Modifies the configuration for the device, which is eventually sent from
    the Cloud IoT Core servers. Returns the modified configuration version and
    its metadata.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListDeviceConfigVersions(self, request, context):
        """Lists the last few versions of the device configuration in descending
    order (i.e.: newest first).
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListDeviceStates(self, request, context):
        """Lists the last few versions of the device state in descending order (i.e.:
    newest first).
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SetIamPolicy(self, request, context):
        """Sets the access control policy on the specified resource. Replaces any
    existing policy.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetIamPolicy(self, request, context):
        """Gets the access control policy for a resource.
    Returns an empty policy if the resource exists and does not have a policy
    set.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def TestIamPermissions(self, request, context):
        """Returns permissions that a caller has on the specified resource.
    If the resource does not exist, this will return an empty set of
    permissions, not a NOT_FOUND error.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def SendCommandToDevice(self, request, context):
        """Sends a command to the specified device. In order for a device to be able
    to receive commands, it must:
    1) be connected to Cloud IoT Core using the MQTT protocol, and
    2) be subscribed to the group of MQTT topics specified by
    /devices/{device-id}/commands/#. This subscription will receive commands
    at the top-level topic /devices/{device-id}/commands as well as commands
    for subfolders, like /devices/{device-id}/commands/subfolder.
    Note that subscribing to specific subfolders is not supported.
    If the command could not be delivered to the device, this method will
    return an error; in particular, if the device is not subscribed, this
    method will return FAILED_PRECONDITION. Otherwise, this method will
    return OK. If the subscription is QoS 1, at least once delivery will be
    guaranteed; for QoS 0, no acknowledgment will be expected from the device.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def BindDeviceToGateway(self, request, context):
        """Associates the device with the gateway.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UnbindDeviceFromGateway(self, request, context):
        """Deletes the association between the device and the gateway.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_DeviceManagerServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CreateDeviceRegistry": grpc.unary_unary_rpc_method_handler(
            servicer.CreateDeviceRegistry,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.CreateDeviceRegistryRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceRegistry.SerializeToString,
        ),
        "GetDeviceRegistry": grpc.unary_unary_rpc_method_handler(
            servicer.GetDeviceRegistry,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.GetDeviceRegistryRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceRegistry.SerializeToString,
        ),
        "UpdateDeviceRegistry": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateDeviceRegistry,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UpdateDeviceRegistryRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceRegistry.SerializeToString,
        ),
        "DeleteDeviceRegistry": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteDeviceRegistry,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.DeleteDeviceRegistryRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "ListDeviceRegistries": grpc.unary_unary_rpc_method_handler(
            servicer.ListDeviceRegistries,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceRegistriesRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceRegistriesResponse.SerializeToString,
        ),
        "CreateDevice": grpc.unary_unary_rpc_method_handler(
            servicer.CreateDevice,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.CreateDeviceRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.Device.SerializeToString,
        ),
        "GetDevice": grpc.unary_unary_rpc_method_handler(
            servicer.GetDevice,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.GetDeviceRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.Device.SerializeToString,
        ),
        "UpdateDevice": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateDevice,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UpdateDeviceRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.Device.SerializeToString,
        ),
        "DeleteDevice": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteDevice,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.DeleteDeviceRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "ListDevices": grpc.unary_unary_rpc_method_handler(
            servicer.ListDevices,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDevicesRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDevicesResponse.SerializeToString,
        ),
        "ModifyCloudToDeviceConfig": grpc.unary_unary_rpc_method_handler(
            servicer.ModifyCloudToDeviceConfig,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ModifyCloudToDeviceConfigRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2.DeviceConfig.SerializeToString,
        ),
        "ListDeviceConfigVersions": grpc.unary_unary_rpc_method_handler(
            servicer.ListDeviceConfigVersions,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceConfigVersionsRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceConfigVersionsResponse.SerializeToString,
        ),
        "ListDeviceStates": grpc.unary_unary_rpc_method_handler(
            servicer.ListDeviceStates,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceStatesRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.ListDeviceStatesResponse.SerializeToString,
        ),
        "SetIamPolicy": grpc.unary_unary_rpc_method_handler(
            servicer.SetIamPolicy,
            request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.SetIamPolicyRequest.FromString,
            response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString,
        ),
        "GetIamPolicy": grpc.unary_unary_rpc_method_handler(
            servicer.GetIamPolicy,
            request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.FromString,
            response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString,
        ),
        "TestIamPermissions": grpc.unary_unary_rpc_method_handler(
            servicer.TestIamPermissions,
            request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsRequest.FromString,
            response_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.TestIamPermissionsResponse.SerializeToString,
        ),
        "SendCommandToDevice": grpc.unary_unary_rpc_method_handler(
            servicer.SendCommandToDevice,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.SendCommandToDeviceRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.SendCommandToDeviceResponse.SerializeToString,
        ),
        "BindDeviceToGateway": grpc.unary_unary_rpc_method_handler(
            servicer.BindDeviceToGateway,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.BindDeviceToGatewayRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.BindDeviceToGatewayResponse.SerializeToString,
        ),
        "UnbindDeviceFromGateway": grpc.unary_unary_rpc_method_handler(
            servicer.UnbindDeviceFromGateway,
            request_deserializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UnbindDeviceFromGatewayRequest.FromString,
            response_serializer=google_dot_cloud_dot_iot__v1_dot_proto_dot_device__manager__pb2.UnbindDeviceFromGatewayResponse.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.cloud.iot.v1.DeviceManager", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
