Interface DeviceOrBuilder (2.19.0)

public interface DeviceOrBuilder extends MessageOrBuilder

Implements

MessageOrBuilder

Methods

containsMetadata(String key)

public abstract boolean containsMetadata(String key)

The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device.

Keys must conform to the regular expression a-zA-Z+ and be less than 128 bytes in length.

Values are free-form strings. Each value must be less than or equal to 32 KB in size.

The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.

map<string, string> metadata = 17;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getBlocked()

public abstract boolean getBlocked()

If a device is blocked, connections or requests from this device will fail. Can be used to temporarily prevent the device from connecting if, for example, the sensor is generating bad data and needs maintenance.

bool blocked = 19;

Returns
TypeDescription
boolean

The blocked.

getConfig()

public abstract DeviceConfig getConfig()

The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. If not present on creation, the configuration will be initialized with an empty payload and version value of 1. To update this field after creation, use the DeviceManager.ModifyCloudToDeviceConfig method.

.google.cloud.iot.v1.DeviceConfig config = 13;

Returns
TypeDescription
DeviceConfig

The config.

getConfigOrBuilder()

public abstract DeviceConfigOrBuilder getConfigOrBuilder()

The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. If not present on creation, the configuration will be initialized with an empty payload and version value of 1. To update this field after creation, use the DeviceManager.ModifyCloudToDeviceConfig method.

.google.cloud.iot.v1.DeviceConfig config = 13;

Returns
TypeDescription
DeviceConfigOrBuilder

getCredentials(int index)

public abstract DeviceCredential getCredentials(int index)

The credentials used to authenticate this device. To allow credential rotation without interruption, multiple device credentials can be bound to this device. No more than 3 credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the DeviceRegistry.credentials field.

repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;

Parameter
NameDescription
indexint
Returns
TypeDescription
DeviceCredential

getCredentialsCount()

public abstract int getCredentialsCount()

The credentials used to authenticate this device. To allow credential rotation without interruption, multiple device credentials can be bound to this device. No more than 3 credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the DeviceRegistry.credentials field.

repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;

Returns
TypeDescription
int

getCredentialsList()

public abstract List<DeviceCredential> getCredentialsList()

The credentials used to authenticate this device. To allow credential rotation without interruption, multiple device credentials can be bound to this device. No more than 3 credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the DeviceRegistry.credentials field.

repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;

Returns
TypeDescription
List<DeviceCredential>

getCredentialsOrBuilder(int index)

public abstract DeviceCredentialOrBuilder getCredentialsOrBuilder(int index)

The credentials used to authenticate this device. To allow credential rotation without interruption, multiple device credentials can be bound to this device. No more than 3 credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the DeviceRegistry.credentials field.

repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;

Parameter
NameDescription
indexint
Returns
TypeDescription
DeviceCredentialOrBuilder

getCredentialsOrBuilderList()

public abstract List<? extends DeviceCredentialOrBuilder> getCredentialsOrBuilderList()

The credentials used to authenticate this device. To allow credential rotation without interruption, multiple device credentials can be bound to this device. No more than 3 credentials can be bound to a single device at a time. When new credentials are added to a device, they are verified against the registry credentials. For details, see the description of the DeviceRegistry.credentials field.

repeated .google.cloud.iot.v1.DeviceCredential credentials = 12;

Returns
TypeDescription
List<? extends com.google.cloud.iot.v1.DeviceCredentialOrBuilder>

getGatewayConfig()

public abstract GatewayConfig getGatewayConfig()

Gateway-related configuration and state.

.google.cloud.iot.v1.GatewayConfig gateway_config = 24;

Returns
TypeDescription
GatewayConfig

The gatewayConfig.

getGatewayConfigOrBuilder()

public abstract GatewayConfigOrBuilder getGatewayConfigOrBuilder()

Gateway-related configuration and state.

.google.cloud.iot.v1.GatewayConfig gateway_config = 24;

Returns
TypeDescription
GatewayConfigOrBuilder

getId()

public abstract String getId()

The user-defined device identifier. The device ID must be unique within a device registry.

string id = 1;

Returns
TypeDescription
String

The id.

getIdBytes()

public abstract ByteString getIdBytes()

The user-defined device identifier. The device ID must be unique within a device registry.

string id = 1;

Returns
TypeDescription
ByteString

The bytes for id.

getLastConfigAckTime()

public abstract Timestamp getLastConfigAckTime()

[Output only] The last time a cloud-to-device config version acknowledgment was received from the device. This field is only for configurations sent through MQTT.

.google.protobuf.Timestamp last_config_ack_time = 14;

Returns
TypeDescription
Timestamp

The lastConfigAckTime.

getLastConfigAckTimeOrBuilder()

public abstract TimestampOrBuilder getLastConfigAckTimeOrBuilder()

[Output only] The last time a cloud-to-device config version acknowledgment was received from the device. This field is only for configurations sent through MQTT.

.google.protobuf.Timestamp last_config_ack_time = 14;

Returns
TypeDescription
TimestampOrBuilder

getLastConfigSendTime()

public abstract Timestamp getLastConfigSendTime()

