google-cloud-bigquery-data_transfer 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,498 @@
1
+ # Copyright 2018 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
+ # https://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
+
15
+ module Google
16
+ module Cloud
17
+ module Bigquery
18
+ module Datatransfer
19
+ ##
20
+ # # BigQuery Data Transfer API Contents
21
+ #
22
+ # | Class | Description |
23
+ # | ----- | ----------- |
24
+ # | [DataTransferServiceClient][] | The Google BigQuery Data Transfer Service API enables BigQuery users to configure the transfer of their data from other Google Products into BigQuery. |
25
+ # | [Data Types][] | Data types for Google::Cloud::Bigquery::DataTransfer::V1 |
26
+ #
27
+ # [DataTransferServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-bigquery-data_transfer/latest/google/cloud/bigquery/datatransfer/v1/datatransferserviceclient
28
+ # [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-bigquery-data_transfer/latest/google/cloud/bigquery/datatransfer/v1/datatypes
29
+ #
30
+ module V1
31
+ # Represents a data source parameter with validation rules, so that
32
+ # parameters can be rendered in the UI. These parameters are given to us by
33
+ # supported data sources, and include all needed information for rendering
34
+ # and validation.
35
+ # Thus, whoever uses this api can decide to generate either generic ui,
36
+ # or custom data source specific forms.
37
+ # @!attribute [rw] param_id
38
+ # @return [String]
39
+ # Parameter identifier.
40
+ # @!attribute [rw] display_name
41
+ # @return [String]
42
+ # Parameter display name in the user interface.
43
+ # @!attribute [rw] description
44
+ # @return [String]
45
+ # Parameter description.
46
+ # @!attribute [rw] type
47
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::DataSourceParameter::Type]
48
+ # Parameter type.
49
+ # @!attribute [rw] required
50
+ # @return [true, false]
51
+ # Is parameter required.
52
+ # @!attribute [rw] repeated
53
+ # @return [true, false]
54
+ # Can parameter have multiple values.
55
+ # @!attribute [rw] validation_regex
56
+ # @return [String]
57
+ # Regular expression which can be used for parameter validation.
58
+ # @!attribute [rw] allowed_values
59
+ # @return [Array<String>]
60
+ # All possible values for the parameter.
61
+ # @!attribute [rw] min_value
62
+ # @return [Google::Protobuf::DoubleValue]
63
+ # For integer and double values specifies minimum allowed value.
64
+ # @!attribute [rw] max_value
65
+ # @return [Google::Protobuf::DoubleValue]
66
+ # For integer and double values specifies maxminum allowed value.
67
+ # @!attribute [rw] fields
68
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::DataSourceParameter>]
69
+ # When parameter is a record, describes child fields.
70
+ # @!attribute [rw] validation_description
71
+ # @return [String]
72
+ # Description of the requirements for this field, in case the user input does
73
+ # not fulfill the regex pattern or min/max values.
74
+ # @!attribute [rw] validation_help_url
75
+ # @return [String]
76
+ # URL to a help document to further explain the naming requirements.
77
+ # @!attribute [rw] immutable
78
+ # @return [true, false]
79
+ # Cannot be changed after initial creation.
80
+ # @!attribute [rw] recurse
81
+ # @return [true, false]
82
+ # If set to true, schema should be taken from the parent with the same
83
+ # parameter_id. Only applicable when parameter type is RECORD.
84
+ class DataSourceParameter
85
+ # Parameter type.
86
+ module Type
87
+ # Type unspecified.
88
+ TYPE_UNSPECIFIED = 0
89
+
90
+ # String parameter.
91
+ STRING = 1
92
+
93
+ # Integer parameter (64-bits).
94
+ # Will be serialized to json as string.
95
+ INTEGER = 2
96
+
97
+ # Double precision floating point parameter.
98
+ DOUBLE = 3
99
+
100
+ # Boolean parameter.
101
+ BOOLEAN = 4
102
+
103
+ # Record parameter.
104
+ RECORD = 5
105
+
106
+ # Page ID for a Google+ Page.
107
+ PLUS_PAGE = 6
108
+ end
109
+ end
110
+
111
+ # Represents data source metadata. Metadata is sufficient to
112
+ # render UI and request proper OAuth tokens.
113
+ # @!attribute [rw] name
114
+ # @return [String]
115
+ # Output only. Data source resource name.
116
+ # @!attribute [rw] data_source_id
117
+ # @return [String]
118
+ # Data source id.
119
+ # @!attribute [rw] display_name
120
+ # @return [String]
121
+ # User friendly data source name.
122
+ # @!attribute [rw] description
123
+ # @return [String]
124
+ # User friendly data source description string.
125
+ # @!attribute [rw] client_id
126
+ # @return [String]
127
+ # Data source client id which should be used to receive refresh token.
128
+ # When not supplied, no offline credentials are populated for data transfer.
129
+ # @!attribute [rw] scopes
130
+ # @return [Array<String>]
131
+ # Api auth scopes for which refresh token needs to be obtained. Only valid
132
+ # when +client_id+ is specified. Ignored otherwise. These are scopes needed
133
+ # by a data source to prepare data and ingest them into BigQuery,
134
+ # e.g., https://www.googleapis.com/auth/bigquery
135
+ # @!attribute [rw] transfer_type
136
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferType]
137
+ # Deprecated. This field has no effect.
138
+ # @!attribute [rw] supports_multiple_transfers
139
+ # @return [true, false]
140
+ # Indicates whether the data source supports multiple transfers
141
+ # to different BigQuery targets.
142
+ # @!attribute [rw] update_deadline_seconds
143
+ # @return [Integer]
144
+ # The number of seconds to wait for an update from the data source
145
+ # before BigQuery marks the transfer as failed.
146
+ # @!attribute [rw] default_schedule
147
+ # @return [String]
148
+ # Default data transfer schedule.
149
+ # Examples of valid schedules include:
150
+ # +1st,3rd monday of month 15:30+,
151
+ # +every wed,fri of jan,jun 13:15+, and
152
+ # +first sunday of quarter 00:00+.
153
+ # @!attribute [rw] supports_custom_schedule
154
+ # @return [true, false]
155
+ # Specifies whether the data source supports a user defined schedule, or
156
+ # operates on the default schedule.
157
+ # When set to +true+, user can override default schedule.
158
+ # @!attribute [rw] parameters
159
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::DataSourceParameter>]
160
+ # Data source parameters.
161
+ # @!attribute [rw] help_url
162
+ # @return [String]
163
+ # Url for the help document for this data source.
164
+ # @!attribute [rw] authorization_type
165
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::DataSource::AuthorizationType]
166
+ # Indicates the type of authorization.
167
+ # @!attribute [rw] data_refresh_type
168
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::DataSource::DataRefreshType]
169
+ # Specifies whether the data source supports automatic data refresh for the
170
+ # past few days, and how it's supported.
171
+ # For some data sources, data might not be complete until a few days later,
172
+ # so it's useful to refresh data automatically.
173
+ # @!attribute [rw] default_data_refresh_window_days
174
+ # @return [Integer]
175
+ # Default data refresh window on days.
176
+ # Only meaningful when +data_refresh_type+ = +SLIDING_WINDOW+.
177
+ # @!attribute [rw] manual_runs_disabled
178
+ # @return [true, false]
179
+ # Disables backfilling and manual run scheduling
180
+ # for the data source.
181
+ # @!attribute [rw] minimum_schedule_interval
182
+ # @return [Google::Protobuf::Duration]
183
+ # The minimum interval for scheduler to schedule runs.
184
+ class DataSource
185
+ # The type of authorization needed for this data source.
186
+ module AuthorizationType
187
+ # Type unspecified.
188
+ AUTHORIZATION_TYPE_UNSPECIFIED = 0
189
+
190
+ # Use OAuth 2 authorization codes that can be exchanged
191
+ # for a refresh token on the backend.
192
+ AUTHORIZATION_CODE = 1
193
+
194
+ # Return an authorization code for a given Google+ page that can then be
195
+ # exchanged for a refresh token on the backend.
196
+ GOOGLE_PLUS_AUTHORIZATION_CODE = 2
197
+ end
198
+
199
+ # Represents how the data source supports data auto refresh.
200
+ module DataRefreshType
201
+ # The data source won't support data auto refresh, which is default value.
202
+ DATA_REFRESH_TYPE_UNSPECIFIED = 0
203
+
204
+ # The data source supports data auto refresh, and runs will be scheduled
205
+ # for the past few days. Does not allow custom values to be set for each
206
+ # transfer config.
207
+ SLIDING_WINDOW = 1
208
+
209
+ # The data source supports data auto refresh, and runs will be scheduled
210
+ # for the past few days. Allows custom values to be set for each transfer
211
+ # config.
212
+ CUSTOM_SLIDING_WINDOW = 2
213
+ end
214
+ end
215
+
216
+ # A request to get data source info.
217
+ # @!attribute [rw] name
218
+ # @return [String]
219
+ # The field will contain name of the resource requested, for example:
220
+ # +projects/{project_id}/dataSources/{data_source_id}+
221
+ class GetDataSourceRequest; end
222
+
223
+ # Request to list supported data sources and their data transfer settings.
224
+ # @!attribute [rw] parent
225
+ # @return [String]
226
+ # The BigQuery project id for which data sources should be returned.
227
+ # Must be in the form: +projects/{project_id}+
228
+ # @!attribute [rw] page_token
229
+ # @return [String]
230
+ # Pagination token, which can be used to request a specific page
231
+ # of +ListDataSourcesRequest+ list results. For multiple-page
232
+ # results, +ListDataSourcesResponse+ outputs
233
+ # a +next_page+ token, which can be used as the
234
+ # +page_token+ value to request the next page of list results.
235
+ # @!attribute [rw] page_size
236
+ # @return [Integer]
237
+ # Page size. The default page size is the maximum value of 1000 results.
238
+ class ListDataSourcesRequest; end
239
+
240
+ # Returns list of supported data sources and their metadata.
241
+ # @!attribute [rw] data_sources
242
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::DataSource>]
243
+ # List of supported data sources and their transfer settings.
244
+ # @!attribute [rw] next_page_token
245
+ # @return [String]
246
+ # Output only. The next-pagination token. For multiple-page list results,
247
+ # this token can be used as the
248
+ # +ListDataSourcesRequest.page_token+
249
+ # to request the next page of list results.
250
+ class ListDataSourcesResponse; end
251
+
252
+ # A request to create a data transfer configuration. If new credentials are
253
+ # needed for this transfer configuration, an authorization code must be
254
+ # provided. If an authorization code is provided, the transfer configuration
255
+ # will be associated with the user id corresponding to the
256
+ # authorization code. Otherwise, the transfer configuration will be associated
257
+ # with the calling user.
258
+ # @!attribute [rw] parent
259
+ # @return [String]
260
+ # The BigQuery project id where the transfer configuration should be created.
261
+ # Must be in the format /projects/{project_id}/locations/{location_id}
262
+ # If specified location and location of the destination bigquery dataset
263
+ # do not match - the request will fail.
264
+ # @!attribute [rw] transfer_config
265
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
266
+ # Data transfer configuration to create.
267
+ # @!attribute [rw] authorization_code
268
+ # @return [String]
269
+ # Optional OAuth2 authorization code to use with this transfer configuration.
270
+ # This is required if new credentials are needed, as indicated by
271
+ # +CheckValidCreds+.
272
+ # In order to obtain authorization_code, please make a
273
+ # request to
274
+ # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=<datatransferapiclientid>&scope=<data_source_scopes>&redirect_uri=<redirect_uri>
275
+ #
276
+ # * client_id should be OAuth client_id of BigQuery DTS API for the given
277
+ # data source returned by ListDataSources method.
278
+ # * data_source_scopes are the scopes returned by ListDataSources method.
279
+ # * redirect_uri is an optional parameter. If not specified, then
280
+ # authorization code is posted to the opener of authorization flow window.
281
+ # Otherwise it will be sent to the redirect uri. A special value of
282
+ # urn:ietf:wg:oauth:2.0:oob means that authorization code should be
283
+ # returned in the title bar of the browser, with the page text prompting
284
+ # the user to copy the code and paste it in the application.
285
+ class CreateTransferConfigRequest; end
286
+
287
+ # A request to update a transfer configuration. To update the user id of the
288
+ # transfer configuration, an authorization code needs to be provided.
289
+ # @!attribute [rw] transfer_config
290
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
291
+ # Data transfer configuration to create.
292
+ # @!attribute [rw] authorization_code
293
+ # @return [String]
294
+ # Optional OAuth2 authorization code to use with this transfer configuration.
295
+ # If it is provided, the transfer configuration will be associated with the
296
+ # authorizing user.
297
+ # In order to obtain authorization_code, please make a
298
+ # request to
299
+ # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=<datatransferapiclientid>&scope=<data_source_scopes>&redirect_uri=<redirect_uri>
300
+ #
301
+ # * client_id should be OAuth client_id of BigQuery DTS API for the given
302
+ # data source returned by ListDataSources method.
303
+ # * data_source_scopes are the scopes returned by ListDataSources method.
304
+ # * redirect_uri is an optional parameter. If not specified, then
305
+ # authorization code is posted to the opener of authorization flow window.
306
+ # Otherwise it will be sent to the redirect uri. A special value of
307
+ # urn:ietf:wg:oauth:2.0:oob means that authorization code should be
308
+ # returned in the title bar of the browser, with the page text prompting
309
+ # the user to copy the code and paste it in the application.
310
+ # @!attribute [rw] update_mask
311
+ # @return [Google::Protobuf::FieldMask]
312
+ # Required list of fields to be updated in this request.
313
+ class UpdateTransferConfigRequest; end
314
+
315
+ # A request to get data transfer information.
316
+ # @!attribute [rw] name
317
+ # @return [String]
318
+ # The field will contain name of the resource requested, for example:
319
+ # +projects/{project_id}/transferConfigs/{config_id}+
320
+ class GetTransferConfigRequest; end
321
+
322
+ # A request to delete data transfer information. All associated transfer runs
323
+ # and log messages will be deleted as well.
324
+ # @!attribute [rw] name
325
+ # @return [String]
326
+ # The field will contain name of the resource requested, for example:
327
+ # +projects/{project_id}/transferConfigs/{config_id}+
328
+ class DeleteTransferConfigRequest; end
329
+
330
+ # A request to get data transfer run information.
331
+ # @!attribute [rw] name
332
+ # @return [String]
333
+ # The field will contain name of the resource requested, for example:
334
+ # +projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}+
335
+ class GetTransferRunRequest; end
336
+
337
+ # A request to delete data transfer run information.
338
+ # @!attribute [rw] name
339
+ # @return [String]
340
+ # The field will contain name of the resource requested, for example:
341
+ # +projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}+
342
+ class DeleteTransferRunRequest; end
343
+
344
+ # A request to list data transfers configured for a BigQuery project.
345
+ # @!attribute [rw] parent
346
+ # @return [String]
347
+ # The BigQuery project id for which data sources
348
+ # should be returned: +projects/{project_id}+.
349
+ # @!attribute [rw] data_source_ids
350
+ # @return [Array<String>]
351
+ # When specified, only configurations of requested data sources are returned.
352
+ # @!attribute [rw] page_token
353
+ # @return [String]
354
+ # Pagination token, which can be used to request a specific page
355
+ # of +ListTransfersRequest+ list results. For multiple-page
356
+ # results, +ListTransfersResponse+ outputs
357
+ # a +next_page+ token, which can be used as the
358
+ # +page_token+ value to request the next page of list results.
359
+ # @!attribute [rw] page_size
360
+ # @return [Integer]
361
+ # Page size. The default page size is the maximum value of 1000 results.
362
+ class ListTransferConfigsRequest; end
363
+
364
+ # The returned list of pipelines in the project.
365
+ # @!attribute [rw] transfer_configs
366
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig>]
367
+ # Output only. The stored pipeline transfer configurations.
368
+ # @!attribute [rw] next_page_token
369
+ # @return [String]
370
+ # Output only. The next-pagination token. For multiple-page list results,
371
+ # this token can be used as the
372
+ # +ListTransferConfigsRequest.page_token+
373
+ # to request the next page of list results.
374
+ class ListTransferConfigsResponse; end
375
+
376
+ # A request to list data transfer runs. UI can use this method to show/filter
377
+ # specific data transfer runs. The data source can use this method to request
378
+ # all scheduled transfer runs.
379
+ # @!attribute [rw] parent
380
+ # @return [String]
381
+ # Name of transfer configuration for which transfer runs should be retrieved.
382
+ # Format of transfer configuration resource name is:
383
+ # +projects/{project_id}/transferConfigs/{config_id}+.
384
+ # @!attribute [rw] states
385
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferState>]
386
+ # When specified, only transfer runs with requested states are returned.
387
+ # @!attribute [rw] page_token
388
+ # @return [String]
389
+ # Pagination token, which can be used to request a specific page
390
+ # of +ListTransferRunsRequest+ list results. For multiple-page
391
+ # results, +ListTransferRunsResponse+ outputs
392
+ # a +next_page+ token, which can be used as the
393
+ # +page_token+ value to request the next page of list results.
394
+ # @!attribute [rw] page_size
395
+ # @return [Integer]
396
+ # Page size. The default page size is the maximum value of 1000 results.
397
+ # @!attribute [rw] run_attempt
398
+ # @return [Google::Cloud::Bigquery::Datatransfer::V1::ListTransferRunsRequest::RunAttempt]
399
+ # Indicates how run attempts are to be pulled.
400
+ class ListTransferRunsRequest
401
+ # Represents which runs should be pulled.
402
+ module RunAttempt
403
+ # All runs should be returned.
404
+ RUN_ATTEMPT_UNSPECIFIED = 0
405
+
406
+ # Only latest run per day should be returned.
407
+ LATEST = 1
408
+ end
409
+ end
410
+
411
+ # The returned list of pipelines in the project.
412
+ # @!attribute [rw] transfer_runs
413
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferRun>]
414
+ # Output only. The stored pipeline transfer runs.
415
+ # @!attribute [rw] next_page_token
416
+ # @return [String]
417
+ # Output only. The next-pagination token. For multiple-page list results,
418
+ # this token can be used as the
419
+ # +ListTransferRunsRequest.page_token+
420
+ # to request the next page of list results.
421
+ class ListTransferRunsResponse; end
422
+
423
+ # A request to get user facing log messages associated with data transfer run.
424
+ # @!attribute [rw] parent
425
+ # @return [String]
426
+ # Transfer run name in the form:
427
+ # +projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}+.
428
+ # @!attribute [rw] page_token
429
+ # @return [String]
430
+ # Pagination token, which can be used to request a specific page
431
+ # of +ListTransferLogsRequest+ list results. For multiple-page
432
+ # results, +ListTransferLogsResponse+ outputs
433
+ # a +next_page+ token, which can be used as the
434
+ # +page_token+ value to request the next page of list results.
435
+ # @!attribute [rw] page_size
436
+ # @return [Integer]
437
+ # Page size. The default page size is the maximum value of 1000 results.
438
+ # @!attribute [rw] message_types
439
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferMessage::MessageSeverity>]
440
+ # Message types to return. If not populated - INFO, WARNING and ERROR
441
+ # messages are returned.
442
+ class ListTransferLogsRequest; end
443
+
444
+ # The returned list transfer run messages.
445
+ # @!attribute [rw] transfer_messages
446
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferMessage>]
447
+ # Output only. The stored pipeline transfer messages.
448
+ # @!attribute [rw] next_page_token
449
+ # @return [String]
450
+ # Output only. The next-pagination token. For multiple-page list results,
451
+ # this token can be used as the
452
+ # +GetTransferRunLogRequest.page_token+
453
+ # to request the next page of list results.
454
+ class ListTransferLogsResponse; end
455
+
456
+ # A request to determine whether the user has valid credentials. This method
457
+ # is used to limit the number of OAuth popups in the user interface. The
458
+ # user id is inferred from the API call context.
459
+ # If the data source has the Google+ authorization type, this method
460
+ # returns false, as it cannot be determined whether the credentials are
461
+ # already valid merely based on the user id.
462
+ # @!attribute [rw] name
463
+ # @return [String]
464
+ # The data source in the form:
465
+ # +projects/{project_id}/dataSources/{data_source_id}+
466
+ class CheckValidCredsRequest; end
467
+
468
+ # A response indicating whether the credentials exist and are valid.
469
+ # @!attribute [rw] has_valid_creds
470
+ # @return [true, false]
471
+ # If set to +true+, the credentials exist and are valid.
472
+ class CheckValidCredsResponse; end
473
+
474
+ # A request to schedule transfer runs for a time range.
475
+ # @!attribute [rw] parent
476
+ # @return [String]
477
+ # Transfer configuration name in the form:
478
+ # +projects/{project_id}/transferConfigs/{config_id}+.
479
+ # @!attribute [rw] start_time
480
+ # @return [Google::Protobuf::Timestamp]
481
+ # Start time of the range of transfer runs. For example,
482
+ # +"2017-05-25T00:00:00+00:00"+.
483
+ # @!attribute [rw] end_time
484
+ # @return [Google::Protobuf::Timestamp]
485
+ # End time of the range of transfer runs. For example,
486
+ # +"2017-05-30T00:00:00+00:00"+.
487
+ class ScheduleTransferRunsRequest; end
488
+
489
+ # A response to schedule transfer runs for a time range.
490
+ # @!attribute [rw] runs
491
+ # @return [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferRun>]
492
+ # The transfer runs that were scheduled.
493
+ class ScheduleTransferRunsResponse; end
494
+ end
495
+ end
496
+ end
497
+ end
498
+ end