Class: Google::Apis::HomegraphV1::ReportStateAndNotificationRequest

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/homegraph_v1/classes.rb,
lib/google/apis/homegraph_v1/representations.rb,
lib/google/apis/homegraph_v1/representations.rb

Overview

Request type for the ReportStateAndNotification call. It may include states, notifications, home_traits, home_events, or any combination thereof. Smart Home Device Traits (SHDT) states and notifications are defined per device_id (for example, "123" and "456" in the following example). Google Home Traits home_traits and home_events are lists of updates or events, each associated with a device_id (for example, "789" 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 `, `, "homeTraits": [ ` "deviceId": "789", "components": [ ` "componentId": "main", "traitData": [ ` "trait": ` "@type": "type.googleapis.com/home.graph.v1.OnOffTrait", "onOff": true ` ` ] ` ] ` ], "homeEvents": [ ` "deviceId": "789", "events": [ ` " componentId": "main", "events": [ ` "eventId": "event-123", "eventTime": "2026- 01-01T00:00:00Z", "event": ` "@type": "type.googleapis.com/home.graph.v1. DoorbellPressTrait.DoorbellPressedEvent" ` ` ] ` ] ` ] ` ` `

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ReportStateAndNotificationRequest

Returns a new instance of ReportStateAndNotificationRequest.



708
709
710
# File 'lib/google/apis/homegraph_v1/classes.rb', line 708

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#agent_user_idString

Required. Third-party user ID. Corresponds to the JSON property agentUserId

Returns:

  • (String)


686
687
688
# File 'lib/google/apis/homegraph_v1/classes.rb', line 686

def agent_user_id
  @agent_user_id
end

#event_idString

Unique identifier per event (for example, a doorbell press). Corresponds to the JSON property eventId

Returns:

  • (String)


691
692
693
# File 'lib/google/apis/homegraph_v1/classes.rb', line 691

def event_id
  @event_id
end

#follow_up_tokenString

Deprecated. Corresponds to the JSON property followUpToken

Returns:

  • (String)


696
697
698
# File 'lib/google/apis/homegraph_v1/classes.rb', line 696

def follow_up_token
  @follow_up_token
end

#payloadGoogle::Apis::HomegraphV1::StateAndNotificationPayload

Payload containing the state and notification information for devices. Corresponds to the JSON property payload



701
702
703
# File 'lib/google/apis/homegraph_v1/classes.rb', line 701

def payload
  @payload
end

#request_idString

Request ID used for debugging. Corresponds to the JSON property requestId

Returns:

  • (String)


706
707
708
# File 'lib/google/apis/homegraph_v1/classes.rb', line 706

def request_id
  @request_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



713
714
715
716
717
718
719
# File 'lib/google/apis/homegraph_v1/classes.rb', line 713

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