google-cloud-bigquery-data_transfer 0.7.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -2
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +301 -0
  6. data/README.md +33 -45
  7. data/lib/{google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/datatransfer/v1/datasource.rb → google-cloud-bigquery-data_transfer.rb} +5 -11
  8. data/lib/google/cloud/bigquery/data_transfer.rb +88 -140
  9. data/lib/google/cloud/bigquery/data_transfer/version.rb +6 -2
  10. metadata +60 -68
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/bigquery/data_transfer/credentials.rb +0 -33
  13. data/lib/google/cloud/bigquery/data_transfer/v1.rb +0 -173
  14. data/lib/google/cloud/bigquery/data_transfer/v1/credentials.rb +0 -43
  15. data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_pb.rb +0 -190
  16. data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service_client.rb +0 -1177
  17. data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service_client_config.json +0 -96
  18. data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_services_pb.rb +0 -87
  19. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/data_transfer/v1/data_transfer.rb +0 -500
  20. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/data_transfer/v1/transfer.rb +0 -217
  21. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/datatransfer/v1/datatransfer.rb +0 -565
  22. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/datatransfer/v1/transfer.rb +0 -257
  23. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/any.rb +0 -131
  24. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/duration.rb +0 -91
  25. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/empty.rb +0 -29
  26. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/field_mask.rb +0 -222
  27. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/struct.rb +0 -74
  28. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/timestamp.rb +0 -113
  29. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/wrappers.rb +0 -26
  30. data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/rpc/status.rb +0 -39
  31. data/lib/google/cloud/bigquery/data_transfer/v1/transfer_pb.rb +0 -83
  32. data/lib/google/cloud/bigquery/datatransfer/v1/datasource_pb.rb +0 -170
  33. data/lib/google/cloud/bigquery/datatransfer/v1/datasource_services_pb.rb +0 -103
  34. data/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_pb.rb +0 -215
  35. data/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb +0 -94
  36. data/lib/google/cloud/bigquery/datatransfer/v1/transfer_pb.rb +0 -103
