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