2021-01-01 03:01:13 +00:00
|
|
|
# Copyright 2020 Google LLC
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
require 'date'
|
|
|
|
require 'google/apis/core/base_service'
|
|
|
|
require 'google/apis/core/json_representation'
|
|
|
|
require 'google/apis/core/hashable'
|
|
|
|
require 'google/apis/errors'
|
|
|
|
|
|
|
|
module Google
|
|
|
|
module Apis
|
|
|
|
module HomegraphV1
|
|
|
|
|
|
|
|
# Third-party device ID for one device.
|
|
|
|
class AgentDeviceId
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Third-party device ID.
|
|
|
|
# Corresponds to the JSON property `id`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@id = args[:id] if args.key?(:id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Alternate third-party device ID.
|
|
|
|
class AgentOtherDeviceId
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Project ID for your smart home Action.
|
|
|
|
# Corresponds to the JSON property `agentId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :agent_id
|
|
|
|
|
|
|
|
# Unique third-party device ID.
|
|
|
|
# Corresponds to the JSON property `deviceId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :device_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@agent_id = args[:agent_id] if args.key?(:agent_id)
|
|
|
|
@device_id = args[:device_id] if args.key?(:device_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Third-party device definition.
|
|
|
|
class Device
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Attributes for the traits supported by the device.
|
|
|
|
# Corresponds to the JSON property `attributes`
|
|
|
|
# @return [Hash<String,Object>]
|
|
|
|
attr_accessor :attributes
|
|
|
|
|
|
|
|
# Custom device attributes stored in Home Graph and provided to your smart home
|
|
|
|
# Action in each [QUERY](https://developers.google.com/assistant/smarthome/
|
|
|
|
# reference/intent/query) and [EXECUTE](https://developers.google.com/assistant/
|
feat: Automated regeneration of homegraph v1 client (#2457)
This PR was generated using Autosynth. :rainbow:
<details><summary>Log from Synthtool</summary>
```
2021-01-21 02:47:04,844 synthtool [DEBUG] > Executing /home/kbuilder/.cache/synthtool/google-api-ruby-client/synth.py.
On branch autosynth-homegraph-v1
nothing to commit, working tree clean
2021-01-21 02:47:04,919 synthtool [DEBUG] > Running: docker run --rm -v/home/kbuilder/.cache/synthtool/google-api-ruby-client:/workspace -v/var/run/docker.sock:/var/run/docker.sock -w /workspace --entrypoint script/synth.rb gcr.io/cloud-devrel-kokoro-resources/yoshi-ruby/autosynth homegraph v1
DEBUG:synthtool:Running: docker run --rm -v/home/kbuilder/.cache/synthtool/google-api-ruby-client:/workspace -v/var/run/docker.sock:/var/run/docker.sock -w /workspace --entrypoint script/synth.rb gcr.io/cloud-devrel-kokoro-resources/yoshi-ruby/autosynth homegraph v1
git clean -df
bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching rake 11.3.0
Installing rake 11.3.0
Fetching concurrent-ruby 1.1.8
Fetching minitest 5.14.3
Fetching zeitwerk 2.4.2
Fetching public_suffix 4.0.6
Installing zeitwerk 2.4.2
Installing minitest 5.14.3
Installing public_suffix 4.0.6
Installing concurrent-ruby 1.1.8
Fetching ast 2.4.1
Installing ast 2.4.1
Using bundler 2.2.6
Fetching coderay 1.1.3
Fetching byebug 11.1.3
Fetching json 2.5.1
Installing coderay 1.1.3
Installing byebug 11.1.3 with native extensions
Installing json 2.5.1 with native extensions
Fetching docile 1.3.5
Installing docile 1.3.5
Fetching simplecov-html 0.10.2
Installing simplecov-html 0.10.2
Using sync 0.5.0
Fetching thor 1.1.0
Installing thor 1.1.0
Fetching rexml 3.2.4
Fetching declarative 0.0.20
Installing rexml 3.2.4
Installing declarative 0.0.20
Fetching declarative-option 0.1.0
Installing declarative-option 0.1.0
Fetching diff-lcs 1.4.4
Installing diff-lcs 1.4.4
Fetching dotenv 2.7.6
Installing dotenv 2.7.6
Fetching fakefs 0.20.1
Installing fakefs 0.20.1
Fetching faraday-net_http 1.0.1
Installing faraday-net_http 1.0.1
Fetching multipart-post 2.1.1
Fetching ruby2_keywords 0.0.4
Installing multipart-post 2.1.1
Installing ruby2_keywords 0.0.4
Fetching gems 1.2.0
Installing gems 1.2.0
Fetching github-markup 1.7.0
Installing github-markup 1.7.0
Fetching jwt 2.2.2
Installing jwt 2.2.2
Fetching multi_json 1.15.0
Fetching memoist 0.16.2
Installing memoist 0.16.2
Installing multi_json 1.15.0
Fetching os 0.9.6
Installing os 0.9.6
Fetching httpclient 2.8.3
Fetching uber 0.1.0
Fetching mini_mime 1.0.2
Installing httpclient 2.8.3
Installing uber 0.1.0
Installing mini_mime 1.0.2
Fetching retriable 3.1.2
Fetching hashdiff 1.0.1
Installing retriable 3.1.2
Installing hashdiff 1.0.1
Fetching mime-types-data 3.2020.1104
Installing mime-types-data 3.2020.1104
Fetching rspec-support 3.10.1
Fetching multi_xml 0.6.0
Installing multi_xml 0.6.0
Installing rspec-support 3.10.1
Fetching method_source 1.0.0
Fetching little-plugger 1.1.4
Installing method_source 1.0.0
Installing little-plugger 1.1.4
Fetching opencensus 0.5.0
Installing opencensus 0.5.0
Fetching powerpack 0.1.3
Fetching parallel 1.20.1
Installing powerpack 0.1.3
Installing parallel 1.20.1
Fetching yard 0.9.26
Fetching rainbow 2.2.2
Installing rainbow 2.2.2 with native extensions
Installing yard 0.9.26
Fetching redcarpet 3.5.1
Installing redcarpet 3.5.1 with native extensions
Fetching redis 3.3.5
Installing redis 3.3.5
Fetching rmail 1.1.4
Installing rmail 1.1.4
Fetching ruby-progressbar 1.11.0
Installing ruby-progressbar 1.11.0
Fetching unicode-display_width 1.7.0
Installing unicode-display_width 1.7.0
Fetching parser 2.7.2.0
Fetching addressable 2.7.0
Installing parser 2.7.2.0
Installing addressable 2.7.0
Fetching i18n 1.8.7
Installing i18n 1.8.7
Fetching tzinfo 2.0.4
Installing tzinfo 2.0.4
Fetching tins 1.28.0
Installing tins 1.28.0
Fetching crack 0.4.5
Installing crack 0.4.5
Fetching faraday 1.3.0
Installing faraday 1.3.0
Fetching google-id-token 1.4.2
Installing google-id-token 1.4.2
Fetching representable 3.0.4
Installing representable 3.0.4
Fetching mime-types 3.3.1
Installing mime-types 3.3.1
Fetching rspec-core 3.10.1
Installing rspec-core 3.10.1
Fetching rspec-expectations 3.10.1
Fetching rspec-mocks 3.10.1
Installing rspec-mocks 3.10.1
Installing rspec-expectations 3.10.1
Fetching logging 2.3.0
Installing logging 2.3.0
Fetching pry 0.13.1
Fetching simplecov 0.16.1
Installing simplecov 0.16.1
Installing pry 0.13.1
Fetching launchy 2.5.0
Installing launchy 2.5.0
Fetching rubocop 0.49.1
Fetching activesupport 6.1.1
Installing activesupport 6.1.1
Fetching webmock 2.3.2
Installing rubocop 0.49.1
Installing webmock 2.3.2
Fetching signet 0.14.0
Installing signet 0.14.0
Fetching term-ansicolor 1.7.1
Fetching httparty 0.18.1
Installing term-ansicolor 1.7.1
Installing httparty 0.18.1
Fetching rspec 3.10.0
Installing rspec 3.10.0
Fetching pry-byebug 3.9.0
Fetching pry-doc 0.13.5
Installing pry-byebug 3.9.0
Fetching coveralls 0.8.23
Fetching googleauth 0.14.0
Installing coveralls 0.8.23
Installing googleauth 0.14.0
Fetching json_spec 1.1.5
Installing json_spec 1.1.5
Fetching google-apis-core 0.2.0
Installing pry-doc 0.13.5
Installing google-apis-core 0.2.0
Fetching google-apis-discovery_v1 0.1.0
Installing google-apis-discovery_v1 0.1.0
Using google-apis-generator 0.1.2 from source at `.`
Bundle complete! 25 Gemfile dependencies, 81 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from i18n:
HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.
If you are upgrading your Rails application from an older version of Rails:
Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.
If you are starting a NEW Rails application, you can ignore this notice.
For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
Post-install message from httparty:
When you HTTParty, you must party hard!
echo a | bundle exec bin/generate-api gen /workspace/generated --api=homegraph.v1 --names=/workspace/api_names.yaml --names-out=/workspace/api_names_out.yaml --spot-check
Loading homegraph, version v1 from https://raw.githubusercontent.com/googleapis/discovery-artifact-manager/master/discoveries/homegraph.v1.json
conflict google-apis-homegraph_v1/lib/google/apis/homegraph_v1/classes.rb
<raph_v1/classes.rb? (enter "h" for help) [Ynaqdhm] a
force google-apis-homegraph_v1/lib/google/apis/homegraph_v1/classes.rb
conflict google-apis-homegraph_v1/lib/google/apis/homegraph_v1/gem_version.rb
force google-apis-homegraph_v1/lib/google/apis/homegraph_v1/gem_version.rb
conflict google-apis-homegraph_v1/CHANGELOG.md
force google-apis-homegraph_v1/CHANGELOG.md
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.3
Using public_suffix 4.0.6
Using bundler 2.2.6
Using declarative 0.0.20
Using declarative-option 0.1.0
Using diff-lcs 1.4.4
Using faraday-net_http 1.0.1
Using multipart-post 2.1.1
Using ruby2_keywords 0.0.4
Using jwt 2.2.2
Using memoist 0.16.2
Using multi_json 1.15.0
Using httpclient 2.8.3
Using mini_mime 1.0.2
Using uber 0.1.0
Using retriable 3.1.2
Using rexml 3.2.4
Using opencensus 0.5.0
Using redcarpet 3.5.1
Using rspec-support 3.10.1
Fetching os 1.1.1
Using yard 0.9.26
Using addressable 2.7.0
Using faraday 1.3.0
Using representable 3.0.4
Using signet 0.14.0
Using rspec-core 3.10.1
Using rspec-expectations 3.10.1
Using rspec-mocks 3.10.1
Using rspec 3.10.0
Installing os 1.1.1
Using googleauth 0.14.0
Using google-apis-core 0.2.0
Using google-apis-homegraph_v1 0.2.0 from source at `.`
Bundle complete! 8 Gemfile dependencies, 33 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
/root/.rbenv/versions/2.6.6/bin/ruby -I/root/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rspec-core-3.10.1/lib:/root/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rspec-support-3.10.1/lib /root/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rspec-core-3.10.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Google::Apis::HomegraphV1
should load
Finished in 0.31899 seconds (files took 0.10219 seconds to load)
1 example, 0 failures
Files: 4
Modules: 3 ( 1 undocumented)
Classes: 21 ( 0 undocumented)
Constants: 5 ( 0 undocumented)
Attributes: 32 ( 0 undocumented)
Methods: 46 ( 0 undocumented)
99.07% documented
google-apis-homegraph_v1 0.2.0 built to pkg/google-apis-homegraph_v1-0.2.0.gem.
identical /workspace/api_names_out.yaml
2021-01-21 02:47:33,071 synthtool [DEBUG] > Wrote metadata to generated/google-apis-homegraph_v1/synth.metadata.
DEBUG:synthtool:Wrote metadata to generated/google-apis-homegraph_v1/synth.metadata.
```
</details>
Full log will be available here:
https://source.cloud.google.com/results/invocations/d1a977ae-86ff-41c3-afb0-6f2a713bfd4c/targets
- [ ] To automatically regenerate this PR, check this box.
2021-01-21 11:02:02 +00:00
|
|
|
# smarthome/reference/intent/execute) intent. Data in this object has a few
|
|
|
|
# constraints: No sensitive information, including but not limited to Personally
|
|
|
|
# Identifiable Information.
|
2021-01-01 03:01:13 +00:00
|
|
|
# Corresponds to the JSON property `customData`
|
|
|
|
# @return [Hash<String,Object>]
|
|
|
|
attr_accessor :custom_data
|
|
|
|
|
|
|
|
# Device information.
|
|
|
|
# Corresponds to the JSON property `deviceInfo`
|
|
|
|
# @return [Google::Apis::HomegraphV1::DeviceInfo]
|
|
|
|
attr_accessor :device_info
|
|
|
|
|
|
|
|
# Third-party device ID.
|
|
|
|
# Corresponds to the JSON property `id`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :id
|
|
|
|
|
|
|
|
# Identifiers used to describe the device.
|
|
|
|
# Corresponds to the JSON property `name`
|
|
|
|
# @return [Google::Apis::HomegraphV1::DeviceNames]
|
|
|
|
attr_accessor :name
|
|
|
|
|
|
|
|
# Indicates whether your smart home Action will report notifications to Google
|
|
|
|
# for this device via ReportStateAndNotification. If your smart home Action
|
|
|
|
# enables users to control device notifications, you should update this field
|
|
|
|
# and call RequestSyncDevices.
|
|
|
|
# Corresponds to the JSON property `notificationSupportedByAgent`
|
|
|
|
# @return [Boolean]
|
|
|
|
attr_accessor :notification_supported_by_agent
|
|
|
|
alias_method :notification_supported_by_agent?, :notification_supported_by_agent
|
|
|
|
|
|
|
|
# Alternate IDs associated with this device. This is used to identify cloud
|
|
|
|
# synced devices enabled for [local fulfillment](https://developers.google.com/
|
|
|
|
# assistant/smarthome/concepts/local).
|
|
|
|
# Corresponds to the JSON property `otherDeviceIds`
|
|
|
|
# @return [Array<Google::Apis::HomegraphV1::AgentOtherDeviceId>]
|
|
|
|
attr_accessor :other_device_ids
|
|
|
|
|
|
|
|
# Suggested name for the room where this device is installed. Google attempts to
|
|
|
|
# use this value during user setup.
|
|
|
|
# Corresponds to the JSON property `roomHint`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :room_hint
|
|
|
|
|
|
|
|
# Suggested name for the structure where this device is installed. Google
|
|
|
|
# attempts to use this value during user setup.
|
|
|
|
# Corresponds to the JSON property `structureHint`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :structure_hint
|
|
|
|
|
|
|
|
# Traits supported by the device. See [device traits](https://developers.google.
|
|
|
|
# com/assistant/smarthome/traits).
|
|
|
|
# Corresponds to the JSON property `traits`
|
|
|
|
# @return [Array<String>]
|
|
|
|
attr_accessor :traits
|
|
|
|
|
|
|
|
# Hardware type of the device. See [device types](https://developers.google.com/
|
|
|
|
# assistant/smarthome/guides).
|
|
|
|
# Corresponds to the JSON property `type`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :type
|
|
|
|
|
|
|
|
# Indicates whether your smart home Action will report state of this device to
|
|
|
|
# Google via ReportStateAndNotification.
|
|
|
|
# Corresponds to the JSON property `willReportState`
|
|
|
|
# @return [Boolean]
|
|
|
|
attr_accessor :will_report_state
|
|
|
|
alias_method :will_report_state?, :will_report_state
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@attributes = args[:attributes] if args.key?(:attributes)
|
|
|
|
@custom_data = args[:custom_data] if args.key?(:custom_data)
|
|
|
|
@device_info = args[:device_info] if args.key?(:device_info)
|
|
|
|
@id = args[:id] if args.key?(:id)
|
|
|
|
@name = args[:name] if args.key?(:name)
|
|
|
|
@notification_supported_by_agent = args[:notification_supported_by_agent] if args.key?(:notification_supported_by_agent)
|
|
|
|
@other_device_ids = args[:other_device_ids] if args.key?(:other_device_ids)
|
|
|
|
@room_hint = args[:room_hint] if args.key?(:room_hint)
|
|
|
|
@structure_hint = args[:structure_hint] if args.key?(:structure_hint)
|
|
|
|
@traits = args[:traits] if args.key?(:traits)
|
|
|
|
@type = args[:type] if args.key?(:type)
|
|
|
|
@will_report_state = args[:will_report_state] if args.key?(:will_report_state)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Device information.
|
|
|
|
class DeviceInfo
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Device hardware version.
|
|
|
|
# Corresponds to the JSON property `hwVersion`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :hw_version
|
|
|
|
|
|
|
|
# Device manufacturer.
|
|
|
|
# Corresponds to the JSON property `manufacturer`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :manufacturer
|
|
|
|
|
|
|
|
# Device model.
|
|
|
|
# Corresponds to the JSON property `model`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :model
|
|
|
|
|
|
|
|
# Device software version.
|
|
|
|
# Corresponds to the JSON property `swVersion`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :sw_version
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@hw_version = args[:hw_version] if args.key?(:hw_version)
|
|
|
|
@manufacturer = args[:manufacturer] if args.key?(:manufacturer)
|
|
|
|
@model = args[:model] if args.key?(:model)
|
|
|
|
@sw_version = args[:sw_version] if args.key?(:sw_version)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Identifiers used to describe the device.
|
|
|
|
class DeviceNames
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# List of names provided by the manufacturer rather than the user, such as
|
|
|
|
# serial numbers, SKUs, etc.
|
|
|
|
# Corresponds to the JSON property `defaultNames`
|
|
|
|
# @return [Array<String>]
|
|
|
|
attr_accessor :default_names
|
|
|
|
|
|
|
|
# Primary name of the device, generally provided by the user.
|
|
|
|
# Corresponds to the JSON property `name`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :name
|
|
|
|
|
|
|
|
# Additional names provided by the user for the device.
|
|
|
|
# Corresponds to the JSON property `nicknames`
|
|
|
|
# @return [Array<String>]
|
|
|
|
attr_accessor :nicknames
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@default_names = args[:default_names] if args.key?(:default_names)
|
|
|
|
@name = args[:name] if args.key?(:name)
|
|
|
|
@nicknames = args[:nicknames] if args.key?(:nicknames)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# A generic empty message that you can re-use to avoid defining duplicated empty
|
|
|
|
# messages in your APIs. A typical example is to use it as the request or the
|
|
|
|
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
|
|
|
# protobuf.Empty) returns (google.protobuf.Empty); ` The JSON representation for
|
|
|
|
# `Empty` is empty JSON object ````.
|
|
|
|
class Empty
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Request type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.Query)
|
|
|
|
# call.
|
|
|
|
class QueryRequest
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Required. Third-party user ID.
|
|
|
|
# Corresponds to the JSON property `agentUserId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :agent_user_id
|
|
|
|
|
|
|
|
# Required. Inputs containing third-party device IDs for which to get the device
|
|
|
|
# states.
|
|
|
|
# Corresponds to the JSON property `inputs`
|
|
|
|
# @return [Array<Google::Apis::HomegraphV1::QueryRequestInput>]
|
|
|
|
attr_accessor :inputs
|
|
|
|
|
|
|
|
# Request ID used for debugging.
|
|
|
|
# Corresponds to the JSON property `requestId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :request_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@agent_user_id = args[:agent_user_id] if args.key?(:agent_user_id)
|
|
|
|
@inputs = args[:inputs] if args.key?(:inputs)
|
|
|
|
@request_id = args[:request_id] if args.key?(:request_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Device ID inputs to QueryRequest.
|
|
|
|
class QueryRequestInput
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Payload containing device IDs.
|
|
|
|
# Corresponds to the JSON property `payload`
|
|
|
|
# @return [Google::Apis::HomegraphV1::QueryRequestPayload]
|
|
|
|
attr_accessor :payload
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@payload = args[:payload] if args.key?(:payload)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Payload containing device IDs.
|
|
|
|
class QueryRequestPayload
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Third-party device IDs for which to get the device states.
|
|
|
|
# Corresponds to the JSON property `devices`
|
|
|
|
# @return [Array<Google::Apis::HomegraphV1::AgentDeviceId>]
|
|
|
|
attr_accessor :devices
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@devices = args[:devices] if args.key?(:devices)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Response type for the [`Query`](#google.home.graph.v1.HomeGraphApiService.
|
|
|
|
# Query) call. This should follow the same format as the Google smart home `
|
|
|
|
# action.devices.QUERY` [response](https://developers.google.com/assistant/
|
|
|
|
# smarthome/reference/intent/query). # Example ```json ` "requestId": "ff36a3cc-
|
|
|
|
# ec34-11e6-b1a0-64510650abcf", "payload": ` "devices": ` "123": ` "on": true, "
|
|
|
|
# online": true `, "456": ` "on": true, "online": true, "brightness": 80, "color"
|
|
|
|
# : ` "name": "cerulean", "spectrumRGB": 31655 ` ` ` ` ` ```
|
|
|
|
class QueryResponse
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Payload containing device states information.
|
|
|
|
# Corresponds to the JSON property `payload`
|
|
|
|
# @return [Google::Apis::HomegraphV1::QueryResponsePayload]
|
|
|
|
attr_accessor :payload
|
|
|
|
|
|
|
|
# Request ID used for debugging. Copied from the request.
|
|
|
|
# Corresponds to the JSON property `requestId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :request_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@payload = args[:payload] if args.key?(:payload)
|
|
|
|
@request_id = args[:request_id] if args.key?(:request_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Payload containing device states information.
|
|
|
|
class QueryResponsePayload
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# States of the devices. Map of third-party device ID to struct of device states.
|
|
|
|
# Corresponds to the JSON property `devices`
|
|
|
|
# @return [Hash<String,Hash<String,Object>>]
|
|
|
|
attr_accessor :devices
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@devices = args[:devices] if args.key?(:devices)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# The states and notifications specific to a device.
|
|
|
|
class ReportStateAndNotificationDevice
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Notifications metadata for devices. See the **Device NOTIFICATIONS** section
|
|
|
|
# of the individual trait [reference guides](https://developers.google.com/
|
|
|
|
# assistant/smarthome/traits).
|
|
|
|
# Corresponds to the JSON property `notifications`
|
|
|
|
# @return [Hash<String,Object>]
|
|
|
|
attr_accessor :notifications
|
|
|
|
|
|
|
|
# States of devices to update. See the **Device STATES** section of the
|
|
|
|
# individual trait [reference guides](https://developers.google.com/assistant/
|
|
|
|
# smarthome/traits).
|
|
|
|
# Corresponds to the JSON property `states`
|
|
|
|
# @return [Hash<String,Object>]
|
|
|
|
attr_accessor :states
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@notifications = args[:notifications] if args.key?(:notifications)
|
|
|
|
@states = args[:states] if args.key?(:states)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Request type for the [`ReportStateAndNotification`](#google.home.graph.v1.
|
|
|
|
# HomeGraphApiService.ReportStateAndNotification) call. It may include states,
|
|
|
|
# notifications, or both. States and notifications are defined per `device_id` (
|
|
|
|
# for example, "123" and "456" in the following example). # Example ```json ` "
|
|
|
|
# requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "agentUserId": "1234", "
|
|
|
|
# payload": ` "devices": ` "states": ` "123": ` "on": true `, "456": ` "on":
|
|
|
|
# true, "brightness": 10 ` `, ` ` ` ```
|
|
|
|
class ReportStateAndNotificationRequest
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Required. Third-party user ID.
|
|
|
|
# Corresponds to the JSON property `agentUserId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :agent_user_id
|
|
|
|
|
|
|
|
# Unique identifier per event (for example, a doorbell press).
|
|
|
|
# Corresponds to the JSON property `eventId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :event_id
|
|
|
|
|
|
|
|
# Token to maintain state in the follow up notification response. Deprecated.
|
|
|
|
# See the [notifications guide](https://developers.google.com/assistant/
|
|
|
|
# smarthome/develop/notifications) for details on implementing follow up
|
|
|
|
# notifications.
|
|
|
|
# Corresponds to the JSON property `followUpToken`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :follow_up_token
|
|
|
|
|
|
|
|
# Payload containing the state and notification information for devices.
|
|
|
|
# Corresponds to the JSON property `payload`
|
|
|
|
# @return [Google::Apis::HomegraphV1::StateAndNotificationPayload]
|
|
|
|
attr_accessor :payload
|
|
|
|
|
|
|
|
# Request ID used for debugging.
|
|
|
|
# Corresponds to the JSON property `requestId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :request_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@agent_user_id = args[:agent_user_id] if args.key?(:agent_user_id)
|
|
|
|
@event_id = args[:event_id] if args.key?(:event_id)
|
|
|
|
@follow_up_token = args[:follow_up_token] if args.key?(:follow_up_token)
|
|
|
|
@payload = args[:payload] if args.key?(:payload)
|
|
|
|
@request_id = args[:request_id] if args.key?(:request_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Response type for the [`ReportStateAndNotification`](#google.home.graph.v1.
|
|
|
|
# HomeGraphApiService.ReportStateAndNotification) call.
|
|
|
|
class ReportStateAndNotificationResponse
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Request ID copied from ReportStateAndNotificationRequest.
|
|
|
|
# Corresponds to the JSON property `requestId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :request_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@request_id = args[:request_id] if args.key?(:request_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Request type for the [`RequestSyncDevices`](#google.home.graph.v1.
|
|
|
|
# HomeGraphApiService.RequestSyncDevices) call.
|
|
|
|
class RequestSyncDevicesRequest
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Required. Third-party user ID.
|
|
|
|
# Corresponds to the JSON property `agentUserId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :agent_user_id
|
|
|
|
|
|
|
|
# Optional. If set, the request will be added to a queue and a response will be
|
|
|
|
# returned immediately. This enables concurrent requests for the given `
|
|
|
|
# agent_user_id`, but the caller will not receive any error responses.
|
|
|
|
# Corresponds to the JSON property `async`
|
|
|
|
# @return [Boolean]
|
|
|
|
attr_accessor :async
|
|
|
|
alias_method :async?, :async
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@agent_user_id = args[:agent_user_id] if args.key?(:agent_user_id)
|
|
|
|
@async = args[:async] if args.key?(:async)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Response type for the [`RequestSyncDevices`](#google.home.graph.v1.
|
|
|
|
# HomeGraphApiService.RequestSyncDevices) call. Intentionally empty upon success.
|
|
|
|
# An HTTP response code is returned with more details upon failure.
|
|
|
|
class RequestSyncDevicesResponse
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Payload containing the state and notification information for devices.
|
|
|
|
class StateAndNotificationPayload
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# The states and notifications specific to a device.
|
|
|
|
# Corresponds to the JSON property `devices`
|
|
|
|
# @return [Google::Apis::HomegraphV1::ReportStateAndNotificationDevice]
|
|
|
|
attr_accessor :devices
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@devices = args[:devices] if args.key?(:devices)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Request type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync)
|
|
|
|
# call.
|
|
|
|
class SyncRequest
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Required. Third-party user ID.
|
|
|
|
# Corresponds to the JSON property `agentUserId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :agent_user_id
|
|
|
|
|
|
|
|
# Request ID used for debugging.
|
|
|
|
# Corresponds to the JSON property `requestId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :request_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@agent_user_id = args[:agent_user_id] if args.key?(:agent_user_id)
|
|
|
|
@request_id = args[:request_id] if args.key?(:request_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Response type for the [`Sync`](#google.home.graph.v1.HomeGraphApiService.Sync)
|
|
|
|
# call. This should follow the same format as the Google smart home `action.
|
|
|
|
# devices.SYNC` [response](https://developers.google.com/assistant/smarthome/
|
|
|
|
# reference/intent/sync). # Example ```json ` "requestId": "ff36a3cc-ec34-11e6-
|
|
|
|
# b1a0-64510650abcf", "payload": ` "agentUserId": "1836.15267389", "devices": [`
|
|
|
|
# "id": "123", "type": "action.devices.types.OUTLET", "traits": [ "action.
|
|
|
|
# devices.traits.OnOff" ], "name": ` "defaultNames": ["My Outlet 1234"], "name":
|
|
|
|
# "Night light", "nicknames": ["wall plug"] `, "willReportState": false, "
|
|
|
|
# deviceInfo": ` "manufacturer": "lights-out-inc", "model": "hs1234", "hwVersion"
|
|
|
|
# : "3.2", "swVersion": "11.4" `, "customData": ` "fooValue": 74, "barValue":
|
|
|
|
# true, "bazValue": "foo" ` `] ` ` ```
|
|
|
|
class SyncResponse
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Payload containing device information.
|
|
|
|
# Corresponds to the JSON property `payload`
|
|
|
|
# @return [Google::Apis::HomegraphV1::SyncResponsePayload]
|
|
|
|
attr_accessor :payload
|
|
|
|
|
|
|
|
# Request ID used for debugging. Copied from the request.
|
|
|
|
# Corresponds to the JSON property `requestId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :request_id
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@payload = args[:payload] if args.key?(:payload)
|
|
|
|
@request_id = args[:request_id] if args.key?(:request_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Payload containing device information.
|
|
|
|
class SyncResponsePayload
|
|
|
|
include Google::Apis::Core::Hashable
|
|
|
|
|
|
|
|
# Third-party user ID
|
|
|
|
# Corresponds to the JSON property `agentUserId`
|
|
|
|
# @return [String]
|
|
|
|
attr_accessor :agent_user_id
|
|
|
|
|
|
|
|
# Devices associated with the third-party user.
|
|
|
|
# Corresponds to the JSON property `devices`
|
|
|
|
# @return [Array<Google::Apis::HomegraphV1::Device>]
|
|
|
|
attr_accessor :devices
|
|
|
|
|
|
|
|
def initialize(**args)
|
|
|
|
update!(**args)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Update properties of this object
|
|
|
|
def update!(**args)
|
|
|
|
@agent_user_id = args[:agent_user_id] if args.key?(:agent_user_id)
|
|
|
|
@devices = args[:devices] if args.key?(:devices)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|