Synchronize new proto/yaml changes.

PiperOrigin-RevId: 189782134
This commit is contained in:
Google APIs 2018-03-20 11:57:21 -07:00 committed by Copybara-Service
parent a5efe34f9c
commit 923962ca27
4 changed files with 398 additions and 0 deletions

View File

@ -0,0 +1,33 @@
common:
api_name: homegraph
api_version: v1
organization_name: smarthome
proto_deps:
- name: google-common-protos
src_proto_paths:
- v1
service_yaml: base.yaml
gapic_yaml: v1/homegraph_gapic.yaml
artifacts:
- name: gapic_config
type: GAPIC_CONFIG
- name: java_gapic
language: JAVA
- name: python_gapic
type: GAPIC
language: PYTHON
- name: nodejs_gapic
type: GAPIC
language: NODEJS
- name: php_gapic
type: GAPIC
language: PHP
- name: go_gapic
type: GAPIC
language: GO
- name: ruby_gapic
type: GAPIC
language: RUBY
- name: csharp_gapic
type: GAPIC
language: CSHARP

View File

@ -0,0 +1,16 @@
type: google.api.Service
config_version: 3
name: homegraph.googleapis.com
title: HomeGraph API
apis:
- name: google.home.graph.v1.HomeGraphApiService
backend:
rules:
- selector: google.home.graph.v1.HomeGraphApiService.RequestSyncDevices
deadline: 60.0
- selector: google.home.graph.v1.HomeGraphApiService.ReportStateAndNotification
deadline: 60.0
- selector: google.home.graph.v1.HomeGraphApiService.DeleteAgentUser
deadline: 60.0

View File

