graph

package
v0.0.0-...-694d95b Latest Latest
Warning

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

Go to latest
Published: May 23, 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 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"`
	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 (dst *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 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) (*empty.Empty, 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.
	//
	// 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)
}

type ReportStateAndNotificationDevice

type ReportStateAndNotificationDevice struct {
	// States of devices to update.
	States *_struct.Struct `protobuf:"bytes,1,opt,name=states" json:"states,omitempty"`
	// Notifications metadata for devices.
	Notifications        *_struct.Struct `protobuf:"bytes,2,opt,name=notifications" 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 (dst *ReportStateAndNotificationDevice) XXX_Merge(src proto.Message)

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" 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"`
	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: 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

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 (dst *ReportStateAndNotificationRequest) XXX_Merge(src proto.Message)

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" 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 (dst *ReportStateAndNotificationResponse) XXX_Merge(src proto.Message)

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" 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" 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 (dst *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 (dst *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" 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 (dst *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

Jump to

Keyboard shortcuts

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