@@ -1,190 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/cloud/bigquery/data_transfer/v1/transfer_pb'
9
- require 'google/protobuf/duration_pb'
10
- require 'google/protobuf/empty_pb'
11
- require 'google/protobuf/field_mask_pb'
12
- require 'google/protobuf/timestamp_pb'
13
- require 'google/protobuf/wrappers_pb'
14
- Google::Protobuf::DescriptorPool.generated_pool.build do
15
- add_message "google.cloud.bigquery.datatransfer.v1.DataSourceParameter" do
16
- optional :param_id, :string, 1
17
- optional :display_name, :string, 2
18
- optional :description, :string, 3
19
- optional :type, :enum, 4, "google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type"
20
- optional :required, :bool, 5
21
- optional :repeated, :bool, 6
22
- optional :validation_regex, :string, 7
23
- repeated :allowed_values, :string, 8
24
- optional :min_value, :message, 9, "google.protobuf.DoubleValue"
25
- optional :max_value, :message, 10, "google.protobuf.DoubleValue"
26
- repeated :fields, :message, 11, "google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
27
- optional :validation_description, :string, 12
28
- optional :validation_help_url, :string, 13
29
- optional :immutable, :bool, 14
30
- optional :recurse, :bool, 15
31
- end
32
- add_enum "google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type" do
33
- value :TYPE_UNSPECIFIED, 0
34
- value :STRING, 1
35
- value :INTEGER, 2
36
- value :DOUBLE, 3
37
- value :BOOLEAN, 4
38
- value :RECORD, 5
39
- value :PLUS_PAGE, 6
40
- end
41
- add_message "google.cloud.bigquery.datatransfer.v1.DataSource" do
42
- optional :name, :string, 1
43
- optional :data_source_id, :string, 2
44
- optional :display_name, :string, 3
45
- optional :description, :string, 4
46
- optional :client_id, :string, 5
47
- repeated :scopes, :string, 6
48
- optional :transfer_type, :enum, 7, "google.cloud.bigquery.datatransfer.v1.TransferType"
49
- optional :supports_multiple_transfers, :bool, 8
50
- optional :update_deadline_seconds, :int32, 9
51
- optional :default_schedule, :string, 10
52
- optional :supports_custom_schedule, :bool, 11
53
- repeated :parameters, :message, 12, "google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
54
- optional :help_url, :string, 13
55
- optional :authorization_type, :enum, 14, "google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType"
56
- optional :data_refresh_type, :enum, 15, "google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType"
57
- optional :default_data_refresh_window_days, :int32, 16
58
- optional :manual_runs_disabled, :bool, 17
59
- optional :minimum_schedule_interval, :message, 18, "google.protobuf.Duration"
60
- end
61
- add_enum "google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType" do
62
- value :AUTHORIZATION_TYPE_UNSPECIFIED, 0
63
- value :AUTHORIZATION_CODE, 1
64
- value :GOOGLE_PLUS_AUTHORIZATION_CODE, 2
65
- end
66
- add_enum "google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType" do
67
- value :DATA_REFRESH_TYPE_UNSPECIFIED, 0
68
- value :SLIDING_WINDOW, 1
69
- value :CUSTOM_SLIDING_WINDOW, 2
70
- end
71
- add_message "google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest" do
72
- optional :name, :string, 1
73
- end
74
- add_message "google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest" do
75
- optional :parent, :string, 1
76
- optional :page_token, :string, 3
77
- optional :page_size, :int32, 4
78
- end
79
- add_message "google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse" do
80
- repeated :data_sources, :message, 1, "google.cloud.bigquery.datatransfer.v1.DataSource"
81
- optional :next_page_token, :string, 2
82
- end
83
- add_message "google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest" do
84
- optional :parent, :string, 1
85
- optional :transfer_config, :message, 2, "google.cloud.bigquery.datatransfer.v1.TransferConfig"
86
- optional :authorization_code, :string, 3
87
- end
88
- add_message "google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest" do
89
- optional :transfer_config, :message, 1, "google.cloud.bigquery.datatransfer.v1.TransferConfig"
90
- optional :authorization_code, :string, 3
91
- optional :update_mask, :message, 4, "google.protobuf.FieldMask"
92
- end
93
- add_message "google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest" do
94
- optional :name, :string, 1
95
- end
96
- add_message "google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest" do
97
- optional :name, :string, 1
98
- end
99
- add_message "google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest" do
100
- optional :name, :string, 1
101
- end
102
- add_message "google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest" do
103
- optional :name, :string, 1
104
- end
105
- add_message "google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest" do
106
- optional :parent, :string, 1
107
- repeated :data_source_ids, :string, 2
108
- optional :page_token, :string, 3
109
- optional :page_size, :int32, 4
110
- end
111
- add_message "google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse" do
112
- repeated :transfer_configs, :message, 1, "google.cloud.bigquery.datatransfer.v1.TransferConfig"
113
- optional :next_page_token, :string, 2
114
- end
115
- add_message "google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest" do
116
- optional :parent, :string, 1
117
- repeated :states, :enum, 2, "google.cloud.bigquery.datatransfer.v1.TransferState"
118
- optional :page_token, :string, 3
119
- optional :page_size, :int32, 4
120
- optional :run_attempt, :enum, 5, "google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt"
121
- end
122
- add_enum "google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt" do
123
- value :RUN_ATTEMPT_UNSPECIFIED, 0
124
- value :LATEST, 1
125
- end
126
- add_message "google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse" do
127
- repeated :transfer_runs, :message, 1, "google.cloud.bigquery.datatransfer.v1.TransferRun"
128
- optional :next_page_token, :string, 2
129
- end
130
- add_message "google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest" do
131
- optional :parent, :string, 1
132
- optional :page_token, :string, 4
133
- optional :page_size, :int32, 5
134
- repeated :message_types, :enum, 6, "google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity"
135
- end
136
- add_message "google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse" do
137
- repeated :transfer_messages, :message, 1, "google.cloud.bigquery.datatransfer.v1.TransferMessage"
138
- optional :next_page_token, :string, 2
139
- end
140
- add_message "google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest" do
141
- optional :name, :string, 1
142
- end
143
- add_message "google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse" do
144
- optional :has_valid_creds, :bool, 1
145
- end
146
- add_message "google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest" do
147
- optional :parent, :string, 1
148
- optional :start_time, :message, 2, "google.protobuf.Timestamp"
149
- optional :end_time, :message, 3, "google.protobuf.Timestamp"
150
- end
151
- add_message "google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse" do
152
- repeated :runs, :message, 1, "google.cloud.bigquery.datatransfer.v1.TransferRun"
153
- end
154
- end
155
-
156
- module Google
157
- module Cloud
158
- module Bigquery
159
- module DataTransfer
160
- module V1
161
- DataSourceParameter = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DataSourceParameter").msgclass
162
- DataSourceParameter::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type").enummodule
163
- DataSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DataSource").msgclass
164
- DataSource::AuthorizationType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType").enummodule
165
- DataSource::DataRefreshType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType").enummodule
166
- GetDataSourceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest").msgclass
167
- ListDataSourcesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest").msgclass
168
- ListDataSourcesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse").msgclass
169
- CreateTransferConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest").msgclass
170
- UpdateTransferConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest").msgclass
171
- GetTransferConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest").msgclass
172
- DeleteTransferConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest").msgclass
173
- GetTransferRunRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest").msgclass
174
- DeleteTransferRunRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest").msgclass
175
- ListTransferConfigsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest").msgclass
176
- ListTransferConfigsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse").msgclass
177
- ListTransferRunsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest").msgclass
178
- ListTransferRunsRequest::RunAttempt = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt").enummodule
179
- ListTransferRunsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse").msgclass
180
- ListTransferLogsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest").msgclass
181
- ListTransferLogsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse").msgclass
182
- CheckValidCredsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest").msgclass
183
- CheckValidCredsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse").msgclass
184
- ScheduleTransferRunsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest").msgclass
185
- ScheduleTransferRunsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse").msgclass
186
- end
187
- end
188
- end
189
- end
190
- end
@@ -1,1177 +0,0 @@
1
- # Copyright 2020 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
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/cloud/bigquery/datatransfer/v1/datatransfer.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/cloud/bigquery/datatransfer/v1/datatransfer_pb"
29
- require "google/cloud/bigquery/data_transfer/v1/credentials"
30
- require "google/cloud/bigquery/data_transfer/version"
31
-
32
- module Google
33
- module Cloud
34
- module Bigquery
35
- module DataTransfer
36
- module V1
37
- # The Google BigQuery Data Transfer Service API enables BigQuery users to
38
- # configure the transfer of their data from other Google Products into
39
- # BigQuery. This service contains methods that are end user exposed. It backs
40
- # up the frontend.
41
- #
42
- # @!attribute [r] data_transfer_service_stub
43
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::DataTransferService::Stub]
44
- class DataTransferServiceClient
45
- # @private
46
- attr_reader :data_transfer_service_stub
47
-
48
- # The default address of the service.
49
- SERVICE_ADDRESS = "bigquerydatatransfer.googleapis.com".freeze
50
-
51
- # The default port of the service.
52
- DEFAULT_SERVICE_PORT = 443
53
-
54
- # The default set of gRPC interceptors.
55
- GRPC_INTERCEPTORS = []
56
-
57
- DEFAULT_TIMEOUT = 30
58
-
59
- PAGE_DESCRIPTORS = {
60
- "list_data_sources" => Google::Gax::PageDescriptor.new(
61
- "page_token",
62
- "next_page_token",
63
- "data_sources"),
64
- "list_transfer_configs" => Google::Gax::PageDescriptor.new(
65
- "page_token",
66
- "next_page_token",
67
- "transfer_configs"),
68
- "list_transfer_runs" => Google::Gax::PageDescriptor.new(
69
- "page_token",
70
- "next_page_token",
71
- "transfer_runs"),
72
- "list_transfer_logs" => Google::Gax::PageDescriptor.new(
73
- "page_token",
74
- "next_page_token",
75
- "transfer_messages")
76
- }.freeze
77
-
78
- private_constant :PAGE_DESCRIPTORS
79
-
80
- # The scopes needed to make gRPC calls to all of the methods defined in
81
- # this service.
82
- ALL_SCOPES = [
83
- "https://www.googleapis.com/auth/cloud-platform"
84
- ].freeze
85
-
86
-
87
- LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
88
- "projects/{project}/locations/{location}"
89
- )
90
-
91
- private_constant :LOCATION_PATH_TEMPLATE
92
-
93
- LOCATION_DATA_SOURCE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
94
- "projects/{project}/locations/{location}/dataSources/{data_source}"
95
- )
96
-
97
- private_constant :LOCATION_DATA_SOURCE_PATH_TEMPLATE
98
-
99
- LOCATION_RUN_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
100
- "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}"
101
- )
102
-
103
- private_constant :LOCATION_RUN_PATH_TEMPLATE
104
-
105
- LOCATION_TRANSFER_CONFIG_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
106
- "projects/{project}/locations/{location}/transferConfigs/{transfer_config}"
107
- )
108
-
109
- private_constant :LOCATION_TRANSFER_CONFIG_PATH_TEMPLATE
110
-
111
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
112
- "projects/{project}"
113
- )
114
-
115
- private_constant :PROJECT_PATH_TEMPLATE
116
-
117
- PROJECT_DATA_SOURCE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
118
- "projects/{project}/dataSources/{data_source}"
119
- )
120
-
121
- private_constant :PROJECT_DATA_SOURCE_PATH_TEMPLATE
122
-
123
- PROJECT_RUN_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
124
- "projects/{project}/transferConfigs/{transfer_config}/runs/{run}"
125
- )
126
-
127
- private_constant :PROJECT_RUN_PATH_TEMPLATE
128
-
129
- PROJECT_TRANSFER_CONFIG_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
130
- "projects/{project}/transferConfigs/{transfer_config}"
131
- )
132
-
133
- private_constant :PROJECT_TRANSFER_CONFIG_PATH_TEMPLATE
134
-
135
- # Returns a fully-qualified location resource name string.
136
- # @param project [String]
137
- # @param location [String]
138
- # @return [String]
139
- def self.location_path project, location
140
- LOCATION_PATH_TEMPLATE.render(
141
- :"project" => project,
142
- :"location" => location
143
- )
144
- end
145
-
146
- # Returns a fully-qualified location_data_source resource name string.
147
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
148
- # This helper function will be deleted in the next major version.
149
- # @param project [String]
150
- # @param location [String]
151
- # @param data_source [String]
152
- # @return [String]
153
- def self.location_data_source_path project, location, data_source
154
- LOCATION_DATA_SOURCE_PATH_TEMPLATE.render(
155
- :"project" => project,
156
- :"location" => location,
157
- :"data_source" => data_source
158
- )
159
- end
160
-
161
- # Returns a fully-qualified location_run resource name string.
162
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
163
- # This helper function will be deleted in the next major version.
164
- # @param project [String]
165
- # @param location [String]
166
- # @param transfer_config [String]
167
- # @param run [String]
168
- # @return [String]
169
- def self.location_run_path project, location, transfer_config, run
170
- LOCATION_RUN_PATH_TEMPLATE.render(
171
- :"project" => project,
172
- :"location" => location,
173
- :"transfer_config" => transfer_config,
174
- :"run" => run
175
- )
176
- end
177
-
178
- # Returns a fully-qualified location_transfer_config resource name string.
179
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
180
- # This helper function will be deleted in the next major version.
181
- # @param project [String]
182
- # @param location [String]
183
- # @param transfer_config [String]
184
- # @return [String]
185
- def self.location_transfer_config_path project, location, transfer_config
186
- LOCATION_TRANSFER_CONFIG_PATH_TEMPLATE.render(
187
- :"project" => project,
188
- :"location" => location,
189
- :"transfer_config" => transfer_config
190
- )
191
- end
192
-
193
- # Returns a fully-qualified project resource name string.
194
- # @param project [String]
195
- # @return [String]
196
- def self.project_path project
197
- PROJECT_PATH_TEMPLATE.render(
198
- :"project" => project
199
- )
200
- end
201
-
202
- # Returns a fully-qualified project_data_source resource name string.
203
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
204
- # This helper function will be deleted in the next major version.
205
- # @param project [String]
206
- # @param data_source [String]
207
- # @return [String]
208
- def self.project_data_source_path project, data_source
209
- PROJECT_DATA_SOURCE_PATH_TEMPLATE.render(
210
- :"project" => project,
211
- :"data_source" => data_source
212
- )
213
- end
214
-
215
- # Returns a fully-qualified project_run resource name string.
216
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
217
- # This helper function will be deleted in the next major version.
218
- # @param project [String]
219
- # @param transfer_config [String]
220
- # @param run [String]
221
- # @return [String]
222
- def self.project_run_path project, transfer_config, run
223
- PROJECT_RUN_PATH_TEMPLATE.render(
224
- :"project" => project,
225
- :"transfer_config" => transfer_config,
226
- :"run" => run
227
- )
228
- end
229
-
230
- # Returns a fully-qualified project_transfer_config resource name string.
231
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
232
- # This helper function will be deleted in the next major version.
233
- # @param project [String]
234
- # @param transfer_config [String]
235
- # @return [String]
236
- def self.project_transfer_config_path project, transfer_config
237
- PROJECT_TRANSFER_CONFIG_PATH_TEMPLATE.render(
238
- :"project" => project,
239
- :"transfer_config" => transfer_config
240
- )
241
- end
242
-
243
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
244
- # Provides the means for authenticating requests made by the client. This parameter can
245
- # be many types.
246
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
247
- # authenticating requests made by this client.
248
- # A `String` will be treated as the path to the keyfile to be used for the construction of
249
- # credentials for this client.
250
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
251
- # credentials for this client.
252
- # A `GRPC::Core::Channel` will be used to make calls through.
253
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
254
- # should already be composed with a `GRPC::Core::CallCredentials` object.
255
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
256
- # metadata for requests, generally, to give OAuth credentials.
257
- # @param scopes [Array<String>]
258
- # The OAuth scopes for this service. This parameter is ignored if
259
- # an updater_proc is supplied.
260
- # @param client_config [Hash]
261
- # A Hash for call options for each method. See
262
- # Google::Gax#construct_settings for the structure of
263
- # this data. Falls back to the default config if not specified
264
- # or the specified config is missing data points.
265
- # @param timeout [Numeric]
266
- # The default timeout, in seconds, for calls made through this client.
267
- # @param metadata [Hash]
268
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
269
- # @param service_address [String]
270
- # Override for the service hostname, or `nil` to leave as the default.
271
- # @param service_port [Integer]
272
- # Override for the service port, or `nil` to leave as the default.
273
- # @param exception_transformer [Proc]
274
- # An optional proc that intercepts any exceptions raised during an API call to inject
275
- # custom error handling.
276
- def initialize \
277
- credentials: nil,
278
- scopes: ALL_SCOPES,
279
- client_config: {},
280
- timeout: DEFAULT_TIMEOUT,
281
- metadata: nil,
282
- service_address: nil,
283
- service_port: nil,
284
- exception_transformer: nil,
285
- lib_name: nil,
286
- lib_version: ""
287
- # These require statements are intentionally placed here to initialize
288
- # the gRPC module only when it's required.
289
- # See https://github.com/googleapis/toolkit/issues/446
290
- require "google/gax/grpc"
291
- require "google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb"
292
-
293
- credentials ||= Google::Cloud::Bigquery::DataTransfer::V1::Credentials.default
294
-
295
- if credentials.is_a?(String) || credentials.is_a?(Hash)
296
- updater_proc = Google::Cloud::Bigquery::DataTransfer::V1::Credentials.new(credentials).updater_proc
297
- end
298
- if credentials.is_a?(GRPC::Core::Channel)
299
- channel = credentials
300
- end
301
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
302
- chan_creds = credentials
303
- end
304
- if credentials.is_a?(Proc)
305
- updater_proc = credentials
306
- end
307
- if credentials.is_a?(Google::Auth::Credentials)
308
- updater_proc = credentials.updater_proc
309
- end
310
-
311
- package_version = Google::Cloud::Bigquery::DataTransfer::VERSION
312
-
313
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
314
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
315
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
316
- google_api_client << " grpc/#{GRPC::VERSION}"
317
- google_api_client.freeze
318
-
319
- headers = { :"x-goog-api-client" => google_api_client }
320
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
321
- headers[:"x-goog-user-project"] = credentials.quota_project_id
322
- end
323
- headers.merge!(metadata) unless metadata.nil?
324
- client_config_file = Pathname.new(__dir__).join(
325
- "data_transfer_service_client_config.json"
326
- )
327
- defaults = client_config_file.open do |f|
328
- Google::Gax.construct_settings(
329
- "google.cloud.bigquery.datatransfer.v1.DataTransferService",
330
- JSON.parse(f.read),
331
- client_config,
332
- Google::Gax::Grpc::STATUS_CODE_NAMES,
333
- timeout,
334
- page_descriptors: PAGE_DESCRIPTORS,
335
- errors: Google::Gax::Grpc::API_ERRORS,
336
- metadata: headers
337
- )
338
- end
339
-
340
- # Allow overriding the service path/port in subclasses.
341
- service_path = service_address || self.class::SERVICE_ADDRESS
342
- port = service_port || self.class::DEFAULT_SERVICE_PORT
343
- interceptors = self.class::GRPC_INTERCEPTORS
344
- @data_transfer_service_stub = Google::Gax::Grpc.create_stub(
345
- service_path,
346
- port,
347
- chan_creds: chan_creds,
348
- channel: channel,
349
- updater_proc: updater_proc,
350
- scopes: scopes,
351
- interceptors: interceptors,
352
- &Google::Cloud::Bigquery::Datatransfer::V1::DataTransferService::Stub.method(:new)
353
- )
354
-
355
- @get_data_source = Google::Gax.create_api_call(
356
- @data_transfer_service_stub.method(:get_data_source),
357
- defaults["get_data_source"],
358
- exception_transformer: exception_transformer,
359
- params_extractor: proc do |request|
360
- {'name' => request.name}
361
- end
362
- )
363
- @list_data_sources = Google::Gax.create_api_call(
364
- @data_transfer_service_stub.method(:list_data_sources),
365
- defaults["list_data_sources"],
366
- exception_transformer: exception_transformer,
367
- params_extractor: proc do |request|
368
- {'parent' => request.parent}
369
- end
370
- )
371
- @create_transfer_config = Google::Gax.create_api_call(
372
- @data_transfer_service_stub.method(:create_transfer_config),
373
- defaults["create_transfer_config"],
374
- exception_transformer: exception_transformer,
375
- params_extractor: proc do |request|
376
- {'parent' => request.parent}
377
- end
378
- )
379
- @update_transfer_config = Google::Gax.create_api_call(
380
- @data_transfer_service_stub.method(:update_transfer_config),
381
- defaults["update_transfer_config"],
382
- exception_transformer: exception_transformer,
383
- params_extractor: proc do |request|
384
- {'transfer_config.name' => request.transfer_config.name}
385
- end
386
- )
387
- @delete_transfer_config = Google::Gax.create_api_call(
388
- @data_transfer_service_stub.method(:delete_transfer_config),
389
- defaults["delete_transfer_config"],
390
- exception_transformer: exception_transformer,
391
- params_extractor: proc do |request|
392
- {'name' => request.name}
393
- end
394
- )
395
- @get_transfer_config = Google::Gax.create_api_call(
396
- @data_transfer_service_stub.method(:get_transfer_config),
397
- defaults["get_transfer_config"],
398
- exception_transformer: exception_transformer,
399
- params_extractor: proc do |request|
400
- {'name' => request.name}
401
- end
402
- )
403
- @list_transfer_configs = Google::Gax.create_api_call(
404
- @data_transfer_service_stub.method(:list_transfer_configs),
405
- defaults["list_transfer_configs"],
406
- exception_transformer: exception_transformer,
407
- params_extractor: proc do |request|
408
- {'parent' => request.parent}
409
- end
410
- )
411
- @schedule_transfer_runs = Google::Gax.create_api_call(
412
- @data_transfer_service_stub.method(:schedule_transfer_runs),
413
- defaults["schedule_transfer_runs"],
414
- exception_transformer: exception_transformer,
415
- params_extractor: proc do |request|
416
- {'parent' => request.parent}
417
- end
418
- )
419
- @start_manual_transfer_runs = Google::Gax.create_api_call(
420
- @data_transfer_service_stub.method(:start_manual_transfer_runs),
421
- defaults["start_manual_transfer_runs"],
422
- exception_transformer: exception_transformer,
423
- params_extractor: proc do |request|
424
- {'parent' => request.parent}
425
- end
426
- )
427
- @get_transfer_run = Google::Gax.create_api_call(
428
- @data_transfer_service_stub.method(:get_transfer_run),
429
- defaults["get_transfer_run"],
430
- exception_transformer: exception_transformer,
431
- params_extractor: proc do |request|
432
- {'name' => request.name}
433
- end
434
- )
435
- @delete_transfer_run = Google::Gax.create_api_call(
436
- @data_transfer_service_stub.method(:delete_transfer_run),
437
- defaults["delete_transfer_run"],
438
- exception_transformer: exception_transformer,
439
- params_extractor: proc do |request|
440
- {'name' => request.name}
441
- end
442
- )
443
- @list_transfer_runs = Google::Gax.create_api_call(
444
- @data_transfer_service_stub.method(:list_transfer_runs),
445
- defaults["list_transfer_runs"],
446
- exception_transformer: exception_transformer,
447
- params_extractor: proc do |request|
448
- {'parent' => request.parent}
449
- end
450
- )
451
- @list_transfer_logs = Google::Gax.create_api_call(
452
- @data_transfer_service_stub.method(:list_transfer_logs),
453
- defaults["list_transfer_logs"],
454
- exception_transformer: exception_transformer,
455
- params_extractor: proc do |request|
456
- {'parent' => request.parent}
457
- end
458
- )
459
- @check_valid_creds = Google::Gax.create_api_call(
460
- @data_transfer_service_stub.method(:check_valid_creds),
461
- defaults["check_valid_creds"],
462
- exception_transformer: exception_transformer,
463
- params_extractor: proc do |request|
464
- {'name' => request.name}
465
- end
466
- )
467
- end
468
-
469
- # Service calls
470
-
471
- # Retrieves a supported data source and returns its settings,
472
- # which can be used for UI rendering.
473
- #
474
- # @param name [String]
475
- # Required. The field will contain name of the resource requested, for example:
476
- # `projects/{project_id}/dataSources/{data_source_id}` or
477
- # `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
478
- # @param options [Google::Gax::CallOptions]
479
- # Overrides the default settings for this call, e.g, timeout,
480
- # retries, etc.
481
- # @yield [result, operation] Access the result along with the RPC operation
482
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::DataSource]
483
- # @yieldparam operation [GRPC::ActiveCall::Operation]
484
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::DataSource]
485
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
486
- # @example
487
- # require "google/cloud/bigquery/data_transfer"
488
- #
489
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
490
- # formatted_name = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_data_source_path("[PROJECT]", "[DATA_SOURCE]")
491
- # response = data_transfer_client.get_data_source(formatted_name)
492
-
493
- def get_data_source \
494
- name,
495
- options: nil,
496
- &block
497
- req = {
498
- name: name
499
- }.delete_if { |_, v| v.nil? }
500
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::GetDataSourceRequest)
501
- @get_data_source.call(req, options, &block)
502
- end
503
-
504
- # Lists supported data sources and returns their settings,
505
- # which can be used for UI rendering.
506
- #
507
- # @param parent [String]
508
- # Required. The BigQuery project id for which data sources should be returned.
509
- # Must be in the form: `projects/{project_id}` or
510
- # `projects/{project_id}/locations/{location_id}
511
- # @param page_size [Integer]
512
- # The maximum number of resources contained in the underlying API
513
- # response. If page streaming is performed per-resource, this
514
- # parameter does not affect the return value. If page streaming is
515
- # performed per-page, this determines the maximum number of
516
- # resources in a page.
517
- # @param options [Google::Gax::CallOptions]
518
- # Overrides the default settings for this call, e.g, timeout,
519
- # retries, etc.
520
- # @yield [result, operation] Access the result along with the RPC operation
521
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::DataSource>]
522
- # @yieldparam operation [GRPC::ActiveCall::Operation]
523
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::DataSource>]
524
- # An enumerable of Google::Cloud::Bigquery::Datatransfer::V1::DataSource instances.
525
- # See Google::Gax::PagedEnumerable documentation for other
526
- # operations such as per-page iteration or access to the response
527
- # object.
528
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
529
- # @example
530
- # require "google/cloud/bigquery/data_transfer"
531
- #
532
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
533
- # formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_path("[PROJECT]")
534
- #
535
- # # Iterate over all results.
536
- # data_transfer_client.list_data_sources(formatted_parent).each do |element|
537
- # # Process element.
538
- # end
539
- #
540
- # # Or iterate over results one page at a time.
541
- # data_transfer_client.list_data_sources(formatted_parent).each_page do |page|
542
- # # Process each page at a time.
543
- # page.each do |element|
544
- # # Process element.
545
- # end
546
- # end
547
-
548
- def list_data_sources \
549
- parent,
550
- page_size: nil,
551
- options: nil,
552
- &block
553
- req = {
554
- parent: parent,
555
- page_size: page_size
556
- }.delete_if { |_, v| v.nil? }
557
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::ListDataSourcesRequest)
558
- @list_data_sources.call(req, options, &block)
559
- end
560
-
561
- # Creates a new data transfer configuration.
562
- #
563
- # @param parent [String]
564
- # Required. The BigQuery project id where the transfer configuration should be created.
565
- # Must be in the format projects/\\{project_id}/locations/\\{location_id} or
566
- # projects/\\{project_id}. If specified location and location of the
567
- # destination bigquery dataset do not match - the request will fail.
568
- # @param transfer_config [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig | Hash]
569
- # Required. Data transfer configuration to create.
570
- # A hash of the same form as `Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig`
571
- # can also be provided.
572
- # @param authorization_code [String]
573
- # Optional OAuth2 authorization code to use with this transfer configuration.
574
- # This is required if new credentials are needed, as indicated by
575
- # `CheckValidCreds`.
576
- # In order to obtain authorization_code, please make a
577
- # request to
578
- # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=<datatransferapiclientid>&scope=<data_source_scopes>&redirect_uri=<redirect_uri>
579
- #
580
- # * client_id should be OAuth client_id of BigQuery DTS API for the given
581
- # data source returned by ListDataSources method.
582
- # * data_source_scopes are the scopes returned by ListDataSources method.
583
- # * redirect_uri is an optional parameter. If not specified, then
584
- # authorization code is posted to the opener of authorization flow window.
585
- # Otherwise it will be sent to the redirect uri. A special value of
586
- # urn:ietf:wg:oauth:2.0:oob means that authorization code should be
587
- # returned in the title bar of the browser, with the page text prompting
588
- # the user to copy the code and paste it in the application.
589
- # @param version_info [String]
590
- # Optional version info. If users want to find a very recent access token,
591
- # that is, immediately after approving access, users have to set the
592
- # version_info claim in the token request. To obtain the version_info, users
593
- # must use the "none+gsession" response type. which be return a
594
- # version_info back in the authorization response which be be put in a JWT
595
- # claim in the token request.
596
- # @param service_account_name [String]
597
- # Optional service account name. If this field is set, transfer config will
598
- # be created with this service account credentials. It requires that
599
- # requesting user calling this API has permissions to act as this service
600
- # account.
601
- # @param options [Google::Gax::CallOptions]
602
- # Overrides the default settings for this call, e.g, timeout,
603
- # retries, etc.
604
- # @yield [result, operation] Access the result along with the RPC operation
605
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
606
- # @yieldparam operation [GRPC::ActiveCall::Operation]
607
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
608
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
609
- # @example
610
- # require "google/cloud/bigquery/data_transfer"
611
- #
612
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
613
- # formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_path("[PROJECT]")
614
- #
615
- # # TODO: Initialize `transfer_config`:
616
- # transfer_config = {}
617
- # response = data_transfer_client.create_transfer_config(formatted_parent, transfer_config)
618
-
619
- def create_transfer_config \
620
- parent,
621
- transfer_config,
622
- authorization_code: nil,
623
- version_info: nil,
624
- service_account_name: nil,
625
- options: nil,
626
- &block
627
- req = {
628
- parent: parent,
629
- transfer_config: transfer_config,
630
- authorization_code: authorization_code,
631
- version_info: version_info,
632
- service_account_name: service_account_name
633
- }.delete_if { |_, v| v.nil? }
634
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::CreateTransferConfigRequest)
635
- @create_transfer_config.call(req, options, &block)
636
- end
637
-
638
- # Updates a data transfer configuration.
639
- # All fields must be set, even if they are not updated.
640
- #
641
- # @param transfer_config [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig | Hash]
642
- # Required. Data transfer configuration to create.
643
- # A hash of the same form as `Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig`
644
- # can also be provided.
645
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
646
- # Required. Required list of fields to be updated in this request.
647
- # A hash of the same form as `Google::Protobuf::FieldMask`
648
- # can also be provided.
649
- # @param authorization_code [String]
650
- # Optional OAuth2 authorization code to use with this transfer configuration.
651
- # If it is provided, the transfer configuration will be associated with the
652
- # authorizing user.
653
- # In order to obtain authorization_code, please make a
654
- # request to
655
- # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=<datatransferapiclientid>&scope=<data_source_scopes>&redirect_uri=<redirect_uri>
656
- #
657
- # * client_id should be OAuth client_id of BigQuery DTS API for the given
658
- # data source returned by ListDataSources method.
659
- # * data_source_scopes are the scopes returned by ListDataSources method.
660
- # * redirect_uri is an optional parameter. If not specified, then
661
- # authorization code is posted to the opener of authorization flow window.
662
- # Otherwise it will be sent to the redirect uri. A special value of
663
- # urn:ietf:wg:oauth:2.0:oob means that authorization code should be
664
- # returned in the title bar of the browser, with the page text prompting
665
- # the user to copy the code and paste it in the application.
666
- # @param version_info [String]
667
- # Optional version info. If users want to find a very recent access token,
668
- # that is, immediately after approving access, users have to set the
669
- # version_info claim in the token request. To obtain the version_info, users
670
- # must use the "none+gsession" response type. which be return a
671
- # version_info back in the authorization response which be be put in a JWT
672
- # claim in the token request.
673
- # @param service_account_name [String]
674
- # Optional service account name. If this field is set and
675
- # "service_account_name" is set in update_mask, transfer config will be
676
- # updated to use this service account credentials. It requires that
677
- # requesting user calling this API has permissions to act as this service
678
- # account.
679
- # @param options [Google::Gax::CallOptions]
680
- # Overrides the default settings for this call, e.g, timeout,
681
- # retries, etc.
682
- # @yield [result, operation] Access the result along with the RPC operation
683
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
684
- # @yieldparam operation [GRPC::ActiveCall::Operation]
685
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
686
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
687
- # @example
688
- # require "google/cloud/bigquery/data_transfer"
689
- #
690
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
691
- #
692
- # # TODO: Initialize `transfer_config`:
693
- # transfer_config = {}
694
- #
695
- # # TODO: Initialize `update_mask`:
696
- # update_mask = {}
697
- # response = data_transfer_client.update_transfer_config(transfer_config, update_mask)
698
-
699
- def update_transfer_config \
700
- transfer_config,
701
- update_mask,
702
- authorization_code: nil,
703
- version_info: nil,
704
- service_account_name: nil,
705
- options: nil,
706
- &block
707
- req = {
708
- transfer_config: transfer_config,
709
- update_mask: update_mask,
710
- authorization_code: authorization_code,
711
- version_info: version_info,
712
- service_account_name: service_account_name
713
- }.delete_if { |_, v| v.nil? }
714
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::UpdateTransferConfigRequest)
715
- @update_transfer_config.call(req, options, &block)
716
- end
717
-
718
- # Deletes a data transfer configuration,
719
- # including any associated transfer runs and logs.
720
- #
721
- # @param name [String]
722
- # Required. The field will contain name of the resource requested, for example:
723
- # `projects/{project_id}/transferConfigs/{config_id}` or
724
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
725
- # @param options [Google::Gax::CallOptions]
726
- # Overrides the default settings for this call, e.g, timeout,
727
- # retries, etc.
728
- # @yield [result, operation] Access the result along with the RPC operation
729
- # @yieldparam result []
730
- # @yieldparam operation [GRPC::ActiveCall::Operation]
731
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
732
- # @example
733
- # require "google/cloud/bigquery/data_transfer"
734
- #
735
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
736
- # formatted_name = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_transfer_config_path("[PROJECT]", "[TRANSFER_CONFIG]")
737
- # data_transfer_client.delete_transfer_config(formatted_name)
738
-
739
- def delete_transfer_config \
740
- name,
741
- options: nil,
742
- &block
743
- req = {
744
- name: name
745
- }.delete_if { |_, v| v.nil? }
746
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::DeleteTransferConfigRequest)
747
- @delete_transfer_config.call(req, options, &block)
748
- nil
749
- end
750
-
751
- # Returns information about a data transfer config.
752
- #
753
- # @param name [String]
754
- # Required. The field will contain name of the resource requested, for example:
755
- # `projects/{project_id}/transferConfigs/{config_id}` or
756
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
757
- # @param options [Google::Gax::CallOptions]
758
- # Overrides the default settings for this call, e.g, timeout,
759
- # retries, etc.
760
- # @yield [result, operation] Access the result along with the RPC operation
761
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
762
- # @yieldparam operation [GRPC::ActiveCall::Operation]
763
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig]
764
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
765
- # @example
766
- # require "google/cloud/bigquery/data_transfer"
767
- #
768
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
769
- # formatted_name = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_transfer_config_path("[PROJECT]", "[TRANSFER_CONFIG]")
770
- # response = data_transfer_client.get_transfer_config(formatted_name)
771
-
772
- def get_transfer_config \
773
- name,
774
- options: nil,
775
- &block
776
- req = {
777
- name: name
778
- }.delete_if { |_, v| v.nil? }
779
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::GetTransferConfigRequest)
780
- @get_transfer_config.call(req, options, &block)
781
- end
782
-
783
- # Returns information about all data transfers in the project.
784
- #
785
- # @param parent [String]
786
- # Required. The BigQuery project id for which data sources
787
- # should be returned: `projects/{project_id}` or
788
- # `projects/{project_id}/locations/{location_id}`
789
- # @param data_source_ids [Array<String>]
790
- # When specified, only configurations of requested data sources are returned.
791
- # @param page_size [Integer]
792
- # The maximum number of resources contained in the underlying API
793
- # response. If page streaming is performed per-resource, this
794
- # parameter does not affect the return value. If page streaming is
795
- # performed per-page, this determines the maximum number of
796
- # resources in a page.
797
- # @param options [Google::Gax::CallOptions]
798
- # Overrides the default settings for this call, e.g, timeout,
799
- # retries, etc.
800
- # @yield [result, operation] Access the result along with the RPC operation
801
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig>]
802
- # @yieldparam operation [GRPC::ActiveCall::Operation]
803
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig>]
804
- # An enumerable of Google::Cloud::Bigquery::Datatransfer::V1::TransferConfig instances.
805
- # See Google::Gax::PagedEnumerable documentation for other
806
- # operations such as per-page iteration or access to the response
807
- # object.
808
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
809
- # @example
810
- # require "google/cloud/bigquery/data_transfer"
811
- #
812
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
813
- # formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_path("[PROJECT]")
814
- #
815
- # # Iterate over all results.
816
- # data_transfer_client.list_transfer_configs(formatted_parent).each do |element|
817
- # # Process element.
818
- # end
819
- #
820
- # # Or iterate over results one page at a time.
821
- # data_transfer_client.list_transfer_configs(formatted_parent).each_page do |page|
822
- # # Process each page at a time.
823
- # page.each do |element|
824
- # # Process element.
825
- # end
826
- # end
827
-
828
- def list_transfer_configs \
829
- parent,
830
- data_source_ids: nil,
831
- page_size: nil,
832
- options: nil,
833
- &block
834
- req = {
835
- parent: parent,
836
- data_source_ids: data_source_ids,
837
- page_size: page_size
838
- }.delete_if { |_, v| v.nil? }
839
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::ListTransferConfigsRequest)
840
- @list_transfer_configs.call(req, options, &block)
841
- end
842
-
843
- # Creates transfer runs for a time range [start_time, end_time].
844
- # For each date - or whatever granularity the data source supports - in the
845
- # range, one transfer run is created.
846
- # Note that runs are created per UTC time in the time range.
847
- # DEPRECATED: use StartManualTransferRuns instead.
848
- #
849
- # @param parent [String]
850
- # Required. Transfer configuration name in the form:
851
- # `projects/{project_id}/transferConfigs/{config_id}` or
852
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
853
- # @param start_time [Google::Protobuf::Timestamp | Hash]
854
- # Required. Start time of the range of transfer runs. For example,
855
- # `"2017-05-25T00:00:00+00:00"`.
856
- # A hash of the same form as `Google::Protobuf::Timestamp`
857
- # can also be provided.
858
- # @param end_time [Google::Protobuf::Timestamp | Hash]
859
- # Required. End time of the range of transfer runs. For example,
860
- # `"2017-05-30T00:00:00+00:00"`.
861
- # A hash of the same form as `Google::Protobuf::Timestamp`
862
- # can also be provided.
863
- # @param options [Google::Gax::CallOptions]
864
- # Overrides the default settings for this call, e.g, timeout,
865
- # retries, etc.
866
- # @yield [result, operation] Access the result along with the RPC operation
867
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::ScheduleTransferRunsResponse]
868
- # @yieldparam operation [GRPC::ActiveCall::Operation]
869
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::ScheduleTransferRunsResponse]
870
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
871
- # @example
872
- # require "google/cloud/bigquery/data_transfer"
873
- #
874
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
875
- # formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_transfer_config_path("[PROJECT]", "[TRANSFER_CONFIG]")
876
- #
877
- # # TODO: Initialize `start_time`:
878
- # start_time = {}
879
- #
880
- # # TODO: Initialize `end_time`:
881
- # end_time = {}
882
- # response = data_transfer_client.schedule_transfer_runs(formatted_parent, start_time, end_time)
883
-
884
- def schedule_transfer_runs \
885
- parent,
886
- start_time,
887
- end_time,
888
- options: nil,
889
- &block
890
- req = {
891
- parent: parent,
892
- start_time: start_time,
893
- end_time: end_time
894
- }.delete_if { |_, v| v.nil? }
895
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::ScheduleTransferRunsRequest)
896
- @schedule_transfer_runs.call(req, options, &block)
897
- end
898
-
899
- # Start manual transfer runs to be executed now with schedule_time equal to
900
- # current time. The transfer runs can be created for a time range where the
901
- # run_time is between start_time (inclusive) and end_time (exclusive), or for
902
- # a specific run_time.
903
- #
904
- # @param parent [String]
905
- # Transfer configuration name in the form:
906
- # `projects/{project_id}/transferConfigs/{config_id}` or
907
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
908
- # @param requested_time_range [Google::Cloud::Bigquery::Datatransfer::V1::StartManualTransferRunsRequest::TimeRange | Hash]
909
- # Time range for the transfer runs that should be started.
910
- # A hash of the same form as `Google::Cloud::Bigquery::Datatransfer::V1::StartManualTransferRunsRequest::TimeRange`
911
- # can also be provided.
912
- # @param requested_run_time [Google::Protobuf::Timestamp | Hash]
913
- # Specific run_time for a transfer run to be started. The
914
- # requested_run_time must not be in the future.
915
- # A hash of the same form as `Google::Protobuf::Timestamp`
916
- # can also be provided.
917
- # @param options [Google::Gax::CallOptions]
918
- # Overrides the default settings for this call, e.g, timeout,
919
- # retries, etc.
920
- # @yield [result, operation] Access the result along with the RPC operation
921
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::StartManualTransferRunsResponse]
922
- # @yieldparam operation [GRPC::ActiveCall::Operation]
923
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::StartManualTransferRunsResponse]
924
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
925
- # @example
926
- # require "google/cloud/bigquery/data_transfer"
927
- #
928
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
929
- # response = data_transfer_client.start_manual_transfer_runs
930
-
931
- def start_manual_transfer_runs \
932
- parent: nil,
933
- requested_time_range: nil,
934
- requested_run_time: nil,
935
- options: nil,
936
- &block
937
- req = {
938
- parent: parent,
939
- requested_time_range: requested_time_range,
940
- requested_run_time: requested_run_time
941
- }.delete_if { |_, v| v.nil? }
942
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::StartManualTransferRunsRequest)
943
- @start_manual_transfer_runs.call(req, options, &block)
944
- end
945
-
946
- # Returns information about the particular transfer run.
947
- #
948
- # @param name [String]
949
- # Required. The field will contain name of the resource requested, for example:
950
- # `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
951
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
952
- # @param options [Google::Gax::CallOptions]
953
- # Overrides the default settings for this call, e.g, timeout,
954
- # retries, etc.
955
- # @yield [result, operation] Access the result along with the RPC operation
956
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::TransferRun]
957
- # @yieldparam operation [GRPC::ActiveCall::Operation]
958
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::TransferRun]
959
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
960
- # @example
961
- # require "google/cloud/bigquery/data_transfer"
962
- #
963
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
964
- # formatted_name = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_run_path("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
965
- # response = data_transfer_client.get_transfer_run(formatted_name)
966
-
967
- def get_transfer_run \
968
- name,
969
- options: nil,
970
- &block
971
- req = {
972
- name: name
973
- }.delete_if { |_, v| v.nil? }
974
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::GetTransferRunRequest)
975
- @get_transfer_run.call(req, options, &block)
976
- end
977
-
978
- # Deletes the specified transfer run.
979
- #
980
- # @param name [String]
981
- # Required. The field will contain name of the resource requested, for example:
982
- # `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
983
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
984
- # @param options [Google::Gax::CallOptions]
985
- # Overrides the default settings for this call, e.g, timeout,
986
- # retries, etc.
987
- # @yield [result, operation] Access the result along with the RPC operation
988
- # @yieldparam result []
989
- # @yieldparam operation [GRPC::ActiveCall::Operation]
990
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
991
- # @example
992
- # require "google/cloud/bigquery/data_transfer"
993
- #
994
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
995
- # formatted_name = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_run_path("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
996
- # data_transfer_client.delete_transfer_run(formatted_name)
997
-
998
- def delete_transfer_run \
999
- name,
1000
- options: nil,
1001
- &block
1002
- req = {
1003
- name: name
1004
- }.delete_if { |_, v| v.nil? }
1005
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::DeleteTransferRunRequest)
1006
- @delete_transfer_run.call(req, options, &block)
1007
- nil
1008
- end
1009
-
1010
- # Returns information about running and completed jobs.
1011
- #
1012
- # @param parent [String]
1013
- # Required. Name of transfer configuration for which transfer runs should be retrieved.
1014
- # Format of transfer configuration resource name is:
1015
- # `projects/{project_id}/transferConfigs/{config_id}` or
1016
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1017
- # @param states [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferState>]
1018
- # When specified, only transfer runs with requested states are returned.
1019
- # @param page_size [Integer]
1020
- # The maximum number of resources contained in the underlying API
1021
- # response. If page streaming is performed per-resource, this
1022
- # parameter does not affect the return value. If page streaming is
1023
- # performed per-page, this determines the maximum number of
1024
- # resources in a page.
1025
- # @param run_attempt [Google::Cloud::Bigquery::Datatransfer::V1::ListTransferRunsRequest::RunAttempt]
1026
- # Indicates how run attempts are to be pulled.
1027
- # @param options [Google::Gax::CallOptions]
1028
- # Overrides the default settings for this call, e.g, timeout,
1029
- # retries, etc.
1030
- # @yield [result, operation] Access the result along with the RPC operation
1031
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::TransferRun>]
1032
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1033
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::TransferRun>]
1034
- # An enumerable of Google::Cloud::Bigquery::Datatransfer::V1::TransferRun instances.
1035
- # See Google::Gax::PagedEnumerable documentation for other
1036
- # operations such as per-page iteration or access to the response
1037
- # object.
1038
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1039
- # @example
1040
- # require "google/cloud/bigquery/data_transfer"
1041
- #
1042
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
1043
- # formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_transfer_config_path("[PROJECT]", "[TRANSFER_CONFIG]")
1044
- #
1045
- # # Iterate over all results.
1046
- # data_transfer_client.list_transfer_runs(formatted_parent).each do |element|
1047
- # # Process element.
1048
- # end
1049
- #
1050
- # # Or iterate over results one page at a time.
1051
- # data_transfer_client.list_transfer_runs(formatted_parent).each_page do |page|
1052
- # # Process each page at a time.
1053
- # page.each do |element|
1054
- # # Process element.
1055
- # end
1056
- # end
1057
-
1058
- def list_transfer_runs \
1059
- parent,
1060
- states: nil,
1061
- page_size: nil,
1062
- run_attempt: nil,
1063
- options: nil,
1064
- &block
1065
- req = {
1066
- parent: parent,
1067
- states: states,
1068
- page_size: page_size,
1069
- run_attempt: run_attempt
1070
- }.delete_if { |_, v| v.nil? }
1071
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::ListTransferRunsRequest)
1072
- @list_transfer_runs.call(req, options, &block)
1073
- end
1074
-
1075
- # Returns user facing log messages for the data transfer run.
1076
- #
1077
- # @param parent [String]
1078
- # Required. Transfer run name in the form:
1079
- # `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
1080
- # `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1081
- # @param page_size [Integer]
1082
- # The maximum number of resources contained in the underlying API
1083
- # response. If page streaming is performed per-resource, this
1084
- # parameter does not affect the return value. If page streaming is
1085
- # performed per-page, this determines the maximum number of
1086
- # resources in a page.
1087
- # @param message_types [Array<Google::Cloud::Bigquery::Datatransfer::V1::TransferMessage::MessageSeverity>]
1088
- # Message types to return. If not populated - INFO, WARNING and ERROR
1089
- # messages are returned.
1090
- # @param options [Google::Gax::CallOptions]
1091
- # Overrides the default settings for this call, e.g, timeout,
1092
- # retries, etc.
1093
- # @yield [result, operation] Access the result along with the RPC operation
1094
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::TransferMessage>]
1095
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1096
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Bigquery::Datatransfer::V1::TransferMessage>]
1097
- # An enumerable of Google::Cloud::Bigquery::Datatransfer::V1::TransferMessage instances.
1098
- # See Google::Gax::PagedEnumerable documentation for other
1099
- # operations such as per-page iteration or access to the response
1100
- # object.
1101
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1102
- # @example
1103
- # require "google/cloud/bigquery/data_transfer"
1104
- #
1105
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
1106
- # formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_run_path("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
1107
- #
1108
- # # Iterate over all results.
1109
- # data_transfer_client.list_transfer_logs(formatted_parent).each do |element|
1110
- # # Process element.
1111
- # end
1112
- #
1113
- # # Or iterate over results one page at a time.
1114
- # data_transfer_client.list_transfer_logs(formatted_parent).each_page do |page|
1115
- # # Process each page at a time.
1116
- # page.each do |element|
1117
- # # Process element.
1118
- # end
1119
- # end
1120
-
1121
- def list_transfer_logs \
1122
- parent,
1123
- page_size: nil,
1124
- message_types: nil,
1125
- options: nil,
1126
- &block
1127
- req = {
1128
- parent: parent,
1129
- page_size: page_size,
1130
- message_types: message_types
1131
- }.delete_if { |_, v| v.nil? }
1132
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::ListTransferLogsRequest)
1133
- @list_transfer_logs.call(req, options, &block)
1134
- end
1135
-
1136
- # Returns true if valid credentials exist for the given data source and
1137
- # requesting user.
1138
- # Some data sources doesn't support service account, so we need to talk to
1139
- # them on behalf of the end user. This API just checks whether we have OAuth
1140
- # token for the particular user, which is a pre-requisite before user can
1141
- # create a transfer config.
1142
- #
1143
- # @param name [String]
1144
- # Required. The data source in the form:
1145
- # `projects/{project_id}/dataSources/{data_source_id}` or
1146
- # `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
1147
- # @param options [Google::Gax::CallOptions]
1148
- # Overrides the default settings for this call, e.g, timeout,
1149
- # retries, etc.
1150
- # @yield [result, operation] Access the result along with the RPC operation
1151
- # @yieldparam result [Google::Cloud::Bigquery::Datatransfer::V1::CheckValidCredsResponse]
1152
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1153
- # @return [Google::Cloud::Bigquery::Datatransfer::V1::CheckValidCredsResponse]
1154
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1155
- # @example
1156
- # require "google/cloud/bigquery/data_transfer"
1157
- #
1158
- # data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new(version: :v1)
1159
- # formatted_name = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_data_source_path("[PROJECT]", "[DATA_SOURCE]")
1160
- # response = data_transfer_client.check_valid_creds(formatted_name)
1161
-
1162
- def check_valid_creds \
1163
- name,
1164
- options: nil,
1165
- &block
1166
- req = {
1167
- name: name
1168
- }.delete_if { |_, v| v.nil? }
1169
- req = Google::Gax::to_proto(req, Google::Cloud::Bigquery::Datatransfer::V1::CheckValidCredsRequest)
1170
- @check_valid_creds.call(req, options, &block)
1171
- end
1172
- end
1173
- end
1174
- end
1175
- end
1176
- end
1177
- end