@ -0,0 +1,191 @@
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.home.graph.v1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
option go_package = "google.golang.org/genproto/googleapis/home/graph/v1;graph";
option java_outer_classname = "HomeGraphApiServiceProto";
option java_package = "com.google.home.graph.v1";
// Google HomeGraph API. HomeGraph Service provides the support for storing
// and querying first-party and third-party devices, rooms and structures,
// the relationships among them and their state in the home. It stores
// entities and their relationships in the home.
service HomeGraphApiService {
// 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.
rpc RequestSyncDevices(RequestSyncDevicesRequest) returns (RequestSyncDevicesResponse) {
option (google.api.http) = {
post: "/v1/devices:requestSync"
body: "*"
};
}
// 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.
rpc ReportStateAndNotification(ReportStateAndNotificationRequest) returns (ReportStateAndNotificationResponse) {
option (google.api.http) = {
post: "/v1/devices:reportStateAndNotification"
body: "*"
};
}
// 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.
rpc DeleteAgentUser(DeleteAgentUserRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{agent_user_id=agentUsers/**}"
};
}
}
// Request type for RequestSyncDevices call.
message RequestSyncDevicesRequest {
// Required. Third-party user id issued by agent's third-party identity
// provider.
string agent_user_id = 1;
}
// Response type for RequestSyncDevices call. Intentionally empty upon success.
// An HTTP response code is returned with more details upon failure.
message RequestSyncDevicesResponse {
}
// 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,
// "online": true,
// "isLocked": true
// }
// },
// "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.
message ReportStateAndNotificationRequest {
// Request id used for debugging.
string request_id = 1;
// Unique identifier per event (eg: doorbell press).
string event_id = 4;
// Required. Third-party user id.
string agent_user_id = 2;
// 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.
StateAndNotificationPayload payload = 3;
}
// Response type for ReportStateAndNotification call.
message ReportStateAndNotificationResponse {
// Request id copied from ReportStateAndNotificationRequest.
string request_id = 1;
}
// Payload containing the State and Notification information for devices.
message StateAndNotificationPayload {
// The devices for updating State and sending Notifications.
ReportStateAndNotificationDevice devices = 1;
}
// The States and Notifications specific to a device.
message ReportStateAndNotificationDevice {
// States of devices to update.
google.protobuf.Struct states = 1;
// Notifications metadata for devices.
google.protobuf.Struct notifications = 2;
}
// Request type for DeleteAgentUser call.
message DeleteAgentUserRequest {
// Request id used for debugging.
string request_id = 1;
// Required. Third-party user id.
string agent_user_id = 2;
}

View File

@ -0,0 +1,158 @@
type: com.google.api.codegen.ConfigProto
config_schema_version: 1.0.0
# The settings of generated code in a specific language.
language_settings:
java:
package_name: com.google.home.graph.v1
python:
package_name: google.home.graph_v1.gapic
go:
package_name: google.golang.org/api/homegraph/v1
csharp:
package_name: Google.Home.Graph.V1
ruby:
package_name: Google::Home::Graph::V1
php:
package_name: Google\Home\Graph\V1
nodejs:
package_name: google.home.graph.v1
# The configuration for the license header to put on generated files.
license_header:
# The file containing the copyright line(s).
copyright_file: copyright-google.txt
# The file containing the raw license header without any copyright line(s).
license_file: license-header-apache-2.0.txt
# A list of API interface configurations.
interfaces:
# The fully qualified name of the API interface.
- name: google.home.graph.v1.HomeGraphApiService
# A list of resource collection configurations.
# Consists of a name_pattern and an entity_name.
# The name_pattern is a pattern to describe the names of the resources of this
# collection, using the platform's conventions for URI patterns. A generator
# may use this to generate methods to compose and decompose such names. The
# pattern should use named placeholders as in `shelves/{shelf}/books/{book}`;
# those will be taken as hints for the parameter names of the generated
# methods. If empty, no name methods are generated.
# The entity_name is the name to be used as a basis for generated methods and
# classes.
collections:
- name_pattern: agentUsers/{agent_user_path=**}
entity_name: agent_user_path
# Definition for retryable codes.
retry_codes_def:
- name: idempotent
retry_codes:
- UNAVAILABLE
- DEADLINE_EXCEEDED
- name: non_idempotent
retry_codes: []
# Definition for retry/backoff parameters.
retry_params_def:
- name: default
initial_retry_delay_millis: 100
retry_delay_multiplier: 1.3
max_retry_delay_millis: 60000
initial_rpc_timeout_millis: 20000
rpc_timeout_multiplier: 1
max_rpc_timeout_millis: 20000
total_timeout_millis: 600000
# A list of method configurations.
# Common properties:
#
# name - The simple name of the method.
#
# flattening - Specifies the configuration for parameter flattening.
# Describes the parameter groups for which a generator should produce method
# overloads which allow a client to directly pass request message fields as
# method parameters. This information may or may not be used, depending on
# the target language.
# Consists of groups, which each represent a list of parameters to be
# flattened. Each parameter listed must be a field of the request message.
#
# required_fields - Fields that are always required for a request to be
# valid.
#
# request_object_method - Turns on or off the generation of a method whose
# sole parameter is a request object. Not all languages will generate this
# method.
#
# resource_name_treatment - An enum that specifies how to treat the resource
# name formats defined in the field_name_patterns and
# response_field_name_patterns fields.
# UNSET: default value
# NONE: the collection configs will not be used by the generated code.
# VALIDATE: string fields will be validated by the client against the
# specified resource name formats.
# STATIC_TYPES: the client will use generated types for resource names.
#
# page_streaming - Specifies the configuration for paging.
# Describes information for generating a method which transforms a paging
# list RPC into a stream of resources.
# Consists of a request and a response.
# The request specifies request information of the list method. It defines
# which fields match the paging pattern in the request. The request consists
# of a page_size_field and a token_field. The page_size_field is the name of
# the optional field specifying the maximum number of elements to be
# returned in the response. The token_field is the name of the field in the
# request containing the page token.
# The response specifies response information of the list method. It defines
# which fields match the paging pattern in the response. The response
# consists of a token_field and a resources_field. The token_field is the
# name of the field in the response containing the next page token. The
# resources_field is the name of the field in the response containing the
# list of resources belonging to the page.
#
# retry_codes_name - Specifies the configuration for retryable codes. The
# name must be defined in interfaces.retry_codes_def.
#
# retry_params_name - Specifies the configuration for retry/backoff
# parameters. The name must be defined in interfaces.retry_params_def.
#
# field_name_patterns - Maps the field name of the request type to
# entity_name of interfaces.collections.
# Specifies the string pattern that the field must follow.
#
# timeout_millis - Specifies the default timeout for a non-retrying call. If
# the call is retrying, refer to retry_params_name instead.
methods:
- name: RequestSyncDevices
flattening:
groups:
- parameters:
- agent_user_id
required_fields:
- agent_user_id
request_object_method: false
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 10000
- name: ReportStateAndNotification
flattening:
groups:
- parameters:
- request_id
- event_id
- agent_user_id
- payload
required_fields:
- agent_user_id
- payload
request_object_method: true
retry_codes_name: non_idempotent
retry_params_name: default
timeout_millis: 10000
- name: DeleteAgentUser
flattening:
groups:
- parameters:
- request_id
- agent_user_id
required_fields:
- agent_user_id
request_object_method: true
retry_codes_name: idempotent
retry_params_name: default
field_name_patterns:
agent_user_id: agent_user_path
timeout_millis: 10000