gsuiteaddons.proto 14 KB

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