Skip to content

Commit

Permalink
feat: Automated regeneration of HomeGraph client
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Mar 12, 2024
1 parent 9f57fc1 commit 24f55c2
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions clients/home_graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_home_graph, "~> 0.12"}]
[{:google_api_home_graph, "~> 0.13"}]
end
```

## For more information

Product documentation is available at [https://developers.google.com/actions/smarthome/create-app#request-sync](https://developers.google.com/actions/smarthome/create-app#request-sync).
Product documentation is available at [https://developers.home.google.com/cloud-to-cloud/get-started](https://developers.home.google.com/cloud-to-cloud/get-started).

Library reference documentation is published on Hexdocs at
[https://hexdocs.pm/google_api_home_graph](https://hexdocs.pm/google_api_home_graph).
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule GoogleApi.HomeGraph.V1.Api.AgentUsers do
@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.google.com/assistant/smarthome/concepts/fulfillment-authentication). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.
Unlinks the given third-party user from your smart home Action. All data related to this user will be deleted. For more details on how users link their accounts, see [fulfillment and authentication](https://developers.home.google.com/cloud-to-cloud/primer/fulfillment). The third-party user's identity is passed in via the `agent_user_id` (see DeleteAgentUserRequest). This request must be authorized using service account credentials from your Actions console project.
## Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ defmodule GoogleApi.HomeGraph.V1.Api.Devices do
end

@doc """
Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.google.com/assistant/smarthome/develop/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.google.com/assistant/smarthome/concepts/devices-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.
Reports device state and optionally sends device notifications. Called by your smart home Action when the state of a third-party device changes or you need to send a notification about the device. See [Implement Report State](https://developers.home.google.com/cloud-to-cloud/integration/report-state) for more information. This method updates the device state according to its declared [traits](https://developers.home.google.com/cloud-to-cloud/primer/device-types-and-traits). Publishing a new state value outside of these traits will result in an `INVALID_ARGUMENT` error response. The third-party user's identity is passed in via the `agent_user_id` (see ReportStateAndNotificationRequest). This request must be authorized using service account credentials from your Actions console project.
## Parameters
Expand Down Expand Up @@ -150,7 +150,7 @@ defmodule GoogleApi.HomeGraph.V1.Api.Devices do
end

@doc """
Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.
Requests Google to send an `action.devices.SYNC` [intent](https://developers.home.google.com/cloud-to-cloud/intents/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.
## Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.HomeGraph.V1 do
API client metadata for GoogleApi.HomeGraph.V1.
"""

@discovery_revision "20220325"
@discovery_revision "20240226"

def discovery_revision(), do: @discovery_revision
end
10 changes: 5 additions & 5 deletions clients/home_graph/lib/google_api/home_graph/v1/model/device.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@

defmodule GoogleApi.HomeGraph.V1.Model.Device do
@moduledoc """
Third-party device definition. Next ID = 14
Third-party device definition.
## Attributes
* `attributes` (*type:* `map()`, *default:* `nil`) - Attributes for the traits supported by the device.
* `customData` (*type:* `map()`, *default:* `nil`) - 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/smarthome/reference/intent/execute) intent. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.
* `customData` (*type:* `map()`, *default:* `nil`) - Custom device attributes stored in Home Graph and provided to your smart home Action in each [QUERY](https://developers.home.google.com/cloud-to-cloud/intents/query) and [EXECUTE](https://developers.home.google.com/cloud-to-cloud/intents/execute) intent. Data in this object has a few constraints: No sensitive information, including but not limited to Personally Identifiable Information.
* `deviceInfo` (*type:* `GoogleApi.HomeGraph.V1.Model.DeviceInfo.t`, *default:* `nil`) - Device manufacturer, model, hardware version, and software version.
* `id` (*type:* `String.t`, *default:* `nil`) - Third-party device ID.
* `name` (*type:* `GoogleApi.HomeGraph.V1.Model.DeviceNames.t`, *default:* `nil`) - Names given to this device by your smart home Action.
* `notificationSupportedByAgent` (*type:* `boolean()`, *default:* `nil`) - 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.
* `otherDeviceIds` (*type:* `list(GoogleApi.HomeGraph.V1.Model.AgentOtherDeviceId.t)`, *default:* `nil`) - 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).
* `otherDeviceIds` (*type:* `list(GoogleApi.HomeGraph.V1.Model.AgentOtherDeviceId.t)`, *default:* `nil`) - Alternate IDs associated with this device. This is used to identify cloud synced devices enabled for [local fulfillment](https://developers.home.google.com/local-home/overview).
* `roomHint` (*type:* `String.t`, *default:* `nil`) - Suggested name for the room where this device is installed. Google attempts to use this value during user setup.
* `structureHint` (*type:* `String.t`, *default:* `nil`) - Suggested name for the structure where this device is installed. Google attempts to use this value during user setup.
* `traits` (*type:* `list(String.t)`, *default:* `nil`) - Traits supported by the device. See [device traits](https://developers.google.com/assistant/smarthome/traits).
* `type` (*type:* `String.t`, *default:* `nil`) - Hardware type of the device. See [device types](https://developers.google.com/assistant/smarthome/guides).
* `traits` (*type:* `list(String.t)`, *default:* `nil`) - Traits supported by the device. See [device traits](https://developers.home.google.com/cloud-to-cloud/traits).
* `type` (*type:* `String.t`, *default:* `nil`) - Hardware type of the device. See [device types](https://developers.home.google.com/cloud-to-cloud/guides).
* `willReportState` (*type:* `boolean()`, *default:* `nil`) - Indicates whether your smart home Action will report state of this device to Google via ReportStateAndNotification.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.HomeGraph.V1.Model.QueryResponse do
@moduledoc """
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 } } } } } ```
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.home.google.com/cloud-to-cloud/intents/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 } } } } } ```
## Attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ defmodule GoogleApi.HomeGraph.V1.Model.ReportStateAndNotificationDevice do
## Attributes
* `notifications` (*type:* `map()`, *default:* `nil`) - Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).
* `states` (*type:* `map()`, *default:* `nil`) - States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.google.com/assistant/smarthome/traits).
* `notifications` (*type:* `map()`, *default:* `nil`) - Notifications metadata for devices. See the **Device NOTIFICATIONS** section of the individual trait [reference guides](https://developers.home.google.com/cloud-to-cloud/traits).
* `states` (*type:* `map()`, *default:* `nil`) - States of devices to update. See the **Device STATES** section of the individual trait [reference guides](https://developers.home.google.com/cloud-to-cloud/traits).
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.HomeGraph.V1.Model.ReportStateAndNotificationRequest do
@moduledoc """
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 } }, } } } ```
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 } }, } } } ```
## Attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

defmodule GoogleApi.HomeGraph.V1.Model.SyncResponse do
@moduledoc """
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" } }] } } ```
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.home.google.com/cloud-to-cloud/intents/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" } }] } } ```
## Attributes
Expand Down
4 changes: 2 additions & 2 deletions clients/home_graph/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.HomeGraph.Mixfile do
use Mix.Project

@version "0.12.1"
@version "0.13.0"

def project() do
[
Expand Down Expand Up @@ -59,7 +59,7 @@ defmodule GoogleApi.HomeGraph.Mixfile do
licenses: ["Apache 2.0"],
links: %{
"GitHub" => "https://github.com/googleapis/elixir-google-api/tree/master/clients/home_graph",
"Homepage" => "https://developers.google.com/actions/smarthome/create-app#request-sync"
"Homepage" => "https://developers.home.google.com/cloud-to-cloud/get-started"
}
]
end
Expand Down

0 comments on commit 24f55c2

Please sign in to comment.