[Output only] The last time a cloud-to-device config version was sent to the device.

.google.protobuf.Timestamp last_config_send_time = 18;

Returns
TypeDescription
Timestamp

The lastConfigSendTime.

getLastConfigSendTimeOrBuilder()

public abstract TimestampOrBuilder getLastConfigSendTimeOrBuilder()

[Output only] The last time a cloud-to-device config version was sent to the device.

.google.protobuf.Timestamp last_config_send_time = 18;

Returns
TypeDescription
TimestampOrBuilder

getLastErrorStatus()

public abstract Status getLastErrorStatus()

[Output only] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this field. If no errors have occurred, this field has an empty message and the status code 0 == OK. Otherwise, this field is expected to have a status code other than OK.

.google.rpc.Status last_error_status = 11;

Returns
TypeDescription
com.google.rpc.Status

The lastErrorStatus.

getLastErrorStatusOrBuilder()

public abstract StatusOrBuilder getLastErrorStatusOrBuilder()

[Output only] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this field. If no errors have occurred, this field has an empty message and the status code 0 == OK. Otherwise, this field is expected to have a status code other than OK.

.google.rpc.Status last_error_status = 11;

Returns
TypeDescription
com.google.rpc.StatusOrBuilder

getLastErrorTime()

public abstract Timestamp getLastErrorTime()

[Output only] The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub. This field is the timestamp of 'last_error_status'.

.google.protobuf.Timestamp last_error_time = 10;

Returns
TypeDescription
Timestamp

The lastErrorTime.

getLastErrorTimeOrBuilder()

public abstract TimestampOrBuilder getLastErrorTimeOrBuilder()

[Output only] The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub. This field is the timestamp of 'last_error_status'.

.google.protobuf.Timestamp last_error_time = 10;

Returns
TypeDescription
TimestampOrBuilder

getLastEventTime()

public abstract Timestamp getLastEventTime()

[Output only] The last time a telemetry event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_event_time = 8;

Returns
TypeDescription
Timestamp

The lastEventTime.

getLastEventTimeOrBuilder()

public abstract TimestampOrBuilder getLastEventTimeOrBuilder()

[Output only] The last time a telemetry event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_event_time = 8;

Returns
TypeDescription
TimestampOrBuilder

getLastHeartbeatTime()

public abstract Timestamp getLastHeartbeatTime()

[Output only] The last time an MQTT PINGREQ was received. This field applies only to devices connecting through MQTT. MQTT clients usually only send PINGREQ messages if the connection is idle, and no other messages have been sent. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_heartbeat_time = 7;

Returns
TypeDescription
Timestamp

The lastHeartbeatTime.

getLastHeartbeatTimeOrBuilder()

public abstract TimestampOrBuilder getLastHeartbeatTimeOrBuilder()

[Output only] The last time an MQTT PINGREQ was received. This field applies only to devices connecting through MQTT. MQTT clients usually only send PINGREQ messages if the connection is idle, and no other messages have been sent. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_heartbeat_time = 7;

Returns
TypeDescription
TimestampOrBuilder

getLastStateTime()

public abstract Timestamp getLastStateTime()

[Output only] The last time a state event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_state_time = 20;

Returns
TypeDescription
Timestamp

The lastStateTime.

getLastStateTimeOrBuilder()

public abstract TimestampOrBuilder getLastStateTimeOrBuilder()

[Output only] The last time a state event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_state_time = 20;

Returns
TypeDescription
TimestampOrBuilder

getLogLevel()

public abstract LogLevel getLogLevel()

Beta Feature

The logging verbosity for device activity. If unspecified, DeviceRegistry.log_level will be used.

.google.cloud.iot.v1.LogLevel log_level = 21;

Returns
TypeDescription
LogLevel

The logLevel.

getLogLevelValue()

public abstract int getLogLevelValue()

Beta Feature

The logging verbosity for device activity. If unspecified, DeviceRegistry.log_level will be used.

.google.cloud.iot.v1.LogLevel log_level = 21;

Returns
TypeDescription
int

The enum numeric value on the wire for logLevel.

getMetadata()

public abstract Map<String,String> getMetadata()

Use #getMetadataMap() instead.

Returns
TypeDescription
Map<String,String>

getMetadataCount()

public abstract int getMetadataCount()

The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device.

Keys must conform to the regular expression a-zA-Z+ and be less than 128 bytes in length.

Values are free-form strings. Each value must be less than or equal to 32 KB in size.

The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.

map<string, string> metadata = 17;

Returns
TypeDescription
int

getMetadataMap()

public abstract Map<String,String> getMetadataMap()

The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device.

Keys must conform to the regular expression a-zA-Z+ and be less than 128 bytes in length.

Values are free-form strings. Each value must be less than or equal to 32 KB in size.

The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.

map<string, string> metadata = 17;

Returns
TypeDescription
Map<String,String>

getMetadataOrDefault(String key, String defaultValue)

public abstract String getMetadataOrDefault(String key, String defaultValue)

The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device.

Keys must conform to the regular expression a-zA-Z+ and be less than 128 bytes in length.

