Class DeviceManager.DeviceManagerBase (2.0.0)

[BindServiceMethod(typeof(DeviceManager), "BindService")]
public abstract class DeviceManagerBase

Base class for server-side implementations of DeviceManager

Inheritance

Object > DeviceManager.DeviceManagerBase

Namespace

Google.Cloud.Iot.V1

Assembly

Google.Cloud.Iot.V1.dll

Methods

BindDeviceToGateway(BindDeviceToGatewayRequest, ServerCallContext)

public virtual Task<BindDeviceToGatewayResponse> BindDeviceToGateway(BindDeviceToGatewayRequest request, ServerCallContext context)

Associates the device with the gateway.

Parameters
NameDescription
requestBindDeviceToGatewayRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<BindDeviceToGatewayResponse>

The response to send back to the client (wrapped by a task).

CreateDevice(CreateDeviceRequest, ServerCallContext)

public virtual Task<Device> CreateDevice(CreateDeviceRequest request, ServerCallContext context)

Creates a device in a device registry.

Parameters
NameDescription
requestCreateDeviceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Device>

The response to send back to the client (wrapped by a task).

CreateDeviceRegistry(CreateDeviceRegistryRequest, ServerCallContext)

public virtual Task<DeviceRegistry> CreateDeviceRegistry(CreateDeviceRegistryRequest request, ServerCallContext context)

Creates a device registry that contains devices.

Parameters
NameDescription
requestCreateDeviceRegistryRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<DeviceRegistry>

The response to send back to the client (wrapped by a task).

DeleteDevice(DeleteDeviceRequest, ServerCallContext)

public virtual Task<Empty> DeleteDevice(DeleteDeviceRequest request, ServerCallContext context)

Deletes a device.

Parameters
NameDescription
requestDeleteDeviceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Empty>

The response to send back to the client (wrapped by a task).

DeleteDeviceRegistry(DeleteDeviceRegistryRequest, ServerCallContext)

public virtual Task<Empty> DeleteDeviceRegistry(DeleteDeviceRegistryRequest request, ServerCallContext context)

Deletes a device registry configuration.

Parameters
NameDescription
requestDeleteDeviceRegistryRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Empty>

The response to send back to the client (wrapped by a task).

GetDevice(GetDeviceRequest, ServerCallContext)

public virtual Task<Device> GetDevice(GetDeviceRequest request, ServerCallContext context)

Gets details about a device.

Parameters
NameDescription
requestGetDeviceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Device>

The response to send back to the client (wrapped by a task).

GetDeviceRegistry(GetDeviceRegistryRequest, ServerCallContext)

public virtual Task<DeviceRegistry> GetDeviceRegistry(GetDeviceRegistryRequest request, ServerCallContext context)

Gets a device registry configuration.

Parameters
NameDescription
requestGetDeviceRegistryRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<DeviceRegistry>

The response to send back to the client (wrapped by a task).

GetIamPolicy(GetIamPolicyRequest, ServerCallContext)

public virtual Task<Policy> GetIamPolicy(GetIamPolicyRequest request, ServerCallContext context)

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
NameDescription
requestGetIamPolicyRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Policy>

The response to send back to the client (wrapped by a task).

ListDeviceConfigVersions(ListDeviceConfigVersionsRequest, ServerCallContext)

public virtual Task<ListDeviceConfigVersionsResponse> ListDeviceConfigVersions(ListDeviceConfigVersionsRequest request, ServerCallContext context)

Lists the last few versions of the device configuration in descending order (i.e.: newest first).

Parameters
NameDescription
requestListDeviceConfigVersionsRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<ListDeviceConfigVersionsResponse>

The response to send back to the client (wrapped by a task).

ListDeviceRegistries(ListDeviceRegistriesRequest, ServerCallContext)

public virtual Task<ListDeviceRegistriesResponse> ListDeviceRegistries(ListDeviceRegistriesRequest request, ServerCallContext context)

Lists device registries.

Parameters
NameDescription
requestListDeviceRegistriesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<ListDeviceRegistriesResponse>

The response to send back to the client (wrapped by a task).

ListDevices(ListDevicesRequest, ServerCallContext)

public virtual Task<ListDevicesResponse> ListDevices(ListDevicesRequest request, ServerCallContext context)

List devices in a device registry.

Parameters
NameDescription
requestListDevicesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<ListDevicesResponse>

The response to send back to the client (wrapped by a task).

ListDeviceStates(ListDeviceStatesRequest, ServerCallContext)

public virtual Task<ListDeviceStatesResponse> ListDeviceStates(ListDeviceStatesRequest request, ServerCallContext context)

Lists the last few versions of the device state in descending order (i.e.: newest first).

Parameters
NameDescription
requestListDeviceStatesRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<ListDeviceStatesResponse>

The response to send back to the client (wrapped by a task).

ModifyCloudToDeviceConfig(ModifyCloudToDeviceConfigRequest, ServerCallContext)

public virtual Task<DeviceConfig> ModifyCloudToDeviceConfig(ModifyCloudToDeviceConfigRequest request, ServerCallContext 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.

Parameters
NameDescription
requestModifyCloudToDeviceConfigRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<DeviceConfig>

The response to send back to the client (wrapped by a task).

SendCommandToDevice(SendCommandToDeviceRequest, ServerCallContext)

public virtual Task<SendCommandToDeviceResponse> SendCommandToDevice(SendCommandToDeviceRequest request, ServerCallContext 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.

Parameters
NameDescription
requestSendCommandToDeviceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<SendCommandToDeviceResponse>

The response to send back to the client (wrapped by a task).

SetIamPolicy(SetIamPolicyRequest, ServerCallContext)

public virtual Task<Policy> SetIamPolicy(SetIamPolicyRequest request, ServerCallContext context)

Sets the access control policy on the specified resource. Replaces any existing policy.

Parameters
NameDescription
requestSetIamPolicyRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Policy>

The response to send back to the client (wrapped by a task).

TestIamPermissions(TestIamPermissionsRequest, ServerCallContext)

public virtual Task<TestIamPermissionsResponse> TestIamPermissions(TestIamPermissionsRequest request, ServerCallContext 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.

Parameters
NameDescription
requestTestIamPermissionsRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<TestIamPermissionsResponse>

The response to send back to the client (wrapped by a task).

UnbindDeviceFromGateway(UnbindDeviceFromGatewayRequest, ServerCallContext)

public virtual Task<UnbindDeviceFromGatewayResponse> UnbindDeviceFromGateway(UnbindDeviceFromGatewayRequest request, ServerCallContext context)

Deletes the association between the device and the gateway.

Parameters
NameDescription
requestUnbindDeviceFromGatewayRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<UnbindDeviceFromGatewayResponse>

The response to send back to the client (wrapped by a task).

UpdateDevice(UpdateDeviceRequest, ServerCallContext)

public virtual Task<Device> UpdateDevice(UpdateDeviceRequest request, ServerCallContext context)

Updates a device.

Parameters
NameDescription
requestUpdateDeviceRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<Device>

The response to send back to the client (wrapped by a task).

UpdateDeviceRegistry(UpdateDeviceRegistryRequest, ServerCallContext)

public virtual Task<DeviceRegistry> UpdateDeviceRegistry(UpdateDeviceRegistryRequest request, ServerCallContext context)

Updates a device registry configuration.

Parameters
NameDescription
requestUpdateDeviceRegistryRequest

The request received from the client.

contextServerCallContext

The context of the server-side call handler being invoked.

Returns
TypeDescription
Task<DeviceRegistry>

The response to send back to the client (wrapped by a task).