1// Copyright 2022 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.home.enterprise.sdm.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/home/enterprise/sdm/v1/device.proto"; 24import "google/home/enterprise/sdm/v1/site.proto"; 25import "google/protobuf/struct.proto"; 26 27option csharp_namespace = "Google.Home.Enterprise.Sdm.V1"; 28option go_package = "google.golang.org/genproto/googleapis/home/enterprise/sdm/v1;sdm"; 29option java_multiple_files = true; 30option java_package = "com.google.home.enterprise.sdm.v1"; 31option objc_class_prefix = "GHENTSDM"; 32option php_namespace = "Google\\Home\\Enterprise\\Sdm\\V1"; 33 34// core::0122 is getting triggered by adding fields custom_name. 35// though, 0122 has exception for such field name as display_name. Due to 36// historical reasons we use custom_name for exactly same purpose, so it is 37// covered by that exception. 38 39// A service that allows API consumers to provision and manage Google 40// Home structures and devices for enterprise use cases. 41service SmartDeviceManagementService { 42 option (google.api.default_host) = "smartdevicemanagement.googleapis.com"; 43 option (google.api.oauth_scopes) = 44 "https://www.googleapis.com/auth/sdm.service"; 45 46 // Gets a device managed by the enterprise. 47 rpc GetDevice(GetDeviceRequest) returns (Device) { 48 option (google.api.http) = { 49 get: "/v1/{name=enterprises/*/devices/*}" 50 }; 51 } 52 53 // Lists devices managed by the enterprise. 54 rpc ListDevices(ListDevicesRequest) returns (ListDevicesResponse) { 55 option (google.api.http) = { 56 get: "/v1/{parent=enterprises/*}/devices" 57 }; 58 } 59 60 // Executes a command to device managed by the enterprise. 61 rpc ExecuteDeviceCommand(ExecuteDeviceCommandRequest) 62 returns (ExecuteDeviceCommandResponse) { 63 option (google.api.http) = { 64 post: "/v1/{name=enterprises/*/devices/*}:executeCommand" 65 body: "*" 66 }; 67 } 68 69 // Gets a structure managed by the enterprise. 70 rpc GetStructure(GetStructureRequest) returns (Structure) { 71 option (google.api.http) = { 72 get: "/v1/{name=enterprises/*/structures/*}" 73 }; 74 } 75 76 // Lists structures managed by the enterprise. 77 rpc ListStructures(ListStructuresRequest) returns (ListStructuresResponse) { 78 option (google.api.http) = { 79 get: "/v1/{parent=enterprises/*}/structures" 80 }; 81 } 82 83 // Gets a room managed by the enterprise. 84 rpc GetRoom(GetRoomRequest) returns (Room) { 85 option (google.api.http) = { 86 get: "/v1/{name=enterprises/*/structures/*/rooms/*}" 87 }; 88 } 89 90 // Lists rooms managed by the enterprise. 91 rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse) { 92 option (google.api.http) = { 93 get: "/v1/{parent=enterprises/*/structures/*}/rooms" 94 }; 95 } 96} 97 98// Request message for SmartDeviceManagementService.GetDevice 99message GetDeviceRequest { 100 // The name of the device requested. For example: 101 // "enterprises/XYZ/devices/123" 102 string name = 1; 103} 104 105// Request message for SmartDeviceManagementService.ListDevices 106message ListDevicesRequest { 107 // The parent enterprise to list devices under. E.g. "enterprises/XYZ". 108 string parent = 1; 109 110 // Optional requested page size. Server may return fewer devices than 111 // requested. If unspecified, server will pick an appropriate default. 112 int32 page_size = 2; 113 114 // Optional token of the page to retrieve. 115 string page_token = 3; 116 117 // Optional filter to list devices. 118 // 119 // Filters can be done on: 120 // Device custom name (substring match): 121 // 'customName=wing' 122 string filter = 4; 123} 124 125// Response message for SmartDeviceManagementService.ListDevices 126message ListDevicesResponse { 127 // The list of devices. 128 repeated Device devices = 1; 129 130 // The pagination token to retrieve the next page of results. 131 string next_page_token = 2; 132} 133 134// Request message for SmartDeviceManagementService.ExecuteDeviceCommand 135message ExecuteDeviceCommandRequest { 136 // The name of the device requested. For example: 137 // "enterprises/XYZ/devices/123" 138 string name = 1; 139 140 // The command name to execute, represented by the fully qualified protobuf 141 // message name. 142 string command = 2; 143 144 // The command message to execute, represented as a Struct. 145 google.protobuf.Struct params = 3; 146} 147 148// Response message for SmartDeviceManagementService.ExecuteDeviceCommand 149message ExecuteDeviceCommandResponse { 150 // The results of executing the command. 151 google.protobuf.Struct results = 1; 152} 153 154// Request message for SmartDeviceManagementService.GetStructure 155message GetStructureRequest { 156 // The name of the structure requested. For example: 157 // "enterprises/XYZ/structures/ABC". 158 string name = 1; 159} 160 161// Request message for SmartDeviceManagementService.ListStructures 162message ListStructuresRequest { 163 // The parent enterprise to list structures under. E.g. "enterprises/XYZ". 164 string parent = 1; 165 166 // Requested page size. Server may return fewer structures than requested. 167 // If unspecified, server will pick an appropriate default. 168 int32 page_size = 2; 169 170 // The token of the page to retrieve. 171 string page_token = 3; 172 173 // Optional filter to list structures. 174 string filter = 4; 175} 176 177// Response message for SmartDeviceManagementService.ListStructures 178message ListStructuresResponse { 179 // The list of structures. 180 repeated Structure structures = 1; 181 182 // The pagination token to retrieve the next page of results. 183 // If this field is omitted, there are no subsequent pages. 184 string next_page_token = 2; 185} 186 187// Request message for SmartDeviceManagementService.GetRoom 188message GetRoomRequest { 189 // The name of the room requested. For example: 190 // "enterprises/XYZ/structures/ABC/rooms/123". 191 string name = 1; 192} 193 194// Request message for SmartDeviceManagementService.ListRooms 195message ListRoomsRequest { 196 // The parent resource name of the rooms requested. For example: 197 // "enterprises/XYZ/structures/ABC". 198 string parent = 1; 199 200 // Requested page size. Server may return fewer rooms than requested. 201 // If unspecified, server will pick an appropriate default. 202 int32 page_size = 2; 203 204 // The token of the page to retrieve. 205 string page_token = 3; 206} 207 208// Response message for SmartDeviceManagementService.ListRooms 209message ListRoomsResponse { 210 // The list of rooms. 211 repeated Room rooms = 1; 212 213 // The pagination token to retrieve the next page of results. 214 // If this field is omitted, there are no subsequent pages. 215 string next_page_token = 2; 216} 217