graph

package
v0.0.0-...-2824937 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2020 License: MIT, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package graph is a generated protocol buffer package.

It is generated from these files:

google/home/graph/v1/homegraph.proto

It has these top-level messages:

RequestSyncDevicesRequest
RequestSyncDevicesResponse
ReportStateAndNotificationRequest
ReportStateAndNotificationResponse
StateAndNotificationPayload
ReportStateAndNotificationDevice
DeleteAgentUserRequest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHomeGraphApiServiceServer

func RegisterHomeGraphApiServiceServer(s *grpc.Server, srv HomeGraphApiServiceServer)

Types

type DeleteAgentUserRequest

type DeleteAgentUserRequest struct {
	// Request id used for debugging.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"`
	// Required. Third-party user id.
	AgentUserId string `protobuf:"bytes,2,opt,name=agent_user_id,json=agentUserId" json:"agent_user_id,omitempty"`
}

Request type for DeleteAgentUser call.

func (*DeleteAgentUserRequest) Descriptor

func (*DeleteAgentUserRequest) Descriptor() ([]byte, []int)

func (*DeleteAgentUserRequest) GetAgentUserId

func (m *DeleteAgentUserRequest) GetAgentUserId() string

func (*DeleteAgentUserRequest) GetRequestId

func (m *DeleteAgentUserRequest) GetRequestId() string

func (*DeleteAgentUserRequest) ProtoMessage

func (*DeleteAgentUserRequest) ProtoMessage()

func (*DeleteAgentUserRequest) Reset

func (m *DeleteAgentUserRequest) Reset()

func (*DeleteAgentUserRequest) String

func (m *DeleteAgentUserRequest) String() string

type HomeGraphApiServiceClient

