1// Copyright 2020 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.cloud.gsuiteaddons.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/apps/script/type/calendar/calendar_addon_manifest.proto"; 24import "google/apps/script/type/docs/docs_addon_manifest.proto"; 25import "google/apps/script/type/drive/drive_addon_manifest.proto"; 26import "google/apps/script/type/gmail/gmail_addon_manifest.proto"; 27import "google/apps/script/type/script_manifest.proto"; 28import "google/apps/script/type/sheets/sheets_addon_manifest.proto"; 29import "google/apps/script/type/slides/slides_addon_manifest.proto"; 30import "google/protobuf/empty.proto"; 31import "google/protobuf/wrappers.proto"; 32 33option csharp_namespace = "Google.Cloud.GSuiteAddOns.V1"; 34option go_package = "cloud.google.com/go/gsuiteaddons/apiv1/gsuiteaddonspb;gsuiteaddonspb"; 35option java_multiple_files = true; 36option java_outer_classname = "GSuiteAddOnsProto"; 37option java_package = "com.google.cloud.gsuiteaddons.v1"; 38option php_namespace = "Google\\Cloud\\GSuiteAddOns\\V1"; 39option ruby_package = "Google::Cloud::GSuiteAddOns::V1"; 40 41// A service for managing Google Workspace Add-ons deployments. 42// 43// A Google Workspace Add-on is a third-party embedded component that can be 44// installed in Google Workspace Applications like Gmail, Calendar, Drive, and 45// the Google Docs, Sheets, and Slides editors. Google Workspace Add-ons can 46// display UI cards, receive contextual information from the host application, 47// and perform actions in the host application (See: 48// https://developers.google.com/gsuite/add-ons/overview for more information). 49// 50// A Google Workspace Add-on deployment resource specifies metadata about the 51// add-on, including a specification of the entry points in the host application 52// that trigger add-on executions (see: 53// https://developers.google.com/gsuite/add-ons/concepts/gsuite-manifests). 54// Add-on deployments defined via the Google Workspace Add-ons API define their 55// entrypoints using HTTPS URLs (See: 56// https://developers.google.com/gsuite/add-ons/guides/alternate-runtimes), 57// 58// A Google Workspace Add-on deployment can be installed in developer mode, 59// which allows an add-on developer to test the experience an end-user would see 60// when installing and running the add-on in their G Suite applications. When 61// running in developer mode, more detailed error messages are exposed in the 62// add-on UI to aid in debugging. 63// 64// A Google Workspace Add-on deployment can be published to Google Workspace 65// Marketplace, which allows other Google Workspace users to discover and 66// install the add-on. See: 67// https://developers.google.com/gsuite/add-ons/how-tos/publish-add-on-overview 68// for details. 69service GSuiteAddOns { 70 option (google.api.default_host) = "gsuiteaddons.googleapis.com"; 71 option (google.api.oauth_scopes) = 72 "https://www.googleapis.com/auth/cloud-platform"; 73 74 // Gets the authorization information for deployments in a given project. 75 rpc GetAuthorization(GetAuthorizationRequest) returns (Authorization) { 76 option (google.api.http) = { 77 get: "/v1/{name=projects/*/authorization}" 78 }; 79 option (google.api.method_signature) = "name"; 80 } 81 82 // Creates a deployment with the specified name and configuration. 83 rpc CreateDeployment(CreateDeploymentRequest) returns (Deployment) { 84 option (google.api.http) = { 85 post: "/v1/{parent=projects/*}/deployments" 86 body: "deployment" 87 }; 88 option (google.api.method_signature) = "parent,deployment,deployment_id"; 89 } 90 91 // Creates or replaces a deployment with the specified name. 92 rpc ReplaceDeployment(ReplaceDeploymentRequest) returns (Deployment) { 93 option (google.api.http) = { 94 put: "/v1/{deployment.name=projects/*/deployments/*}" 95 body: "deployment" 96 }; 97 option (google.api.method_signature) = "deployment"; 98 } 99 100 // Gets the deployment with the specified name. 101 rpc GetDeployment(GetDeploymentRequest) returns (Deployment) { 102 option (google.api.http) = { 103 get: "/v1/{name=projects/*/deployments/*}" 104 }; 105 option (google.api.method_signature) = "name"; 106 } 107 108 // Lists all deployments in a particular project. 109 rpc ListDeployments(ListDeploymentsRequest) 110 returns (ListDeploymentsResponse) { 111 option (google.api.http) = { 112 get: "/v1/{parent=projects/*}/deployments" 113 }; 114 option (google.api.method_signature) = "parent"; 115 } 116 117 // Deletes the deployment with the given name. 118 rpc DeleteDeployment(DeleteDeploymentRequest) 119 returns (google.protobuf.Empty) { 120 option (google.api.http) = { 121 delete: "/v1/{name=projects/*/deployments/*}" 122 }; 123 option (google.api.method_signature) = "name"; 124 } 125 126 // Installs a deployment in developer mode. 127 // See: 128 // https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons. 129 rpc InstallDeployment(InstallDeploymentRequest) 130 returns (google.protobuf.Empty) { 131 option (google.api.http) = { 132 post: "/v1/{name=projects/*/deployments/*}:install" 133 body: "*" 134 }; 135 option (google.api.method_signature) = "name"; 136 } 137 138 // Uninstalls a developer mode deployment. 139 // See: 140 // https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons. 141 rpc UninstallDeployment(UninstallDeploymentRequest) 142 returns (google.protobuf.Empty) { 143 option (google.api.http) = { 144 post: "/v1/{name=projects/*/deployments/*}:uninstall" 145 body: "*" 146 }; 147 option (google.api.method_signature) = "name"; 148 } 149 150 // Fetches the install status of a developer mode deployment. 151 rpc GetInstallStatus(GetInstallStatusRequest) returns (InstallStatus) { 152 option (google.api.http) = { 153 get: "/v1/{name=projects/*/deployments/*/installStatus}" 154 }; 155 option (google.api.method_signature) = "name"; 156 } 157} 158 159// Request message to get Google Workspace Add-ons authorization information. 160message GetAuthorizationRequest { 161 // Required. Name of the project for which to get the Google Workspace Add-ons 162 // authorization information. 163 // 164 // Example: `projects/my_project/authorization`. 165 string name = 2 [ 166 (google.api.field_behavior) = REQUIRED, 167 (google.api.resource_reference) = { 168 type: "gsuiteaddons.googleapis.com/Authorization" 169 } 170 ]; 171} 172 173// The authorization information used when invoking deployment endpoints. 174message Authorization { 175 option (google.api.resource) = { 176 type: "gsuiteaddons.googleapis.com/Authorization" 177 pattern: "projects/{project}/authorization" 178 }; 179 180 // The canonical full name of this resource. 181 // Example: `projects/123/authorization` 182 string name = 1; 183 184 // The email address of the service account used to authenticate requests to 185 // add-on callback endpoints. 186 string service_account_email = 2; 187 188 // The OAuth client ID used to obtain OAuth access tokens for a user on the 189 // add-on's behalf. 190 string oauth_client_id = 3; 191} 192 193// Request message to create a deployment. 194message CreateDeploymentRequest { 195 // Required. Name of the project in which to create the deployment. 196 // 197 // Example: `projects/my_project`. 198 string parent = 1 [ 199 (google.api.field_behavior) = REQUIRED, 200 (google.api.resource_reference) = { 201 type: "cloudresourcemanager.googleapis.com/Project" 202 } 203 ]; 204 205 // Required. The id to use for this deployment. The full name of the created 206 // resource will be `projects/<project_number>/deployments/<deployment_id>`. 207 string deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; 208 209 // Required. The deployment to create (deployment.name cannot be set). 210 Deployment deployment = 3 [(google.api.field_behavior) = REQUIRED]; 211} 212 213// Request message to create or replace a deployment. 214message ReplaceDeploymentRequest { 215 // Required. The deployment to create or replace. 216 Deployment deployment = 2 [(google.api.field_behavior) = REQUIRED]; 217} 218 219// Request message to get a deployment. 220message GetDeploymentRequest { 221 // Required. The full resource name of the deployment to get. 222 // 223 // Example: `projects/my_project/deployments/my_deployment`. 224 string name = 1 [ 225 (google.api.field_behavior) = REQUIRED, 226 (google.api.resource_reference) = { 227 type: "gsuiteaddons.googleapis.com/Deployment" 228 } 229 ]; 230} 231 232// Request message to list deployments for a project. 233message ListDeploymentsRequest { 234 // Required. Name of the project in which to create the deployment. 235 // 236 // Example: `projects/my_project`. 237 string parent = 1 [ 238 (google.api.field_behavior) = REQUIRED, 239 (google.api.resource_reference) = { 240 type: "cloudresourcemanager.googleapis.com/Project" 241 } 242 ]; 243 244 // The maximum number of deployments to return. The service may return fewer 245 // than this value. 246 // If unspecified, at most 1000 deployments will be returned. 247 // The maximum value is 1000; values above 1000 will be coerced to 1000. 248 int32 page_size = 2; 249 250 // A page token, received from a previous `ListDeployments` call. 251 // Provide this to retrieve the subsequent page. 252 // 253 // When paginating, all other parameters provided to `ListDeployments` must 254 // match the call that provided the page token. 255 string page_token = 3; 256} 257 258// Response message to list deployments. 259message ListDeploymentsResponse { 260 // The list of deployments for the given project. 261 repeated Deployment deployments = 1; 262 263 // A token, which can be sent as `page_token` to retrieve the next page. 264 // If this field is omitted, there are no subsequent pages. 265 string next_page_token = 2; 266} 267 268// Request message to delete a deployment. 269message DeleteDeploymentRequest { 270 // Required. The full resource name of the deployment to delete. 271 // 272 // Example: `projects/my_project/deployments/my_deployment`. 273 string name = 1 [ 274 (google.api.field_behavior) = REQUIRED, 275 (google.api.resource_reference) = { 276 type: "gsuiteaddons.googleapis.com/Deployment" 277 } 278 ]; 279 280 // The etag of the deployment to delete. 281 // If this is provided, it must match the server's etag. 282 string etag = 2; 283} 284 285// Request message to install a developer mode deployment. 286message InstallDeploymentRequest { 287 // Required. The full resource name of the deployment to install. 288 // 289 // Example: `projects/my_project/deployments/my_deployment`. 290 string name = 1 [ 291 (google.api.field_behavior) = REQUIRED, 292 (google.api.resource_reference) = { 293 type: "gsuiteaddons.googleapis.com/Deployment" 294 } 295 ]; 296} 297 298// Request message to uninstall a developer mode deployment. 299message UninstallDeploymentRequest { 300 // Required. The full resource name of the deployment to install. 301 // 302 // Example: `projects/my_project/deployments/my_deployment`. 303 string name = 1 [ 304 (google.api.field_behavior) = REQUIRED, 305 (google.api.resource_reference) = { 306 type: "gsuiteaddons.googleapis.com/Deployment" 307 } 308 ]; 309} 310 311// Request message to get the install status of a developer mode deployment. 312message GetInstallStatusRequest { 313 // Required. The full resource name of the deployment. 314 // 315 // Example: `projects/my_project/deployments/my_deployment/installStatus`. 316 string name = 1 [ 317 (google.api.field_behavior) = REQUIRED, 318 (google.api.resource_reference) = { 319 type: "gsuiteaddons.googleapis.com/InstallStatus" 320 } 321 ]; 322} 323 324// Developer mode install status of a deployment 325message InstallStatus { 326 option (google.api.resource) = { 327 type: "gsuiteaddons.googleapis.com/InstallStatus" 328 pattern: "projects/{project}/deployments/{deployment}/installStatus" 329 }; 330 331 // The canonical full resource name of the deployment install status. 332 // 333 // Example: `projects/123/deployments/my_deployment/installStatus`. 334 string name = 1; 335 336 // True if the deployment is installed for the user 337 google.protobuf.BoolValue installed = 2; 338} 339 340// A Google Workspace Add-on deployment 341message Deployment { 342 option (google.api.resource) = { 343 type: "gsuiteaddons.googleapis.com/Deployment" 344 pattern: "projects/{project}/deployments/{deployment}" 345 }; 346 347 // The deployment resource name. 348 // Example: projects/123/deployments/my_deployment. 349 string name = 1; 350 351 // The list of Google OAuth scopes for which to request consent from the end 352 // user before executing an add-on endpoint. 353 repeated string oauth_scopes = 2; 354 355 // The Google Workspace Add-on configuration. 356 AddOns add_ons = 3; 357 358 // This value is computed by the server based on the version of the 359 // deployment in storage, and may be sent on update and delete requests to 360 // ensure the client has an up-to-date value before proceeding. 361 string etag = 5; 362} 363 364// A Google Workspace Add-on configuration. 365message AddOns { 366 // Configuration that is common across all Google Workspace Add-ons. 367 google.apps.script.type.CommonAddOnManifest common = 1; 368 369 // Gmail add-on configuration. 370 google.apps.script.type.gmail.GmailAddOnManifest gmail = 2; 371 372 // Drive add-on configuration. 373 google.apps.script.type.drive.DriveAddOnManifest drive = 5; 374 375 // Calendar add-on configuration. 376 google.apps.script.type.calendar.CalendarAddOnManifest calendar = 6; 377 378 // Docs add-on configuration. 379 google.apps.script.type.docs.DocsAddOnManifest docs = 7; 380 381 // Sheets add-on configuration. 382 google.apps.script.type.sheets.SheetsAddOnManifest sheets = 8; 383 384 // Slides add-on configuration. 385 google.apps.script.type.slides.SlidesAddOnManifest slides = 10; 386 387 // Options for sending requests to add-on HTTP endpoints 388 google.apps.script.type.HttpOptions http_options = 15; 389} 390