graph

package
v0.0.0-...-0e82294 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHomeGraphApiServiceServer

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

Types

type AgentDeviceId

type AgentDeviceId struct {
	// Third-party partner's device ID.
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Third-party partner's device ID for one device.

func (*AgentDeviceId) Descriptor

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

func (*AgentDeviceId) GetId

func (m *AgentDeviceId) GetId() string

func (*AgentDeviceId) ProtoMessage

func (*AgentDeviceId) ProtoMessage()

func (*AgentDeviceId) Reset

func (m *AgentDeviceId) Reset()

func (*AgentDeviceId) String

func (m *AgentDeviceId) String() string

func (*AgentDeviceId) XXX_DiscardUnknown

func (m *AgentDeviceId) XXX_DiscardUnknown()

func (*AgentDeviceId) XXX_Marshal

func (m *AgentDeviceId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AgentDeviceId) XXX_Merge

func (m *AgentDeviceId) XXX_Merge(src proto.Message)

func (*AgentDeviceId) XXX_Size

func (m *AgentDeviceId) XXX_Size() int

func (*AgentDeviceId) XXX_Unmarshal

func (m *AgentDeviceId) XXX_Unmarshal(b []byte) error

type DeleteAgentUserRequest

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

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

func (*DeleteAgentUserRequest) XXX_DiscardUnknown

func (m *DeleteAgentUserRequest) XXX_DiscardUnknown()

func (*DeleteAgentUserRequest) XXX_Marshal

func (m *DeleteAgentUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeleteAgentUserRequest) XXX_Merge

func (m *DeleteAgentUserRequest) XXX_Merge(src proto.Message)

func (*DeleteAgentUserRequest) XXX_Size

func (m *DeleteAgentUserRequest) XXX_Size() int

func (*DeleteAgentUserRequest) XXX_Unmarshal

func (m *DeleteAgentUserRequest) XXX_Unmarshal(b []byte) error

type Device

type Device struct {
	// Third-party partner's device ID.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Hardware type of the device (e.g. light, outlet, etc).
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// Traits supported by the device.
	Traits []string `protobuf:"bytes,3,rep,name=traits,proto3" json:"traits,omitempty"`
	// Name of the device given by the third party. This includes names given to
	// the device via third party device manufacturer's app, model names for the
	// device, etc.
	Name *DeviceNames `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// Indicates whether the state of this device is being reported to Google
	// through ReportStateAndNotification call.
	WillReportState bool `protobuf:"varint,5,opt,name=will_report_state,json=willReportState,proto3" json:"will_report_state,omitempty"`
	// If the third-party partner's cloud configuration includes placing devices
	// in rooms, the name of the room can be provided here.
	RoomHint string `protobuf:"bytes,6,opt,name=room_hint,json=roomHint,proto3" json:"room_hint,omitempty"`
	// As in roomHint, for structures that users set up in the partner's system.
	StructureHint string `protobuf:"bytes,7,opt,name=structure_hint,json=structureHint,proto3" json:"structure_hint,omitempty"`
	// Device manufacturer, model, hardware version, and software version.
	DeviceInfo *DeviceInfo `protobuf:"bytes,8,opt,name=device_info,json=deviceInfo,proto3" json:"device_info,omitempty"`
	// Attributes for the traits supported by the device.
	Attributes *_struct.Struct `protobuf:"bytes,9,opt,name=attributes,proto3" json:"attributes,omitempty"`
	// Custom JSON data provided by the manufacturer and attached to QUERY and
	// EXECUTE requests in AoG.
	CustomData           string   `protobuf:"bytes,10,opt,name=custom_data,json=customData,proto3" json:"custom_data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Third-party partner's device definition.

func (*Device) Descriptor

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

func (*Device) GetAttributes

func (m *Device) GetAttributes() *_struct.Struct

func (*Device) GetCustomData

func (m *Device) GetCustomData() string

func (*Device) GetDeviceInfo

func (m *Device) GetDeviceInfo() *DeviceInfo

func (*Device) GetId

func (m *Device) GetId() string

func (*Device) GetName

func (m *Device) GetName() *DeviceNames

func (*Device) GetRoomHint

func (m *Device) GetRoomHint() string

func (*Device) GetStructureHint

func (m *Device) GetStructureHint() string

func (*Device) GetTraits

func (m *Device) GetTraits() []string

func (*Device) GetType

func (m *Device) GetType() string

func (*Device) GetWillReportState

func (m *Device) GetWillReportState() bool

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) Reset

func (m *Device) Reset()

func (*Device) String

func (m *Device) String() string

func (*Device) XXX_DiscardUnknown

func (m *Device) XXX_DiscardUnknown()

func (*Device) XXX_Marshal

func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Device) XXX_Merge

