Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/HomeGraphService/DeviceMetadata.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

namespace Google\Service\HomeGraphService;

class DeviceMetadata extends \Google\Model
{
/**
* Map from the Trait ID (e.g., "action.devices.traits.OnOff") to its last
* Spanner commit timestamp.
*
* @var string[]
*/
public $traitCommitTimestamps;

/**
* Map from the Trait ID (e.g., "action.devices.traits.OnOff") to its last
* Spanner commit timestamp.
*
* @param string[] $traitCommitTimestamps
*/
public function setTraitCommitTimestamps($traitCommitTimestamps)
{
$this->traitCommitTimestamps = $traitCommitTimestamps;
}
/**
* @return string[]
*/
public function getTraitCommitTimestamps()
{
return $this->traitCommitTimestamps;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DeviceMetadata::class, 'Google_Service_HomeGraphService_DeviceMetadata');
24 changes: 24 additions & 0 deletions src/HomeGraphService/QueryRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ class QueryRequest extends \Google\Collection
* @var string
*/
public $agentUserId;
/**
* Optional. If true, the response will include device metadata in the
* device_metadata field.
*
* @var bool
*/
public $includeDeviceMetadata;
protected $inputsType = QueryRequestInput::class;
protected $inputsDataType = 'array';
/**
Expand All @@ -51,6 +58,23 @@ public function getAgentUserId()
{
return $this->agentUserId;
}
/**
* Optional. If true, the response will include device metadata in the
* device_metadata field.
*
* @param bool $includeDeviceMetadata
*/
public function setIncludeDeviceMetadata($includeDeviceMetadata)
{
$this->includeDeviceMetadata = $includeDeviceMetadata;
}
/**
* @return bool
*/
public function getIncludeDeviceMetadata()
{
return $this->includeDeviceMetadata;
}
/**
* Required. Inputs containing third-party device IDs for which to get the
* device states.
Expand Down
20 changes: 20 additions & 0 deletions src/HomeGraphService/QueryResponsePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

class QueryResponsePayload extends \Google\Model
{
protected $deviceMetadataType = DeviceMetadata::class;
protected $deviceMetadataDataType = 'map';
/**
* States of the devices. Map of third-party device ID to struct of device
* states.
Expand All @@ -27,6 +29,24 @@ class QueryResponsePayload extends \Google\Model
*/
public $devices;

/**
* Map from the Trait ID (e.g., "action.devices.traits.OnOff") to its last
* Spanner commit timestamp. If a trait has no recorded timestamp, it will be
* omitted from this map.
*
* @param DeviceMetadata[] $deviceMetadata
*/
public function setDeviceMetadata($deviceMetadata)
{
$this->deviceMetadata = $deviceMetadata;
}
/**
* @return DeviceMetadata[]
*/
public function getDeviceMetadata()
{
return $this->deviceMetadata;
}
/**
* States of the devices. Map of third-party device ID to struct of device
* states.
Expand Down
Loading