Values are free-form strings. Each value must be less than or equal to 32 KB in size.

The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.

map<string, string> metadata = 17;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getMetadataOrThrow(String key)

public abstract String getMetadataOrThrow(String key)

The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device.

Keys must conform to the regular expression a-zA-Z+ and be less than 128 bytes in length.

Values are free-form strings. Each value must be less than or equal to 32 KB in size.

The total size of all keys and values must be less than 256 KB, and the maximum number of key-value pairs is 500.

map<string, string> metadata = 17;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getName()

public abstract String getName()

The resource path name. For example, projects/p1/locations/us-central1/registries/registry0/devices/dev0 or projects/p1/locations/us-central1/registries/registry0/devices/{num_id}. When name is populated as a response from the service, it always ends in the device numeric ID.

string name = 2;

Returns
TypeDescription
String

The name.

getNameBytes()

public abstract ByteString getNameBytes()

The resource path name. For example, projects/p1/locations/us-central1/registries/registry0/devices/dev0 or projects/p1/locations/us-central1/registries/registry0/devices/{num_id}. When name is populated as a response from the service, it always ends in the device numeric ID.

string name = 2;

Returns
TypeDescription
ByteString

The bytes for name.

getNumId()

public abstract long getNumId()

[Output only] A server-defined unique numeric ID for the device. This is a more compact way to identify devices, and it is globally unique.

uint64 num_id = 3;

Returns
TypeDescription
long

The numId.

getState()

public abstract DeviceState getState()

[Output only] The state most recently received from the device. If no state has been reported, this field is not present.

.google.cloud.iot.v1.DeviceState state = 16;

Returns
TypeDescription
DeviceState

The state.

getStateOrBuilder()

public abstract DeviceStateOrBuilder getStateOrBuilder()

[Output only] The state most recently received from the device. If no state has been reported, this field is not present.

.google.cloud.iot.v1.DeviceState state = 16;

Returns
TypeDescription
DeviceStateOrBuilder

hasConfig()

public abstract boolean hasConfig()

The most recent device configuration, which is eventually sent from Cloud IoT Core to the device. If not present on creation, the configuration will be initialized with an empty payload and version value of 1. To update this field after creation, use the DeviceManager.ModifyCloudToDeviceConfig method.

.google.cloud.iot.v1.DeviceConfig config = 13;

Returns
TypeDescription
boolean

Whether the config field is set.

hasGatewayConfig()

public abstract boolean hasGatewayConfig()

Gateway-related configuration and state.

.google.cloud.iot.v1.GatewayConfig gateway_config = 24;

Returns
TypeDescription
boolean

Whether the gatewayConfig field is set.

hasLastConfigAckTime()

public abstract boolean hasLastConfigAckTime()

[Output only] The last time a cloud-to-device config version acknowledgment was received from the device. This field is only for configurations sent through MQTT.

.google.protobuf.Timestamp last_config_ack_time = 14;

Returns
TypeDescription
boolean

Whether the lastConfigAckTime field is set.

hasLastConfigSendTime()

public abstract boolean hasLastConfigSendTime()

[Output only] The last time a cloud-to-device config version was sent to the device.

.google.protobuf.Timestamp last_config_send_time = 18;

Returns
TypeDescription
boolean

Whether the lastConfigSendTime field is set.

hasLastErrorStatus()

public abstract boolean hasLastErrorStatus()

[Output only] The error message of the most recent error, such as a failure to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this field. If no errors have occurred, this field has an empty message and the status code 0 == OK. Otherwise, this field is expected to have a status code other than OK.

.google.rpc.Status last_error_status = 11;

Returns
TypeDescription
boolean

Whether the lastErrorStatus field is set.

hasLastErrorTime()

public abstract boolean hasLastErrorTime()

[Output only] The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub. This field is the timestamp of 'last_error_status'.

.google.protobuf.Timestamp last_error_time = 10;

Returns
TypeDescription
boolean

Whether the lastErrorTime field is set.

hasLastEventTime()

public abstract boolean hasLastEventTime()

[Output only] The last time a telemetry event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_event_time = 8;

Returns
TypeDescription
boolean

Whether the lastEventTime field is set.

hasLastHeartbeatTime()

public abstract boolean hasLastHeartbeatTime()

[Output only] The last time an MQTT PINGREQ was received. This field applies only to devices connecting through MQTT. MQTT clients usually only send PINGREQ messages if the connection is idle, and no other messages have been sent. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_heartbeat_time = 7;

Returns
TypeDescription
boolean

Whether the lastHeartbeatTime field is set.

hasLastStateTime()

public abstract boolean hasLastStateTime()

[Output only] The last time a state event was received. Timestamps are periodically collected and written to storage; they may be stale by a few minutes.

.google.protobuf.Timestamp last_state_time = 20;

Returns
TypeDescription
boolean

Whether the lastStateTime field is set.

hasState()

public abstract boolean hasState()

[Output only] The state most recently received from the device. If no state has been reported, this field is not present.

.google.cloud.iot.v1.DeviceState state = 16;

Returns
TypeDescription
boolean

Whether the state field is set.