func (m *Device) XXX_Merge(src proto.Message)

func (*Device) XXX_Size

func (m *Device) XXX_Size() int

func (*Device) XXX_Unmarshal

func (m *Device) XXX_Unmarshal(b []byte) error

type DeviceInfo

type DeviceInfo struct {
	// Device manufacturer.
	Manufacturer string `protobuf:"bytes,1,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"`
	// Device model.
	Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`
	// Device hardware version.
	HwVersion string `protobuf:"bytes,3,opt,name=hw_version,json=hwVersion,proto3" json:"hw_version,omitempty"`
	// Device software version.
	SwVersion            string   `protobuf:"bytes,4,opt,name=sw_version,json=swVersion,proto3" json:"sw_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Device information.

func (*DeviceInfo) Descriptor

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

func (*DeviceInfo) GetHwVersion

func (m *DeviceInfo) GetHwVersion() string

func (*DeviceInfo) GetManufacturer

func (m *DeviceInfo) GetManufacturer() string

func (*DeviceInfo) GetModel

func (m *DeviceInfo) GetModel() string

func (*DeviceInfo) GetSwVersion

func (m *DeviceInfo) GetSwVersion() string

func (*DeviceInfo) ProtoMessage

func (*DeviceInfo) ProtoMessage()

func (*DeviceInfo) Reset

func (m *DeviceInfo) Reset()

func (*DeviceInfo) String

func (m *DeviceInfo) String() string

func (*DeviceInfo) XXX_DiscardUnknown

func (m *DeviceInfo) XXX_DiscardUnknown()

func (*DeviceInfo) XXX_Marshal

func (m *DeviceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeviceInfo) XXX_Merge

func (m *DeviceInfo) XXX_Merge(src proto.Message)

func (*DeviceInfo) XXX_Size

func (m *DeviceInfo) XXX_Size() int

func (*DeviceInfo) XXX_Unmarshal

func (m *DeviceInfo) XXX_Unmarshal(b []byte) error

type DeviceNames

type DeviceNames struct {
	// Primary name of the device, generally provided by the user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Additional names provided by the user for the device.
	Nicknames []string `protobuf:"bytes,2,rep,name=nicknames,proto3" json:"nicknames,omitempty"`
	// List of names provided by the partner rather than the user, often
	// manufacturer names, SKUs, etc.
	DefaultNames         []string `protobuf:"bytes,3,rep,name=default_names,json=defaultNames,proto3" json:"default_names,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Different names for the device.

func (*DeviceNames) Descriptor

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

func (*DeviceNames) GetDefaultNames

func (m *DeviceNames) GetDefaultNames() []string

func (*DeviceNames) GetName

func (m *DeviceNames) GetName() string

func (*DeviceNames) GetNicknames

func (m *DeviceNames) GetNicknames() []string

func (*DeviceNames) ProtoMessage

func (*DeviceNames) ProtoMessage()

func (*DeviceNames) Reset

func (m *DeviceNames) Reset()

func (*DeviceNames) String

func (m *DeviceNames) String() string

func (*DeviceNames) XXX_DiscardUnknown

func (m *DeviceNames) XXX_DiscardUnknown()

func (*DeviceNames) XXX_Marshal

func (m *DeviceNames) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeviceNames) XXX_Merge

func (m *DeviceNames) XXX_Merge(src proto.Message)

func (*DeviceNames) XXX_Size

func (m *DeviceNames) XXX_Size() int

func (*DeviceNames) XXX_Unmarshal

func (m *DeviceNames) XXX_Unmarshal(b []byte) error

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.
	//
	// Here is how the agent user is created in Google:
	// When users open their Google Home App, they can begin linking a 3p
	// partner. User is guided through the OAuth process. After entering the 3p
	// credentials, Google gets the 3p OAuth token, and uses it to make a
	// Sync call to the 3p partner and gets back all the user's data, including
	// agent_user_id and devices.
	// Google then creates the agent user and stores a mapping from the
	// agent_user_id -> Google ID mapping. Google also stores all user's devices
	// under that Google ID.
	// The mapping from agent_user_id -> Google ID is many to many, since one
	// Google user can have multiple 3p accounts, and multiple Google users can
	// map to one agent_user_id (e.g. husband and wife share one Nest account
	// username/password).
	//
	// 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) (*empty.Empty, error)
	// Gets the device states for the devices in QueryRequest.
	// Third-party user's identity is passed in as agent_user_id. Agent is
	// identified by the JWT signed by the third-party partner's service account.
	Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
	// Gets all the devices associated with the given third-party user.
	// Third-party user's identity is passed in as agent_user_id. Agent is
	// identified by the JWT signed by the third-party partner's service account.
	Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
}

HomeGraphApiServiceClient is the client API for HomeGraphApiService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

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.
	//
	// Here is how the agent user is created in Google:
	// When users open their Google Home App, they can begin linking a 3p
	// partner. User is guided through the OAuth process. After entering the 3p
	// credentials, Google gets the 3p OAuth token, and uses it to make a
	// Sync call to the 3p partner and gets back all the user's data, including
	// agent_user_id and devices.
	// Google then creates the agent user and stores a mapping from the
	// agent_user_id -> Google ID mapping. Google also stores all user's devices
	// under that Google ID.
	// The mapping from agent_user_id -> Google ID is many to many, since one
	// Google user can have multiple 3p accounts, and multiple Google users can
	// map to one agent_user_id (e.g. husband and wife share one Nest account
	// username/password).
	//
	// 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) (*empty.Empty, error)
	// Gets the device states for the devices in QueryRequest.
	// Third-party user's identity is passed in as agent_user_id. Agent is
	// identified by the JWT signed by the third-party partner's service account.
	Query(context.Context, *QueryRequest) (*QueryResponse, error)
	// Gets all the devices associated with the given third-party user.
	// Third-party user's identity is passed in as agent_user_id. Agent is
	// identified by the JWT signed by the third-party partner's service account.
	Sync(context.Context, *SyncRequest) (*SyncResponse, error)
}

HomeGraphApiServiceServer is the server API for HomeGraphApiService service.

type QueryRequest

type QueryRequest struct {
	// Request ID used for debugging.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Required. Third-party user ID.
	AgentUserId string `protobuf:"bytes,2,opt,name=agent_user_id,json=agentUserId,proto3" json:"agent_user_id,omitempty"`
	// Required. Inputs containing third-party partner's device IDs for which to
	// get the device states.
	Inputs               []*QueryRequestInput `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Request type for Query call. This should be the same format as the AoG action.devices.QUERY request (https://developers.google.com/actions/smarthome/create-app#actiondevicesquery) with the exception of the extra "agent_user_id" and no "intent" and "customData" field.

func (*QueryRequest) Descriptor

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

func (*QueryRequest) GetAgentUserId

func (m *QueryRequest) GetAgentUserId() string

func (*QueryRequest) GetInputs

func (m *QueryRequest) GetInputs() []*QueryRequestInput

func (*QueryRequest) GetRequestId

func (m *QueryRequest) GetRequestId() string

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) Reset

func (m *QueryRequest) Reset()

func (*QueryRequest) String

func (m *QueryRequest) String() string

func (*QueryRequest) XXX_DiscardUnknown

func (m *QueryRequest) XXX_DiscardUnknown()

func (*QueryRequest) XXX_Marshal

func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryRequest) XXX_Merge

func (m *QueryRequest) XXX_Merge(src proto.Message)

func (*QueryRequest) XXX_Size

func (m *QueryRequest) XXX_Size() int

func (*QueryRequest) XXX_Unmarshal

func (m *QueryRequest) XXX_Unmarshal(b []byte) error

type QueryRequestInput

type QueryRequestInput struct {
	// Payload containing third-party partner's device IDs.
	Payload              *QueryRequestPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Device ID inputs to QueryRequest.

func (*QueryRequestInput) Descriptor

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

func (*QueryRequestInput) GetPayload

func (m *QueryRequestInput) GetPayload() *QueryRequestPayload

func (*QueryRequestInput) ProtoMessage

func (*QueryRequestInput) ProtoMessage()

func (*QueryRequestInput) Reset

func (m *QueryRequestInput) Reset()

func (*QueryRequestInput) String

func (m *QueryRequestInput) String() string

func (*QueryRequestInput) XXX_DiscardUnknown

func (m *QueryRequestInput) XXX_DiscardUnknown()

func (*QueryRequestInput) XXX_Marshal

func (m *QueryRequestInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryRequestInput) XXX_Merge

func (m *QueryRequestInput) XXX_Merge(src proto.Message)

func (*QueryRequestInput) XXX_Size

func (m *QueryRequestInput) XXX_Size() int

func (*QueryRequestInput) XXX_Unmarshal

func (m *QueryRequestInput) XXX_Unmarshal(b []byte) error

type QueryRequestPayload

type QueryRequestPayload struct {
	// Third-party partner's device IDs to get device states for.
	Devices              []*AgentDeviceId `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Payload containing device IDs.

func (*QueryRequestPayload) Descriptor

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

func (*QueryRequestPayload) GetDevices

func (m *QueryRequestPayload) GetDevices() []*AgentDeviceId

func (*QueryRequestPayload) ProtoMessage

func (*QueryRequestPayload) ProtoMessage()

func (*QueryRequestPayload) Reset

func (m *QueryRequestPayload) Reset()

func (*QueryRequestPayload) String

func (m *QueryRequestPayload) String() string

func (*QueryRequestPayload) XXX_DiscardUnknown

func (m *QueryRequestPayload) XXX_DiscardUnknown()

func (*QueryRequestPayload) XXX_Marshal

func (m *QueryRequestPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryRequestPayload) XXX_Merge

func (m *QueryRequestPayload) XXX_Merge(src proto.Message)

func (*QueryRequestPayload) XXX_Size

func (m *QueryRequestPayload) XXX_Size() int

func (*QueryRequestPayload) XXX_Unmarshal

func (m *QueryRequestPayload) XXX_Unmarshal(b []byte) error

type QueryResponse

type QueryResponse struct {
	// Request ID used for debugging. Copied from the request.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Device states for the devices given in the request.
	Payload              *QueryResponsePayload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

Response type for Query call. This should follow the same format as AoG action.devices.QUERY response (https://developers.google.com/actions/smarthome/create-app#actiondevicesquery).

func (*QueryResponse) Descriptor

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

func (*QueryResponse) GetPayload

func (m *QueryResponse) GetPayload() *QueryResponsePayload

func (*QueryResponse) GetRequestId

func (m *QueryResponse) GetRequestId() string

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) Reset

func (m *QueryResponse) Reset()

func (*QueryResponse) String

func (m *QueryResponse) String() string

func (*QueryResponse) XXX_DiscardUnknown

func (m *QueryResponse) XXX_DiscardUnknown()

func (*QueryResponse) XXX_Marshal

func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryResponse) XXX_Merge

func (m *QueryResponse) XXX_Merge(src proto.Message)

func (*QueryResponse) XXX_Size

func (m *QueryResponse) XXX_Size() int

func (*QueryResponse) XXX_Unmarshal

func (m *QueryResponse) XXX_Unmarshal(b []byte) error

type QueryResponsePayload

type QueryResponsePayload struct {
	// States of the devices. Map of third-party device ID to struct of device
	// states.
	Devices              map[string]*_struct.Struct `` /* 155-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

Payload containing device states information.

func (*QueryResponsePayload) Descriptor

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

func (*QueryResponsePayload) GetDevices

func (m *QueryResponsePayload) GetDevices() map[string]*_struct.Struct

func (*QueryResponsePayload) ProtoMessage

func (*QueryResponsePayload) ProtoMessage()

func (*QueryResponsePayload) Reset

func (m *QueryResponsePayload) Reset()

func (*QueryResponsePayload) String

func (m *QueryResponsePayload) String() string

func (*QueryResponsePayload) XXX_DiscardUnknown

func (m *QueryResponsePayload) XXX_DiscardUnknown()

func (*QueryResponsePayload) XXX_Marshal

func (m *QueryResponsePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryResponsePayload) XXX_Merge

func (m *QueryResponsePayload) XXX_Merge(src proto.Message)

func (*QueryResponsePayload) XXX_Size

func (m *QueryResponsePayload) XXX_Size() int

func (*QueryResponsePayload) XXX_Unmarshal

func (m *QueryResponsePayload) XXX_Unmarshal(b []byte) error

type ReportStateAndNotificationDevice

type ReportStateAndNotificationDevice struct {
	// States of devices to update.
	States *_struct.Struct `protobuf:"bytes,1,opt,name=states,proto3" json:"states,omitempty"`
	// Notifications metadata for devices.
	Notifications        *_struct.Struct `protobuf:"bytes,2,opt,name=notifications,proto3" json:"notifications,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

The States and Notifications specific to a device.

func (*ReportStateAndNotificationDevice) Descriptor

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

func (*ReportStateAndNotificationDevice) GetNotifications

func (m *ReportStateAndNotificationDevice) GetNotifications() *_struct.Struct

func (*ReportStateAndNotificationDevice) GetStates

func (*ReportStateAndNotificationDevice) ProtoMessage

func (*ReportStateAndNotificationDevice) ProtoMessage()

func (*ReportStateAndNotificationDevice) Reset

func (*ReportStateAndNotificationDevice) String

func (*ReportStateAndNotificationDevice) XXX_DiscardUnknown

func (m *ReportStateAndNotificationDevice) XXX_DiscardUnknown()

func (*ReportStateAndNotificationDevice) XXX_Marshal

func (m *ReportStateAndNotificationDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReportStateAndNotificationDevice) XXX_Merge

func (*ReportStateAndNotificationDevice) XXX_Size

func (m *ReportStateAndNotificationDevice) XXX_Size() int

func (*ReportStateAndNotificationDevice) XXX_Unmarshal

func (m *ReportStateAndNotificationDevice) XXX_Unmarshal(b []byte) error

type ReportStateAndNotificationRequest

type ReportStateAndNotificationRequest struct {
	// Request id used for debugging.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Unique identifier per event (eg: doorbell press).
	EventId string `protobuf:"bytes,4,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	// Required. Third-party user id.
	AgentUserId string `protobuf:"bytes,2,opt,name=agent_user_id,json=agentUserId,proto3" json:"agent_user_id,omitempty"`
	// Token to maintain state in the follow up notification response.
	FollowUpToken string `protobuf:"bytes,5,opt,name=follow_up_token,json=followUpToken,proto3" json:"follow_up_token,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,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

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: 6.

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) GetFollowUpToken

func (m *ReportStateAndNotificationRequest) GetFollowUpToken() string

func (*ReportStateAndNotificationRequest) GetPayload

func (*ReportStateAndNotificationRequest) GetRequestId

func (m *ReportStateAndNotificationRequest) GetRequestId() string

func (*ReportStateAndNotificationRequest) ProtoMessage

func (*ReportStateAndNotificationRequest) ProtoMessage()

func (*ReportStateAndNotificationRequest) Reset

func (*ReportStateAndNotificationRequest) String

func (*ReportStateAndNotificationRequest) XXX_DiscardUnknown

func (m *ReportStateAndNotificationRequest) XXX_DiscardUnknown()

func (*ReportStateAndNotificationRequest) XXX_Marshal

func (m *ReportStateAndNotificationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReportStateAndNotificationRequest) XXX_Merge

func (*ReportStateAndNotificationRequest) XXX_Size

func (m *ReportStateAndNotificationRequest) XXX_Size() int

func (*ReportStateAndNotificationRequest) XXX_Unmarshal

func (m *ReportStateAndNotificationRequest) XXX_Unmarshal(b []byte) error

type ReportStateAndNotificationResponse

type ReportStateAndNotificationResponse struct {
	// Request id copied from ReportStateAndNotificationRequest.
	RequestId            string   `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*ReportStateAndNotificationResponse) XXX_DiscardUnknown

func (m *ReportStateAndNotificationResponse) XXX_DiscardUnknown()

func (*ReportStateAndNotificationResponse) XXX_Marshal

func (m *ReportStateAndNotificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReportStateAndNotificationResponse) XXX_Merge

func (*ReportStateAndNotificationResponse) XXX_Size

func (*ReportStateAndNotificationResponse) XXX_Unmarshal

func (m *ReportStateAndNotificationResponse) XXX_Unmarshal(b []byte) error

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,proto3" json:"agent_user_id,omitempty"`
	// Optional. If set, the request will be added to a queue and a response will
	// be returned immediately. The queue allows for de-duplication of
	// simultaneous requests.
	Async                bool     `protobuf:"varint,2,opt,name=async,proto3" json:"async,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request type for RequestSyncDevices call.

func (*RequestSyncDevicesRequest) Descriptor

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

func (*RequestSyncDevicesRequest) GetAgentUserId

func (m *RequestSyncDevicesRequest) GetAgentUserId() string

func (*RequestSyncDevicesRequest) GetAsync

func (m *RequestSyncDevicesRequest) GetAsync() bool

func (*RequestSyncDevicesRequest) ProtoMessage

func (*RequestSyncDevicesRequest) ProtoMessage()

func (*RequestSyncDevicesRequest) Reset

func (m *RequestSyncDevicesRequest) Reset()

func (*RequestSyncDevicesRequest) String

func (m *RequestSyncDevicesRequest) String() string

func (*RequestSyncDevicesRequest) XXX_DiscardUnknown

func (m *RequestSyncDevicesRequest) XXX_DiscardUnknown()

func (*RequestSyncDevicesRequest) XXX_Marshal

func (m *RequestSyncDevicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestSyncDevicesRequest) XXX_Merge

func (m *RequestSyncDevicesRequest) XXX_Merge(src proto.Message)

func (*RequestSyncDevicesRequest) XXX_Size

func (m *RequestSyncDevicesRequest) XXX_Size() int

func (*RequestSyncDevicesRequest) XXX_Unmarshal

func (m *RequestSyncDevicesRequest) XXX_Unmarshal(b []byte) error

type RequestSyncDevicesResponse

type RequestSyncDevicesResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*RequestSyncDevicesResponse) XXX_DiscardUnknown

func (m *RequestSyncDevicesResponse) XXX_DiscardUnknown()

func (*RequestSyncDevicesResponse) XXX_Marshal

func (m *RequestSyncDevicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RequestSyncDevicesResponse) XXX_Merge

func (m *RequestSyncDevicesResponse) XXX_Merge(src proto.Message)

func (*RequestSyncDevicesResponse) XXX_Size

func (m *RequestSyncDevicesResponse) XXX_Size() int

func (*RequestSyncDevicesResponse) XXX_Unmarshal

func (m *RequestSyncDevicesResponse) XXX_Unmarshal(b []byte) error

type StateAndNotificationPayload

type StateAndNotificationPayload struct {
	// The devices for updating State and sending Notifications.
	Devices              *ReportStateAndNotificationDevice `protobuf:"bytes,1,opt,name=devices,proto3" json:"devices,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                          `json:"-"`
	XXX_unrecognized     []byte                            `json:"-"`
	XXX_sizecache        int32                             `json:"-"`
}

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

func (*StateAndNotificationPayload) XXX_DiscardUnknown

func (m *StateAndNotificationPayload) XXX_DiscardUnknown()

func (*StateAndNotificationPayload) XXX_Marshal

func (m *StateAndNotificationPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StateAndNotificationPayload) XXX_Merge

func (m *StateAndNotificationPayload) XXX_Merge(src proto.Message)

func (*StateAndNotificationPayload) XXX_Size

func (m *StateAndNotificationPayload) XXX_Size() int

func (*StateAndNotificationPayload) XXX_Unmarshal

func (m *StateAndNotificationPayload) XXX_Unmarshal(b []byte) error

type SyncRequest

type SyncRequest struct {
	// Request ID used for debugging.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Required. Third-party user ID.
	AgentUserId          string   `protobuf:"bytes,2,opt,name=agent_user_id,json=agentUserId,proto3" json:"agent_user_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request type for Sync call. This should follow the same format as AoG action.devices.SYNC request (https://developers.google.com/actions/smarthome/create-app#actiondevicessync) with the exception of the extra "agent_user_id" and no "intent" field.

func (*SyncRequest) Descriptor

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

func (*SyncRequest) GetAgentUserId

func (m *SyncRequest) GetAgentUserId() string

func (*SyncRequest) GetRequestId

func (m *SyncRequest) GetRequestId() string

func (*SyncRequest) ProtoMessage

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) Reset

func (m *SyncRequest) Reset()

func (*SyncRequest) String

func (m *SyncRequest) String() string

func (*SyncRequest) XXX_DiscardUnknown

func (m *SyncRequest) XXX_DiscardUnknown()

func (*SyncRequest) XXX_Marshal

func (m *SyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SyncRequest) XXX_Merge

func (m *SyncRequest) XXX_Merge(src proto.Message)

func (*SyncRequest) XXX_Size

func (m *SyncRequest) XXX_Size() int

func (*SyncRequest) XXX_Unmarshal

func (m *SyncRequest) XXX_Unmarshal(b []byte) error

type SyncResponse

type SyncResponse struct {
	// Request ID used for debugging. Copied from the request.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Devices associated with the third-party user.
	Payload              *SyncResponsePayload `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Example SyncResponse:

{
  "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 Sync call. This should follow the same format as AoG action.devices.SYNC response (https://developers.google.com/actions/smarthome/create-app#actiondevicessync).

func (*SyncResponse) Descriptor

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

func (*SyncResponse) GetPayload

func (m *SyncResponse) GetPayload() *SyncResponsePayload

func (*SyncResponse) GetRequestId

func (m *SyncResponse) GetRequestId() string

func (*SyncResponse) ProtoMessage

func (*SyncResponse) ProtoMessage()

func (*SyncResponse) Reset

func (m *SyncResponse) Reset()

func (*SyncResponse) String

func (m *SyncResponse) String() string

func (*SyncResponse) XXX_DiscardUnknown

func (m *SyncResponse) XXX_DiscardUnknown()

func (*SyncResponse) XXX_Marshal

func (m *SyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SyncResponse) XXX_Merge

func (m *SyncResponse) XXX_Merge(src proto.Message)

func (*SyncResponse) XXX_Size

func (m *SyncResponse) XXX_Size() int

func (*SyncResponse) XXX_Unmarshal

func (m *SyncResponse) XXX_Unmarshal(b []byte) error

type SyncResponsePayload

type SyncResponsePayload struct {
	// Third-party user ID
	AgentUserId string `protobuf:"bytes,1,opt,name=agent_user_id,json=agentUserId,proto3" json:"agent_user_id,omitempty"`
	// Devices associated with the third-party user.
	Devices              []*Device `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

Payload containing device information.

func (*SyncResponsePayload) Descriptor

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

func (*SyncResponsePayload) GetAgentUserId

func (m *SyncResponsePayload) GetAgentUserId() string

func (*SyncResponsePayload) GetDevices

func (m *SyncResponsePayload) GetDevices() []*Device

func (*SyncResponsePayload) ProtoMessage

func (*SyncResponsePayload) ProtoMessage()

func (*SyncResponsePayload) Reset

func (m *SyncResponsePayload) Reset()

func (*SyncResponsePayload) String

func (m *SyncResponsePayload) String() string

func (*SyncResponsePayload) XXX_DiscardUnknown

func (m *SyncResponsePayload) XXX_DiscardUnknown()

func (*SyncResponsePayload) XXX_Marshal

func (m *SyncResponsePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SyncResponsePayload) XXX_Merge

func (m *SyncResponsePayload) XXX_Merge(src proto.Message)

func (*SyncResponsePayload) XXX_Size

func (m *SyncResponsePayload) XXX_Size() int

func (*SyncResponsePayload) XXX_Unmarshal

func (m *SyncResponsePayload) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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