xref: /aosp_15_r20/external/googleapis/google/cloud/dataform/v1beta1/dataform.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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.v1beta1;
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/protobuf/timestamp.proto";
26import "google/rpc/status.proto";
27import "google/type/interval.proto";
28
29option csharp_namespace = "Google.Cloud.Dataform.V1Beta1";
30option go_package = "cloud.google.com/go/dataform/apiv1beta1/dataformpb;dataformpb";
31option java_multiple_files = true;
32option java_outer_classname = "DataformProto";
33option java_package = "com.google.cloud.dataform.v1beta1";
34option php_namespace = "Google\\Cloud\\Dataform\\V1beta1";
35option ruby_package = "Google::Cloud::Dataform::V1beta1";
36option (google.api.resource_definition) = {
37  type: "secretmanager.googleapis.com/SecretVersion"
38  pattern: "projects/{project}/secrets/{secret}/versions/{version}"
39};
40
41// Dataform is a service to develop, create, document, test, and update curated
42// tables in BigQuery.
43service Dataform {
44  option (google.api.default_host) = "dataform.googleapis.com";
45  option (google.api.oauth_scopes) =
46      "https://www.googleapis.com/auth/cloud-platform";
47
48  // Lists Repositories in a given project and location.
49  rpc ListRepositories(ListRepositoriesRequest)
50      returns (ListRepositoriesResponse) {
51    option (google.api.http) = {
52      get: "/v1beta1/{parent=projects/*/locations/*}/repositories"
53    };
54    option (google.api.method_signature) = "parent";
55  }
56
57  // Fetches a single Repository.
58  rpc GetRepository(GetRepositoryRequest) returns (Repository) {
59    option (google.api.http) = {
60      get: "/v1beta1/{name=projects/*/locations/*/repositories/*}"
61    };
62    option (google.api.method_signature) = "name";
63  }
64
65  // Creates a new Repository in a given project and location.
66  rpc CreateRepository(CreateRepositoryRequest) returns (Repository) {
67    option (google.api.http) = {
68      post: "/v1beta1/{parent=projects/*/locations/*}/repositories"
69      body: "repository"
70    };
71    option (google.api.method_signature) = "parent,repository,repository_id";
72  }
73
74  // Updates a single Repository.
75  rpc UpdateRepository(UpdateRepositoryRequest) returns (Repository) {
76    option (google.api.http) = {
77      patch: "/v1beta1/{repository.name=projects/*/locations/*/repositories/*}"
78      body: "repository"
79    };
80    option (google.api.method_signature) = "repository,update_mask";
81  }
82
83  // Deletes a single Repository.
84  rpc DeleteRepository(DeleteRepositoryRequest)
85      returns (google.protobuf.Empty) {
86    option (google.api.http) = {
87      delete: "/v1beta1/{name=projects/*/locations/*/repositories/*}"
88    };
89    option (google.api.method_signature) = "name";
90  }
91
92  // Applies a Git commit to a Repository. The Repository must not have a value
93  // for `git_remote_settings.url`.
94  rpc CommitRepositoryChanges(CommitRepositoryChangesRequest)
95      returns (google.protobuf.Empty) {
96    option (google.api.http) = {
97      post: "/v1beta1/{name=projects/*/locations/*/repositories/*}:commit"
98      body: "*"
99    };
100  }
101
102  // Returns the contents of a file (inside a Repository). The Repository
103  // must not have a value for `git_remote_settings.url`.
104  rpc ReadRepositoryFile(ReadRepositoryFileRequest)
105      returns (ReadRepositoryFileResponse) {
106    option (google.api.http) = {
107      get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:readFile"
108    };
109  }
110
111  // Returns the contents of a given Repository directory. The Repository must
112  // not have a value for `git_remote_settings.url`.
113  rpc QueryRepositoryDirectoryContents(QueryRepositoryDirectoryContentsRequest)
114      returns (QueryRepositoryDirectoryContentsResponse) {
115    option (google.api.http) = {
116      get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:queryDirectoryContents"
117    };
118  }
119
120  // Fetches a Repository's history of commits.  The Repository must not have a
121  // value for `git_remote_settings.url`.
122  rpc FetchRepositoryHistory(FetchRepositoryHistoryRequest)
123      returns (FetchRepositoryHistoryResponse) {
124    option (google.api.http) = {
125      get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:fetchHistory"
126    };
127  }
128
129  // Computes a Repository's Git access token status.
130  rpc ComputeRepositoryAccessTokenStatus(
131      ComputeRepositoryAccessTokenStatusRequest)
132      returns (ComputeRepositoryAccessTokenStatusResponse) {
133    option (google.api.http) = {
134      get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:computeAccessTokenStatus"
135    };
136  }
137
138  // Fetches a Repository's remote branches.
139  rpc FetchRemoteBranches(FetchRemoteBranchesRequest)
140      returns (FetchRemoteBranchesResponse) {
141    option (google.api.http) = {
142      get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:fetchRemoteBranches"
143    };
144  }
145
146  // Lists Workspaces in a given Repository.
147  rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) {
148    option (google.api.http) = {
149      get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces"
150    };
151    option (google.api.method_signature) = "parent";
152  }
153
154  // Fetches a single Workspace.
155  rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) {
156    option (google.api.http) = {
157      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}"
158    };
159    option (google.api.method_signature) = "name";
160  }
161
162  // Creates a new Workspace in a given Repository.
163  rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) {
164    option (google.api.http) = {
165      post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces"
166      body: "workspace"
167    };
168    option (google.api.method_signature) = "parent,workspace,workspace_id";
169  }
170
171  // Deletes a single Workspace.
172  rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) {
173    option (google.api.http) = {
174      delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}"
175    };
176    option (google.api.method_signature) = "name";
177  }
178
179  // Installs dependency NPM packages (inside a Workspace).
180  rpc InstallNpmPackages(InstallNpmPackagesRequest)
181      returns (InstallNpmPackagesResponse) {
182    option (google.api.http) = {
183      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:installNpmPackages"
184      body: "*"
185    };
186  }
187
188  // Pulls Git commits from the Repository's remote into a Workspace.
189  rpc PullGitCommits(PullGitCommitsRequest) returns (google.protobuf.Empty) {
190    option (google.api.http) = {
191      post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:pull"
192      body: "*"
193    };
194  }
195
196  // Pushes Git commits from a Workspace to the Repository's remote.
197  rpc PushGitCommits(PushGitCommitsRequest) returns (google.protobuf.Empty) {
198    option (google.api.http) = {
199      post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:push"
200      body: "*"
201    };
202  }
203
204  // Fetches Git statuses for the files in a Workspace.
205  rpc FetchFileGitStatuses(FetchFileGitStatusesRequest)
206      returns (FetchFileGitStatusesResponse) {
207    option (google.api.http) = {
208      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileGitStatuses"
209    };
210  }
211
212  // Fetches Git ahead/behind against a remote branch.
213  rpc FetchGitAheadBehind(FetchGitAheadBehindRequest)
214      returns (FetchGitAheadBehindResponse) {
215    option (google.api.http) = {
216      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind"
217    };
218  }
219
220  // Applies a Git commit for uncommitted files in a Workspace.
221  rpc CommitWorkspaceChanges(CommitWorkspaceChangesRequest)
222      returns (google.protobuf.Empty) {
223    option (google.api.http) = {
224      post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:commit"
225      body: "*"
226    };
227  }
228
229  // Performs a Git reset for uncommitted files in a Workspace.
230  rpc ResetWorkspaceChanges(ResetWorkspaceChangesRequest)
231      returns (google.protobuf.Empty) {
232    option (google.api.http) = {
233      post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:reset"
234      body: "*"
235    };
236  }
237
238  // Fetches Git diff for an uncommitted file in a Workspace.
239  rpc FetchFileDiff(FetchFileDiffRequest) returns (FetchFileDiffResponse) {
240    option (google.api.http) = {
241      get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileDiff"
242    };
243  }
244
245  // Returns the contents of a given Workspace directory.
246  rpc QueryDirectoryContents(QueryDirectoryContentsRequest)
247      returns (QueryDirectoryContentsResponse) {
248    option (google.api.http) = {
249      get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents"
250    };
251  }
252
253  // Creates a directory inside a Workspace.
254  rpc MakeDirectory(MakeDirectoryRequest) returns (MakeDirectoryResponse) {
255    option (google.api.http) = {
256      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:makeDirectory"
257      body: "*"
258    };
259  }
260
261  // Deletes a directory (inside a Workspace) and all of its contents.
262  rpc RemoveDirectory(RemoveDirectoryRequest) returns (google.protobuf.Empty) {
263    option (google.api.http) = {
264      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeDirectory"
265      body: "*"
266    };
267  }
268
269  // Moves a directory (inside a Workspace), and all of its contents, to a new
270  // location.
271  rpc MoveDirectory(MoveDirectoryRequest) returns (MoveDirectoryResponse) {
272    option (google.api.http) = {
273      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveDirectory"
274      body: "*"
275    };
276  }
277
278  // Returns the contents of a file (inside a Workspace).
279  rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) {
280    option (google.api.http) = {
281      get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile"
282    };
283  }
284
285  // Deletes a file (inside a Workspace).
286  rpc RemoveFile(RemoveFileRequest) returns (google.protobuf.Empty) {
287    option (google.api.http) = {
288      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeFile"
289      body: "*"
290    };
291  }
292
293  // Moves a file (inside a Workspace) to a new location.
294  rpc MoveFile(MoveFileRequest) returns (MoveFileResponse) {
295    option (google.api.http) = {
296      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveFile"
297      body: "*"
298    };
299  }
300
301  // Writes to a file (inside a Workspace).
302  rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) {
303    option (google.api.http) = {
304      post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:writeFile"
305      body: "*"
306    };
307  }
308
309  // Lists ReleaseConfigs in a given Repository.
310  rpc ListReleaseConfigs(ListReleaseConfigsRequest)
311      returns (ListReleaseConfigsResponse) {
312    option (google.api.http) = {
313      get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/releaseConfigs"
314    };
315    option (google.api.method_signature) = "parent";
316  }
317
318  // Fetches a single ReleaseConfig.
319  rpc GetReleaseConfig(GetReleaseConfigRequest) returns (ReleaseConfig) {
320    option (google.api.http) = {
321      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/releaseConfigs/*}"
322    };
323    option (google.api.method_signature) = "name";
324  }
325
326  // Creates a new ReleaseConfig in a given Repository.
327  rpc CreateReleaseConfig(CreateReleaseConfigRequest) returns (ReleaseConfig) {
328    option (google.api.http) = {
329      post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/releaseConfigs"
330      body: "release_config"
331    };
332    option (google.api.method_signature) =
333        "parent,release_config,release_config_id";
334  }
335
336  // Updates a single ReleaseConfig.
337  rpc UpdateReleaseConfig(UpdateReleaseConfigRequest) returns (ReleaseConfig) {
338    option (google.api.http) = {
339      patch: "/v1beta1/{release_config.name=projects/*/locations/*/repositories/*/releaseConfigs/*}"
340      body: "release_config"
341    };
342    option (google.api.method_signature) = "release_config,update_mask";
343  }
344
345  // Deletes a single ReleaseConfig.
346  rpc DeleteReleaseConfig(DeleteReleaseConfigRequest)
347      returns (google.protobuf.Empty) {
348    option (google.api.http) = {
349      delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/releaseConfigs/*}"
350    };
351    option (google.api.method_signature) = "name";
352  }
353
354  // Lists CompilationResults in a given Repository.
355  rpc ListCompilationResults(ListCompilationResultsRequest)
356      returns (ListCompilationResultsResponse) {
357    option (google.api.http) = {
358      get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults"
359    };
360    option (google.api.method_signature) = "parent";
361  }
362
363  // Fetches a single CompilationResult.
364  rpc GetCompilationResult(GetCompilationResultRequest)
365      returns (CompilationResult) {
366    option (google.api.http) = {
367      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}"
368    };
369    option (google.api.method_signature) = "name";
370  }
371
372  // Creates a new CompilationResult in a given project and location.
373  rpc CreateCompilationResult(CreateCompilationResultRequest)
374      returns (CompilationResult) {
375    option (google.api.http) = {
376      post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults"
377      body: "compilation_result"
378    };
379    option (google.api.method_signature) = "parent,compilation_result";
380  }
381
382  // Returns CompilationResultActions in a given CompilationResult.
383  rpc QueryCompilationResultActions(QueryCompilationResultActionsRequest)
384      returns (QueryCompilationResultActionsResponse) {
385    option (google.api.http) = {
386      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}:query"
387    };
388  }
389
390  // Lists WorkflowConfigs in a given Repository.
391  rpc ListWorkflowConfigs(ListWorkflowConfigsRequest)
392      returns (ListWorkflowConfigsResponse) {
393    option (google.api.http) = {
394      get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowConfigs"
395    };
396    option (google.api.method_signature) = "parent";
397  }
398
399  // Fetches a single WorkflowConfig.
400  rpc GetWorkflowConfig(GetWorkflowConfigRequest) returns (WorkflowConfig) {
401    option (google.api.http) = {
402      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowConfigs/*}"
403    };
404    option (google.api.method_signature) = "name";
405  }
406
407  // Creates a new WorkflowConfig in a given Repository.
408  rpc CreateWorkflowConfig(CreateWorkflowConfigRequest)
409      returns (WorkflowConfig) {
410    option (google.api.http) = {
411      post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowConfigs"
412      body: "workflow_config"
413    };
414    option (google.api.method_signature) =
415        "parent,workflow_config,workflow_config_id";
416  }
417
418  // Updates a single WorkflowConfig.
419  rpc UpdateWorkflowConfig(UpdateWorkflowConfigRequest)
420      returns (WorkflowConfig) {
421    option (google.api.http) = {
422      patch: "/v1beta1/{workflow_config.name=projects/*/locations/*/repositories/*/workflowConfigs/*}"
423      body: "workflow_config"
424    };
425    option (google.api.method_signature) = "workflow_config,update_mask";
426  }
427
428  // Deletes a single WorkflowConfig.
429  rpc DeleteWorkflowConfig(DeleteWorkflowConfigRequest)
430      returns (google.protobuf.Empty) {
431    option (google.api.http) = {
432      delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowConfigs/*}"
433    };
434    option (google.api.method_signature) = "name";
435  }
436
437  // Lists WorkflowInvocations in a given Repository.
438  rpc ListWorkflowInvocations(ListWorkflowInvocationsRequest)
439      returns (ListWorkflowInvocationsResponse) {
440    option (google.api.http) = {
441      get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations"
442    };
443    option (google.api.method_signature) = "parent";
444  }
445
446  // Fetches a single WorkflowInvocation.
447  rpc GetWorkflowInvocation(GetWorkflowInvocationRequest)
448      returns (WorkflowInvocation) {
449    option (google.api.http) = {
450      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}"
451    };
452    option (google.api.method_signature) = "name";
453  }
454
455  // Creates a new WorkflowInvocation in a given Repository.
456  rpc CreateWorkflowInvocation(CreateWorkflowInvocationRequest)
457      returns (WorkflowInvocation) {
458    option (google.api.http) = {
459      post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations"
460      body: "workflow_invocation"
461    };
462    option (google.api.method_signature) = "parent,workflow_invocation";
463  }
464
465  // Deletes a single WorkflowInvocation.
466  rpc DeleteWorkflowInvocation(DeleteWorkflowInvocationRequest)
467      returns (google.protobuf.Empty) {
468    option (google.api.http) = {
469      delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}"
470    };
471    option (google.api.method_signature) = "name";
472  }
473
474  // Requests cancellation of a running WorkflowInvocation.
475  rpc CancelWorkflowInvocation(CancelWorkflowInvocationRequest)
476      returns (google.protobuf.Empty) {
477    option (google.api.http) = {
478      post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:cancel"
479      body: "*"
480    };
481  }
482
483  // Returns WorkflowInvocationActions in a given WorkflowInvocation.
484  rpc QueryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest)
485      returns (QueryWorkflowInvocationActionsResponse) {
486    option (google.api.http) = {
487      get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:query"
488    };
489  }
490}
491
492// Represents a Dataform Git repository.
493message Repository {
494  option (google.api.resource) = {
495    type: "dataform.googleapis.com/Repository"
496    pattern: "projects/{project}/locations/{location}/repositories/{repository}"
497  };
498
499  // Controls Git remote configuration for a repository.
500  message GitRemoteSettings {
501    // Configures fields for performing SSH authentication.
502    message SshAuthenticationConfig {
503      // Required. The name of the Secret Manager secret version to use as a
504      // ssh private key for Git operations.
505      // Must be in the format `projects/*/secrets/*/versions/*`.
506      string user_private_key_secret_version = 1 [
507        (google.api.field_behavior) = REQUIRED,
508        (google.api.resource_reference) = {
509          type: "secretmanager.googleapis.com/SecretVersion"
510        }
511      ];
512
513      // Required. Content of a public SSH key to verify an identity of a remote
514      // Git host.
515      string host_public_key = 2 [(google.api.field_behavior) = REQUIRED];
516    }
517
518    enum TokenStatus {
519      // Default value. This value is unused.
520      TOKEN_STATUS_UNSPECIFIED = 0;
521
522      // The token could not be found in Secret Manager (or the Dataform
523      // Service Account did not have permission to access it).
524      NOT_FOUND = 1;
525
526      // The token could not be used to authenticate against the Git remote.
527      INVALID = 2;
528
529      // The token was used successfully to authenticate against the Git remote.
530      VALID = 3;
531    }
532
533    // Required. The Git remote's URL.
534    string url = 1 [(google.api.field_behavior) = REQUIRED];
535
536    // Required. The Git remote's default branch name.
537    string default_branch = 2 [(google.api.field_behavior) = REQUIRED];
538
539    // Optional. The name of the Secret Manager secret version to use as an
540    // authentication token for Git operations. Must be in the format
541    // `projects/*/secrets/*/versions/*`.
542    string authentication_token_secret_version = 3 [
543      (google.api.field_behavior) = OPTIONAL,
544      (google.api.resource_reference) = {
545        type: "secretmanager.googleapis.com/SecretVersion"
546      }
547    ];
548
549    // Optional. Authentication fields for remote uris using SSH protocol.
550    SshAuthenticationConfig ssh_authentication_config = 5
551        [(google.api.field_behavior) = OPTIONAL];
552
553    // Output only. Deprecated: The field does not contain any token status
554    // information. Instead use
555    // https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories/computeAccessTokenStatus
556    TokenStatus token_status = 4
557        [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
558  }
559
560  // Configures workspace compilation overrides for a repository.
561  // Primarily used by the UI (`console.cloud.google.com`).
562  // `schema_suffix` and `table_prefix` can have a special expression -
563  // `${workspaceName}`, which refers to the workspace name from which the
564  // compilation results will be created. API callers are expected to resolve
565  // the expression in these overrides and provide them explicitly in
566  // `code_compilation_config`
567  // (https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories.compilationResults#codecompilationconfig)
568  // when creating workspace-scoped compilation results.
569  message WorkspaceCompilationOverrides {
570    // Optional. The default database (Google Cloud project ID).
571    string default_database = 1 [(google.api.field_behavior) = OPTIONAL];
572
573    // Optional. The suffix that should be appended to all schema (BigQuery
574    // dataset ID) names.
575    string schema_suffix = 2 [(google.api.field_behavior) = OPTIONAL];
576
577    // Optional. The prefix that should be prepended to all table names.
578    string table_prefix = 3 [(google.api.field_behavior) = OPTIONAL];
579  }
580
581  // Output only. The repository's name.
582  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
583
584  // Optional. The repository's user-friendly name.
585  string display_name = 8 [(google.api.field_behavior) = OPTIONAL];
586
587  // Optional. If set, configures this repository to be linked to a Git remote.
588  GitRemoteSettings git_remote_settings = 2
589      [(google.api.field_behavior) = OPTIONAL];
590
591  // Optional. The name of the Secret Manager secret version to be used to
592  // interpolate variables into the .npmrc file for package installation
593  // operations. Must be in the format `projects/*/secrets/*/versions/*`. The
594  // file itself must be in a JSON format.
595  string npmrc_environment_variables_secret_version = 3 [
596    (google.api.field_behavior) = OPTIONAL,
597    (google.api.resource_reference) = {
598      type: "secretmanager.googleapis.com/SecretVersion"
599    }
600  ];
601
602  // Optional. If set, fields of `workspace_compilation_overrides` override the
603  // default compilation settings that are specified in dataform.json when
604  // creating workspace-scoped compilation results. See documentation for
605  // `WorkspaceCompilationOverrides` for more information.
606  WorkspaceCompilationOverrides workspace_compilation_overrides = 4
607      [(google.api.field_behavior) = OPTIONAL];
608
609  // Optional. Repository user labels.
610  map<string, string> labels = 5 [(google.api.field_behavior) = OPTIONAL];
611
612  // Optional. Input only. If set to true, the authenticated user will be
613  // granted the roles/dataform.admin role on the created repository. To modify
614  // access to the created repository later apply setIamPolicy from
615  // https://cloud.google.com/dataform/reference/rest#rest-resource:-v1beta1.projects.locations.repositories
616  bool set_authenticated_user_admin = 9 [
617    (google.api.field_behavior) = OPTIONAL,
618    (google.api.field_behavior) = INPUT_ONLY
619  ];
620
621  // Optional. The service account to run workflow invocations under.
622  string service_account = 10 [(google.api.field_behavior) = OPTIONAL];
623}
624
625// `ListRepositories` request message.
626message ListRepositoriesRequest {
627  // Required. The location in which to list repositories. Must be in the format
628  // `projects/*/locations/*`.
629  string parent = 1 [
630    (google.api.field_behavior) = REQUIRED,
631    (google.api.resource_reference) = {
632      type: "locations.googleapis.com/Location"
633    }
634  ];
635
636  // Optional. Maximum number of repositories to return. The server may return
637  // fewer items than requested. If unspecified, the server will pick an
638  // appropriate default.
639  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
640
641  // Optional. Page token received from a previous `ListRepositories` call.
642  // Provide this to retrieve the subsequent page.
643  //
644  // When paginating, all other parameters provided to `ListRepositories`
645  // must match the call that provided the page token.
646  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
647
648  // Optional. This field only supports ordering by `name`. If unspecified, the
649  // server will choose the ordering. If specified, the default order is
650  // ascending for the `name` field.
651  string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
652
653  // Optional. Filter for the returned list.
654  string filter = 5 [(google.api.field_behavior) = OPTIONAL];
655}
656
657// `ListRepositories` response message.
658message ListRepositoriesResponse {
659  // List of repositories.
660  repeated Repository repositories = 1;
661
662  // A token which can be sent as `page_token` to retrieve the next page.
663  // If this field is omitted, there are no subsequent pages.
664  string next_page_token = 2;
665
666  // Locations which could not be reached.
667  repeated string unreachable = 3;
668}
669
670// `GetRepository` request message.
671message GetRepositoryRequest {
672  // Required. The repository's name.
673  string name = 1 [
674    (google.api.field_behavior) = REQUIRED,
675    (google.api.resource_reference) = {
676      type: "dataform.googleapis.com/Repository"
677    }
678  ];
679}
680
681// `CreateRepository` request message.
682message CreateRepositoryRequest {
683  // Required. The location in which to create the repository. Must be in the
684  // format `projects/*/locations/*`.
685  string parent = 1 [
686    (google.api.field_behavior) = REQUIRED,
687    (google.api.resource_reference) = {
688      type: "locations.googleapis.com/Location"
689    }
690  ];
691
692  // Required. The repository to create.
693  Repository repository = 2 [(google.api.field_behavior) = REQUIRED];
694
695  // Required. The ID to use for the repository, which will become the final
696  // component of the repository's resource name.
697  string repository_id = 3 [(google.api.field_behavior) = REQUIRED];
698}
699
700// `UpdateRepository` request message.
701message UpdateRepositoryRequest {
702  // Optional. Specifies the fields to be updated in the repository. If left
703  // unset, all fields will be updated.
704  google.protobuf.FieldMask update_mask = 1
705      [(google.api.field_behavior) = OPTIONAL];
706
707  // Required. The repository to update.
708  Repository repository = 2 [(google.api.field_behavior) = REQUIRED];
709}
710
711// `DeleteRepository` request message.
712message DeleteRepositoryRequest {
713  // Required. The repository's name.
714  string name = 1 [
715    (google.api.field_behavior) = REQUIRED,
716    (google.api.resource_reference) = {
717      type: "dataform.googleapis.com/Repository"
718    }
719  ];
720
721  // If set to true, any child resources of this repository will also be
722  // deleted. (Otherwise, the request will only succeed if the repository has no
723  // child resources.)
724  bool force = 2;
725}
726
727// `CommitRepositoryChanges` request message.
728message CommitRepositoryChangesRequest {
729  // Represents a single file operation to the repository.
730  message FileOperation {
731    // Represents the write file operation (for files added or modified).
732    message WriteFile {
733      // The file's contents.
734      bytes contents = 1;
735    }
736
737    // Represents the delete file operation.
738    message DeleteFile {}
739
740    oneof operation {
741      // Represents the write operation.
742      WriteFile write_file = 1;
743
744      // Represents the delete operation.
745      DeleteFile delete_file = 2;
746    }
747  }
748
749  // Required. The repository's name.
750  string name = 1 [
751    (google.api.field_behavior) = REQUIRED,
752    (google.api.resource_reference) = {
753      type: "dataform.googleapis.com/Repository"
754    }
755  ];
756
757  // Required. The changes to commit to the repository.
758  CommitMetadata commit_metadata = 2 [(google.api.field_behavior) = REQUIRED];
759
760  // Optional. The commit SHA which must be the repository's current HEAD before
761  // applying this commit; otherwise this request will fail. If unset, no
762  // validation on the current HEAD commit SHA is performed.
763  string required_head_commit_sha = 4 [(google.api.field_behavior) = OPTIONAL];
764
765  // A map to the path of the file to the operation. The path is the full file
766  // path including filename, from repository root.
767  map<string, FileOperation> file_operations = 3;
768}
769
770// `ReadRepositoryFile` request message.
771message ReadRepositoryFileRequest {
772  // Required. The repository's name.
773  string name = 1 [
774    (google.api.field_behavior) = REQUIRED,
775    (google.api.resource_reference) = {
776      type: "dataform.googleapis.com/Repository"
777    }
778  ];
779
780  // Optional. The commit SHA for the commit to read from. If unset, the file
781  // will be read from HEAD.
782  string commit_sha = 2 [(google.api.field_behavior) = OPTIONAL];
783
784  // Required. Full file path to read including filename, from repository root.
785  string path = 3 [(google.api.field_behavior) = REQUIRED];
786}
787
788// `ReadRepositoryFile` response message.
789message ReadRepositoryFileResponse {
790  // The file's contents.
791  bytes contents = 1;
792}
793
794// `QueryRepositoryDirectoryContents` request message.
795message QueryRepositoryDirectoryContentsRequest {
796  // Required. The repository's name.
797  string name = 1 [
798    (google.api.field_behavior) = REQUIRED,
799    (google.api.resource_reference) = {
800      type: "dataform.googleapis.com/Repository"
801    }
802  ];
803
804  // Optional. The Commit SHA for the commit to query from. If unset, the
805  // directory will be queried from HEAD.
806  string commit_sha = 2 [(google.api.field_behavior) = OPTIONAL];
807
808  // Optional. The directory's full path including directory name, relative to
809  // root. If left unset, the root is used.
810  string path = 3 [(google.api.field_behavior) = OPTIONAL];
811
812  // Optional. Maximum number of paths to return. The server may return fewer
813  // items than requested. If unspecified, the server will pick an appropriate
814  // default.
815  int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL];
816
817  // Optional. Page token received from a previous
818  // `QueryRepositoryDirectoryContents` call. Provide this to retrieve the
819  // subsequent page.
820  //
821  // When paginating, all other parameters provided to
822  // `QueryRepositoryDirectoryContents` must match the call that provided the
823  // page token.
824  string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
825}
826
827// `QueryRepositoryDirectoryContents` response message.
828message QueryRepositoryDirectoryContentsResponse {
829  // List of entries in the directory.
830  repeated DirectoryEntry directory_entries = 1;
831
832  // A token, which can be sent as `page_token` to retrieve the next page.
833  // If this field is omitted, there are no subsequent pages.
834  string next_page_token = 2;
835}
836
837// `FetchRepositoryHistory` request message.
838message FetchRepositoryHistoryRequest {
839  // Required. The repository's name.
840  string name = 1 [
841    (google.api.field_behavior) = REQUIRED,
842    (google.api.resource_reference) = {
843      type: "dataform.googleapis.com/Repository"
844    }
845  ];
846
847  // Optional. Maximum number of commits to return. The server may return fewer
848  // items than requested. If unspecified, the server will pick an appropriate
849  // default.
850  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
851
852  // Optional. Page token received from a previous `FetchRepositoryHistory`
853  // call. Provide this to retrieve the subsequent page.
854  //
855  // When paginating, all other parameters provided to `FetchRepositoryHistory`
856  // must match the call that provided the page token.
857  string page_token = 5 [(google.api.field_behavior) = OPTIONAL];
858}
859
860// `FetchRepositoryHistory` response message.
861message FetchRepositoryHistoryResponse {
862  // A list of commit logs, ordered by 'git log' default order.
863  repeated CommitLogEntry commits = 1;
864
865  // A token, which can be sent as `page_token` to retrieve the next page.
866  // If this field is omitted, there are no subsequent pages.
867  string next_page_token = 2;
868}
869
870// Represents a single commit log.
871message CommitLogEntry {
872  // Commit timestamp.
873  google.protobuf.Timestamp commit_time = 1;
874
875  // The commit SHA for this commit log entry.
876  string commit_sha = 2;
877
878  // The commit author for this commit log entry.
879  CommitAuthor author = 3;
880
881  // The commit message for this commit log entry.
882  string commit_message = 4;
883}
884
885// Represents a Dataform Git commit.
886message CommitMetadata {
887  // Required. The commit's author.
888  CommitAuthor author = 1 [(google.api.field_behavior) = REQUIRED];
889
890  // Optional. The commit's message.
891  string commit_message = 2 [(google.api.field_behavior) = OPTIONAL];
892}
893
894// `ComputeRepositoryAccessTokenStatus` request message.
895message ComputeRepositoryAccessTokenStatusRequest {
896  // Required. The repository's name.
897  string name = 1 [
898    (google.api.field_behavior) = REQUIRED,
899    (google.api.resource_reference) = {
900      type: "dataform.googleapis.com/Repository"
901    }
902  ];
903}
904
905// `ComputeRepositoryAccessTokenStatus` response message.
906message ComputeRepositoryAccessTokenStatusResponse {
907  // Indicates the status of a Git authentication token.
908  enum TokenStatus {
909    // Default value. This value is unused.
910    TOKEN_STATUS_UNSPECIFIED = 0;
911
912    // The token could not be found in Secret Manager (or the Dataform
913    // Service Account did not have permission to access it).
914    NOT_FOUND = 1;
915
916    // The token could not be used to authenticate against the Git remote.
917    INVALID = 2;
918
919    // The token was used successfully to authenticate against the Git remote.
920    VALID = 3;
921  }
922
923  // Indicates the status of the Git access token.
924  TokenStatus token_status = 1;
925}
926
927// `FetchRemoteBranches` request message.
928message FetchRemoteBranchesRequest {
929  // Required. The repository's name.
930  string name = 1 [
931    (google.api.field_behavior) = REQUIRED,
932    (google.api.resource_reference) = {
933      type: "dataform.googleapis.com/Repository"
934    }
935  ];
936}
937
938// `FetchRemoteBranches` response message.
939message FetchRemoteBranchesResponse {
940  // The remote repository's branch names.
941  repeated string branches = 1;
942}
943
944// Represents a Dataform Git workspace.
945message Workspace {
946  option (google.api.resource) = {
947    type: "dataform.googleapis.com/Workspace"
948    pattern: "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}"
949  };
950
951  // Output only. The workspace's name.
952  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
953}
954
955// `ListWorkspaces` request message.
956message ListWorkspacesRequest {
957  // Required. The repository in which to list workspaces. Must be in the
958  // format `projects/*/locations/*/repositories/*`.
959  string parent = 1 [
960    (google.api.field_behavior) = REQUIRED,
961    (google.api.resource_reference) = {
962      type: "dataform.googleapis.com/Repository"
963    }
964  ];
965
966  // Optional. Maximum number of workspaces to return. The server may return
967  // fewer items than requested. If unspecified, the server will pick an
968  // appropriate default.
969  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
970
971  // Optional. Page token received from a previous `ListWorkspaces` call.
972  // Provide this to retrieve the subsequent page.
973  //
974  // When paginating, all other parameters provided to `ListWorkspaces`
975  // must match the call that provided the page token.
976  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
977
978  // Optional. This field only supports ordering by `name`. If unspecified, the
979  // server will choose the ordering. If specified, the default order is
980  // ascending for the `name` field.
981  string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
982
983  // Optional. Filter for the returned list.
984  string filter = 5 [(google.api.field_behavior) = OPTIONAL];
985}
986
987// `ListWorkspaces` response message.
988message ListWorkspacesResponse {
989  // List of workspaces.
990  repeated Workspace workspaces = 1;
991
992  // A token, which can be sent as `page_token` to retrieve the next page.
993  // If this field is omitted, there are no subsequent pages.
994  string next_page_token = 2;
995
996  // Locations which could not be reached.
997  repeated string unreachable = 3;
998}
999
1000// `GetWorkspace` request message.
1001message GetWorkspaceRequest {
1002  // Required. The workspace's name.
1003  string name = 1 [
1004    (google.api.field_behavior) = REQUIRED,
1005    (google.api.resource_reference) = {
1006      type: "dataform.googleapis.com/Workspace"
1007    }
1008  ];
1009}
1010
1011// `CreateWorkspace` request message.
1012message CreateWorkspaceRequest {
1013  // Required. The repository in which to create the workspace. Must be in the
1014  // format `projects/*/locations/*/repositories/*`.
1015  string parent = 1 [
1016    (google.api.field_behavior) = REQUIRED,
1017    (google.api.resource_reference) = {
1018      type: "dataform.googleapis.com/Repository"
1019    }
1020  ];
1021
1022  // Required. The workspace to create.
1023  Workspace workspace = 2 [(google.api.field_behavior) = REQUIRED];
1024
1025  // Required. The ID to use for the workspace, which will become the final
1026  // component of the workspace's resource name.
1027  string workspace_id = 3 [(google.api.field_behavior) = REQUIRED];
1028}
1029
1030// `DeleteWorkspace` request message.
1031message DeleteWorkspaceRequest {
1032  // Required. The workspace resource's name.
1033  string name = 1 [
1034    (google.api.field_behavior) = REQUIRED,
1035    (google.api.resource_reference) = {
1036      type: "dataform.googleapis.com/Workspace"
1037    }
1038  ];
1039}
1040
1041// Represents the author of a Git commit.
1042message CommitAuthor {
1043  // Required. The commit author's name.
1044  string name = 1 [(google.api.field_behavior) = REQUIRED];
1045
1046  // Required. The commit author's email address.
1047  string email_address = 2 [(google.api.field_behavior) = REQUIRED];
1048}
1049
1050// `PullGitCommits` request message.
1051message PullGitCommitsRequest {
1052  // Required. The workspace's name.
1053  string name = 1 [
1054    (google.api.field_behavior) = REQUIRED,
1055    (google.api.resource_reference) = {
1056      type: "dataform.googleapis.com/Workspace"
1057    }
1058  ];
1059
1060  // Optional. The name of the branch in the Git remote from which to pull
1061  // commits. If left unset, the repository's default branch name will be used.
1062  string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL];
1063
1064  // Required. The author of any merge commit which may be created as a result
1065  // of merging fetched Git commits into this workspace.
1066  CommitAuthor author = 3 [(google.api.field_behavior) = REQUIRED];
1067}
1068
1069// `PushGitCommits` request message.
1070message PushGitCommitsRequest {
1071  // Required. The workspace's name.
1072  string name = 1 [
1073    (google.api.field_behavior) = REQUIRED,
1074    (google.api.resource_reference) = {
1075      type: "dataform.googleapis.com/Workspace"
1076    }
1077  ];
1078
1079  // Optional. The name of the branch in the Git remote to which commits should
1080  // be pushed. If left unset, the repository's default branch name will be
1081  // used.
1082  string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL];
1083}
1084
1085// `FetchFileGitStatuses` request message.
1086message FetchFileGitStatusesRequest {
1087  // Required. The workspace's name.
1088  string name = 1 [
1089    (google.api.field_behavior) = REQUIRED,
1090    (google.api.resource_reference) = {
1091      type: "dataform.googleapis.com/Workspace"
1092    }
1093  ];
1094}
1095
1096// `FetchFileGitStatuses` response message.
1097message FetchFileGitStatusesResponse {
1098  // Represents the Git state of a file with uncommitted changes.
1099  message UncommittedFileChange {
1100    // Indicates the status of an uncommitted file change.
1101    enum State {
1102      // Default value. This value is unused.
1103      STATE_UNSPECIFIED = 0;
1104
1105      // The file has been newly added.
1106      ADDED = 1;
1107
1108      // The file has been deleted.
1109      DELETED = 2;
1110
1111      // The file has been modified.
1112      MODIFIED = 3;
1113
1114      // The file contains merge conflicts.
1115      HAS_CONFLICTS = 4;
1116    }
1117
1118    // The file's full path including filename, relative to the workspace root.
1119    string path = 1;
1120
1121    // Indicates the status of the file.
1122    State state = 2;
1123  }
1124
1125  // A list of all files which have uncommitted Git changes. There will only be
1126  // a single entry for any given file.
1127  repeated UncommittedFileChange uncommitted_file_changes = 1;
1128}
1129
1130// `FetchGitAheadBehind` request message.
1131message FetchGitAheadBehindRequest {
1132  // Required. The workspace's name.
1133  string name = 1 [
1134    (google.api.field_behavior) = REQUIRED,
1135    (google.api.resource_reference) = {
1136      type: "dataform.googleapis.com/Workspace"
1137    }
1138  ];
1139
1140  // Optional. The name of the branch in the Git remote against which this
1141  // workspace should be compared. If left unset, the repository's default
1142  // branch name will be used.
1143  string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL];
1144}
1145
1146// `FetchGitAheadBehind` response message.
1147message FetchGitAheadBehindResponse {
1148  // The number of commits in the remote branch that are not in the workspace.
1149  int32 commits_ahead = 1;
1150
1151  // The number of commits in the workspace that are not in the remote branch.
1152  int32 commits_behind = 2;
1153}
1154
1155// `CommitWorkspaceChanges` request message.
1156message CommitWorkspaceChangesRequest {
1157  // Required. The workspace's name.
1158  string name = 1 [
1159    (google.api.field_behavior) = REQUIRED,
1160    (google.api.resource_reference) = {
1161      type: "dataform.googleapis.com/Workspace"
1162    }
1163  ];
1164
1165  // Required. The commit's author.
1166  CommitAuthor author = 4 [(google.api.field_behavior) = REQUIRED];
1167
1168  // Optional. The commit's message.
1169  string commit_message = 2 [(google.api.field_behavior) = OPTIONAL];
1170
1171  // Optional. Full file paths to commit including filename, rooted at workspace
1172  // root. If left empty, all files will be committed.
1173  repeated string paths = 3 [(google.api.field_behavior) = OPTIONAL];
1174}
1175
1176// `ResetWorkspaceChanges` request message.
1177message ResetWorkspaceChangesRequest {
1178  // Required. The workspace's name.
1179  string name = 1 [
1180    (google.api.field_behavior) = REQUIRED,
1181    (google.api.resource_reference) = {
1182      type: "dataform.googleapis.com/Workspace"
1183    }
1184  ];
1185
1186  // Optional. Full file paths to reset back to their committed state including
1187  // filename, rooted at workspace root. If left empty, all files will be reset.
1188  repeated string paths = 2 [(google.api.field_behavior) = OPTIONAL];
1189
1190  // Optional. If set to true, untracked files will be deleted.
1191  bool clean = 3 [(google.api.field_behavior) = OPTIONAL];
1192}
1193
1194// `FetchFileDiff` request message.
1195message FetchFileDiffRequest {
1196  // Required. The workspace's name.
1197  string workspace = 1 [
1198    (google.api.field_behavior) = REQUIRED,
1199    (google.api.resource_reference) = {
1200      type: "dataform.googleapis.com/Workspace"
1201    }
1202  ];
1203
1204  // Required. The file's full path including filename, relative to the
1205  // workspace root.
1206  string path = 2 [(google.api.field_behavior) = REQUIRED];
1207}
1208
1209// `FetchFileDiff` response message.
1210message FetchFileDiffResponse {
1211  // The raw formatted Git diff for the file.
1212  string formatted_diff = 1;
1213}
1214
1215// `QueryDirectoryContents` request message.
1216message QueryDirectoryContentsRequest {
1217  // Required. The workspace's name.
1218  string workspace = 1 [
1219    (google.api.field_behavior) = REQUIRED,
1220    (google.api.resource_reference) = {
1221      type: "dataform.googleapis.com/Workspace"
1222    }
1223  ];
1224
1225  // Optional. The directory's full path including directory name, relative to
1226  // the workspace root. If left unset, the workspace root is used.
1227  string path = 2 [(google.api.field_behavior) = OPTIONAL];
1228
1229  // Optional. Maximum number of paths to return. The server may return fewer
1230  // items than requested. If unspecified, the server will pick an appropriate
1231  // default.
1232  int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
1233
1234  // Optional. Page token received from a previous `QueryDirectoryContents`
1235  // call. Provide this to retrieve the subsequent page.
1236  //
1237  // When paginating, all other parameters provided to
1238  // `QueryDirectoryContents` must match the call that provided the page
1239  // token.
1240  string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
1241}
1242
1243// `QueryDirectoryContents` response message.
1244message QueryDirectoryContentsResponse {
1245  // List of entries in the directory.
1246  repeated DirectoryEntry directory_entries = 1;
1247
1248  // A token, which can be sent as `page_token` to retrieve the next page.
1249  // If this field is omitted, there are no subsequent pages.
1250  string next_page_token = 2;
1251}
1252
1253// Represents a single entry in a directory.
1254message DirectoryEntry {
1255  oneof entry {
1256    // A file in the directory.
1257    string file = 1;
1258
1259    // A child directory in the directory.
1260    string directory = 2;
1261  }
1262}
1263
1264// `MakeDirectory` request message.
1265message MakeDirectoryRequest {
1266  // Required. The workspace's name.
1267  string workspace = 1 [
1268    (google.api.field_behavior) = REQUIRED,
1269    (google.api.resource_reference) = {
1270      type: "dataform.googleapis.com/Workspace"
1271    }
1272  ];
1273
1274  // Required. The directory's full path including directory name, relative to
1275  // the workspace root.
1276  string path = 2 [(google.api.field_behavior) = REQUIRED];
1277}
1278
1279// `MakeDirectory` response message.
1280message MakeDirectoryResponse {}
1281
1282// `RemoveDirectory` request message.
1283message RemoveDirectoryRequest {
1284  // Required. The workspace's name.
1285  string workspace = 1 [
1286    (google.api.field_behavior) = REQUIRED,
1287    (google.api.resource_reference) = {
1288      type: "dataform.googleapis.com/Workspace"
1289    }
1290  ];
1291
1292  // Required. The directory's full path including directory name, relative to
1293  // the workspace root.
1294  string path = 2 [(google.api.field_behavior) = REQUIRED];
1295}
1296
1297// `MoveDirectory` request message.
1298message MoveDirectoryRequest {
1299  // Required. The workspace's name.
1300  string workspace = 1 [
1301    (google.api.field_behavior) = REQUIRED,
1302    (google.api.resource_reference) = {
1303      type: "dataform.googleapis.com/Workspace"
1304    }
1305  ];
1306
1307  // Required. The directory's full path including directory name, relative to
1308  // the workspace root.
1309  string path = 2 [(google.api.field_behavior) = REQUIRED];
1310
1311  // Required. The new path for the directory including directory name, rooted
1312  // at workspace root.
1313  string new_path = 3 [(google.api.field_behavior) = REQUIRED];
1314}
1315
1316// `MoveDirectory` response message.
1317message MoveDirectoryResponse {}
1318
1319// `ReadFile` request message.
1320message ReadFileRequest {
1321  // Required. The workspace's name.
1322  string workspace = 1 [
1323    (google.api.field_behavior) = REQUIRED,
1324    (google.api.resource_reference) = {
1325      type: "dataform.googleapis.com/Workspace"
1326    }
1327  ];
1328
1329  // Required. The file's full path including filename, relative to the
1330  // workspace root.
1331  string path = 2 [(google.api.field_behavior) = REQUIRED];
1332}
1333
1334// `ReadFile` response message.
1335message ReadFileResponse {
1336  // The file's contents.
1337  bytes file_contents = 1;
1338}
1339
1340// `RemoveFile` request message.
1341message RemoveFileRequest {
1342  // Required. The workspace's name.
1343  string workspace = 1 [
1344    (google.api.field_behavior) = REQUIRED,
1345    (google.api.resource_reference) = {
1346      type: "dataform.googleapis.com/Workspace"
1347    }
1348  ];
1349
1350  // Required. The file's full path including filename, relative to the
1351  // workspace root.
1352  string path = 2 [(google.api.field_behavior) = REQUIRED];
1353}
1354
1355// `MoveFile` request message.
1356message MoveFileRequest {
1357  // Required. The workspace's name.
1358  string workspace = 1 [
1359    (google.api.field_behavior) = REQUIRED,
1360    (google.api.resource_reference) = {
1361      type: "dataform.googleapis.com/Workspace"
1362    }
1363  ];
1364
1365  // Required. The file's full path including filename, relative to the
1366  // workspace root.
1367  string path = 2 [(google.api.field_behavior) = REQUIRED];
1368
1369  // Required. The file's new path including filename, relative to the workspace
1370  // root.
1371  string new_path = 3 [(google.api.field_behavior) = REQUIRED];
1372}
1373
1374// `MoveFile` response message.
1375message MoveFileResponse {}
1376
1377// `WriteFile` request message.
1378message WriteFileRequest {
1379  // Required. The workspace's name.
1380  string workspace = 1 [
1381    (google.api.field_behavior) = REQUIRED,
1382    (google.api.resource_reference) = {
1383      type: "dataform.googleapis.com/Workspace"
1384    }
1385  ];
1386
1387  // Required. The file.
1388  string path = 2 [(google.api.field_behavior) = REQUIRED];
1389
1390  // Required. The file's contents.
1391  bytes contents = 3 [(google.api.field_behavior) = REQUIRED];
1392}
1393
1394// `WriteFile` response message.
1395message WriteFileResponse {}
1396
1397// `InstallNpmPackages` request message.
1398message InstallNpmPackagesRequest {
1399  // Required. The workspace's name.
1400  string workspace = 1 [
1401    (google.api.field_behavior) = REQUIRED,
1402    (google.api.resource_reference) = {
1403      type: "dataform.googleapis.com/Workspace"
1404    }
1405  ];
1406}
1407
1408// `InstallNpmPackages` response message.
1409message InstallNpmPackagesResponse {}
1410
1411// Represents a Dataform release configuration.
1412message ReleaseConfig {
1413  option (google.api.resource) = {
1414    type: "dataform.googleapis.com/ReleaseConfig"
1415    pattern: "projects/{project}/locations/{location}/repositories/{repository}/releaseConfigs/{release_config}"
1416  };
1417
1418  // A record of an attempt to create a compilation result for this release
1419  // config.
1420  message ScheduledReleaseRecord {
1421    // The timestamp of this release attempt.
1422    google.protobuf.Timestamp release_time = 1;
1423
1424    oneof result {
1425      // The name of the created compilation result, if one was successfully
1426      // created. Must be in the format
1427      // `projects/*/locations/*/repositories/*/compilationResults/*`.
1428      string compilation_result = 2 [(google.api.resource_reference) = {
1429        type: "dataform.googleapis.com/CompilationResult"
1430      }];
1431
1432      // The error status encountered upon this attempt to create the
1433      // compilation result, if the attempt was unsuccessful.
1434      google.rpc.Status error_status = 3;
1435    }
1436  }
1437
1438  // Output only. The release config's name.
1439  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1440
1441  // Required. Git commit/tag/branch name at which the repository should be
1442  // compiled. Must exist in the remote repository. Examples:
1443  // - a commit SHA: `12ade345`
1444  // - a tag: `tag1`
1445  // - a branch name: `branch1`
1446  string git_commitish = 2 [(google.api.field_behavior) = REQUIRED];
1447
1448  // Optional. If set, fields of `code_compilation_config` override the default
1449  // compilation settings that are specified in dataform.json.
1450  CodeCompilationConfig code_compilation_config = 3
1451      [(google.api.field_behavior) = OPTIONAL];
1452
1453  // Optional. Optional schedule (in cron format) for automatic creation of
1454  // compilation results.
1455  string cron_schedule = 4 [(google.api.field_behavior) = OPTIONAL];
1456
1457  // Optional. Specifies the time zone to be used when interpreting
1458  // cron_schedule. Must be a time zone name from the time zone database
1459  // (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left
1460  // unspecified, the default is UTC.
1461  string time_zone = 7 [(google.api.field_behavior) = OPTIONAL];
1462
1463  // Output only. Records of the 10 most recent scheduled release attempts,
1464  // ordered in in descending order of `release_time`. Updated whenever
1465  // automatic creation of a compilation result is triggered by cron_schedule.
1466  repeated ScheduledReleaseRecord recent_scheduled_release_records = 5
1467      [(google.api.field_behavior) = OUTPUT_ONLY];
1468
1469  // Optional. The name of the currently released compilation result for this
1470  // release config. This value is updated when a compilation result is created
1471  // from this release config, or when this resource is updated by API call
1472  // (perhaps to roll back to an earlier release). The compilation result must
1473  // have been created using this release config. Must be in the format
1474  // `projects/*/locations/*/repositories/*/compilationResults/*`.
1475  string release_compilation_result = 6 [
1476    (google.api.field_behavior) = OPTIONAL,
1477    (google.api.resource_reference) = {
1478      type: "dataform.googleapis.com/CompilationResult"
1479    }
1480  ];
1481}
1482
1483// `ListReleaseConfigs` request message.
1484message ListReleaseConfigsRequest {
1485  // Required. The repository in which to list release configs. Must be in the
1486  // format `projects/*/locations/*/repositories/*`.
1487  string parent = 1 [
1488    (google.api.field_behavior) = REQUIRED,
1489    (google.api.resource_reference) = {
1490      type: "dataform.googleapis.com/Repository"
1491    }
1492  ];
1493
1494  // Optional. Maximum number of release configs to return. The server may
1495  // return fewer items than requested. If unspecified, the server will pick an
1496  // appropriate default.
1497  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1498
1499  // Optional. Page token received from a previous `ListReleaseConfigs` call.
1500  // Provide this to retrieve the subsequent page.
1501  //
1502  // When paginating, all other parameters provided to `ListReleaseConfigs`
1503  // must match the call that provided the page token.
1504  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1505}
1506
1507// `ListReleaseConfigs` response message.
1508message ListReleaseConfigsResponse {
1509  // List of release configs.
1510  repeated ReleaseConfig release_configs = 1;
1511
1512  // A token, which can be sent as `page_token` to retrieve the next page.
1513  // If this field is omitted, there are no subsequent pages.
1514  string next_page_token = 2;
1515
1516  // Locations which could not be reached.
1517  repeated string unreachable = 3;
1518}
1519
1520// `GetReleaseConfig` request message.
1521message GetReleaseConfigRequest {
1522  // Required. The release config's name.
1523  string name = 1 [
1524    (google.api.field_behavior) = REQUIRED,
1525    (google.api.resource_reference) = {
1526      type: "dataform.googleapis.com/ReleaseConfig"
1527    }
1528  ];
1529}
1530
1531// `CreateReleaseConfig` request message.
1532message CreateReleaseConfigRequest {
1533  // Required. The repository in which to create the release config. Must be in
1534  // the format `projects/*/locations/*/repositories/*`.
1535  string parent = 1 [
1536    (google.api.field_behavior) = REQUIRED,
1537    (google.api.resource_reference) = {
1538      type: "dataform.googleapis.com/Repository"
1539    }
1540  ];
1541
1542  // Required. The release config to create.
1543  ReleaseConfig release_config = 2 [(google.api.field_behavior) = REQUIRED];
1544
1545  // Required. The ID to use for the release config, which will become the final
1546  // component of the release config's resource name.
1547  string release_config_id = 3 [(google.api.field_behavior) = REQUIRED];
1548}
1549
1550// `UpdateReleaseConfig` request message.
1551message UpdateReleaseConfigRequest {
1552  // Optional. Specifies the fields to be updated in the release config. If left
1553  // unset, all fields will be updated.
1554  google.protobuf.FieldMask update_mask = 1
1555      [(google.api.field_behavior) = OPTIONAL];
1556
1557  // Required. The release config to update.
1558  ReleaseConfig release_config = 2 [(google.api.field_behavior) = REQUIRED];
1559}
1560
1561// `DeleteReleaseConfig` request message.
1562message DeleteReleaseConfigRequest {
1563  // Required. The release config's name.
1564  string name = 1 [
1565    (google.api.field_behavior) = REQUIRED,
1566    (google.api.resource_reference) = {
1567      type: "dataform.googleapis.com/ReleaseConfig"
1568    }
1569  ];
1570}
1571
1572// Represents the result of compiling a Dataform project.
1573message CompilationResult {
1574  option (google.api.resource) = {
1575    type: "dataform.googleapis.com/CompilationResult"
1576    pattern: "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}"
1577  };
1578
1579  // An error encountered when attempting to compile a Dataform project.
1580  message CompilationError {
1581    // Output only. The error's top level message.
1582    string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1583
1584    // Output only. The error's full stack trace.
1585    string stack = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1586
1587    // Output only. The path of the file where this error occurred, if
1588    // available, relative to the project root.
1589    string path = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1590
1591    // Output only. The identifier of the action where this error occurred, if
1592    // available.
1593    Target action_target = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1594  }
1595
1596  // Output only. The compilation result's name.
1597  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1598
1599  oneof source {
1600    // Immutable. Git commit/tag/branch name at which the repository should be
1601    // compiled. Must exist in the remote repository. Examples:
1602    // - a commit SHA: `12ade345`
1603    // - a tag: `tag1`
1604    // - a branch name: `branch1`
1605    string git_commitish = 2 [(google.api.field_behavior) = IMMUTABLE];
1606
1607    // Immutable. The name of the workspace to compile. Must be in the format
1608    // `projects/*/locations/*/repositories/*/workspaces/*`.
1609    string workspace = 3 [
1610      (google.api.field_behavior) = IMMUTABLE,
1611      (google.api.resource_reference) = {
1612        type: "dataform.googleapis.com/Workspace"
1613      }
1614    ];
1615
1616    // Immutable. The name of the release config to compile. The release
1617    // config's 'current_compilation_result' field will be updated to this
1618    // compilation result. Must be in the format
1619    // `projects/*/locations/*/repositories/*/releaseConfigs/*`.
1620    string release_config = 7 [
1621      (google.api.field_behavior) = IMMUTABLE,
1622      (google.api.resource_reference) = {
1623        type: "dataform.googleapis.com/ReleaseConfig"
1624      }
1625    ];
1626  }
1627
1628  // Immutable. If set, fields of `code_compilation_config` override the default
1629  // compilation settings that are specified in dataform.json.
1630  CodeCompilationConfig code_compilation_config = 4
1631      [(google.api.field_behavior) = IMMUTABLE];
1632
1633  // Output only. The fully resolved Git commit SHA of the code that was
1634  // compiled. Not set for compilation results whose source is a workspace.
1635  string resolved_git_commit_sha = 8
1636      [(google.api.field_behavior) = OUTPUT_ONLY];
1637
1638  // Output only. The version of `@dataform/core` that was used for compilation.
1639  string dataform_core_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
1640
1641  // Output only. Errors encountered during project compilation.
1642  repeated CompilationError compilation_errors = 6
1643      [(google.api.field_behavior) = OUTPUT_ONLY];
1644}
1645
1646// Configures various aspects of Dataform code compilation.
1647message CodeCompilationConfig {
1648  // Optional. The default database (Google Cloud project ID).
1649  string default_database = 1 [(google.api.field_behavior) = OPTIONAL];
1650
1651  // Optional. The default schema (BigQuery dataset ID).
1652  string default_schema = 2 [(google.api.field_behavior) = OPTIONAL];
1653
1654  // Optional. The default BigQuery location to use. Defaults to "US".
1655  // See the BigQuery docs for a full list of locations:
1656  // https://cloud.google.com/bigquery/docs/locations.
1657  string default_location = 8 [(google.api.field_behavior) = OPTIONAL];
1658
1659  // Optional. The default schema (BigQuery dataset ID) for assertions.
1660  string assertion_schema = 3 [(google.api.field_behavior) = OPTIONAL];
1661
1662  // Optional. User-defined variables that are made available to project code
1663  // during compilation.
1664  map<string, string> vars = 4 [(google.api.field_behavior) = OPTIONAL];
1665
1666  // Optional. The suffix that should be appended to all database (Google Cloud
1667  // project ID) names.
1668  string database_suffix = 5 [(google.api.field_behavior) = OPTIONAL];
1669
1670  // Optional. The suffix that should be appended to all schema (BigQuery
1671  // dataset ID) names.
1672  string schema_suffix = 6 [(google.api.field_behavior) = OPTIONAL];
1673
1674  // Optional. The prefix that should be prepended to all table names.
1675  string table_prefix = 7 [(google.api.field_behavior) = OPTIONAL];
1676}
1677
1678// `ListCompilationResults` request message.
1679message ListCompilationResultsRequest {
1680  // Required. The repository in which to list compilation results. Must be in
1681  // the format `projects/*/locations/*/repositories/*`.
1682  string parent = 1 [
1683    (google.api.field_behavior) = REQUIRED,
1684    (google.api.resource_reference) = {
1685      type: "dataform.googleapis.com/Repository"
1686    }
1687  ];
1688
1689  // Optional. Maximum number of compilation results to return. The server may
1690  // return fewer items than requested. If unspecified, the server will pick an
1691  // appropriate default.
1692  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1693
1694  // Optional. Page token received from a previous `ListCompilationResults`
1695  // call. Provide this to retrieve the subsequent page.
1696  //
1697  // When paginating, all other parameters provided to `ListCompilationResults`
1698  // must match the call that provided the page token.
1699  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1700}
1701
1702// `ListCompilationResults` response message.
1703message ListCompilationResultsResponse {
1704  // List of compilation results.
1705  repeated CompilationResult compilation_results = 1;
1706
1707  // A token, which can be sent as `page_token` to retrieve the next page.
1708  // If this field is omitted, there are no subsequent pages.
1709  string next_page_token = 2;
1710
1711  // Locations which could not be reached.
1712  repeated string unreachable = 3;
1713}
1714
1715// `GetCompilationResult` request message.
1716message GetCompilationResultRequest {
1717  // Required. The compilation result's name.
1718  string name = 1 [
1719    (google.api.field_behavior) = REQUIRED,
1720    (google.api.resource_reference) = {
1721      type: "dataform.googleapis.com/CompilationResult"
1722    }
1723  ];
1724}
1725
1726// `CreateCompilationResult` request message.
1727message CreateCompilationResultRequest {
1728  // Required. The repository in which to create the compilation result. Must be
1729  // in the format `projects/*/locations/*/repositories/*`.
1730  string parent = 1 [
1731    (google.api.field_behavior) = REQUIRED,
1732    (google.api.resource_reference) = {
1733      type: "dataform.googleapis.com/Repository"
1734    }
1735  ];
1736
1737  // Required. The compilation result to create.
1738  CompilationResult compilation_result = 2
1739      [(google.api.field_behavior) = REQUIRED];
1740}
1741
1742// Represents an action identifier. If the action writes output, the output
1743// will be written to the referenced database object.
1744message Target {
1745  // The action's database (Google Cloud project ID) .
1746  string database = 1;
1747
1748  // The action's schema (BigQuery dataset ID), within `database`.
1749  string schema = 2;
1750
1751  // The action's name, within `database` and `schema`.
1752  string name = 3;
1753}
1754
1755// Describes a relation and its columns.
1756message RelationDescriptor {
1757  // Describes a column.
1758  message ColumnDescriptor {
1759    // The identifier for the column. Each entry in `path` represents one level
1760    // of nesting.
1761    repeated string path = 1;
1762
1763    // A textual description of the column.
1764    string description = 2;
1765
1766    // A list of BigQuery policy tags that will be applied to the column.
1767    repeated string bigquery_policy_tags = 3;
1768  }
1769
1770  // A text description of the relation.
1771  string description = 1;
1772
1773  // A list of descriptions of columns within the relation.
1774  repeated ColumnDescriptor columns = 2;
1775
1776  // A set of BigQuery labels that should be applied to the relation.
1777  map<string, string> bigquery_labels = 3;
1778}
1779
1780// Represents a single Dataform action in a compilation result.
1781message CompilationResultAction {
1782  // Represents a database relation.
1783  message Relation {
1784    // Indicates the type of this relation.
1785    enum RelationType {
1786      // Default value. This value is unused.
1787      RELATION_TYPE_UNSPECIFIED = 0;
1788
1789      // The relation is a table.
1790      TABLE = 1;
1791
1792      // The relation is a view.
1793      VIEW = 2;
1794
1795      // The relation is an incrementalized table.
1796      INCREMENTAL_TABLE = 3;
1797
1798      // The relation is a materialized view.
1799      MATERIALIZED_VIEW = 4;
1800    }
1801
1802    // Contains settings for relations of type `INCREMENTAL_TABLE`.
1803    message IncrementalTableConfig {
1804      // The SELECT query which returns rows which should be inserted into the
1805      // relation if it already exists and is not being refreshed.
1806      string incremental_select_query = 1;
1807
1808      // Whether this table should be protected from being refreshed.
1809      bool refresh_disabled = 2;
1810
1811      // A set of columns or SQL expressions used to define row uniqueness.
1812      // If any duplicates are discovered (as defined by `unique_key_parts`),
1813      // only the newly selected rows (as defined by `incremental_select_query`)
1814      // will be included in the relation.
1815      repeated string unique_key_parts = 3;
1816
1817      // A SQL expression conditional used to limit the set of existing rows
1818      // considered for a merge operation (see `unique_key_parts` for more
1819      // information).
1820      string update_partition_filter = 4;
1821
1822      // SQL statements to be executed before inserting new rows into the
1823      // relation.
1824      repeated string incremental_pre_operations = 5;
1825
1826      // SQL statements to be executed after inserting new rows into the
1827      // relation.
1828      repeated string incremental_post_operations = 6;
1829    }
1830
1831    // A list of actions that this action depends on.
1832    repeated Target dependency_targets = 1;
1833
1834    // Whether this action is disabled (i.e. should not be run).
1835    bool disabled = 2;
1836
1837    // Arbitrary, user-defined tags on this action.
1838    repeated string tags = 3;
1839
1840    // Descriptor for the relation and its columns.
1841    RelationDescriptor relation_descriptor = 4;
1842
1843    // The type of this relation.
1844    RelationType relation_type = 5;
1845
1846    // The SELECT query which returns rows which this relation should contain.
1847    string select_query = 6;
1848
1849    // SQL statements to be executed before creating the relation.
1850    repeated string pre_operations = 7;
1851
1852    // SQL statements to be executed after creating the relation.
1853    repeated string post_operations = 8;
1854
1855    // Configures `INCREMENTAL_TABLE` settings for this relation. Only set if
1856    // `relation_type` is `INCREMENTAL_TABLE`.
1857    IncrementalTableConfig incremental_table_config = 9;
1858
1859    // The SQL expression used to partition the relation.
1860    string partition_expression = 10;
1861
1862    // A list of columns or SQL expressions used to cluster the table.
1863    repeated string cluster_expressions = 11;
1864
1865    // Sets the partition expiration in days.
1866    int32 partition_expiration_days = 12;
1867
1868    // Specifies whether queries on this table must include a predicate filter
1869    // that filters on the partitioning column.
1870    bool require_partition_filter = 13;
1871
1872    // Additional options that will be provided as key/value pairs into the
1873    // options clause of a create table/view statement. See
1874    // https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
1875    // for more information on which options are supported.
1876    map<string, string> additional_options = 14;
1877  }
1878
1879  // Represents a list of arbitrary database operations.
1880  message Operations {
1881    // A list of actions that this action depends on.
1882    repeated Target dependency_targets = 1;
1883
1884    // Whether this action is disabled (i.e. should not be run).
1885    bool disabled = 2;
1886
1887    // Arbitrary, user-defined tags on this action.
1888    repeated string tags = 3;
1889
1890    // Descriptor for any output relation and its columns. Only set if
1891    // `has_output` is true.
1892    RelationDescriptor relation_descriptor = 6;
1893
1894    // A list of arbitrary SQL statements that will be executed without
1895    // alteration.
1896    repeated string queries = 4;
1897
1898    // Whether these operations produce an output relation.
1899    bool has_output = 5;
1900  }
1901
1902  // Represents an assertion upon a SQL query which is required return zero
1903  // rows.
1904  message Assertion {
1905    // A list of actions that this action depends on.
1906    repeated Target dependency_targets = 1;
1907
1908    // The parent action of this assertion. Only set if this assertion was
1909    // automatically generated.
1910    Target parent_action = 5;
1911
1912    // Whether this action is disabled (i.e. should not be run).
1913    bool disabled = 2;
1914
1915    // Arbitrary, user-defined tags on this action.
1916    repeated string tags = 3;
1917
1918    // The SELECT query which must return zero rows in order for this assertion
1919    // to succeed.
1920    string select_query = 4;
1921
1922    // Descriptor for the assertion's automatically-generated view and its
1923    // columns.
1924    RelationDescriptor relation_descriptor = 6;
1925  }
1926
1927  // Represents a relation which is not managed by Dataform but which may be
1928  // referenced by Dataform actions.
1929  message Declaration {
1930    // Descriptor for the relation and its columns. Used as documentation only,
1931    // i.e. values here will result in no changes to the relation's metadata.
1932    RelationDescriptor relation_descriptor = 1;
1933  }
1934
1935  // This action's identifier. Unique within the compilation result.
1936  Target target = 1;
1937
1938  // The action's identifier if the project had been compiled without any
1939  // overrides configured. Unique within the compilation result.
1940  Target canonical_target = 2;
1941
1942  // The full path including filename in which this action is located, relative
1943  // to the workspace root.
1944  string file_path = 3;
1945
1946  oneof compiled_object {
1947    // The database relation created/updated by this action.
1948    Relation relation = 4;
1949
1950    // The database operations executed by this action.
1951    Operations operations = 5;
1952
1953    // The assertion executed by this action.
1954    Assertion assertion = 6;
1955
1956    // The declaration declared by this action.
1957    Declaration declaration = 7;
1958  }
1959}
1960
1961// `QueryCompilationResultActions` request message.
1962message QueryCompilationResultActionsRequest {
1963  // Required. The compilation result's name.
1964  string name = 1 [
1965    (google.api.field_behavior) = REQUIRED,
1966    (google.api.resource_reference) = {
1967      type: "dataform.googleapis.com/CompilationResult"
1968    }
1969  ];
1970
1971  // Optional. Maximum number of compilation results to return. The server may
1972  // return fewer items than requested. If unspecified, the server will pick an
1973  // appropriate default.
1974  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1975
1976  // Optional. Page token received from a previous
1977  // `QueryCompilationResultActions` call. Provide this to retrieve the
1978  // subsequent page.
1979  //
1980  // When paginating, all other parameters provided to
1981  // `QueryCompilationResultActions` must match the call that provided the page
1982  // token.
1983  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1984
1985  // Optional. Optional filter for the returned list. Filtering is only
1986  // currently supported on the `file_path` field.
1987  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
1988}
1989
1990// `QueryCompilationResultActions` response message.
1991message QueryCompilationResultActionsResponse {
1992  // List of compilation result actions.
1993  repeated CompilationResultAction compilation_result_actions = 1;
1994
1995  // A token, which can be sent as `page_token` to retrieve the next page.
1996  // If this field is omitted, there are no subsequent pages.
1997  string next_page_token = 2;
1998}
1999
2000// Represents a Dataform workflow configuration.
2001message WorkflowConfig {
2002  option (google.api.resource) = {
2003    type: "dataform.googleapis.com/WorkflowConfig"
2004    pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowConfigs/{workflow_config}"
2005  };
2006
2007  // A record of an attempt to create a workflow invocation for this workflow
2008  // config.
2009  message ScheduledExecutionRecord {
2010    // The timestamp of this execution attempt.
2011    google.protobuf.Timestamp execution_time = 1;
2012
2013    oneof result {
2014      // The name of the created workflow invocation, if one was successfully
2015      // created. Must be in the format
2016      // `projects/*/locations/*/repositories/*/workflowInvocations/*`.
2017      string workflow_invocation = 2 [(google.api.resource_reference) = {
2018        type: "dataform.googleapis.com/WorkflowInvocation"
2019      }];
2020
2021      // The error status encountered upon this attempt to create the
2022      // workflow invocation, if the attempt was unsuccessful.
2023      google.rpc.Status error_status = 3;
2024    }
2025  }
2026
2027  // Output only. The workflow config's name.
2028  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
2029
2030  // Required. The name of the release config whose release_compilation_result
2031  // should be executed. Must be in the format
2032  // `projects/*/locations/*/repositories/*/releaseConfigs/*`.
2033  string release_config = 2 [
2034    (google.api.field_behavior) = REQUIRED,
2035    (google.api.resource_reference) = {
2036      type: "dataform.googleapis.com/ReleaseConfig"
2037    }
2038  ];
2039
2040  // Optional. If left unset, a default InvocationConfig will be used.
2041  InvocationConfig invocation_config = 3
2042      [(google.api.field_behavior) = OPTIONAL];
2043
2044  // Optional. Optional schedule (in cron format) for automatic execution of
2045  // this workflow config.
2046  string cron_schedule = 4 [(google.api.field_behavior) = OPTIONAL];
2047
2048  // Optional. Specifies the time zone to be used when interpreting
2049  // cron_schedule. Must be a time zone name from the time zone database
2050  // (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left
2051  // unspecified, the default is UTC.
2052  string time_zone = 7 [(google.api.field_behavior) = OPTIONAL];
2053
2054  // Output only. Records of the 10 most recent scheduled execution attempts,
2055  // ordered in in descending order of `execution_time`. Updated whenever
2056  // automatic creation of a workflow invocation is triggered by cron_schedule.
2057  repeated ScheduledExecutionRecord recent_scheduled_execution_records = 5
2058      [(google.api.field_behavior) = OUTPUT_ONLY];
2059}
2060
2061// Includes various configuration options for a workflow invocation.
2062// If both `included_targets` and `included_tags` are unset, all actions
2063// will be included.
2064message InvocationConfig {
2065  // Optional. The set of action identifiers to include.
2066  repeated Target included_targets = 1 [(google.api.field_behavior) = OPTIONAL];
2067
2068  // Optional. The set of tags to include.
2069  repeated string included_tags = 2 [(google.api.field_behavior) = OPTIONAL];
2070
2071  // Optional. When set to true, transitive dependencies of included actions
2072  // will be executed.
2073  bool transitive_dependencies_included = 3
2074      [(google.api.field_behavior) = OPTIONAL];
2075
2076  // Optional. When set to true, transitive dependents of included actions will
2077  // be executed.
2078  bool transitive_dependents_included = 4
2079      [(google.api.field_behavior) = OPTIONAL];
2080
2081  // Optional. When set to true, any incremental tables will be fully refreshed.
2082  bool fully_refresh_incremental_tables_enabled = 5
2083      [(google.api.field_behavior) = OPTIONAL];
2084
2085  // Optional. The service account to run workflow invocations under.
2086  string service_account = 6 [(google.api.field_behavior) = OPTIONAL];
2087}
2088
2089// `ListWorkflowConfigs` request message.
2090message ListWorkflowConfigsRequest {
2091  // Required. The repository in which to list workflow configs. Must be in the
2092  // format `projects/*/locations/*/repositories/*`.
2093  string parent = 1 [
2094    (google.api.field_behavior) = REQUIRED,
2095    (google.api.resource_reference) = {
2096      type: "dataform.googleapis.com/Repository"
2097    }
2098  ];
2099
2100  // Optional. Maximum number of workflow configs to return. The server may
2101  // return fewer items than requested. If unspecified, the server will pick an
2102  // appropriate default.
2103  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
2104
2105  // Optional. Page token received from a previous `ListWorkflowConfigs` call.
2106  // Provide this to retrieve the subsequent page.
2107  //
2108  // When paginating, all other parameters provided to `ListWorkflowConfigs`
2109  // must match the call that provided the page token.
2110  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
2111}
2112
2113// `ListWorkflowConfigs` response message.
2114message ListWorkflowConfigsResponse {
2115  // List of workflow configs.
2116  repeated WorkflowConfig workflow_configs = 1;
2117
2118  // A token, which can be sent as `page_token` to retrieve the next page.
2119  // If this field is omitted, there are no subsequent pages.
2120  string next_page_token = 2;
2121
2122  // Locations which could not be reached.
2123  repeated string unreachable = 3;
2124}
2125
2126// `GetWorkflowConfig` request message.
2127message GetWorkflowConfigRequest {
2128  // Required. The workflow config's name.
2129  string name = 1 [
2130    (google.api.field_behavior) = REQUIRED,
2131    (google.api.resource_reference) = {
2132      type: "dataform.googleapis.com/WorkflowConfig"
2133    }
2134  ];
2135}
2136
2137// `CreateWorkflowConfig` request message.
2138message CreateWorkflowConfigRequest {
2139  // Required. The repository in which to create the workflow config. Must be in
2140  // the format `projects/*/locations/*/repositories/*`.
2141  string parent = 1 [
2142    (google.api.field_behavior) = REQUIRED,
2143    (google.api.resource_reference) = {
2144      type: "dataform.googleapis.com/Repository"
2145    }
2146  ];
2147
2148  // Required. The workflow config to create.
2149  WorkflowConfig workflow_config = 2 [(google.api.field_behavior) = REQUIRED];
2150
2151  // Required. The ID to use for the workflow config, which will become the
2152  // final component of the workflow config's resource name.
2153  string workflow_config_id = 3 [(google.api.field_behavior) = REQUIRED];
2154}
2155
2156// `UpdateWorkflowConfig` request message.
2157message UpdateWorkflowConfigRequest {
2158  // Optional. Specifies the fields to be updated in the workflow config. If
2159  // left unset, all fields will be updated.
2160  google.protobuf.FieldMask update_mask = 1
2161      [(google.api.field_behavior) = OPTIONAL];
2162
2163  // Required. The workflow config to update.
2164  WorkflowConfig workflow_config = 2 [(google.api.field_behavior) = REQUIRED];
2165}
2166
2167// `DeleteWorkflowConfig` request message.
2168message DeleteWorkflowConfigRequest {
2169  // Required. The workflow config's name.
2170  string name = 1 [
2171    (google.api.field_behavior) = REQUIRED,
2172    (google.api.resource_reference) = {
2173      type: "dataform.googleapis.com/WorkflowConfig"
2174    }
2175  ];
2176}
2177
2178// Represents a single invocation of a compilation result.
2179message WorkflowInvocation {
2180  option (google.api.resource) = {
2181    type: "dataform.googleapis.com/WorkflowInvocation"
2182    pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}"
2183  };
2184
2185  // Represents the current state of a workflow invocation.
2186  enum State {
2187    // Default value. This value is unused.
2188    STATE_UNSPECIFIED = 0;
2189
2190    // The workflow invocation is currently running.
2191    RUNNING = 1;
2192
2193    // The workflow invocation succeeded. A terminal state.
2194    SUCCEEDED = 2;
2195
2196    // The workflow invocation was cancelled. A terminal state.
2197    CANCELLED = 3;
2198
2199    // The workflow invocation failed. A terminal state.
2200    FAILED = 4;
2201
2202    // The workflow invocation is being cancelled, but some actions are still
2203    // running.
2204    CANCELING = 5;
2205  }
2206
2207  // Output only. The workflow invocation's name.
2208  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
2209
2210  oneof compilation_source {
2211    // Immutable. The name of the compilation result to use for this invocation.
2212    // Must be in the format
2213    // `projects/*/locations/*/repositories/*/compilationResults/*`.
2214    string compilation_result = 2 [
2215      (google.api.field_behavior) = IMMUTABLE,
2216      (google.api.resource_reference) = {
2217        type: "dataform.googleapis.com/CompilationResult"
2218      }
2219    ];
2220
2221    // Immutable. The name of the workflow config to invoke. Must be in the
2222    // format `projects/*/locations/*/repositories/*/workflowConfigs/*`.
2223    string workflow_config = 6 [
2224      (google.api.field_behavior) = IMMUTABLE,
2225      (google.api.resource_reference) = {
2226        type: "dataform.googleapis.com/WorkflowConfig"
2227      }
2228    ];
2229  }
2230
2231  // Immutable. If left unset, a default InvocationConfig will be used.
2232  InvocationConfig invocation_config = 3
2233      [(google.api.field_behavior) = IMMUTABLE];
2234
2235  // Output only. This workflow invocation's current state.
2236  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
2237
2238  // Output only. This workflow invocation's timing details.
2239  google.type.Interval invocation_timing = 5
2240      [(google.api.field_behavior) = OUTPUT_ONLY];
2241}
2242
2243// `ListWorkflowInvocations` request message.
2244message ListWorkflowInvocationsRequest {
2245  // Required. The parent resource of the WorkflowInvocation type. Must be in
2246  // the format `projects/*/locations/*/repositories/*`.
2247  string parent = 1 [
2248    (google.api.field_behavior) = REQUIRED,
2249    (google.api.resource_reference) = {
2250      type: "dataform.googleapis.com/Repository"
2251    }
2252  ];
2253
2254  // Optional. Maximum number of workflow invocations to return. The server may
2255  // return fewer items than requested. If unspecified, the server will pick an
2256  // appropriate default.
2257  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
2258
2259  // Optional. Page token received from a previous `ListWorkflowInvocations`
2260  // call. Provide this to retrieve the subsequent page.
2261  //
2262  // When paginating, all other parameters provided to `ListWorkflowInvocations`
2263  // must match the call that provided the page token.
2264  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
2265
2266  // Optional. This field only supports ordering by `name`. If unspecified, the
2267  // server will choose the ordering. If specified, the default order is
2268  // ascending for the `name` field.
2269  string order_by = 4 [(google.api.field_behavior) = OPTIONAL];
2270
2271  // Optional. Filter for the returned list.
2272  string filter = 5 [(google.api.field_behavior) = OPTIONAL];
2273}
2274
2275// `ListWorkflowInvocations` response message.
2276message ListWorkflowInvocationsResponse {
2277  // List of workflow invocations.
2278  repeated WorkflowInvocation workflow_invocations = 1;
2279
2280  // A token, which can be sent as `page_token` to retrieve the next page.
2281  // If this field is omitted, there are no subsequent pages.
2282  string next_page_token = 2;
2283
2284  // Locations which could not be reached.
2285  repeated string unreachable = 3;
2286}
2287
2288// `GetWorkflowInvocation` request message.
2289message GetWorkflowInvocationRequest {
2290  // Required. The workflow invocation resource's name.
2291  string name = 1 [
2292    (google.api.field_behavior) = REQUIRED,
2293    (google.api.resource_reference) = {
2294      type: "dataform.googleapis.com/WorkflowInvocation"
2295    }
2296  ];
2297}
2298
2299// `CreateWorkflowInvocation` request message.
2300message CreateWorkflowInvocationRequest {
2301  // Required. The repository in which to create the workflow invocation. Must
2302  // be in the format `projects/*/locations/*/repositories/*`.
2303  string parent = 1 [
2304    (google.api.field_behavior) = REQUIRED,
2305    (google.api.resource_reference) = {
2306      type: "dataform.googleapis.com/Repository"
2307    }
2308  ];
2309
2310  // Required. The workflow invocation resource to create.
2311  WorkflowInvocation workflow_invocation = 2
2312      [(google.api.field_behavior) = REQUIRED];
2313}
2314
2315// `DeleteWorkflowInvocation` request message.
2316message DeleteWorkflowInvocationRequest {
2317  // Required. The workflow invocation resource's name.
2318  string name = 1 [
2319    (google.api.field_behavior) = REQUIRED,
2320    (google.api.resource_reference) = {
2321      type: "dataform.googleapis.com/WorkflowInvocation"
2322    }
2323  ];
2324}
2325
2326// `CancelWorkflowInvocation` request message.
2327message CancelWorkflowInvocationRequest {
2328  // Required. The workflow invocation resource's name.
2329  string name = 1 [
2330    (google.api.field_behavior) = REQUIRED,
2331    (google.api.resource_reference) = {
2332      type: "dataform.googleapis.com/WorkflowInvocation"
2333    }
2334  ];
2335}
2336
2337// Represents a single action in a workflow invocation.
2338message WorkflowInvocationAction {
2339  // Represents the current state of a workflow invocation action.
2340  enum State {
2341    // The action has not yet been considered for invocation.
2342    PENDING = 0;
2343
2344    // The action is currently running.
2345    RUNNING = 1;
2346
2347    // Execution of the action was skipped because upstream dependencies did not
2348    // all complete successfully. A terminal state.
2349    SKIPPED = 2;
2350
2351    // Execution of the action was disabled as per the configuration of the
2352    // corresponding compilation result action. A terminal state.
2353    DISABLED = 3;
2354
2355    // The action succeeded. A terminal state.
2356    SUCCEEDED = 4;
2357
2358    // The action was cancelled. A terminal state.
2359    CANCELLED = 5;
2360
2361    // The action failed. A terminal state.
2362    FAILED = 6;
2363  }
2364
2365  // Represents a workflow action that will run against BigQuery.
2366  message BigQueryAction {
2367    // Output only. The generated BigQuery SQL script that will be executed.
2368    string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
2369  }
2370
2371  // Output only. This action's identifier. Unique within the workflow
2372  // invocation.
2373  Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
2374
2375  // Output only. The action's identifier if the project had been compiled
2376  // without any overrides configured. Unique within the compilation result.
2377  Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
2378
2379  // Output only. This action's current state.
2380  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
2381
2382  // Output only. If and only if action's state is FAILED a failure reason is
2383  // set.
2384  string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
2385
2386  // Output only. This action's timing details.
2387  // `start_time` will be set if the action is in [RUNNING, SUCCEEDED,
2388  // CANCELLED, FAILED] state.
2389  // `end_time` will be set if the action is in [SUCCEEDED, CANCELLED, FAILED]
2390  // state.
2391  google.type.Interval invocation_timing = 5
2392      [(google.api.field_behavior) = OUTPUT_ONLY];
2393
2394  // Output only. The workflow action's bigquery action details.
2395  BigQueryAction bigquery_action = 6
2396      [(google.api.field_behavior) = OUTPUT_ONLY];
2397}
2398
2399// `QueryWorkflowInvocationActions` request message.
2400message QueryWorkflowInvocationActionsRequest {
2401  // Required. The workflow invocation's name.
2402  string name = 1 [
2403    (google.api.field_behavior) = REQUIRED,
2404    (google.api.resource_reference) = {
2405      type: "dataform.googleapis.com/WorkflowInvocation"
2406    }
2407  ];
2408
2409  // Optional. Maximum number of workflow invocations to return. The server may
2410  // return fewer items than requested. If unspecified, the server will pick an
2411  // appropriate default.
2412  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
2413
2414  // Optional. Page token received from a previous
2415  // `QueryWorkflowInvocationActions` call. Provide this to retrieve the
2416  // subsequent page.
2417  //
2418  // When paginating, all other parameters provided to
2419  // `QueryWorkflowInvocationActions` must match the call that provided the page
2420  // token.
2421  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
2422}
2423
2424// `QueryWorkflowInvocationActions` response message.
2425message QueryWorkflowInvocationActionsResponse {
2426  // List of workflow invocation actions.
2427  repeated WorkflowInvocationAction workflow_invocation_actions = 1;
2428
2429  // A token, which can be sent as `page_token` to retrieve the next page.
2430  // If this field is omitted, there are no subsequent pages.
2431  string next_page_token = 2;
2432}
2433