type HomeGraphApiServiceClient interface {
	// Requests a Sync call from Google to a 3p partner's home control agent for
	// a user.
	//
	//
	// Third-party user's identity is passed in as agent_user_id.
	// (see [RequestSyncDevicesRequest][google.home.graph.v1.RequestSyncDevicesRequest]) and forwarded back to the agent.
	// Agent is identified by the API key or JWT signed by the partner's service
	// account.
	RequestSyncDevices(ctx context.Context, in *RequestSyncDevicesRequest, opts ...grpc.CallOption) (*RequestSyncDevicesResponse, error)
	// Reports device state and optionally sends device notifications. Called by
	// an agent when the device state of a third-party changes or the agent wants
	// to send a notification about the device.
	// This method updates a predefined set of States for a device, which all
	// devices have (for example a light will have OnOff, Color, Brightness).
	// A new State may not be created and an INVALID_ARGUMENT code will be thrown
	// if so. It also optionally takes in a list of Notifications that may be
	// created, which are associated to this State change.
	//
	// Third-party user's identity is passed in as agent_user_id.
	// Agent is identified by the JWT signed by the partner's service account.
	ReportStateAndNotification(ctx context.Context, in *ReportStateAndNotificationRequest, opts ...grpc.CallOption) (*ReportStateAndNotificationResponse, error)
	// Unlink an agent user from Google. As result, all data related to this user
	// will be deleted.
	//
	// Third-party user's identity is passed in as agent_user_id.
	// Agent is identified by the JWT signed by the partner's service account.
	//
	// Note: Special characters (except "/") in agent_user_id must be URL encoded.
	DeleteAgentUser(ctx context.Context, in *DeleteAgentUserRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
}

func NewHomeGraphApiServiceClient

func NewHomeGraphApiServiceClient(cc *grpc.ClientConn) HomeGraphApiServiceClient

type HomeGraphApiServiceServer

type HomeGraphApiServiceServer interface {
	// Requests a Sync call from Google to a 3p partner's home control agent for
	// a user.
	//
	//
	// Third-party user's identity is passed in as agent_user_id.
	// (see [RequestSyncDevicesRequest][google.home.graph.v1.RequestSyncDevicesRequest]) and forwarded back to the agent.
	// Agent is identified by the API key or JWT signed by the partner's service
	// account.
	RequestSyncDevices(context.Context, *RequestSyncDevicesRequest) (*RequestSyncDevicesResponse, error)
	// Reports device state and optionally sends device notifications. Called by
	// an agent when the device state of a third-party changes or the agent wants
	// to send a notification about the device.
	// This method updates a predefined set of States for a device, which all
	// devices have (for example a light will have OnOff, Color, Brightness).
	// A new State may not be created and an INVALID_ARGUMENT code will be thrown
	// if so. It also optionally takes in a list of Notifications that may be
	// created, which are associated to this State change.
	//
	// Third-party user's identity is passed in as agent_user_id.
	// Agent is identified by the JWT signed by the partner's service account.
	ReportStateAndNotification(context.Context, *ReportStateAndNotificationRequest) (*ReportStateAndNotificationResponse, error)
	// Unlink an agent user from Google. As result, all data related to this user
	// will be deleted.
	//
	// Third-party user's identity is passed in as agent_user_id.
	// Agent is identified by the JWT signed by the partner's service account.
	//
	// Note: Special characters (except "/") in agent_user_id must be URL encoded.
	DeleteAgentUser(context.Context, *DeleteAgentUserRequest) (*google_protobuf1.Empty, error)
}

type ReportStateAndNotificationDevice

type ReportStateAndNotificationDevice struct {
	// States of devices to update.
	States *google_protobuf2.Struct `protobuf:"bytes,1,opt,name=states" json:"states,omitempty"`
	// Notifications metadata for devices.
	Notifications *google_protobuf2.Struct `protobuf:"bytes,2,opt,name=notifications" json:"notifications,omitempty"`
}

The States and Notifications specific to a device.

func (*ReportStateAndNotificationDevice) Descriptor

func (*ReportStateAndNotificationDevice) Descriptor() ([]byte, []int)

func (*ReportStateAndNotificationDevice) GetNotifications

func (*ReportStateAndNotificationDevice) GetStates

func (*ReportStateAndNotificationDevice) ProtoMessage

func (*ReportStateAndNotificationDevice) ProtoMessage()

func (*ReportStateAndNotificationDevice) Reset

func (*ReportStateAndNotificationDevice) String

type ReportStateAndNotificationRequest

type ReportStateAndNotificationRequest struct {
	// Request id used for debugging.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"`
	// Unique identifier per event (eg: doorbell press).
	EventId string `protobuf:"bytes,4,opt,name=event_id,json=eventId" json:"event_id,omitempty"`
	// Required. Third-party user id.
	AgentUserId string `protobuf:"bytes,2,opt,name=agent_user_id,json=agentUserId" json:"agent_user_id,omitempty"`
	// State of devices to update and notification metadata for devices. For
	// example, if a user turns a light on manually, a State update should be
	// sent so that the information is always the current status of the device.
	// Notifications are independent from the state and its piece of the payload
	// should contain everything necessary to notify the user. Although it may be
	// related to a state change, it does not need to be. For example, if a
	// device can turn on/off and change temperature, the states reported would
	// include both "on" and "70 degrees" but the 3p may choose not to send any
	// notification for that, or to only say that the "the room is heating up",
	// keeping state and notification independent.
	Payload *StateAndNotificationPayload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
}

Sample ReportStateAndNotificationRequest, with states and notifications defined per device_id (eg: "123" and "456" in the following example):

{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "agent_user_id": "1234",
  "payload": {
    "devices": {
      "states": {
        "123": {
          "on": true
        },
        "456": {
          "on": true,
          "brightness": 10
        }
      },
      "notifications": {
        "123": {
          "ObjectDetected": {
            "priority": 0,
            "objects": {
              "NAMED": ["Alice", "Bob", "Carol", "Eve"]
            }
          },
          "DoorUnlocked": {
            "priority": 0,
            "keyUsed": {
              "keyName": "Wife's key"
            }
          }
        },
        "456": {
          "SprinklersOn": {
            "priority": 0,
            "timeStarted": "1513792702"
          }
        }
      }
    }
  }
}

Request type for ReportStateAndNotification call. It may include States, Notifications, or both. This request uses globally unique flattened state names instead of namespaces based on traits to align with the existing QUERY and EXECUTE APIs implemented by 90+ Smart Home partners. Next tag: 5.

func (*ReportStateAndNotificationRequest) Descriptor

func (*ReportStateAndNotificationRequest) Descriptor() ([]byte, []int)

func (*ReportStateAndNotificationRequest) GetAgentUserId

func (m *ReportStateAndNotificationRequest) GetAgentUserId() string

func (*ReportStateAndNotificationRequest) GetEventId

func (m *ReportStateAndNotificationRequest) GetEventId() string

func (*ReportStateAndNotificationRequest) GetPayload

func (*ReportStateAndNotificationRequest) GetRequestId

func (m *ReportStateAndNotificationRequest) GetRequestId() string

func (*ReportStateAndNotificationRequest) ProtoMessage

func (*ReportStateAndNotificationRequest) ProtoMessage()

func (*ReportStateAndNotificationRequest) Reset

func (*ReportStateAndNotificationRequest) String

type ReportStateAndNotificationResponse

type ReportStateAndNotificationResponse struct {
	// Request id copied from ReportStateAndNotificationRequest.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId" json:"request_id,omitempty"`
}

Response type for ReportStateAndNotification call.

func (*ReportStateAndNotificationResponse) Descriptor

func (*ReportStateAndNotificationResponse) Descriptor() ([]byte, []int)

func (*ReportStateAndNotificationResponse) GetRequestId

func (m *ReportStateAndNotificationResponse) GetRequestId() string

func (*ReportStateAndNotificationResponse) ProtoMessage

func (*ReportStateAndNotificationResponse) ProtoMessage()

func (*ReportStateAndNotificationResponse) Reset

func (*ReportStateAndNotificationResponse) String

type RequestSyncDevicesRequest

type RequestSyncDevicesRequest struct {
	// Required. Third-party user id issued by agent's third-party identity
	// provider.
	AgentUserId string `protobuf:"bytes,1,opt,name=agent_user_id,json=agentUserId" json:"agent_user_id,omitempty"`
}

Request type for RequestSyncDevices call.

func (*RequestSyncDevicesRequest) Descriptor

func (*RequestSyncDevicesRequest) Descriptor() ([]byte, []int)

func (*RequestSyncDevicesRequest) GetAgentUserId

func (m *RequestSyncDevicesRequest) GetAgentUserId() string

func (*RequestSyncDevicesRequest) ProtoMessage

func (*RequestSyncDevicesRequest) ProtoMessage()

func (*RequestSyncDevicesRequest) Reset

func (m *RequestSyncDevicesRequest) Reset()

func (*RequestSyncDevicesRequest) String

func (m *RequestSyncDevicesRequest) String() string

type RequestSyncDevicesResponse

type RequestSyncDevicesResponse struct {
}

Response type for RequestSyncDevices call. Intentionally empty upon success. An HTTP response code is returned with more details upon failure.

func (*RequestSyncDevicesResponse) Descriptor

func (*RequestSyncDevicesResponse) Descriptor() ([]byte, []int)

func (*RequestSyncDevicesResponse) ProtoMessage

func (*RequestSyncDevicesResponse) ProtoMessage()

func (*RequestSyncDevicesResponse) Reset

func (m *RequestSyncDevicesResponse) Reset()

func (*RequestSyncDevicesResponse) String

func (m *RequestSyncDevicesResponse) String() string

type StateAndNotificationPayload

type StateAndNotificationPayload struct {
	// The devices for updating State and sending Notifications.
	Devices *ReportStateAndNotificationDevice `protobuf:"bytes,1,opt,name=devices" json:"devices,omitempty"`
}

Payload containing the State and Notification information for devices.

func (*StateAndNotificationPayload) Descriptor

func (*StateAndNotificationPayload) Descriptor() ([]byte, []int)

func (*StateAndNotificationPayload) GetDevices

func (*StateAndNotificationPayload) ProtoMessage

func (*StateAndNotificationPayload) ProtoMessage()

func (*StateAndNotificationPayload) Reset

func (m *StateAndNotificationPayload) Reset()

func (*StateAndNotificationPayload) String

func (m *StateAndNotificationPayload) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL