Google_Service_CloudIot_Resource_ProjectsLocationsRegistriesDevices
extends Google_Service_Resource
in package
The "devices" collection of methods.
Typical usage is:
$cloudiotService = new Google_Service_CloudIot(...);
$devices = $cloudiotService->devices;
Table of Contents
- $client : Google_Client
- $methods : array<string|int, mixed>
- $resourceName : string
- $rootUrl : string
- $serviceName : string
- $servicePath : string
- $stackParameters : mixed
- __construct() : mixed
- call() : Google_Http_Request|expectedClass
- TODO: This function needs simplifying.
- create() : Google_Service_CloudIot_Device
- Creates a device in a device registry. (devices.create)
- createRequestUri() : string
- Parse/expand request parameters and create a fully qualified request uri.
- delete() : Google_Service_CloudIot_CloudiotEmpty
- Deletes a device. (devices.delete)
- get() : Google_Service_CloudIot_Device
- Gets details about a device. (devices.get)
- listProjectsLocationsRegistriesDevices() : Google_Service_CloudIot_ListDevicesResponse
- List devices in a device registry.
- modifyCloudToDeviceConfig() : Google_Service_CloudIot_DeviceConfig
- Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. (devices.modifyCloudToDeviceConfig)
- patch() : Google_Service_CloudIot_Device
- Updates a device. (devices.patch)
- sendCommandToDevice() : Google_Service_CloudIot_SendCommandToDeviceResponse
- 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.
- convertToArrayAndStripNulls() : mixed
Properties
$client
private
Google_Client
$client
$methods
private
array<string|int, mixed>
$methods
$resourceName
private
string
$resourceName
$rootUrl
private
string
$rootUrl
$serviceName
private
string
$serviceName
$servicePath
private
string
$servicePath
$stackParameters
private
mixed
$stackParameters
= array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))
Methods
__construct()
public
__construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
- $service : mixed
- $serviceName : mixed
- $resourceName : mixed
- $resource : mixed
Return values
mixed —call()
TODO: This function needs simplifying.
public
call( $name, $arguments[, $expectedClass = null ]) : Google_Http_Request|expectedClass
Parameters
Tags
Return values
Google_Http_Request|expectedClass —create()
Creates a device in a device registry. (devices.create)
public
create(string $parent, Google_Service_CloudIot_Device $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_Device
Parameters
- $parent : string
-
Required. The name of the device registry where this device should be created. For example,
projects/example-project/locations /us-central1/registries/my-registry. - $postBody : Google_Service_CloudIot_Device
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_CloudIot_Device —createRequestUri()
Parse/expand request parameters and create a fully qualified request uri.
public
createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
- $restPath : string
- $params : array<string|int, mixed>
Tags
Return values
string —$requestUrl
delete()
Deletes a device. (devices.delete)
public
delete(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_CloudiotEmpty
Parameters
- $name : string
-
Required. The name of the device. For example,
projects/p0/locations/us-central1/registries/registry0/devices/device0orprojects/p0/locations/us-central1/registries/registry0/devices/{num_id}. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_CloudIot_CloudiotEmpty —get()
Gets details about a device. (devices.get)
public
get(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_Device
Parameters
- $name : string
-
Required. The name of the device. For example,
projects/p0/locations/us-central1/registries/registry0/devices/device0orprojects/p0/locations/us-central1/registries/registry0/devices/{num_id}. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_CloudIot_Device —listProjectsLocationsRegistriesDevices()
List devices in a device registry.
public
listProjectsLocationsRegistriesDevices(string $parent[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_ListDevicesResponse
(devices.listProjectsLocationsRegistriesDevices)
Parameters
- $parent : string
-
Required. The device registry path. Required. For example,
projects/my-project/locations/us-central1/registries/my-registry. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_CloudIot_ListDevicesResponse —modifyCloudToDeviceConfig()
Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. (devices.modifyCloudToDeviceConfig)
public
modifyCloudToDeviceConfig(string $name, Google_Service_CloudIot_ModifyCloudToDeviceConfigRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_DeviceConfig
Parameters
- $name : string
-
Required. The name of the device. For example,
projects/p0/locations/us-central1/registries/registry0/devices/device0orprojects/p0/locations/us-central1/registries/registry0/devices/{num_id}. - $postBody : Google_Service_CloudIot_ModifyCloudToDeviceConfigRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_CloudIot_DeviceConfig —patch()
Updates a device. (devices.patch)
public
patch(string $name, Google_Service_CloudIot_Device $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_Device
Parameters
- $name : string
-
The resource path name. For example,
projects/p1/locations/us-central1/registries/registry0/devices/dev0orprojects/p1/locations/us-central1/registries/registry0/devices/{num_id}. Whennameis populated as a response from the service, it always ends in the device numeric ID. - $postBody : Google_Service_CloudIot_Device
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_CloudIot_Device —sendCommandToDevice()
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.
public
sendCommandToDevice(string $name, Google_Service_CloudIot_SendCommandToDeviceRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_SendCommandToDeviceResponse
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. (devices.sendCommandToDevice)
Parameters
- $name : string
-
Required. The name of the device. For example,
projects/p0/locations/us-central1/registries/registry0/devices/device0orprojects/p0/locations/us-central1/registries/registry0/devices/{num_id}. - $postBody : Google_Service_CloudIot_SendCommandToDeviceRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_CloudIot_SendCommandToDeviceResponse —convertToArrayAndStripNulls()
protected
convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
- $o : mixed