dataform.proto 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628
  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.v1alpha2;
  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.V1Alpha2";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/dataform/v1alpha2;dataform";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "DataformProto";
  27. option java_package = "com.google.cloud.dataform.v1alpha2";
  28. option php_namespace = "Google\\Cloud\\Dataform\\V1alpha2";
  29. option ruby_package = "Google::Cloud::Dataform::V1alpha2";
  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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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: "/v1alpha2/{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 parent resource of the WorkflowInvocation type.
  1240. string parent = 1 [
  1241. (google.api.field_behavior) = REQUIRED,
  1242. (google.api.resource_reference) = {
  1243. type: "dataform.googleapis.com/Repository"
  1244. }
  1245. ];
  1246. // Required. The workflow invocation resource to create.
  1247. WorkflowInvocation workflow_invocation = 2 [(google.api.field_behavior) = REQUIRED];
  1248. }
  1249. // `DeleteWorkflowInvocation` request message.
  1250. message DeleteWorkflowInvocationRequest {
  1251. // Required. The workflow invocation resource's name.
  1252. string name = 1 [
  1253. (google.api.field_behavior) = REQUIRED,
  1254. (google.api.resource_reference) = {
  1255. type: "dataform.googleapis.com/WorkflowInvocation"
  1256. }
  1257. ];
  1258. }
  1259. // `CancelWorkflowInvocation` request message.
  1260. message CancelWorkflowInvocationRequest {
  1261. // Required. The workflow invocation resource's name.
  1262. string name = 1 [
  1263. (google.api.field_behavior) = REQUIRED,
  1264. (google.api.resource_reference) = {
  1265. type: "dataform.googleapis.com/WorkflowInvocation"
  1266. }
  1267. ];
  1268. }
  1269. // Represents a single action in a workflow invocation.
  1270. message WorkflowInvocationAction {
  1271. // Represents the current state of an workflow invocation action.
  1272. enum State {
  1273. // The action has not yet been considered for invocation.
  1274. PENDING = 0;
  1275. // The action is currently running.
  1276. RUNNING = 1;
  1277. // Execution of the action was skipped because upstream dependencies did not
  1278. // all complete successfully. A terminal state.
  1279. SKIPPED = 2;
  1280. // Execution of the action was disabled as per the configuration of the
  1281. // corresponding compilation result action. A terminal state.
  1282. DISABLED = 3;
  1283. // The action succeeded. A terminal state.
  1284. SUCCEEDED = 4;
  1285. // The action was cancelled. A terminal state.
  1286. CANCELLED = 5;
  1287. // The action failed. A terminal state.
  1288. FAILED = 6;
  1289. }
  1290. // Represents a workflow action that will run against BigQuery.
  1291. message BigQueryAction {
  1292. // Output only. The generated BigQuery SQL script that will be executed.
  1293. string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1294. }
  1295. // Output only. This action's identifier. Unique within the workflow invocation.
  1296. Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1297. // Output only. The action's identifier if the project had been compiled without any
  1298. // overrides configured. Unique within the compilation result.
  1299. Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  1300. // Output only. This action's current state.
  1301. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  1302. // Output only. If and only if action's state is FAILED a failure reason is set.
  1303. string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  1304. // Output only. This action's timing details.
  1305. // `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
  1306. // CANCELLED, FAILED] state.
  1307. // `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
  1308. // state.
  1309. google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  1310. // Output only. The workflow action's bigquery action details.
  1311. BigQueryAction bigquery_action = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  1312. }
  1313. // `QueryWorkflowInvocationActions` request message.
  1314. message QueryWorkflowInvocationActionsRequest {
  1315. // Required. The workflow invocation's name.
  1316. string name = 1 [
  1317. (google.api.field_behavior) = REQUIRED,
  1318. (google.api.resource_reference) = {
  1319. type: "dataform.googleapis.com/WorkflowInvocation"
  1320. }
  1321. ];
  1322. // Optional. Maximum number of workflow invocations to return. The server may return
  1323. // fewer items than requested. If unspecified, the server will pick an
  1324. // appropriate default.
  1325. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  1326. // Optional. Page token received from a previous `QueryWorkflowInvocationActions` call.
  1327. // Provide this to retrieve the subsequent page.
  1328. //
  1329. // When paginating, all other parameters provided to
  1330. // `QueryWorkflowInvocationActions` must match the call that provided the page
  1331. // token.
  1332. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  1333. }
  1334. // `QueryWorkflowInvocationActions` response message.
  1335. message QueryWorkflowInvocationActionsResponse {
  1336. // List of workflow invocation actions.
  1337. repeated WorkflowInvocationAction workflow_invocation_actions = 1;
  1338. // A token, which can be sent as `page_token` to retrieve the next page.
  1339. // If this field is omitted, there are no subsequent pages.
  1340. string next_page_token = 2;
  1341. }