dataform.proto 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629
  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. syntax = "proto3";
  15. package google.cloud.dataform.v1beta1;
  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/protobuf/empty.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/type/interval.proto";
  23. option csharp_namespace = "Google.Cloud.Dataform.V1Beta1";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/dataform/v1beta1;dataform";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "DataformProto";
  27. option java_package = "com.google.cloud.dataform.v1beta1";
  28. option php_namespace = "Google\\Cloud\\Dataform\\V1beta1";
  29. option ruby_package = "Google::Cloud::Dataform::V1beta1";
  30. option (google.api.resource_definition) = {
  31. type: "secretmanager.googleapis.com/SecretVersion"
  32. pattern: "projects/{project}/secrets/{secret}/versions/{version}"
  33. };
  34. // Dataform is a service to develop, create, document, test, and update curated
  35. // tables in BigQuery.
  36. service Dataform {
  37. option (google.api.default_host) = "dataform.googleapis.com";
  38. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  39. // Lists Repositories in a given project and location.
  40. rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) {
  41. option (google.api.http) = {
  42. get: "/v1beta1/{parent=projects/*/locations/*}/repositories"
  43. };
  44. option (google.api.method_signature) = "parent";
  45. }
  46. // Fetches a single Repository.
  47. rpc GetRepository(GetRepositoryRequest) returns (Repository) {
  48. option (google.api.http) = {
  49. get: "/v1beta1/{name=projects/*/locations/*/repositories/*}"
  50. };
  51. option (google.api.method_signature) = "name";
  52. }
  53. // Creates a new Repository in a given project and location.
  54. rpc CreateRepository(CreateRepositoryRequest) returns (Repository) {
  55. option (google.api.http) = {
  56. post: "/v1beta1/{parent=projects/*/locations/*}/repositories"
  57. body: "repository"
  58. };
  59. option (google.api.method_signature) = "parent,repository,repository_id";
  60. }
  61. // Updates a single Repository.
  62. rpc UpdateRepository(UpdateRepositoryRequest) returns (Repository) {
  63. option (google.api.http) = {
  64. patch: "/v1beta1/{repository.name=projects/*/locations/*/repositories/*}"
  65. body: "repository"
  66. };
  67. option (google.api.method_signature) = "repository,update_mask";
  68. }
  69. // Deletes a single Repository.
  70. rpc DeleteRepository(DeleteRepositoryRequest) returns (google.protobuf.Empty) {
  71. option (google.api.http) = {
  72. delete: "/v1beta1/{name=projects/*/locations/*/repositories/*}"
  73. };
  74. option (google.api.method_signature) = "name";
  75. }
  76. // Fetches a Repository's remote branches.
  77. rpc FetchRemoteBranches(FetchRemoteBranchesRequest) returns (FetchRemoteBranchesResponse) {
  78. option (google.api.http) = {
  79. get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:fetchRemoteBranches"
  80. };
  81. }
  82. // Lists Workspaces in a given Repository.
  83. rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) {
  84. option (google.api.http) = {
  85. get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces"
  86. };
  87. option (google.api.method_signature) = "parent";
  88. }
  89. // Fetches a single Workspace.
  90. rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) {
  91. option (google.api.http) = {
  92. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}"
  93. };
  94. option (google.api.method_signature) = "name";
  95. }
  96. // Creates a new Workspace in a given Repository.
  97. rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) {
  98. option (google.api.http) = {
  99. post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces"
  100. body: "workspace"
  101. };
  102. option (google.api.method_signature) = "parent,workspace,workspace_id";
  103. }
  104. // Deletes a single Workspace.
  105. rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) {
  106. option (google.api.http) = {
  107. delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}"
  108. };
  109. option (google.api.method_signature) = "name";
  110. }
  111. // Installs dependency NPM packages (inside a Workspace).
  112. rpc InstallNpmPackages(InstallNpmPackagesRequest) returns (InstallNpmPackagesResponse) {
  113. option (google.api.http) = {
  114. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:installNpmPackages"
  115. body: "*"
  116. };
  117. }
  118. // Pulls Git commits from the Repository's remote into a Workspace.
  119. rpc PullGitCommits(PullGitCommitsRequest) returns (google.protobuf.Empty) {
  120. option (google.api.http) = {
  121. post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:pull"
  122. body: "*"
  123. };
  124. }
  125. // Pushes Git commits from a Workspace to the Repository's remote.
  126. rpc PushGitCommits(PushGitCommitsRequest) returns (google.protobuf.Empty) {
  127. option (google.api.http) = {
  128. post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:push"
  129. body: "*"
  130. };
  131. }
  132. // Fetches Git statuses for the files in a Workspace.
  133. rpc FetchFileGitStatuses(FetchFileGitStatusesRequest) returns (FetchFileGitStatusesResponse) {
  134. option (google.api.http) = {
  135. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileGitStatuses"
  136. };
  137. }
  138. // Fetches Git ahead/behind against a remote branch.
  139. rpc FetchGitAheadBehind(FetchGitAheadBehindRequest) returns (FetchGitAheadBehindResponse) {
  140. option (google.api.http) = {
  141. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind"
  142. };
  143. }
  144. // Applies a Git commit for uncommitted files in a Workspace.
  145. rpc CommitWorkspaceChanges(CommitWorkspaceChangesRequest) returns (google.protobuf.Empty) {
  146. option (google.api.http) = {
  147. post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:commit"
  148. body: "*"
  149. };
  150. }
  151. // Performs a Git reset for uncommitted files in a Workspace.
  152. rpc ResetWorkspaceChanges(ResetWorkspaceChangesRequest) returns (google.protobuf.Empty) {
  153. option (google.api.http) = {
  154. post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:reset"
  155. body: "*"
  156. };
  157. }
  158. // Fetches Git diff for an uncommitted file in a Workspace.
  159. rpc FetchFileDiff(FetchFileDiffRequest) returns (FetchFileDiffResponse) {
  160. option (google.api.http) = {
  161. get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileDiff"
  162. };
  163. }
  164. // Returns the contents of a given Workspace directory.
  165. rpc QueryDirectoryContents(QueryDirectoryContentsRequest) returns (QueryDirectoryContentsResponse) {
  166. option (google.api.http) = {
  167. get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents"
  168. };
  169. }
  170. // Creates a directory inside a Workspace.
  171. rpc MakeDirectory(MakeDirectoryRequest) returns (MakeDirectoryResponse) {
  172. option (google.api.http) = {
  173. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:makeDirectory"
  174. body: "*"
  175. };
  176. }
  177. // Deletes a directory (inside a Workspace) and all of its contents.
  178. rpc RemoveDirectory(RemoveDirectoryRequest) returns (google.protobuf.Empty) {
  179. option (google.api.http) = {
  180. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeDirectory"
  181. body: "*"
  182. };
  183. }
  184. // Moves a directory (inside a Workspace), and all of its contents, to a new
  185. // location.
  186. rpc MoveDirectory(MoveDirectoryRequest) returns (MoveDirectoryResponse) {
  187. option (google.api.http) = {
  188. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveDirectory"
  189. body: "*"
  190. };
  191. }
  192. // Returns the contents of a file (inside a Workspace).
  193. rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) {
  194. option (google.api.http) = {
  195. get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile"
  196. };
  197. }
  198. // Deletes a file (inside a Workspace).
  199. rpc RemoveFile(RemoveFileRequest) returns (google.protobuf.Empty) {
  200. option (google.api.http) = {
  201. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeFile"
  202. body: "*"
  203. };
  204. }
  205. // Moves a file (inside a Workspace) to a new location.
  206. rpc MoveFile(MoveFileRequest) returns (MoveFileResponse) {
  207. option (google.api.http) = {
  208. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveFile"
  209. body: "*"
  210. };
  211. }
  212. // Writes to a file (inside a Workspace).
  213. rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) {
  214. option (google.api.http) = {
  215. post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:writeFile"
  216. body: "*"
  217. };
  218. }
  219. // Lists CompilationResults in a given Repository.
  220. rpc ListCompilationResults(ListCompilationResultsRequest) returns (ListCompilationResultsResponse) {
  221. option (google.api.http) = {
  222. get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults"
  223. };
  224. option (google.api.method_signature) = "parent";
  225. }
  226. // Fetches a single CompilationResult.
  227. rpc GetCompilationResult(GetCompilationResultRequest) returns (CompilationResult) {
  228. option (google.api.http) = {
  229. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}"
  230. };
  231. option (google.api.method_signature) = "name";
  232. }
  233. // Creates a new CompilationResult in a given project and location.
  234. rpc CreateCompilationResult(CreateCompilationResultRequest) returns (CompilationResult) {
  235. option (google.api.http) = {
  236. post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults"
  237. body: "compilation_result"
  238. };
  239. option (google.api.method_signature) = "parent,compilation_result";
  240. }
  241. // Returns CompilationResultActions in a given CompilationResult.
  242. rpc QueryCompilationResultActions(QueryCompilationResultActionsRequest) returns (QueryCompilationResultActionsResponse) {
  243. option (google.api.http) = {
  244. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}:query"
  245. };
  246. }
  247. // Lists WorkflowInvocations in a given Repository.
  248. rpc ListWorkflowInvocations(ListWorkflowInvocationsRequest) returns (ListWorkflowInvocationsResponse) {
  249. option (google.api.http) = {
  250. get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations"
  251. };
  252. option (google.api.method_signature) = "parent";
  253. }
  254. // Fetches a single WorkflowInvocation.
  255. rpc GetWorkflowInvocation(GetWorkflowInvocationRequest) returns (WorkflowInvocation) {
  256. option (google.api.http) = {
  257. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}"
  258. };
  259. option (google.api.method_signature) = "name";
  260. }
  261. // Creates a new WorkflowInvocation in a given Repository.
  262. rpc CreateWorkflowInvocation(CreateWorkflowInvocationRequest) returns (WorkflowInvocation) {
  263. option (google.api.http) = {
  264. post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations"
  265. body: "workflow_invocation"
  266. };
  267. option (google.api.method_signature) = "parent,workflow_invocation";
  268. }
  269. // Deletes a single WorkflowInvocation.
  270. rpc DeleteWorkflowInvocation(DeleteWorkflowInvocationRequest) returns (google.protobuf.Empty) {
  271. option (google.api.http) = {
  272. delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}"
  273. };
  274. option (google.api.method_signature) = "name";
  275. }
  276. // Requests cancellation of a running WorkflowInvocation.
  277. rpc CancelWorkflowInvocation(CancelWorkflowInvocationRequest) returns (google.protobuf.Empty) {
  278. option (google.api.http) = {
  279. post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:cancel"
  280. body: "*"
  281. };
  282. }
  283. // Returns WorkflowInvocationActions in a given WorkflowInvocation.
  284. rpc QueryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest) returns (QueryWorkflowInvocationActionsResponse) {
  285. option (google.api.http) = {
  286. get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:query"
  287. };
  288. }
  289. }
  290. // Represents a Dataform Git repository.
  291. message Repository {
  292. option (google.api.resource) = {
  293. type: "dataform.googleapis.com/Repository"
  294. pattern: "projects/{project}/locations/{location}/repositories/{repository}"
  295. };
  296. // Controls Git remote configuration for a repository.
  297. message GitRemoteSettings {
  298. // Indicates the status of a Git authentication token.
  299. enum TokenStatus {
  300. // Default value. This value is unused.
  301. TOKEN_STATUS_UNSPECIFIED = 0;
  302. // The token could not be found in Secret Manager (or the Dataform
  303. // Service Account did not have permission to access it).
  304. NOT_FOUND = 1;
  305. // The token could not be used to authenticate against the Git remote.
  306. INVALID = 2;
  307. // The token was used successfully to authenticate against the Git remote.
  308. VALID = 3;
  309. }
  310. // Required. The Git remote's URL.
  311. string url = 1 [(google.api.field_behavior) = REQUIRED];
  312. // Required. The Git remote's default branch name.
  313. string default_branch = 2 [(google.api.field_behavior) = REQUIRED];
  314. // Required. The name of the Secret Manager secret version to use as an
  315. // authentication token for Git operations. Must be in the format
  316. // `projects/*/secrets/*/versions/*`.
  317. string authentication_token_secret_version = 3 [
  318. (google.api.field_behavior) = REQUIRED,
  319. (google.api.resource_reference) = {
  320. type: "secretmanager.googleapis.com/SecretVersion"
  321. }
  322. ];
  323. // Output only. Indicates the status of the Git access token.
  324. TokenStatus token_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  325. }
  326. // Output only. The repository's name.
  327. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  328. // Optional. If set, configures this repository to be linked to a Git remote.
  329. GitRemoteSettings git_remote_settings = 2 [(google.api.field_behavior) = OPTIONAL];
  330. }
  331. // `ListRepositories` request message.
  332. message ListRepositoriesRequest {
  333. // Required. The location in which to list repositories. Must be in the format
  334. // `projects/*/locations/*`.
  335. string parent = 1 [
  336. (google.api.field_behavior) = REQUIRED,
  337. (google.api.resource_reference) = {
  338. type: "locations.googleapis.com/Location"
  339. }
  340. ];
  341. // Optional. Maximum number of repositories to return. The server may return fewer
  342. // items than requested. If unspecified, the server will pick an appropriate
  343. // default.
  344. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  345. // Optional. Page token received from a previous `ListRepositories` call.
  346. // Provide this to retrieve the subsequent page.
  347. //
  348. // When paginating, all other parameters provided to `ListRepositories`
  349. // must match the call that provided the page token.
  350. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  351. // Optional. This field only supports ordering by `name`. If unspecified, the server
  352. // will choose the ordering. If specified, the default order is ascending for
  353. // the `name` field.
  354. string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
  355. // Optional. Filter for the returned list.
  356. string filter = 5 [(google.api.field_behavior) = OPTIONAL];
  357. }
  358. // `ListRepositories` response message.
  359. message ListRepositoriesResponse {
  360. // List of repositories.
  361. repeated Repository repositories = 1;
  362. // A token which can be sent as `page_token` to retrieve the next page.
  363. // If this field is omitted, there are no subsequent pages.
  364. string next_page_token = 2;
  365. // Locations which could not be reached.
  366. repeated string unreachable = 3;
  367. }
  368. // `GetRepository` request message.
  369. message GetRepositoryRequest {
  370. // Required. The repository's name.
  371. string name = 1 [
  372. (google.api.field_behavior) = REQUIRED,
  373. (google.api.resource_reference) = {
  374. type: "dataform.googleapis.com/Repository"
  375. }
  376. ];
  377. }
  378. // `CreateRepository` request message.
  379. message CreateRepositoryRequest {
  380. // Required. The location in which to create the repository. Must be in the format
  381. // `projects/*/locations/*`.
  382. string parent = 1 [
  383. (google.api.field_behavior) = REQUIRED,
  384. (google.api.resource_reference) = {
  385. type: "locations.googleapis.com/Location"
  386. }
  387. ];
  388. // Required. The repository to create.
  389. Repository repository = 2 [(google.api.field_behavior) = REQUIRED];
  390. // Required. The ID to use for the repository, which will become the final component of
  391. // the repository's resource name.
  392. string repository_id = 3 [(google.api.field_behavior) = REQUIRED];
  393. }
  394. // `UpdateRepository` request message.
  395. message UpdateRepositoryRequest {
  396. // Optional. Specifies the fields to be updated in the repository. If left unset,
  397. // all fields will be updated.
  398. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
  399. // Required. The repository to update.
  400. Repository repository = 2 [(google.api.field_behavior) = REQUIRED];
  401. }
  402. // `DeleteRepository` request message.
  403. message DeleteRepositoryRequest {
  404. // Required. The repository's name.
  405. string name = 1 [
  406. (google.api.field_behavior) = REQUIRED,
  407. (google.api.resource_reference) = {
  408. type: "dataform.googleapis.com/Repository"
  409. }
  410. ];
  411. // If set to true, any child resources of this repository will also be
  412. // deleted. (Otherwise, the request will only succeed if the repository has no
  413. // child resources.)
  414. bool force = 2;
  415. }
  416. // `FetchRemoteBranches` request message.
  417. message FetchRemoteBranchesRequest {
  418. // Required. The repository's name.
  419. string name = 1 [
  420. (google.api.field_behavior) = REQUIRED,
  421. (google.api.resource_reference) = {
  422. type: "dataform.googleapis.com/Repository"
  423. }
  424. ];
  425. }
  426. // `FetchRemoteBranches` response message.
  427. message FetchRemoteBranchesResponse {
  428. // The remote repository's branch names.
  429. repeated string branches = 1;
  430. }
  431. // Represents a Dataform Git workspace.
  432. message Workspace {
  433. option (google.api.resource) = {
  434. type: "dataform.googleapis.com/Workspace"
  435. pattern: "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}"
  436. };
  437. // Output only. The workspace's name.
  438. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  439. }
  440. // `ListWorkspaces` request message.
  441. message ListWorkspacesRequest {
  442. // Required. The repository in which to list workspaces. Must be in the
  443. // format `projects/*/locations/*/repositories/*`.
  444. string parent = 1 [
  445. (google.api.field_behavior) = REQUIRED,
  446. (google.api.resource_reference) = {
  447. type: "dataform.googleapis.com/Repository"
  448. }
  449. ];
  450. // Optional. Maximum number of workspaces to return. The server may return fewer
  451. // items than requested. If unspecified, the server will pick an appropriate
  452. // default.
  453. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  454. // Optional. Page token received from a previous `ListWorkspaces` call.
  455. // Provide this to retrieve the subsequent page.
  456. //
  457. // When paginating, all other parameters provided to `ListWorkspaces`
  458. // must match the call that provided the page token.
  459. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  460. // Optional. This field only supports ordering by `name`. If unspecified, the server
  461. // will choose the ordering. If specified, the default order is ascending for
  462. // the `name` field.
  463. string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
  464. // Optional. Filter for the returned list.
  465. string filter = 5 [(google.api.field_behavior) = OPTIONAL];
  466. }
  467. // `ListWorkspaces` response message.
  468. message ListWorkspacesResponse {
  469. // List of workspaces.
  470. repeated Workspace workspaces = 1;
  471. // A token, which can be sent as `page_token` to retrieve the next page.
  472. // If this field is omitted, there are no subsequent pages.
  473. string next_page_token = 2;
  474. // Locations which could not be reached.
  475. repeated string unreachable = 3;
  476. }
  477. // `GetWorkspace` request message.
  478. message GetWorkspaceRequest {
  479. // Required. The workspace's name.
  480. string name = 1 [
  481. (google.api.field_behavior) = REQUIRED,
  482. (google.api.resource_reference) = {
  483. type: "dataform.googleapis.com/Workspace"
  484. }
  485. ];
  486. }
  487. // `CreateWorkspace` request message.
  488. message CreateWorkspaceRequest {
  489. // Required. The repository in which to create the workspace. Must be in the format
  490. // `projects/*/locations/*/repositories/*`.
  491. string parent = 1 [
  492. (google.api.field_behavior) = REQUIRED,
  493. (google.api.resource_reference) = {
  494. type: "dataform.googleapis.com/Repository"
  495. }
  496. ];
  497. // Required. The workspace to create.
  498. Workspace workspace = 2 [(google.api.field_behavior) = REQUIRED];
  499. // Required. The ID to use for the workspace, which will become the final component of
  500. // the workspace's resource name.
  501. string workspace_id = 3 [(google.api.field_behavior) = REQUIRED];
  502. }
  503. // `DeleteWorkspace` request message.
  504. message DeleteWorkspaceRequest {
  505. // Required. The workspace resource's name.
  506. string name = 1 [
  507. (google.api.field_behavior) = REQUIRED,
  508. (google.api.resource_reference) = {
  509. type: "dataform.googleapis.com/Workspace"
  510. }
  511. ];
  512. }
  513. // Represents the author of a Git commit.
  514. message CommitAuthor {
  515. // Required. The commit author's name.
  516. string name = 1 [(google.api.field_behavior) = REQUIRED];
  517. // Required. The commit author's email address.
  518. string email_address = 2 [(google.api.field_behavior) = REQUIRED];
  519. }
  520. // `PullGitCommits` request message.
  521. message PullGitCommitsRequest {
  522. // Required. The workspace's name.
  523. string name = 1 [
  524. (google.api.field_behavior) = REQUIRED,
  525. (google.api.resource_reference) = {
  526. type: "dataform.googleapis.com/Workspace"
  527. }
  528. ];
  529. // Optional. The name of the branch in the Git remote from which to pull commits.
  530. // If left unset, the repository's default branch name will be used.
  531. string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL];
  532. // Required. The author of any merge commit which may be created as a result of merging
  533. // fetched Git commits into this workspace.
  534. CommitAuthor author = 3 [(google.api.field_behavior) = REQUIRED];
  535. }
  536. // `PushGitCommits` request message.
  537. message PushGitCommitsRequest {
  538. // Required. The workspace's name.
  539. string name = 1 [
  540. (google.api.field_behavior) = REQUIRED,
  541. (google.api.resource_reference) = {
  542. type: "dataform.googleapis.com/Workspace"
  543. }
  544. ];
  545. // Optional. The name of the branch in the Git remote to which commits should be pushed.
  546. // If left unset, the repository's default branch name will be used.
  547. string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL];
  548. }
  549. // `FetchFileGitStatuses` request message.
  550. message FetchFileGitStatusesRequest {
  551. // Required. The workspace's name.
  552. string name = 1 [
  553. (google.api.field_behavior) = REQUIRED,
  554. (google.api.resource_reference) = {
  555. type: "dataform.googleapis.com/Workspace"
  556. }
  557. ];
  558. }
  559. // `FetchFileGitStatuses` response message.
  560. message FetchFileGitStatusesResponse {
  561. // Represents the Git state of a file with uncommitted changes.
  562. message UncommittedFileChange {
  563. // Indicates the status of an uncommitted file change.
  564. enum State {
  565. // Default value. This value is unused.
  566. STATE_UNSPECIFIED = 0;
  567. // The file has been newly added.
  568. ADDED = 1;
  569. // The file has been deleted.
  570. DELETED = 2;
  571. // The file has been modified.
  572. MODIFIED = 3;
  573. // The file contains merge conflicts.
  574. HAS_CONFLICTS = 4;
  575. }
  576. // The file's full path including filename, relative to the workspace root.
  577. string path = 1;
  578. // Indicates the status of the file.
  579. State state = 2;
  580. }
  581. // A list of all files which have uncommitted Git changes. There will only be
  582. // a single entry for any given file.
  583. repeated UncommittedFileChange uncommitted_file_changes = 1;
  584. }
  585. // `FetchGitAheadBehind` request message.
  586. message FetchGitAheadBehindRequest {
  587. // Required. The workspace's name.
  588. string name = 1 [
  589. (google.api.field_behavior) = REQUIRED,
  590. (google.api.resource_reference) = {
  591. type: "dataform.googleapis.com/Workspace"
  592. }
  593. ];
  594. // Optional. The name of the branch in the Git remote against which this workspace
  595. // should be compared. If left unset, the repository's default branch name
  596. // will be used.
  597. string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL];
  598. }
  599. // `FetchGitAheadBehind` response message.
  600. message FetchGitAheadBehindResponse {
  601. // The number of commits in the remote branch that are not in the workspace.
  602. int32 commits_ahead = 1;
  603. // The number of commits in the workspace that are not in the remote branch.
  604. int32 commits_behind = 2;
  605. }
  606. // `CommitWorkspaceChanges` request message.
  607. message CommitWorkspaceChangesRequest {
  608. // Required. The workspace's name.
  609. string name = 1 [
  610. (google.api.field_behavior) = REQUIRED,
  611. (google.api.resource_reference) = {
  612. type: "dataform.googleapis.com/Workspace"
  613. }
  614. ];
  615. // Required. The commit's author.
  616. CommitAuthor author = 4 [(google.api.field_behavior) = REQUIRED];
  617. // Optional. The commit's message.
  618. string commit_message = 2 [(google.api.field_behavior) = OPTIONAL];
  619. // Optional. Full file paths to commit including filename, rooted at workspace root. If
  620. // left empty, all files will be committed.
  621. repeated string paths = 3 [(google.api.field_behavior) = OPTIONAL];
  622. }
  623. // `ResetWorkspaceChanges` request message.
  624. message ResetWorkspaceChangesRequest {
  625. // Required. The workspace's name.
  626. string name = 1 [
  627. (google.api.field_behavior) = REQUIRED,
  628. (google.api.resource_reference) = {
  629. type: "dataform.googleapis.com/Workspace"
  630. }
  631. ];
  632. // Optional. Full file paths to reset back to their committed state including filename,
  633. // rooted at workspace root. If left empty, all files will be reset.
  634. repeated string paths = 2 [(google.api.field_behavior) = OPTIONAL];
  635. // Optional. If set to true, untracked files will be deleted.
  636. bool clean = 3 [(google.api.field_behavior) = OPTIONAL];
  637. }
  638. // `FetchFileDiff` request message.
  639. message FetchFileDiffRequest {
  640. // Required. The workspace's name.
  641. string workspace = 1 [
  642. (google.api.field_behavior) = REQUIRED,
  643. (google.api.resource_reference) = {
  644. type: "dataform.googleapis.com/Workspace"
  645. }
  646. ];
  647. // Required. The file's full path including filename, relative to the workspace root.
  648. string path = 2 [(google.api.field_behavior) = REQUIRED];
  649. }
  650. // `FetchFileDiff` response message.
  651. message FetchFileDiffResponse {
  652. // The raw formatted Git diff for the file.
  653. string formatted_diff = 1;
  654. }
  655. // `QueryDirectoryContents` request message.
  656. message QueryDirectoryContentsRequest {
  657. // Required. The workspace's name.
  658. string workspace = 1 [
  659. (google.api.field_behavior) = REQUIRED,
  660. (google.api.resource_reference) = {
  661. type: "dataform.googleapis.com/Workspace"
  662. }
  663. ];
  664. // Optional. The directory's full path including directory name, relative to the
  665. // workspace root. If left unset, the workspace root is used.
  666. string path = 2 [(google.api.field_behavior) = OPTIONAL];
  667. // Optional. Maximum number of paths to return. The server may return fewer
  668. // items than requested. If unspecified, the server will pick an appropriate
  669. // default.
  670. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  671. // Optional. Page token received from a previous `QueryDirectoryContents` call.
  672. // Provide this to retrieve the subsequent page.
  673. //
  674. // When paginating, all other parameters provided to
  675. // `QueryDirectoryContents` must match the call that provided the page
  676. // token.
  677. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  678. }
  679. // `QueryDirectoryContents` response message.
  680. message QueryDirectoryContentsResponse {
  681. // Represents a single entry in a workspace directory.
  682. message DirectoryEntry {
  683. oneof entry {
  684. // A file in the directory.
  685. string file = 1;
  686. // A child directory in the directory.
  687. string directory = 2;
  688. }
  689. }
  690. // List of entries in the directory.
  691. repeated DirectoryEntry directory_entries = 1;
  692. // A token, which can be sent as `page_token` to retrieve the next page.
  693. // If this field is omitted, there are no subsequent pages.
  694. string next_page_token = 2;
  695. }
  696. // `MakeDirectory` request message.
  697. message MakeDirectoryRequest {
  698. // Required. The workspace's name.
  699. string workspace = 1 [
  700. (google.api.field_behavior) = REQUIRED,
  701. (google.api.resource_reference) = {
  702. type: "dataform.googleapis.com/Workspace"
  703. }
  704. ];
  705. // Required. The directory's full path including directory name, relative to the
  706. // workspace root.
  707. string path = 2 [(google.api.field_behavior) = REQUIRED];
  708. }
  709. // `MakeDirectory` response message.
  710. message MakeDirectoryResponse {
  711. }
  712. // `RemoveDirectory` request message.
  713. message RemoveDirectoryRequest {
  714. // Required. The workspace's name.
  715. string workspace = 1 [
  716. (google.api.field_behavior) = REQUIRED,
  717. (google.api.resource_reference) = {
  718. type: "dataform.googleapis.com/Workspace"
  719. }
  720. ];
  721. // Required. The directory's full path including directory name, relative to the
  722. // workspace root.
  723. string path = 2 [(google.api.field_behavior) = REQUIRED];
  724. }
  725. // `MoveDirectory` request message.
  726. message MoveDirectoryRequest {
  727. // Required. The workspace's name.
  728. string workspace = 1 [
  729. (google.api.field_behavior) = REQUIRED,
  730. (google.api.resource_reference) = {
  731. type: "dataform.googleapis.com/Workspace"
  732. }
  733. ];
  734. // Required. The directory's full path including directory name, relative to the
  735. // workspace root.
  736. string path = 2 [(google.api.field_behavior) = REQUIRED];
  737. // Required. The new path for the directory including directory name, rooted at
  738. // workspace root.
  739. string new_path = 3 [(google.api.field_behavior) = REQUIRED];
  740. }
  741. // `MoveDirectory` response message.
  742. message MoveDirectoryResponse {
  743. }
  744. // `ReadFile` request message.
  745. message ReadFileRequest {
  746. // Required. The workspace's name.
  747. string workspace = 1 [
  748. (google.api.field_behavior) = REQUIRED,
  749. (google.api.resource_reference) = {
  750. type: "dataform.googleapis.com/Workspace"
  751. }
  752. ];
  753. // Required. The file's full path including filename, relative to the workspace root.
  754. string path = 2 [(google.api.field_behavior) = REQUIRED];
  755. }
  756. // `ReadFile` response message.
  757. message ReadFileResponse {
  758. // The file's contents.
  759. bytes file_contents = 1;
  760. }
  761. // `RemoveFile` request message.
  762. message RemoveFileRequest {
  763. // Required. The workspace's name.
  764. string workspace = 1 [
  765. (google.api.field_behavior) = REQUIRED,
  766. (google.api.resource_reference) = {
  767. type: "dataform.googleapis.com/Workspace"
  768. }
  769. ];
  770. // Required. The file's full path including filename, relative to the workspace root.
  771. string path = 2 [(google.api.field_behavior) = REQUIRED];
  772. }
  773. // `MoveFile` request message.
  774. message MoveFileRequest {
  775. // Required. The workspace's name.
  776. string workspace = 1 [
  777. (google.api.field_behavior) = REQUIRED,
  778. (google.api.resource_reference) = {
  779. type: "dataform.googleapis.com/Workspace"
  780. }
  781. ];
  782. // Required. The file's full path including filename, relative to the workspace root.
  783. string path = 2 [(google.api.field_behavior) = REQUIRED];
  784. // Required. The file's new path including filename, relative to the workspace root.
  785. string new_path = 3 [(google.api.field_behavior) = REQUIRED];
  786. }
  787. // `MoveFile` response message.
  788. message MoveFileResponse {
  789. }
  790. // `WriteFile` request message.
  791. message WriteFileRequest {
  792. // Required. The workspace's name.
  793. string workspace = 1 [
  794. (google.api.field_behavior) = REQUIRED,
  795. (google.api.resource_reference) = {
  796. type: "dataform.googleapis.com/Workspace"
  797. }
  798. ];
  799. // Required. The file.
  800. string path = 2 [(google.api.field_behavior) = REQUIRED];
  801. // Required. The file's contents.
  802. bytes contents = 3 [(google.api.field_behavior) = REQUIRED];
  803. }
  804. // `WriteFile` response message.
  805. message WriteFileResponse {
  806. }
  807. // `InstallNpmPackages` request message.
  808. message InstallNpmPackagesRequest {
  809. // Required. The workspace's name.
  810. string workspace = 1 [
  811. (google.api.field_behavior) = REQUIRED,
  812. (google.api.resource_reference) = {
  813. type: "dataform.googleapis.com/Workspace"
  814. }
  815. ];
  816. }
  817. // `InstallNpmPackages` response message.
  818. message InstallNpmPackagesResponse {
  819. }
  820. // Represents the result of compiling a Dataform project.
  821. message CompilationResult {
  822. option (google.api.resource) = {
  823. type: "dataform.googleapis.com/CompilationResult"
  824. pattern: "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}"
  825. };
  826. // Configures various aspects of Dataform code compilation.
  827. message CodeCompilationConfig {
  828. // Optional. The default database (Google Cloud project ID).
  829. string default_database = 1 [(google.api.field_behavior) = OPTIONAL];
  830. // Optional. The default schema (BigQuery dataset ID).
  831. string default_schema = 2 [(google.api.field_behavior) = OPTIONAL];
  832. // Optional. The default BigQuery location to use. Defaults to "US".
  833. // See the BigQuery docs for a full list of locations:
  834. // https://cloud.google.com/bigquery/docs/locations.
  835. string default_location = 8 [(google.api.field_behavior) = OPTIONAL];
  836. // Optional. The default schema (BigQuery dataset ID) for assertions.
  837. string assertion_schema = 3 [(google.api.field_behavior) = OPTIONAL];
  838. // Optional. User-defined variables that are made available to project code during
  839. // compilation.
  840. map<string, string> vars = 4 [(google.api.field_behavior) = OPTIONAL];
  841. // Optional. The suffix that should be appended to all database (Google Cloud project
  842. // ID) names.
  843. string database_suffix = 5 [(google.api.field_behavior) = OPTIONAL];
  844. // Optional. The suffix that should be appended to all schema (BigQuery dataset ID)
  845. // names.
  846. string schema_suffix = 6 [(google.api.field_behavior) = OPTIONAL];
  847. // Optional. The prefix that should be prepended to all table names.
  848. string table_prefix = 7 [(google.api.field_behavior) = OPTIONAL];
  849. }
  850. // An error encountered when attempting to compile a Dataform project.
  851. message CompilationError {
  852. // Output only. The error's top level message.
  853. string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  854. // Output only. The error's full stack trace.
  855. string stack = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  856. // Output only. The path of the file where this error occurred, if available, relative to
  857. // the project root.
  858. string path = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  859. // Output only. The identifier of the action where this error occurred, if available.
  860. Target action_target = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  861. }
  862. // Output only. The compilation result's name.
  863. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  864. oneof source {
  865. // Immutable. Git commit/tag/branch name at which the repository should be compiled.
  866. // Must exist in the remote repository.
  867. // Examples:
  868. // - a commit SHA: `12ade345`
  869. // - a tag: `tag1`
  870. // - a branch name: `branch1`
  871. string git_commitish = 2 [(google.api.field_behavior) = IMMUTABLE];
  872. // Immutable. The name of the workspace to compile. Must be in the format
  873. // `projects/*/locations/*/repositories/*/workspaces/*`.
  874. string workspace = 3 [
  875. (google.api.field_behavior) = IMMUTABLE,
  876. (google.api.resource_reference) = {
  877. type: "dataform.googleapis.com/Workspace"
  878. }
  879. ];
  880. }
  881. // Immutable. If set, fields of `code_compilation_overrides` override the default
  882. // compilation settings that are specified in dataform.json.
  883. CodeCompilationConfig code_compilation_config = 4 [(google.api.field_behavior) = IMMUTABLE];
  884. // Output only. The version of `@dataform/core` that was used for compilation.
  885. string dataform_core_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  886. // Output only. Errors encountered during project compilation.
  887. repeated CompilationError compilation_errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  888. }
  889. // `ListCompilationResults` request message.
  890. message ListCompilationResultsRequest {
  891. // Required. The repository in which to list compilation results. Must be in the
  892. // format `projects/*/locations/*/repositories/*`.
  893. string parent = 1 [
  894. (google.api.field_behavior) = REQUIRED,
  895. (google.api.resource_reference) = {
  896. type: "dataform.googleapis.com/Repository"
  897. }
  898. ];
  899. // Optional. Maximum number of compilation results to return. The server may return
  900. // fewer items than requested. If unspecified, the server will pick an
  901. // appropriate default.
  902. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  903. // Optional. Page token received from a previous `ListCompilationResults` call.
  904. // Provide this to retrieve the subsequent page.
  905. //
  906. // When paginating, all other parameters provided to `ListCompilationResults`
  907. // must match the call that provided the page token.
  908. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  909. }
  910. // `ListCompilationResults` response message.
  911. message ListCompilationResultsResponse {
  912. // List of compilation results.
  913. repeated CompilationResult compilation_results = 1;
  914. // A token, which can be sent as `page_token` to retrieve the next page.
  915. // If this field is omitted, there are no subsequent pages.
  916. string next_page_token = 2;
  917. // Locations which could not be reached.
  918. repeated string unreachable = 3;
  919. }
  920. // `GetCompilationResult` request message.
  921. message GetCompilationResultRequest {
  922. // Required. The compilation result's name.
  923. string name = 1 [
  924. (google.api.field_behavior) = REQUIRED,
  925. (google.api.resource_reference) = {
  926. type: "dataform.googleapis.com/CompilationResult"
  927. }
  928. ];
  929. }
  930. // `CreateCompilationResult` request message.
  931. message CreateCompilationResultRequest {
  932. // Required. The repository in which to create the compilation result. Must be in the
  933. // format `projects/*/locations/*/repositories/*`.
  934. string parent = 1 [
  935. (google.api.field_behavior) = REQUIRED,
  936. (google.api.resource_reference) = {
  937. type: "dataform.googleapis.com/Repository"
  938. }
  939. ];
  940. // Required. The compilation result to create.
  941. CompilationResult compilation_result = 2 [(google.api.field_behavior) = REQUIRED];
  942. }
  943. // Represents an action identifier. If the action writes output, the output
  944. // will be written to the referenced database object.
  945. message Target {
  946. // The action's database (Google Cloud project ID) .
  947. string database = 1;
  948. // The action's schema (BigQuery dataset ID), within `database`.
  949. string schema = 2;
  950. // The action's name, within `database` and `schema`.
  951. string name = 3;
  952. }
  953. // Describes a relation and its columns.
  954. message RelationDescriptor {
  955. // Describes a column.
  956. message ColumnDescriptor {
  957. // The identifier for the column. Each entry in `path` represents one level
  958. // of nesting.
  959. repeated string path = 1;
  960. // A textual description of the column.
  961. string description = 2;
  962. // A list of BigQuery policy tags that will be applied to the column.
  963. repeated string bigquery_policy_tags = 3;
  964. }
  965. // A text description of the relation.
  966. string description = 1;
  967. // A list of descriptions of columns within the relation.
  968. repeated ColumnDescriptor columns = 2;
  969. // A set of BigQuery labels that should be applied to the relation.
  970. map<string, string> bigquery_labels = 3;
  971. }
  972. // Represents a single Dataform action in a compilation result.
  973. message CompilationResultAction {
  974. // Represents a database relation.
  975. message Relation {
  976. // Indicates the type of this relation.
  977. enum RelationType {
  978. // Default value. This value is unused.
  979. RELATION_TYPE_UNSPECIFIED = 0;
  980. // The relation is a table.
  981. TABLE = 1;
  982. // The relation is a view.
  983. VIEW = 2;
  984. // The relation is an incrementalized table.
  985. INCREMENTAL_TABLE = 3;
  986. // The relation is a materialized view.
  987. MATERIALIZED_VIEW = 4;
  988. }
  989. // Contains settings for relations of type `INCREMENTAL_TABLE`.
  990. message IncrementalTableConfig {
  991. // The SELECT query which returns rows which should be inserted into the
  992. // relation if it already exists and is not being refreshed.
  993. string incremental_select_query = 1;
  994. // Whether this table should be protected from being refreshed.
  995. bool refresh_disabled = 2;
  996. // A set of columns or SQL expressions used to define row uniqueness.
  997. // If any duplicates are discovered (as defined by `unique_key_parts`),
  998. // only the newly selected rows (as defined by `incremental_select_query`)
  999. // will be included in the relation.
  1000. repeated string unique_key_parts = 3;
  1001. // A SQL expression conditional used to limit the set of existing rows
  1002. // considered for a merge operation (see `unique_key_parts` for more
  1003. // information).
  1004. string update_partition_filter = 4;
  1005. // SQL statements to be executed before inserting new rows into the
  1006. // relation.
  1007. repeated string incremental_pre_operations = 5;
  1008. // SQL statements to be executed after inserting new rows into the
  1009. // relation.
  1010. repeated string incremental_post_operations = 6;
  1011. }
  1012. // A list of actions that this action depends on.
  1013. repeated Target dependency_targets = 1;
  1014. // Whether this action is disabled (i.e. should not be run).
  1015. bool disabled = 2;
  1016. // Arbitrary, user-defined tags on this action.
  1017. repeated string tags = 3;
  1018. // Descriptor for the relation and its columns.
  1019. RelationDescriptor relation_descriptor = 4;
  1020. // The type of this relation.
  1021. RelationType relation_type = 5;
  1022. // The SELECT query which returns rows which this relation should contain.
  1023. string select_query = 6;
  1024. // SQL statements to be executed before creating the relation.
  1025. repeated string pre_operations = 7;
  1026. // SQL statements to be executed after creating the relation.
  1027. repeated string post_operations = 8;
  1028. // Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
  1029. // `relation_type` is `INCREMENTAL_TABLE`.
  1030. IncrementalTableConfig incremental_table_config = 9;
  1031. // The SQL expression used to partition the relation.
  1032. string partition_expression = 10;
  1033. // A list of columns or SQL expressions used to cluster the table.
  1034. repeated string cluster_expressions = 11;
  1035. // Sets the partition expiration in days.
  1036. int32 partition_expiration_days = 12;
  1037. // Specifies whether queries on this table must include a predicate filter
  1038. // that filters on the partitioning column.
  1039. bool require_partition_filter = 13;
  1040. // Additional options that will be provided as key/value pairs into the
  1041. // options clause of a create table/view statement. See
  1042. // https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
  1043. // for more information on which options are supported.
  1044. map<string, string> additional_options = 14;
  1045. }
  1046. // Represents a list of arbitrary database operations.
  1047. message Operations {
  1048. // A list of actions that this action depends on.
  1049. repeated Target dependency_targets = 1;
  1050. // Whether this action is disabled (i.e. should not be run).
  1051. bool disabled = 2;
  1052. // Arbitrary, user-defined tags on this action.
  1053. repeated string tags = 3;
  1054. // Descriptor for any output relation and its columns. Only set if
  1055. // `has_output` is true.
  1056. RelationDescriptor relation_descriptor = 6;
  1057. // A list of arbitrary SQL statements that will be executed without
  1058. // alteration.
  1059. repeated string queries = 4;
  1060. // Whether these operations produce an output relation.
  1061. bool has_output = 5;
  1062. }
  1063. // Represents an assertion upon a SQL query which is required return zero
  1064. // rows.
  1065. message Assertion {
  1066. // A list of actions that this action depends on.
  1067. repeated Target dependency_targets = 1;
  1068. // The parent action of this assertion. Only set if this assertion was
  1069. // automatically generated.
  1070. Target parent_action = 5;
  1071. // Whether this action is disabled (i.e. should not be run).
  1072. bool disabled = 2;
  1073. // Arbitrary, user-defined tags on this action.
  1074. repeated string tags = 3;
  1075. // The SELECT query which must return zero rows in order for this assertion
  1076. // to succeed.
  1077. string select_query = 4;
  1078. // Descriptor for the assertion's automatically-generated view and its
  1079. // columns.
  1080. RelationDescriptor relation_descriptor = 6;
  1081. }
  1082. // Represents a relation which is not managed by Dataform but which may be
  1083. // referenced by Dataform actions.
  1084. message Declaration {
  1085. // Descriptor for the relation and its columns. Used as documentation only,
  1086. // i.e. values here will result in no changes to the relation's metadata.
  1087. RelationDescriptor relation_descriptor = 1;
  1088. }
  1089. // This action's identifier. Unique within the compilation result.
  1090. Target target = 1;
  1091. // The action's identifier if the project had been compiled without any
  1092. // overrides configured. Unique within the compilation result.
  1093. Target canonical_target = 2;
  1094. // The full path including filename in which this action is located, relative
  1095. // to the workspace root.
  1096. string file_path = 3;
  1097. oneof compiled_object {
  1098. // The database relation created/updated by this action.
  1099. Relation relation = 4;
  1100. // The database operations executed by this action.
  1101. Operations operations = 5;
  1102. // The assertion executed by this action.
  1103. Assertion assertion = 6;
  1104. // The declaration declared by this action.
  1105. Declaration declaration = 7;
  1106. }
  1107. }
  1108. // `QueryCompilationResultActions` request message.
  1109. message QueryCompilationResultActionsRequest {
  1110. // Required. The compilation result's name.
  1111. string name = 1 [
  1112. (google.api.field_behavior) = REQUIRED,
  1113. (google.api.resource_reference) = {
  1114. type: "dataform.googleapis.com/CompilationResult"
  1115. }
  1116. ];
  1117. // Optional. Maximum number of compilation results to return. The server may return
  1118. // fewer items than requested. If unspecified, the server will pick an
  1119. // appropriate default.
  1120. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  1121. // Optional. Page token received from a previous `QueryCompilationResultActions` call.
  1122. // Provide this to retrieve the subsequent page.
  1123. //
  1124. // When paginating, all other parameters provided to
  1125. // `QueryCompilationResultActions` must match the call that provided the page
  1126. // token.
  1127. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  1128. // Optional. Optional filter for the returned list. Filtering is only currently
  1129. // supported on the `file_path` field.
  1130. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  1131. }
  1132. // `QueryCompilationResultActions` response message.
  1133. message QueryCompilationResultActionsResponse {
  1134. // List of compilation result actions.
  1135. repeated CompilationResultAction compilation_result_actions = 1;
  1136. // A token, which can be sent as `page_token` to retrieve the next page.
  1137. // If this field is omitted, there are no subsequent pages.
  1138. string next_page_token = 2;
  1139. }
  1140. // Represents a single invocation of a compilation result.
  1141. message WorkflowInvocation {
  1142. option (google.api.resource) = {
  1143. type: "dataform.googleapis.com/WorkflowInvocation"
  1144. pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}"
  1145. };
  1146. // Includes various configuration options for this workflow invocation.
  1147. // If both `included_targets` and `included_tags` are unset, all actions
  1148. // will be included.
  1149. message InvocationConfig {
  1150. // Immutable. The set of action identifiers to include.
  1151. repeated Target included_targets = 1 [(google.api.field_behavior) = IMMUTABLE];
  1152. // Immutable. The set of tags to include.
  1153. repeated string included_tags = 2 [(google.api.field_behavior) = IMMUTABLE];
  1154. // Immutable. When set to true, transitive dependencies of included actions will be
  1155. // executed.
  1156. bool transitive_dependencies_included = 3 [(google.api.field_behavior) = IMMUTABLE];
  1157. // Immutable. When set to true, transitive dependents of included actions will be
  1158. // executed.
  1159. bool transitive_dependents_included = 4 [(google.api.field_behavior) = IMMUTABLE];
  1160. // Immutable. When set to true, any incremental tables will be fully refreshed.
  1161. bool fully_refresh_incremental_tables_enabled = 5 [(google.api.field_behavior) = IMMUTABLE];
  1162. }
  1163. // Represents the current state of a workflow invocation.
  1164. enum State {
  1165. // Default value. This value is unused.
  1166. STATE_UNSPECIFIED = 0;
  1167. // The workflow invocation is currently running.
  1168. RUNNING = 1;
  1169. // The workflow invocation succeeded. A terminal state.
  1170. SUCCEEDED = 2;
  1171. // The workflow invocation was cancelled. A terminal state.
  1172. CANCELLED = 3;
  1173. // The workflow invocation failed. A terminal state.
  1174. FAILED = 4;
  1175. // The workflow invocation is being cancelled, but some actions are still
  1176. // running.
  1177. CANCELING = 5;
  1178. }
  1179. // Output only. The workflow invocation's name.
  1180. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1181. // Immutable. The name of the compilation result to compile. Must be in the format
  1182. // `projects/*/locations/*/repositories/*/compilationResults/*`.
  1183. string compilation_result = 2 [
  1184. (google.api.field_behavior) = IMMUTABLE,
  1185. (google.api.resource_reference) = {
  1186. type: "dataform.googleapis.com/CompilationResult"
  1187. }
  1188. ];
  1189. // Immutable. If left unset, a default InvocationConfig will be used.
  1190. InvocationConfig invocation_config = 3 [(google.api.field_behavior) = IMMUTABLE];
  1191. // Output only. This workflow invocation's current state.
  1192. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1193. // Output only. This workflow invocation's timing details.
  1194. google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  1195. }
  1196. // `ListWorkflowInvocations` request message.
  1197. message ListWorkflowInvocationsRequest {
  1198. // Required. The parent resource of the WorkflowInvocation type. Must be in the
  1199. // format `projects/*/locations/*/repositories/*`.
  1200. string parent = 1 [
  1201. (google.api.field_behavior) = REQUIRED,
  1202. (google.api.resource_reference) = {
  1203. type: "dataform.googleapis.com/Repository"
  1204. }
  1205. ];
  1206. // Optional. Maximum number of workflow invocations to return. The server may return
  1207. // fewer items than requested. If unspecified, the server will pick an
  1208. // appropriate default.
  1209. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  1210. // Optional. Page token received from a previous `ListWorkflowInvocations` call.
  1211. // Provide this to retrieve the subsequent page.
  1212. //
  1213. // When paginating, all other parameters provided to `ListWorkflowInvocations`
  1214. // must match the call that provided the page token.
  1215. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  1216. }
  1217. // `ListWorkflowInvocations` response message.
  1218. message ListWorkflowInvocationsResponse {
  1219. // List of workflow invocations.
  1220. repeated WorkflowInvocation workflow_invocations = 1;
  1221. // A token, which can be sent as `page_token` to retrieve the next page.
  1222. // If this field is omitted, there are no subsequent pages.
  1223. string next_page_token = 2;
  1224. // Locations which could not be reached.
  1225. repeated string unreachable = 3;
  1226. }
  1227. // `GetWorkflowInvocation` request message.
  1228. message GetWorkflowInvocationRequest {
  1229. // Required. The workflow invocation resource's name.
  1230. string name = 1 [
  1231. (google.api.field_behavior) = REQUIRED,
  1232. (google.api.resource_reference) = {
  1233. type: "dataform.googleapis.com/WorkflowInvocation"
  1234. }
  1235. ];
  1236. }
  1237. // `CreateWorkflowInvocation` request message.
  1238. message CreateWorkflowInvocationRequest {
  1239. // Required. The repository in which to create the workflow invocation. Must be in the
  1240. // format `projects/*/locations/*/repositories/*`.
  1241. string parent = 1 [
  1242. (google.api.field_behavior) = REQUIRED,
  1243. (google.api.resource_reference) = {
  1244. type: "dataform.googleapis.com/Repository"
  1245. }
  1246. ];
  1247. // Required. The workflow invocation resource to create.
  1248. WorkflowInvocation workflow_invocation = 2 [(google.api.field_behavior) = REQUIRED];
  1249. }
  1250. // `DeleteWorkflowInvocation` request message.
  1251. message DeleteWorkflowInvocationRequest {
  1252. // Required. The workflow invocation resource's name.
  1253. string name = 1 [
  1254. (google.api.field_behavior) = REQUIRED,
  1255. (google.api.resource_reference) = {
  1256. type: "dataform.googleapis.com/WorkflowInvocation"
  1257. }
  1258. ];
  1259. }
  1260. // `CancelWorkflowInvocation` request message.
  1261. message CancelWorkflowInvocationRequest {
  1262. // Required. The workflow invocation resource's name.
  1263. string name = 1 [
  1264. (google.api.field_behavior) = REQUIRED,
  1265. (google.api.resource_reference) = {
  1266. type: "dataform.googleapis.com/WorkflowInvocation"
  1267. }
  1268. ];
  1269. }
  1270. // Represents a single action in a workflow invocation.
  1271. message WorkflowInvocationAction {
  1272. // Represents the current state of an workflow invocation action.
  1273. enum State {
  1274. // The action has not yet been considered for invocation.
  1275. PENDING = 0;
  1276. // The action is currently running.
  1277. RUNNING = 1;
  1278. // Execution of the action was skipped because upstream dependencies did not
  1279. // all complete successfully. A terminal state.
  1280. SKIPPED = 2;
  1281. // Execution of the action was disabled as per the configuration of the
  1282. // corresponding compilation result action. A terminal state.
  1283. DISABLED = 3;
  1284. // The action succeeded. A terminal state.
  1285. SUCCEEDED = 4;
  1286. // The action was cancelled. A terminal state.
  1287. CANCELLED = 5;
  1288. // The action failed. A terminal state.
  1289. FAILED = 6;
  1290. }
  1291. // Represents a workflow action that will run against BigQuery.
  1292. message BigQueryAction {
  1293. // Output only. The generated BigQuery SQL script that will be executed.
  1294. string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1295. }
  1296. // Output only. This action's identifier. Unique within the workflow invocation.
  1297. Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1298. // Output only. The action's identifier if the project had been compiled without any
  1299. // overrides configured. Unique within the compilation result.
  1300. Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  1301. // Output only. This action's current state.
  1302. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1303. // Output only. If and only if action's state is FAILED a failure reason is set.
  1304. string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  1305. // Output only. This action's timing details.
  1306. // `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
  1307. // CANCELLED, FAILED] state.
  1308. // `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
  1309. // state.
  1310. google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  1311. // Output only. The workflow action's bigquery action details.
  1312. BigQueryAction bigquery_action = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  1313. }
  1314. // `QueryWorkflowInvocationActions` request message.
  1315. message QueryWorkflowInvocationActionsRequest {
  1316. // Required. The workflow invocation's name.
  1317. string name = 1 [
  1318. (google.api.field_behavior) = REQUIRED,
  1319. (google.api.resource_reference) = {
  1320. type: "dataform.googleapis.com/WorkflowInvocation"
  1321. }
  1322. ];
  1323. // Optional. Maximum number of workflow invocations to return. The server may return
  1324. // fewer items than requested. If unspecified, the server will pick an
  1325. // appropriate default.
  1326. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  1327. // Optional. Page token received from a previous `QueryWorkflowInvocationActions` call.
  1328. // Provide this to retrieve the subsequent page.
  1329. //
  1330. // When paginating, all other parameters provided to
  1331. // `QueryWorkflowInvocationActions` must match the call that provided the page
  1332. // token.
  1333. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  1334. }
  1335. // `QueryWorkflowInvocationActions` response message.
  1336. message QueryWorkflowInvocationActionsResponse {
  1337. // List of workflow invocation actions.
  1338. repeated WorkflowInvocationAction workflow_invocation_actions = 1;
  1339. // A token, which can be sent as `page_token` to retrieve the next page.
  1340. // If this field is omitted, there are no subsequent pages.
  1341. string next_page_token = 2;
  1342. }