xref: /aosp_15_r20/external/googleapis/google/cloud/bigquery/datatransfer/v1/datatransfer.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.bigquery.datatransfer.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/bigquery/datatransfer/v1/transfer.proto";
24import "google/protobuf/duration.proto";
25import "google/protobuf/empty.proto";
26import "google/protobuf/field_mask.proto";
27import "google/protobuf/timestamp.proto";
28import "google/protobuf/wrappers.proto";
29
30option csharp_namespace = "Google.Cloud.BigQuery.DataTransfer.V1";
31option go_package = "cloud.google.com/go/bigquery/datatransfer/apiv1/datatransferpb;datatransferpb";
32option java_multiple_files = true;
33option java_outer_classname = "DataTransferProto";
34option java_package = "com.google.cloud.bigquery.datatransfer.v1";
35option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
36option ruby_package = "Google::Cloud::Bigquery::DataTransfer::V1";
37
38// This API allows users to manage their data transfers into BigQuery.
39service DataTransferService {
40  option (google.api.default_host) = "bigquerydatatransfer.googleapis.com";
41  option (google.api.oauth_scopes) =
42      "https://www.googleapis.com/auth/cloud-platform";
43
44  // Retrieves a supported data source and returns its settings.
45  rpc GetDataSource(GetDataSourceRequest) returns (DataSource) {
46    option (google.api.http) = {
47      get: "/v1/{name=projects/*/locations/*/dataSources/*}"
48      additional_bindings { get: "/v1/{name=projects/*/dataSources/*}" }
49    };
50    option (google.api.method_signature) = "name";
51  }
52
53  // Lists supported data sources and returns their settings.
54  rpc ListDataSources(ListDataSourcesRequest)
55      returns (ListDataSourcesResponse) {
56    option (google.api.http) = {
57      get: "/v1/{parent=projects/*/locations/*}/dataSources"
58      additional_bindings { get: "/v1/{parent=projects/*}/dataSources" }
59    };
60    option (google.api.method_signature) = "parent";
61  }
62
63  // Creates a new data transfer configuration.
64  rpc CreateTransferConfig(CreateTransferConfigRequest)
65      returns (TransferConfig) {
66    option (google.api.http) = {
67      post: "/v1/{parent=projects/*/locations/*}/transferConfigs"
68      body: "transfer_config"
69      additional_bindings {
70        post: "/v1/{parent=projects/*}/transferConfigs"
71        body: "transfer_config"
72      }
73    };
74    option (google.api.method_signature) = "parent,transfer_config";
75  }
76
77  // Updates a data transfer configuration.
78  // All fields must be set, even if they are not updated.
79  rpc UpdateTransferConfig(UpdateTransferConfigRequest)
80      returns (TransferConfig) {
81    option (google.api.http) = {
82      patch: "/v1/{transfer_config.name=projects/*/locations/*/transferConfigs/*}"
83      body: "transfer_config"
84      additional_bindings {
85        patch: "/v1/{transfer_config.name=projects/*/transferConfigs/*}"
86        body: "transfer_config"
87      }
88    };
89    option (google.api.method_signature) = "transfer_config,update_mask";
90  }
91
92  // Deletes a data transfer configuration, including any associated transfer
93  // runs and logs.
94  rpc DeleteTransferConfig(DeleteTransferConfigRequest)
95      returns (google.protobuf.Empty) {
96    option (google.api.http) = {
97      delete: "/v1/{name=projects/*/locations/*/transferConfigs/*}"
98      additional_bindings { delete: "/v1/{name=projects/*/transferConfigs/*}" }
99    };
100    option (google.api.method_signature) = "name";
101  }
102
103  // Returns information about a data transfer config.
104  rpc GetTransferConfig(GetTransferConfigRequest) returns (TransferConfig) {
105    option (google.api.http) = {
106      get: "/v1/{name=projects/*/locations/*/transferConfigs/*}"
107      additional_bindings { get: "/v1/{name=projects/*/transferConfigs/*}" }
108    };
109    option (google.api.method_signature) = "name";
110  }
111
112  // Returns information about all transfer configs owned by a project in the
113  // specified location.
114  rpc ListTransferConfigs(ListTransferConfigsRequest)
115      returns (ListTransferConfigsResponse) {
116    option (google.api.http) = {
117      get: "/v1/{parent=projects/*/locations/*}/transferConfigs"
118      additional_bindings { get: "/v1/{parent=projects/*}/transferConfigs" }
119    };
120    option (google.api.method_signature) = "parent";
121  }
122
123  // Creates transfer runs for a time range [start_time, end_time].
124  // For each date - or whatever granularity the data source supports - in the
125  // range, one transfer run is created.
126  // Note that runs are created per UTC time in the time range.
127  // DEPRECATED: use StartManualTransferRuns instead.
128  rpc ScheduleTransferRuns(ScheduleTransferRunsRequest)
129      returns (ScheduleTransferRunsResponse) {
130    option deprecated = true;
131    option (google.api.http) = {
132      post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:scheduleRuns"
133      body: "*"
134      additional_bindings {
135        post: "/v1/{parent=projects/*/transferConfigs/*}:scheduleRuns"
136        body: "*"
137      }
138    };
139    option (google.api.method_signature) = "parent,start_time,end_time";
140  }
141
142  // Start manual transfer runs to be executed now with schedule_time equal to
143  // current time. The transfer runs can be created for a time range where the
144  // run_time is between start_time (inclusive) and end_time (exclusive), or for
145  // a specific run_time.
146  rpc StartManualTransferRuns(StartManualTransferRunsRequest)
147      returns (StartManualTransferRunsResponse) {
148    option (google.api.http) = {
149      post: "/v1/{parent=projects/*/locations/*/transferConfigs/*}:startManualRuns"
150      body: "*"
151      additional_bindings {
152        post: "/v1/{parent=projects/*/transferConfigs/*}:startManualRuns"
153        body: "*"
154      }
155    };
156  }
157
158  // Returns information about the particular transfer run.
159  rpc GetTransferRun(GetTransferRunRequest) returns (TransferRun) {
160    option (google.api.http) = {
161      get: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}"
162      additional_bindings {
163        get: "/v1/{name=projects/*/transferConfigs/*/runs/*}"
164      }
165    };
166    option (google.api.method_signature) = "name";
167  }
168
169  // Deletes the specified transfer run.
170  rpc DeleteTransferRun(DeleteTransferRunRequest)
171      returns (google.protobuf.Empty) {
172    option (google.api.http) = {
173      delete: "/v1/{name=projects/*/locations/*/transferConfigs/*/runs/*}"
174      additional_bindings {
175        delete: "/v1/{name=projects/*/transferConfigs/*/runs/*}"
176      }
177    };
178    option (google.api.method_signature) = "name";
179  }
180
181  // Returns information about running and completed transfer runs.
182  rpc ListTransferRuns(ListTransferRunsRequest)
183      returns (ListTransferRunsResponse) {
184    option (google.api.http) = {
185      get: "/v1/{parent=projects/*/locations/*/transferConfigs/*}/runs"
186      additional_bindings {
187        get: "/v1/{parent=projects/*/transferConfigs/*}/runs"
188      }
189    };
190    option (google.api.method_signature) = "parent";
191  }
192
193  // Returns log messages for the transfer run.
194  rpc ListTransferLogs(ListTransferLogsRequest)
195      returns (ListTransferLogsResponse) {
196    option (google.api.http) = {
197      get: "/v1/{parent=projects/*/locations/*/transferConfigs/*/runs/*}/transferLogs"
198      additional_bindings {
199        get: "/v1/{parent=projects/*/transferConfigs/*/runs/*}/transferLogs"
200      }
201    };
202    option (google.api.method_signature) = "parent";
203  }
204
205  // Returns true if valid credentials exist for the given data source and
206  // requesting user.
207  rpc CheckValidCreds(CheckValidCredsRequest)
208      returns (CheckValidCredsResponse) {
209    option (google.api.http) = {
210      post: "/v1/{name=projects/*/locations/*/dataSources/*}:checkValidCreds"
211      body: "*"
212      additional_bindings {
213        post: "/v1/{name=projects/*/dataSources/*}:checkValidCreds"
214        body: "*"
215      }
216    };
217    option (google.api.method_signature) = "name";
218  }
219
220  // Enroll data sources in a user project. This allows users to create transfer
221  // configurations for these data sources. They will also appear in the
222  // ListDataSources RPC and as such, will appear in the
223  // [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents
224  // can be found in the public guide for
225  // [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and
226  // [Data Transfer
227  // Service](https://cloud.google.com/bigquery/docs/working-with-transfers).
228  rpc EnrollDataSources(EnrollDataSourcesRequest)
229      returns (google.protobuf.Empty) {
230    option (google.api.http) = {
231      post: "/v1/{name=projects/*/locations/*}:enrollDataSources"
232      body: "*"
233      additional_bindings {
234        post: "/v1/{name=projects/*}:enrollDataSources"
235        body: "*"
236      }
237    };
238  }
239
240  // Unenroll data sources in a user project. This allows users to remove
241  // transfer configurations for these data sources. They will no longer appear
242  // in the ListDataSources RPC and will also no longer appear in the [BigQuery
243  // UI](https://console.cloud.google.com/bigquery). Data transfers
244  // configurations of unenrolled data sources will not be scheduled.
245  rpc UnenrollDataSources(UnenrollDataSourcesRequest)
246      returns (google.protobuf.Empty) {
247    option (google.api.http) = {
248      post: "/v1/{name=projects/*/locations/*}:unenrollDataSources"
249      body: "*"
250    };
251  }
252}
253
254// A parameter used to define custom fields in a data source definition.
255message DataSourceParameter {
256  // Parameter type.
257  enum Type {
258    // Type unspecified.
259    TYPE_UNSPECIFIED = 0;
260
261    // String parameter.
262    STRING = 1;
263
264    // Integer parameter (64-bits).
265    // Will be serialized to json as string.
266    INTEGER = 2;
267
268    // Double precision floating point parameter.
269    DOUBLE = 3;
270
271    // Boolean parameter.
272    BOOLEAN = 4;
273
274    // Deprecated. This field has no effect.
275    RECORD = 5;
276
277    // Page ID for a Google+ Page.
278    PLUS_PAGE = 6;
279
280    // List of strings parameter.
281    LIST = 7;
282  }
283
284  // Parameter identifier.
285  string param_id = 1;
286
287  // Parameter display name in the user interface.
288  string display_name = 2;
289
290  // Parameter description.
291  string description = 3;
292
293  // Parameter type.
294  Type type = 4;
295
296  // Is parameter required.
297  bool required = 5;
298
299  // Deprecated. This field has no effect.
300  bool repeated = 6;
301
302  // Regular expression which can be used for parameter validation.
303  string validation_regex = 7;
304
305  // All possible values for the parameter.
306  repeated string allowed_values = 8;
307
308  // For integer and double values specifies minimum allowed value.
309  google.protobuf.DoubleValue min_value = 9;
310
311  // For integer and double values specifies maximum allowed value.
312  google.protobuf.DoubleValue max_value = 10;
313
314  // Deprecated. This field has no effect.
315  repeated DataSourceParameter fields = 11;
316
317  // Description of the requirements for this field, in case the user input does
318  // not fulfill the regex pattern or min/max values.
319  string validation_description = 12;
320
321  // URL to a help document to further explain the naming requirements.
322  string validation_help_url = 13;
323
324  // Cannot be changed after initial creation.
325  bool immutable = 14;
326
327  // Deprecated. This field has no effect.
328  bool recurse = 15;
329
330  // If true, it should not be used in new transfers, and it should not be
331  // visible to users.
332  bool deprecated = 20;
333}
334
335// Defines the properties and custom parameters for a data source.
336message DataSource {
337  option (google.api.resource) = {
338    type: "bigquerydatatransfer.googleapis.com/DataSource"
339    pattern: "projects/{project}/dataSources/{data_source}"
340    pattern: "projects/{project}/locations/{location}/dataSources/{data_source}"
341  };
342
343  // The type of authorization needed for this data source.
344  enum AuthorizationType {
345    // Type unspecified.
346    AUTHORIZATION_TYPE_UNSPECIFIED = 0;
347
348    // Use OAuth 2 authorization codes that can be exchanged
349    // for a refresh token on the backend.
350    AUTHORIZATION_CODE = 1;
351
352    // Return an authorization code for a given Google+ page that can then be
353    // exchanged for a refresh token on the backend.
354    GOOGLE_PLUS_AUTHORIZATION_CODE = 2;
355
356    // Use First Party OAuth.
357    FIRST_PARTY_OAUTH = 3;
358  }
359
360  // Represents how the data source supports data auto refresh.
361  enum DataRefreshType {
362    // The data source won't support data auto refresh, which is default value.
363    DATA_REFRESH_TYPE_UNSPECIFIED = 0;
364
365    // The data source supports data auto refresh, and runs will be scheduled
366    // for the past few days. Does not allow custom values to be set for each
367    // transfer config.
368    SLIDING_WINDOW = 1;
369
370    // The data source supports data auto refresh, and runs will be scheduled
371    // for the past few days. Allows custom values to be set for each transfer
372    // config.
373    CUSTOM_SLIDING_WINDOW = 2;
374  }
375
376  // Output only. Data source resource name.
377  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
378
379  // Data source id.
380  string data_source_id = 2;
381
382  // User friendly data source name.
383  string display_name = 3;
384
385  // User friendly data source description string.
386  string description = 4;
387
388  // Data source client id which should be used to receive refresh token.
389  string client_id = 5;
390
391  // Api auth scopes for which refresh token needs to be obtained. These are
392  // scopes needed by a data source to prepare data and ingest them into
393  // BigQuery, e.g., https://www.googleapis.com/auth/bigquery
394  repeated string scopes = 6;
395
396  // Deprecated. This field has no effect.
397  TransferType transfer_type = 7 [deprecated = true];
398
399  // Deprecated. This field has no effect.
400  bool supports_multiple_transfers = 8 [deprecated = true];
401
402  // The number of seconds to wait for an update from the data source
403  // before the Data Transfer Service marks the transfer as FAILED.
404  int32 update_deadline_seconds = 9;
405
406  // Default data transfer schedule.
407  // Examples of valid schedules include:
408  // `1st,3rd monday of month 15:30`,
409  // `every wed,fri of jan,jun 13:15`, and
410  // `first sunday of quarter 00:00`.
411  string default_schedule = 10;
412
413  // Specifies whether the data source supports a user defined schedule, or
414  // operates on the default schedule.
415  // When set to `true`, user can override default schedule.
416  bool supports_custom_schedule = 11;
417
418  // Data source parameters.
419  repeated DataSourceParameter parameters = 12;
420
421  // Url for the help document for this data source.
422  string help_url = 13;
423
424  // Indicates the type of authorization.
425  AuthorizationType authorization_type = 14;
426
427  // Specifies whether the data source supports automatic data refresh for the
428  // past few days, and how it's supported.
429  // For some data sources, data might not be complete until a few days later,
430  // so it's useful to refresh data automatically.
431  DataRefreshType data_refresh_type = 15;
432
433  // Default data refresh window on days.
434  // Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`.
435  int32 default_data_refresh_window_days = 16;
436
437  // Disables backfilling and manual run scheduling
438  // for the data source.
439  bool manual_runs_disabled = 17;
440
441  // The minimum interval for scheduler to schedule runs.
442  google.protobuf.Duration minimum_schedule_interval = 18;
443}
444
445// A request to get data source info.
446message GetDataSourceRequest {
447  // Required. The field will contain name of the resource requested, for
448  // example: `projects/{project_id}/dataSources/{data_source_id}` or
449  // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
450  string name = 1 [
451    (google.api.field_behavior) = REQUIRED,
452    (google.api.resource_reference) = {
453      type: "bigquerydatatransfer.googleapis.com/DataSource"
454    }
455  ];
456}
457
458// Request to list supported data sources and their data transfer settings.
459message ListDataSourcesRequest {
460  // Required. The BigQuery project id for which data sources should be
461  // returned. Must be in the form: `projects/{project_id}` or
462  // `projects/{project_id}/locations/{location_id}`
463  string parent = 1 [
464    (google.api.field_behavior) = REQUIRED,
465    (google.api.resource_reference) = {
466      child_type: "bigquerydatatransfer.googleapis.com/DataSource"
467    }
468  ];
469
470  // Pagination token, which can be used to request a specific page
471  // of `ListDataSourcesRequest` list results. For multiple-page
472  // results, `ListDataSourcesResponse` outputs
473  // a `next_page` token, which can be used as the
474  // `page_token` value to request the next page of list results.
475  string page_token = 3;
476
477  // Page size. The default page size is the maximum value of 1000 results.
478  int32 page_size = 4;
479}
480
481// Returns list of supported data sources and their metadata.
482message ListDataSourcesResponse {
483  // List of supported data sources and their transfer settings.
484  repeated DataSource data_sources = 1;
485
486  // Output only. The next-pagination token. For multiple-page list results,
487  // this token can be used as the
488  // `ListDataSourcesRequest.page_token`
489  // to request the next page of list results.
490  string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
491}
492
493// A request to create a data transfer configuration. If new credentials are
494// needed for this transfer configuration, authorization info must be provided.
495// If authorization info is provided, the transfer configuration will be
496// associated with the user id corresponding to the authorization info.
497// Otherwise, the transfer configuration will be associated with the calling
498// user.
499message CreateTransferConfigRequest {
500  // Required. The BigQuery project id where the transfer configuration should
501  // be created. Must be in the format
502  // projects/{project_id}/locations/{location_id} or projects/{project_id}. If
503  // specified location and location of the destination bigquery dataset do not
504  // match - the request will fail.
505  string parent = 1 [
506    (google.api.field_behavior) = REQUIRED,
507    (google.api.resource_reference) = {
508      child_type: "bigquerydatatransfer.googleapis.com/TransferConfig"
509    }
510  ];
511
512  // Required. Data transfer configuration to create.
513  TransferConfig transfer_config = 2 [(google.api.field_behavior) = REQUIRED];
514
515  // Optional OAuth2 authorization code to use with this transfer configuration.
516  // This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
517  // and new credentials are needed, as indicated by `CheckValidCreds`. In order
518  // to obtain authorization_code, make a request to the following URL:
519  // <pre class="prettyprint" suppresswarning="true">
520  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
521  // </pre>
522  // * The <var>client_id</var> is the OAuth client_id of the a data source as
523  // returned by ListDataSources method.
524  // * <var>data_source_scopes</var> are the scopes returned by ListDataSources
525  // method.
526  //
527  // Note that this should not be set when `service_account_name` is used to
528  // create the transfer config.
529  string authorization_code = 3;
530
531  // Optional version info. This is required only if
532  // `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials
533  // are needed, as indicated by `CheckValidCreds`. In order to obtain version
534  // info, make a request to the following URL:
535  // <pre class="prettyprint" suppresswarning="true">
536  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
537  // </pre>
538  // * The <var>client_id</var> is the OAuth client_id of the a data source as
539  // returned by ListDataSources method.
540  // * <var>data_source_scopes</var> are the scopes returned by ListDataSources
541  // method.
542  //
543  // Note that this should not be set when `service_account_name` is used to
544  // create the transfer config.
545  string version_info = 5;
546
547  // Optional service account email. If this field is set, the transfer config
548  // will be created with this service account's credentials. It requires that
549  // the requesting user calling this API has permissions to act as this service
550  // account.
551  //
552  // Note that not all data sources support service account credentials when
553  // creating a transfer config. For the latest list of data sources, read about
554  // [using service
555  // accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
556  string service_account_name = 6;
557}
558
559// A request to update a transfer configuration. To update the user id of the
560// transfer configuration, authorization info needs to be provided.
561message UpdateTransferConfigRequest {
562  // Required. Data transfer configuration to create.
563  TransferConfig transfer_config = 1 [(google.api.field_behavior) = REQUIRED];
564
565  // Optional OAuth2 authorization code to use with this transfer configuration.
566  // This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
567  // and new credentials are needed, as indicated by `CheckValidCreds`. In order
568  // to obtain authorization_code, make a request to the following URL:
569  // <pre class="prettyprint" suppresswarning="true">
570  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
571  // </pre>
572  // * The <var>client_id</var> is the OAuth client_id of the a data source as
573  // returned by ListDataSources method.
574  // * <var>data_source_scopes</var> are the scopes returned by ListDataSources
575  // method.
576  //
577  // Note that this should not be set when `service_account_name` is used to
578  // update the transfer config.
579  string authorization_code = 3;
580
581  // Required. Required list of fields to be updated in this request.
582  google.protobuf.FieldMask update_mask = 4
583      [(google.api.field_behavior) = REQUIRED];
584
585  // Optional version info. This is required only if
586  // `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials
587  // are needed, as indicated by `CheckValidCreds`. In order to obtain version
588  // info, make a request to the following URL:
589  // <pre class="prettyprint" suppresswarning="true">
590  // https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=<var>client_id</var>&scope=<var>data_source_scopes</var>
591  // </pre>
592  // * The <var>client_id</var> is the OAuth client_id of the a data source as
593  // returned by ListDataSources method.
594  // * <var>data_source_scopes</var> are the scopes returned by ListDataSources
595  // method.
596  //
597  // Note that this should not be set when `service_account_name` is used to
598  // update the transfer config.
599  string version_info = 5;
600
601  // Optional service account email. If this field is set, the transfer config
602  // will be created with this service account's credentials. It requires that
603  // the requesting user calling this API has permissions to act as this service
604  // account.
605  //
606  // Note that not all data sources support service account credentials when
607  // creating a transfer config. For the latest list of data sources, read about
608  // [using service
609  // accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
610  string service_account_name = 6;
611}
612
613// A request to get data transfer information.
614message GetTransferConfigRequest {
615  // Required. The field will contain name of the resource requested, for
616  // example: `projects/{project_id}/transferConfigs/{config_id}` or
617  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
618  string name = 1 [
619    (google.api.field_behavior) = REQUIRED,
620    (google.api.resource_reference) = {
621      type: "bigquerydatatransfer.googleapis.com/TransferConfig"
622    }
623  ];
624}
625
626// A request to delete data transfer information. All associated transfer runs
627// and log messages will be deleted as well.
628message DeleteTransferConfigRequest {
629  // Required. The field will contain name of the resource requested, for
630  // example: `projects/{project_id}/transferConfigs/{config_id}` or
631  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
632  string name = 1 [
633    (google.api.field_behavior) = REQUIRED,
634    (google.api.resource_reference) = {
635      type: "bigquerydatatransfer.googleapis.com/TransferConfig"
636    }
637  ];
638}
639
640// A request to get data transfer run information.
641message GetTransferRunRequest {
642  // Required. The field will contain name of the resource requested, for
643  // example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
644  // or
645  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
646  string name = 1 [
647    (google.api.field_behavior) = REQUIRED,
648    (google.api.resource_reference) = {
649      type: "bigquerydatatransfer.googleapis.com/Run"
650    }
651  ];
652}
653
654// A request to delete data transfer run information.
655message DeleteTransferRunRequest {
656  // Required. The field will contain name of the resource requested, for
657  // example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
658  // or
659  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
660  string name = 1 [
661    (google.api.field_behavior) = REQUIRED,
662    (google.api.resource_reference) = {
663      type: "bigquerydatatransfer.googleapis.com/Run"
664    }
665  ];
666}
667
668// A request to list data transfers configured for a BigQuery project.
669message ListTransferConfigsRequest {
670  // Required. The BigQuery project id for which transfer configs
671  // should be returned: `projects/{project_id}` or
672  // `projects/{project_id}/locations/{location_id}`
673  string parent = 1 [
674    (google.api.field_behavior) = REQUIRED,
675    (google.api.resource_reference) = {
676      child_type: "bigquerydatatransfer.googleapis.com/TransferConfig"
677    }
678  ];
679
680  // When specified, only configurations of requested data sources are returned.
681  repeated string data_source_ids = 2;
682
683  // Pagination token, which can be used to request a specific page
684  // of `ListTransfersRequest` list results. For multiple-page
685  // results, `ListTransfersResponse` outputs
686  // a `next_page` token, which can be used as the
687  // `page_token` value to request the next page of list results.
688  string page_token = 3;
689
690  // Page size. The default page size is the maximum value of 1000 results.
691  int32 page_size = 4;
692}
693
694// The returned list of pipelines in the project.
695message ListTransferConfigsResponse {
696  // Output only. The stored pipeline transfer configurations.
697  repeated TransferConfig transfer_configs = 1
698      [(google.api.field_behavior) = OUTPUT_ONLY];
699
700  // Output only. The next-pagination token. For multiple-page list results,
701  // this token can be used as the
702  // `ListTransferConfigsRequest.page_token`
703  // to request the next page of list results.
704  string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
705}
706
707// A request to list data transfer runs.
708message ListTransferRunsRequest {
709  // Represents which runs should be pulled.
710  enum RunAttempt {
711    // All runs should be returned.
712    RUN_ATTEMPT_UNSPECIFIED = 0;
713
714    // Only latest run per day should be returned.
715    LATEST = 1;
716  }
717
718  // Required. Name of transfer configuration for which transfer runs should be
719  // retrieved. Format of transfer configuration resource name is:
720  // `projects/{project_id}/transferConfigs/{config_id}` or
721  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
722  string parent = 1 [
723    (google.api.field_behavior) = REQUIRED,
724    (google.api.resource_reference) = {
725      child_type: "bigquerydatatransfer.googleapis.com/Run"
726    }
727  ];
728
729  // When specified, only transfer runs with requested states are returned.
730  repeated TransferState states = 2;
731
732  // Pagination token, which can be used to request a specific page
733  // of `ListTransferRunsRequest` list results. For multiple-page
734  // results, `ListTransferRunsResponse` outputs
735  // a `next_page` token, which can be used as the
736  // `page_token` value to request the next page of list results.
737  string page_token = 3;
738
739  // Page size. The default page size is the maximum value of 1000 results.
740  int32 page_size = 4;
741
742  // Indicates how run attempts are to be pulled.
743  RunAttempt run_attempt = 5;
744}
745
746// The returned list of pipelines in the project.
747message ListTransferRunsResponse {
748  // Output only. The stored pipeline transfer runs.
749  repeated TransferRun transfer_runs = 1
750      [(google.api.field_behavior) = OUTPUT_ONLY];
751
752  // Output only. The next-pagination token. For multiple-page list results,
753  // this token can be used as the
754  // `ListTransferRunsRequest.page_token`
755  // to request the next page of list results.
756  string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
757}
758
759// A request to get user facing log messages associated with data transfer run.
760message ListTransferLogsRequest {
761  // Required. Transfer run name in the form:
762  // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
763  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
764  string parent = 1 [
765    (google.api.field_behavior) = REQUIRED,
766    (google.api.resource_reference) = {
767      type: "bigquerydatatransfer.googleapis.com/Run"
768    }
769  ];
770
771  // Pagination token, which can be used to request a specific page
772  // of `ListTransferLogsRequest` list results. For multiple-page
773  // results, `ListTransferLogsResponse` outputs
774  // a `next_page` token, which can be used as the
775  // `page_token` value to request the next page of list results.
776  string page_token = 4;
777
778  // Page size. The default page size is the maximum value of 1000 results.
779  int32 page_size = 5;
780
781  // Message types to return. If not populated - INFO, WARNING and ERROR
782  // messages are returned.
783  repeated TransferMessage.MessageSeverity message_types = 6;
784}
785
786// The returned list transfer run messages.
787message ListTransferLogsResponse {
788  // Output only. The stored pipeline transfer messages.
789  repeated TransferMessage transfer_messages = 1
790      [(google.api.field_behavior) = OUTPUT_ONLY];
791
792  // Output only. The next-pagination token. For multiple-page list results,
793  // this token can be used as the
794  // `GetTransferRunLogRequest.page_token`
795  // to request the next page of list results.
796  string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
797}
798
799// A request to determine whether the user has valid credentials. This method
800// is used to limit the number of OAuth popups in the user interface. The
801// user id is inferred from the API call context.
802// If the data source has the Google+ authorization type, this method
803// returns false, as it cannot be determined whether the credentials are
804// already valid merely based on the user id.
805message CheckValidCredsRequest {
806  // Required. The data source in the form:
807  // `projects/{project_id}/dataSources/{data_source_id}` or
808  // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
809  string name = 1 [
810    (google.api.field_behavior) = REQUIRED,
811    (google.api.resource_reference) = {
812      type: "bigquerydatatransfer.googleapis.com/DataSource"
813    }
814  ];
815}
816
817// A response indicating whether the credentials exist and are valid.
818message CheckValidCredsResponse {
819  // If set to `true`, the credentials exist and are valid.
820  bool has_valid_creds = 1;
821}
822
823// A request to schedule transfer runs for a time range.
824message ScheduleTransferRunsRequest {
825  // Required. Transfer configuration name in the form:
826  // `projects/{project_id}/transferConfigs/{config_id}` or
827  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
828  string parent = 1 [
829    (google.api.field_behavior) = REQUIRED,
830    (google.api.resource_reference) = {
831      type: "bigquerydatatransfer.googleapis.com/TransferConfig"
832    }
833  ];
834
835  // Required. Start time of the range of transfer runs. For example,
836  // `"2017-05-25T00:00:00+00:00"`.
837  google.protobuf.Timestamp start_time = 2
838      [(google.api.field_behavior) = REQUIRED];
839
840  // Required. End time of the range of transfer runs. For example,
841  // `"2017-05-30T00:00:00+00:00"`.
842  google.protobuf.Timestamp end_time = 3
843      [(google.api.field_behavior) = REQUIRED];
844}
845
846// A response to schedule transfer runs for a time range.
847message ScheduleTransferRunsResponse {
848  // The transfer runs that were scheduled.
849  repeated TransferRun runs = 1;
850}
851
852// A request to start manual transfer runs.
853message StartManualTransferRunsRequest {
854  // A specification for a time range, this will request transfer runs with
855  // run_time between start_time (inclusive) and end_time (exclusive).
856  message TimeRange {
857    // Start time of the range of transfer runs. For example,
858    // `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than
859    // the end_time. Creates transfer runs where run_time is in the range
860    // between start_time (inclusive) and end_time (exclusive).
861    google.protobuf.Timestamp start_time = 1;
862
863    // End time of the range of transfer runs. For example,
864    // `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future.
865    // Creates transfer runs where run_time is in the range between start_time
866    // (inclusive) and end_time (exclusive).
867    google.protobuf.Timestamp end_time = 2;
868  }
869
870  // Required. Transfer configuration name in the form:
871  // `projects/{project_id}/transferConfigs/{config_id}` or
872  // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
873  string parent = 1 [
874    (google.api.field_behavior) = REQUIRED,
875    (google.api.resource_reference) = {
876      type: "bigquerydatatransfer.googleapis.com/TransferConfig"
877    }
878  ];
879
880  // The requested time specification - this can be a time range or a specific
881  // run_time.
882  oneof time {
883    // A time_range start and end timestamp for historical data files or reports
884    // that are scheduled to be transferred by the scheduled transfer run.
885    // requested_time_range must be a past time and cannot include future time
886    // values.
887    TimeRange requested_time_range = 3;
888
889    // A run_time timestamp for historical data files or reports
890    // that are scheduled to be transferred by the scheduled transfer run.
891    // requested_run_time must be a past time and cannot include future time
892    // values.
893    google.protobuf.Timestamp requested_run_time = 4;
894  }
895}
896
897// A response to start manual transfer runs.
898message StartManualTransferRunsResponse {
899  // The transfer runs that were created.
900  repeated TransferRun runs = 1;
901}
902
903// A request to enroll a set of data sources so they are visible in the
904// BigQuery UI's `Transfer` tab.
905message EnrollDataSourcesRequest {
906  // Required. The name of the project resource in the form:
907  // `projects/{project_id}`
908  string name = 1 [(google.api.field_behavior) = REQUIRED];
909
910  // Data sources that are enrolled. It is required to provide at least one
911  // data source id.
912  repeated string data_source_ids = 2;
913}
914
915// A request to unenroll a set of data sources so they are no longer visible in
916// the BigQuery UI's `Transfer` tab.
917message UnenrollDataSourcesRequest {
918  // Required. The name of the project resource in the form:
919  // `projects/{project_id}`
920  string name = 1 [(google.api.field_behavior) = REQUIRED];
921
922  // Data sources that are unenrolled. It is required to provide at least one
923  // data source id.
924  repeated string data_source_ids = 2;
925}
926