actions_sdk.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  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.actions.sdk.v2;
  16. import "google/actions/sdk/v2/account_linking_secret.proto";
  17. import "google/actions/sdk/v2/files.proto";
  18. import "google/actions/sdk/v2/release_channel.proto";
  19. import "google/actions/sdk/v2/validation_results.proto";
  20. import "google/actions/sdk/v2/version.proto";
  21. import "google/api/annotations.proto";
  22. import "google/api/client.proto";
  23. import "google/api/field_behavior.proto";
  24. import "google/api/resource.proto";
  25. import "google/protobuf/wrappers.proto";
  26. option go_package = "google.golang.org/genproto/googleapis/actions/sdk/v2;sdk";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "ActionsSdkProto";
  29. option java_package = "com.google.actions.sdk.v2";
  30. // Actions SDK API which allows developers to build projects using the SDK.
  31. service ActionsSdk {
  32. option (google.api.default_host) = "actions.googleapis.com";
  33. // Updates the project draft based on the model.
  34. rpc WriteDraft(stream WriteDraftRequest) returns (Draft) {
  35. option (google.api.http) = {
  36. post: "/v2/{parent=projects/*}/draft:write"
  37. body: "*"
  38. };
  39. }
  40. // Updates the user's project preview based on the model.
  41. rpc WritePreview(stream WritePreviewRequest) returns (Preview) {
  42. option (google.api.http) = {
  43. post: "/v2/{parent=projects/*}/preview:write"
  44. body: "*"
  45. };
  46. }
  47. // Creates a project version based on the model and triggers deployment to the
  48. // specified release channel, if specified.
  49. rpc CreateVersion(stream CreateVersionRequest) returns (Version) {
  50. option (google.api.http) = {
  51. post: "/v2/{parent=projects/*}/versions:create"
  52. body: "*"
  53. };
  54. }
  55. // Reads the entire content of the project draft.
  56. rpc ReadDraft(ReadDraftRequest) returns (stream ReadDraftResponse) {
  57. option (google.api.http) = {
  58. post: "/v2/{name=projects/*/draft}:read"
  59. body: "*"
  60. };
  61. }
  62. // Reads the entire content of a project version.
  63. rpc ReadVersion(ReadVersionRequest) returns (stream ReadVersionResponse) {
  64. option (google.api.http) = {
  65. post: "/v2/{name=projects/*/versions/*}:read"
  66. body: "*"
  67. };
  68. }
  69. // Encrypts the OAuth client secret used in account linking flows.
  70. // This can be used to encrypt the client secret for the first time (e.g.
  71. // before the first push or after changing the client secret) or to re-encrypt
  72. // a client secret using the latest primary key version (considering key
  73. // rotation).
  74. rpc EncryptSecret(EncryptSecretRequest) returns (EncryptSecretResponse) {
  75. option (google.api.http) = {
  76. post: "/v2:encryptSecret"
  77. body: "*"
  78. };
  79. }
  80. // Decrypts the OAuth client secret used in account linking flows.
  81. // This can be used to view the client secret (e.g. after pulling a project).
  82. rpc DecryptSecret(DecryptSecretRequest) returns (DecryptSecretResponse) {
  83. option (google.api.http) = {
  84. post: "/v2:decryptSecret"
  85. body: "*"
  86. };
  87. }
  88. // Lists all the sample projects supported by the gactions CLI.
  89. rpc ListSampleProjects(ListSampleProjectsRequest) returns (ListSampleProjectsResponse) {
  90. option (google.api.http) = {
  91. get: "/v2/sampleProjects"
  92. };
  93. }
  94. // Lists all release channels and corresponding versions, if any.
  95. rpc ListReleaseChannels(ListReleaseChannelsRequest) returns (ListReleaseChannelsResponse) {
  96. option (google.api.http) = {
  97. get: "/v2/{parent=projects/*}/releaseChannels"
  98. };
  99. option (google.api.method_signature) = "parent";
  100. }
  101. // Lists all versions and their current states.
  102. rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) {
  103. option (google.api.http) = {
  104. get: "/v2/{parent=projects/*}/versions"
  105. };
  106. option (google.api.method_signature) = "parent";
  107. }
  108. }
  109. // Streaming RPC request for WriteDraft.
  110. message WriteDraftRequest {
  111. // Required. The parent resource name in the format `projects/{project}`. The
  112. // `{project}` is the cloud project ID associated with the project.
  113. string parent = 1 [
  114. (google.api.field_behavior) = REQUIRED,
  115. (google.api.resource_reference) = {
  116. child_type: "actions.googleapis.com/Draft"
  117. }
  118. ];
  119. // Required. List of files sent to the server at a time. This is a list of config files
  120. // or data files.
  121. // 1. The first request must be a ConfigFiles.
  122. // 2. The first request must have a ConfigFile with 'settings'.
  123. // 3. The first request must have a ConfigFile with 'manifest'.
  124. // 4. The webhook ConfigFile corresponding to inline cloud function must be
  125. // streamed before the DataFile corresponding to its source code.
  126. Files files = 4 [(google.api.field_behavior) = REQUIRED];
  127. }
  128. // Definition of draft resource.
  129. message Draft {
  130. option (google.api.resource) = {
  131. type: "actions.googleapis.com/Draft"
  132. pattern: "projects/{project}/draft"
  133. };
  134. // The unique identifier of the draft in the following format.
  135. // `projects/{project}/draft`
  136. string name = 1;
  137. // Validation results associated with the project draft content. Note that
  138. // WriteDraft updates the draft despite the warnings as warnings are not draft
  139. // blocking.
  140. ValidationResults validation_results = 2;
  141. }
  142. // Streaming RPC request for WritePreview.
  143. message WritePreviewRequest {
  144. // Indicates the preview content will be coming from the Draft.
  145. message ContentFromDraft {
  146. }
  147. // Indicates the preview content will be coming from an exiting version.
  148. message ContentFromSubmittedVersion {
  149. // Required. Submitted version of the project to be used to create a preview.
  150. // Format: `projects/{project}/versions/{version}`
  151. string version = 1 [
  152. (google.api.field_behavior) = REQUIRED,
  153. (google.api.resource_reference) = {
  154. type: "actions.googleapis.com/Version"
  155. }
  156. ];
  157. }
  158. // Settings for updating the preview.
  159. message PreviewSettings {
  160. // Indicates whether or not to run certain operations, such as transactions,
  161. // in sandbox mode. By default, preview requests run these operations in
  162. // sandbox mode. In other words, the default value for `sandbox` is `true`.
  163. google.protobuf.BoolValue sandbox = 1;
  164. }
  165. // Required. The parent resource name in the format `projects/{project}`. The
  166. // `{project}` is the cloud project ID associated with the project.
  167. string parent = 1 [
  168. (google.api.field_behavior) = REQUIRED,
  169. (google.api.resource_reference) = {
  170. child_type: "actions.googleapis.com/Preview"
  171. }
  172. ];
  173. // Data source used to created the preview.
  174. oneof source {
  175. // List of files sent to the server at a time. This is a list of config
  176. // files or data files.
  177. // 1. The first request must be a ConfigFiles.
  178. // 2. The first request must have a ConfigFile with 'settings'.
  179. // 3. The first request must have a ConfigFile with 'manifest'.
  180. // 4. The webhook ConfigFile corresponding to inline cloud function must be
  181. // streamed before the DataFile corresponding to its source code.
  182. Files files = 5;
  183. // Content sourced from the project draft.
  184. ContentFromDraft draft = 6;
  185. // Content sourced from the an exiting version.
  186. ContentFromSubmittedVersion submitted_version = 7;
  187. }
  188. // Required. The settings for updating the user's preview.
  189. PreviewSettings preview_settings = 4 [(google.api.field_behavior) = REQUIRED];
  190. }
  191. // Definition of preview resource.
  192. message Preview {
  193. option (google.api.resource) = {
  194. type: "actions.googleapis.com/Preview"
  195. pattern: "projects/{project}/previews/{preview}"
  196. };
  197. // The unique identifier of the preview.
  198. // Format: `projects/{project}/preview`
  199. string name = 1;
  200. // Validation results associated with the user project preview content.
  201. ValidationResults validation_results = 2;
  202. // The simulator URL to test the user preview.
  203. string simulator_url = 3;
  204. }
  205. // Streaming RPC request for CreateVersion.
  206. message CreateVersionRequest {
  207. // Required. The parent resource name in the format `projects/{project}`. The
  208. // `{project}` is the cloud project ID associated with the project.
  209. string parent = 1 [
  210. (google.api.field_behavior) = REQUIRED,
  211. (google.api.resource_reference) = {
  212. child_type: "actions.googleapis.com/Version"
  213. }
  214. ];
  215. // Required. List of files sent to the server at a time. This is a list of config files
  216. // or data files.
  217. // 1. The first request must be a ConfigFiles.
  218. // 2. The first request must have a ConfigFile with 'settings'.
  219. // 3. The first request must have a ConfigFile with 'manifest'.
  220. // 4. The webhook ConfigFile corresponding to inline cloud function must be
  221. // streamed before the DataFile corresponding to its source code.
  222. Files files = 5 [(google.api.field_behavior) = REQUIRED];
  223. // Optional. The release channel to deploy the version, if specified. The supported
  224. // built in release channels are actions.channels.Production,
  225. // actions.channels.ClosedBeta, actions.channels.Alpha.
  226. // .
  227. string release_channel = 4 [(google.api.field_behavior) = OPTIONAL];
  228. }
  229. // RPC request for ReadDraft.
  230. message ReadDraftRequest {
  231. // Required. The name of the resource in the format `projects/{project}/draft`. The
  232. // `{project}` is the cloud project ID associated with the project.
  233. string name = 1 [(google.api.field_behavior) = REQUIRED];
  234. // Optional. The version of the crypto key used to encrypt the account linking OAuth
  235. // client secret. If not specified, the primary key version is used for
  236. // encryption. Only relevant for projects with account linking with client
  237. // secret.
  238. string client_secret_encryption_key_version = 2 [(google.api.field_behavior) = OPTIONAL];
  239. }
  240. // Streaming RPC response for ReadDraft.
  241. message ReadDraftResponse {
  242. // List of files sent from the server at a time.
  243. Files files = 3;
  244. }
  245. // RPC request for ReadVersion.
  246. message ReadVersionRequest {
  247. // Required. The name of the version resource in the format
  248. // `projects/{project}/versions/{version}`. `{project}` is the
  249. // cloud project ID associated with the project, `{version}` is the
  250. // identifier of the version being read.
  251. string name = 1 [(google.api.field_behavior) = REQUIRED];
  252. // Optional. The version of the crypto key used to encrypt the account linking OAuth
  253. // client secret. If not specified, the primary key version is used for
  254. // encryption. Only relevant for projects with account linking with client
  255. // secret.
  256. string client_secret_encryption_key_version = 2 [(google.api.field_behavior) = OPTIONAL];
  257. }
  258. // Streaming RPC response for ReadVersion.
  259. message ReadVersionResponse {
  260. // List of files sent from the server at a time.
  261. Files files = 1;
  262. }
  263. // RPC request for EncryptSecret.
  264. message EncryptSecretRequest {
  265. // Required. The account linking client secret plaintext.
  266. string client_secret = 1 [(google.api.field_behavior) = REQUIRED];
  267. }
  268. // RPC response for EncryptSecret.
  269. message EncryptSecretResponse {
  270. // Contains the encrypted account linking client secret and the key version
  271. // used to encrypt the secret.
  272. AccountLinkingSecret account_linking_secret = 1;
  273. }
  274. // RPC request for DecryptSecret.
  275. message DecryptSecretRequest {
  276. // Required. The account linking client secret ciphertext.
  277. bytes encrypted_client_secret = 1 [(google.api.field_behavior) = REQUIRED];
  278. }
  279. // RPC response for DecryptSecret.
  280. message DecryptSecretResponse {
  281. // The account linking client secret plaintext.
  282. string client_secret = 1;
  283. }
  284. // RPC request for ListSampleProjects.
  285. message ListSampleProjectsRequest {
  286. // Optional. The maximum number of sample projects to return. The service may return
  287. // fewer than this value.
  288. // If unspecified, at most 1000 sample projects will be returned. Values above
  289. // 1000 will be coerced to 1000.
  290. int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
  291. // Optional. A page token, received from a previous 'ListSampleProjects' call.
  292. // Provide this to retrieve the subsequent page.
  293. string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  294. }
  295. // RPC response for ListSampleProjects.
  296. message ListSampleProjectsResponse {
  297. // The list of sample projects supported.
  298. repeated SampleProject sample_projects = 1;
  299. // A token, which can be sent as `page_token` to retrieve the next page.
  300. // If this field is omitted, there are no subsequent pages.
  301. string next_page_token = 2;
  302. }
  303. // Definition of sample project resource.
  304. message SampleProject {
  305. option (google.api.resource) = {
  306. type: "actions.googleapis.com/SampleProject"
  307. pattern: "sampleProjects/{sample_project}"
  308. };
  309. // The name of the sample project.
  310. // Format: `sampleProjects/{sample_project}`
  311. string name = 1;
  312. // The URL to the zip file where the sample is hosted.
  313. string hosted_url = 2;
  314. // The description of the sample project.
  315. string description = 3;
  316. }
  317. // RPC request for listing release channels
  318. message ListReleaseChannelsRequest {
  319. // Required. The name of the resource in the format `projects/{project}`. The
  320. // `{project}` is the cloud project ID associated with the project.
  321. string parent = 1 [
  322. (google.api.field_behavior) = REQUIRED,
  323. (google.api.resource_reference) = {
  324. child_type: "actions.googleapis.com/ReleaseChannel"
  325. }
  326. ];
  327. // The maximum number of release channels to return. The service may return
  328. // fewer than this value. If unspecified, at most 50 release channels will be
  329. // returned.
  330. int32 page_size = 2;
  331. // A page token, received from a previous `ListReleaseChannels` call.
  332. // Provide this to retrieve the subsequent page.
  333. // When paginating, all other parameters provided to `ListReleaseChannels`
  334. // must match the call that provided the page token.
  335. string page_token = 3;
  336. }
  337. // RPC response for listing release channels
  338. message ListReleaseChannelsResponse {
  339. // List of the release channels for the given project id.
  340. repeated ReleaseChannel release_channels = 1;
  341. // A token, which can be sent as `page_token` to retrieve the next page.
  342. // If this field is omitted, there are no subsequent pages.
  343. string next_page_token = 2;
  344. }
  345. // RPC request for listing versions
  346. message ListVersionsRequest {
  347. // Required. The name of the resource in the format `projects/{project}`. The
  348. // `{project}` is the cloud project ID associated with the project.
  349. string parent = 1 [
  350. (google.api.field_behavior) = REQUIRED,
  351. (google.api.resource_reference) = {
  352. child_type: "actions.googleapis.com/Version"
  353. }
  354. ];
  355. // The maximum number of versions to return. The service may return
  356. // fewer than this value. If unspecified, at most 50 versions will be
  357. // returned.
  358. int32 page_size = 2;
  359. // A page token, received from a previous `ListVersions` call.
  360. // Provide this to retrieve the subsequent page.
  361. // When paginating, all other parameters provided to `ListVersions`
  362. // must match the call that provided the page token.
  363. string page_token = 3;
  364. }
  365. // RPC response for listing versions
  366. message ListVersionsResponse {
  367. // List of the versions for the given project id.
  368. repeated Version versions = 1;
  369. // A token, which can be sent as `page_token` to retrieve the next page.
  370. // If this field is omitted, there are no subsequent pages.
  371. string next_page_token = 2;
  372. }