google-cloud-bigquery-data_transfer 0.8.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +3 -2
- data/AUTHENTICATION.md +51 -54
- data/LICENSE.md +203 -0
- data/MIGRATING.md +301 -0
- data/README.md +92 -45
- data/lib/{google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/datatransfer/v1/datasource.rb → google-cloud-bigquery-data_transfer.rb} +5 -11
- data/lib/google/cloud/bigquery/data_transfer.rb +88 -140
- data/lib/google/cloud/bigquery/data_transfer/version.rb +6 -2
- metadata +60 -68
- data/LICENSE +0 -201
- data/lib/google/cloud/bigquery/data_transfer/credentials.rb +0 -33
- data/lib/google/cloud/bigquery/data_transfer/v1.rb +0 -173
- data/lib/google/cloud/bigquery/data_transfer/v1/credentials.rb +0 -43
- data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_pb.rb +0 -190
- data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service_client.rb +0 -1230
- data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service_client_config.json +0 -96
- data/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_services_pb.rb +0 -87
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/data_transfer/v1/data_transfer.rb +0 -500
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/data_transfer/v1/transfer.rb +0 -217
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/datatransfer/v1/datatransfer.rb +0 -570
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/cloud/bigquery/datatransfer/v1/transfer.rb +0 -257
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/protobuf/wrappers.rb +0 -26
- data/lib/google/cloud/bigquery/data_transfer/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/bigquery/data_transfer/v1/transfer_pb.rb +0 -83
- data/lib/google/cloud/bigquery/datatransfer/v1/datasource_pb.rb +0 -170
- data/lib/google/cloud/bigquery/datatransfer/v1/datasource_services_pb.rb +0 -103
- data/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_pb.rb +0 -216
- data/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb +0 -93
- data/lib/google/cloud/bigquery/datatransfer/v1/transfer_pb.rb +0 -103
data/README.md
CHANGED
@@ -1,64 +1,53 @@
|
|
1
|
-
# Ruby Client for BigQuery Data Transfer API
|
1
|
+
# Ruby Client for the BigQuery Data Transfer Service API
|
2
2
|
|
3
|
-
|
4
|
-
Schedule queries or transfer external data from SaaS applications to Google
|
5
|
-
BigQuery on a regular basis.
|
6
|
-
- [Client Library Documentation][]
|
7
|
-
- [Product Documentation][]
|
3
|
+
API Client library for the BigQuery Data Transfer Service API
|
8
4
|
|
9
|
-
|
10
|
-
In order to use this library, you first need to go through the following
|
11
|
-
steps:
|
5
|
+
Schedules queries and transfers external data from SaaS applications to Google BigQuery on a regular basis.
|
12
6
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
Actual client classes for the various versions of this API are defined in
|
8
|
+
_versioned_ client gems, with names of the form `google-cloud-bigquery-data_transfer-v*`.
|
9
|
+
The gem `google-cloud-bigquery-data_transfer` is the main client library that brings the
|
10
|
+
verisoned gems in as dependencies, and provides high-level methods for
|
11
|
+
constructing clients. More information on versioned clients can be found below
|
12
|
+
in the section titled *Which client should I use?*.
|
13
|
+
|
14
|
+
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-bigquery-data_transfer/latest)
|
15
|
+
for this library, google-cloud-bigquery-data_transfer, to see the convenience methods for
|
16
|
+
constructing client objects. Reference documentation for the client objects
|
17
|
+
themselves can be found in the client library documentation for the versioned
|
18
|
+
client gems:
|
19
|
+
[google-cloud-bigquery-data_transfer-v1](https://googleapis.dev/ruby/google-cloud-bigquery-data_transfer-v1/latest).
|
20
|
+
|
21
|
+
See also the [Product Documentation](https://cloud.google.com/bigquery/transfer)
|
22
|
+
for more usage information.
|
23
|
+
|
24
|
+
## Quick Start
|
17
25
|
|
18
|
-
### Installation
|
19
26
|
```
|
20
27
|
$ gem install google-cloud-bigquery-data_transfer
|
21
28
|
```
|
22
29
|
|
23
|
-
|
24
|
-
#### DataTransferServiceClient
|
25
|
-
```rb
|
26
|
-
require "google/cloud/bigquery/data_transfer"
|
27
|
-
|
28
|
-
data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new
|
29
|
-
formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_path(project_id)
|
30
|
+
In order to use this library, you first need to go through the following steps:
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
# Or iterate over results one page at a time.
|
37
|
-
data_transfer_client.list_data_sources(formatted_parent).each_page do |page|
|
38
|
-
# Process each page at a time.
|
39
|
-
page.each do |element|
|
40
|
-
# Process element.
|
41
|
-
end
|
42
|
-
end
|
43
|
-
```
|
32
|
+
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
33
|
+
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
34
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/bigquerydatatransfer.googleapis.com)
|
35
|
+
1. {file:AUTHENTICATION.md Set up authentication.}
|
44
36
|
|
45
|
-
|
46
|
-
- Read the [Client Library Documentation][] for BigQuery Data Transfer API
|
47
|
-
to see other available methods on the client.
|
48
|
-
- Read the [BigQuery Data Transfer API Product documentation][Product Documentation]
|
49
|
-
to learn more about the product and see How-to Guides.
|
50
|
-
- View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
51
|
-
to see the full list of Cloud APIs that we cover.
|
37
|
+
## Migrating from 0.x versions
|
52
38
|
|
53
|
-
|
54
|
-
[
|
39
|
+
The 1.0 release of the google-cloud-bigquery-data_transfer client is a significant upgrade
|
40
|
+
based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
|
41
|
+
and includes substantial interface changes. Existing code written for earlier
|
42
|
+
versions of this library will likely require updates to use this version.
|
43
|
+
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
55
44
|
|
56
45
|
## Enabling Logging
|
57
46
|
|
58
47
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
59
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib
|
48
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
60
49
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
61
|
-
that will write logs to [
|
50
|
+
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
62
51
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
63
52
|
|
64
53
|
Configuring a Ruby stdlib logger:
|
@@ -89,3 +78,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
|
|
89
78
|
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
90
79
|
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
91
80
|
about the Ruby support schedule.
|
81
|
+
|
82
|
+
## Which client should I use?
|
83
|
+
|
84
|
+
Most modern Ruby client libraries for Google APIs come in two flavors: the main
|
85
|
+
client library with a name such as `google-cloud-bigquery-data_transfer`,
|
86
|
+
and lower-level _versioned_ client libraries with names such as
|
87
|
+
`google-cloud-bigquery-data_transfer-v1`.
|
88
|
+
_In most cases, you should install the main client._
|
89
|
+
|
90
|
+
### What's the difference between the main client and a versioned client?
|
91
|
+
|
92
|
+
A _versioned client_ provides a basic set of data types and client classes for
|
93
|
+
a _single version_ of a specific service. (That is, for a service with multiple
|
94
|
+
versions, there might be a separate versioned client for each service version.)
|
95
|
+
Most versioned clients are written and maintained by a code generator.
|
96
|
+
|
97
|
+
The _main client_ is designed to provide you with the _recommended_ client
|
98
|
+
interfaces for the service. There will be only one main client for any given
|
99
|
+
service, even a service with multiple versions. The main client includes
|
100
|
+
factory methods for constructing the client objects we recommend for most
|
101
|
+
users. In some cases, those will be classes provided by an underlying versioned
|
102
|
+
client; in other cases, they will be handwritten higher-level client objects
|
103
|
+
with additional capabilities, convenience methods, or best practices built in.
|
104
|
+
Generally, the main client will default to a recommended service version,
|
105
|
+
although in some cases you can override this if you need to talk to a specific
|
106
|
+
service version.
|
107
|
+
|
108
|
+
### Why would I want to use the main client?
|
109
|
+
|
110
|
+
We recommend that most users install the main client gem for a service. You can
|
111
|
+
identify this gem as the one _without_ a version in its name, e.g.
|
112
|
+
`google-cloud-bigquery-data_transfer`.
|
113
|
+
The main client is recommended because it will embody the best practices for
|
114
|
+
accessing the service, and may also provide more convenient interfaces or
|
115
|
+
tighter integration into frameworks and third-party libraries. In addition, the
|
116
|
+
documentation and samples published by Google will generally demonstrate use of
|
117
|
+
the main client.
|
118
|
+
|
119
|
+
### Why would I want to use a versioned client?
|
120
|
+
|
121
|
+
You can use a versioned client if you are content with a possibly lower-level
|
122
|
+
class interface, you explicitly want to avoid features provided by the main
|
123
|
+
client, or you want to access a specific service version not be covered by the
|
124
|
+
main client. You can identify versioned client gems because the service version
|
125
|
+
is part of the name, e.g. `google-cloud-bigquery-data_transfer-v1`.
|
126
|
+
|
127
|
+
### What about the google-apis-<name> clients?
|
128
|
+
|
129
|
+
Client library gems with names that begin with `google-apis-` are based on an
|
130
|
+
older code generation technology. They talk to a REST/JSON backend (whereas
|
131
|
+
most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
|
132
|
+
not offer the same performance, features, and ease of use provided by more
|
133
|
+
modern clients.
|
134
|
+
|
135
|
+
The `google-apis-` clients have wide coverage across Google services, so you
|
136
|
+
might need to use one if there is no modern client available for the service.
|
137
|
+
However, if a modern client is available, we generally recommend it over the
|
138
|
+
older `google-apis-` clients.
|
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
# you may not use this file except in compliance with the License.
|
@@ -12,14 +14,6 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
15
18
|
|
16
|
-
|
17
|
-
module Cloud
|
18
|
-
module Bigquery
|
19
|
-
module Datatransfer
|
20
|
-
module V1
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
19
|
+
require "google/cloud/bigquery/data_transfer" unless defined? Google::Cloud::Bigquery::DataTransfer::VERSION
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Copyright 2020 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -12,161 +14,107 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
# Require this file early so that the version constant gets defined before
|
20
|
+
# requiring "google/cloud". This is because google-cloud-core will load the
|
21
|
+
# entrypoint (gem name) file, which in turn re-requires this file (hence
|
22
|
+
# causing a require cycle) unless the version constant is already defined.
|
23
|
+
require "google/cloud/bigquery/data_transfer/version"
|
24
|
+
|
25
|
+
require "googleauth"
|
26
|
+
gem "google-cloud-core"
|
27
|
+
require "google/cloud" unless defined? ::Google::Cloud.new
|
28
|
+
require "google/cloud/config"
|
15
29
|
|
16
|
-
|
17
|
-
|
30
|
+
# Set the default configuration
|
31
|
+
::Google::Cloud.configure.add_config! :bigquery_data_transfer do |config|
|
32
|
+
config.add_field! :endpoint, "bigquerydatatransfer.googleapis.com", match: ::String
|
33
|
+
config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
|
34
|
+
config.add_field! :scope, nil, match: [::Array, ::String]
|
35
|
+
config.add_field! :lib_name, nil, match: ::String
|
36
|
+
config.add_field! :lib_version, nil, match: ::String
|
37
|
+
config.add_field! :interceptors, nil, match: ::Array
|
38
|
+
config.add_field! :timeout, nil, match: ::Numeric
|
39
|
+
config.add_field! :metadata, nil, match: ::Hash
|
40
|
+
config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
|
41
|
+
config.add_field! :quota_project, nil, match: ::String
|
42
|
+
end
|
18
43
|
|
19
44
|
module Google
|
20
45
|
module Cloud
|
21
46
|
module Bigquery
|
22
|
-
# rubocop:disable LineLength
|
23
|
-
|
24
|
-
##
|
25
|
-
# # Ruby Client for BigQuery Data Transfer API
|
26
|
-
#
|
27
|
-
# [BigQuery Data Transfer API][Product Documentation]:
|
28
|
-
# Schedule queries or transfer external data from SaaS applications to Google
|
29
|
-
# BigQuery on a regular basis.
|
30
|
-
# - [Product Documentation][]
|
31
|
-
#
|
32
|
-
# ## Quick Start
|
33
|
-
# In order to use this library, you first need to go through the following
|
34
|
-
# steps:
|
35
|
-
#
|
36
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
37
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
38
|
-
# 3. [Enable the BigQuery Data Transfer API.](https://console.cloud.google.com/apis/library/bigquerydatatransfer.googleapis.com)
|
39
|
-
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-bigquery-data_transfer/latest/file.AUTHENTICATION.html)
|
40
|
-
#
|
41
|
-
# ### Installation
|
42
|
-
# ```
|
43
|
-
# $ gem install google-cloud-bigquery-data_transfer
|
44
|
-
# ```
|
45
|
-
#
|
46
|
-
# ### Preview
|
47
|
-
# #### DataTransferServiceClient
|
48
|
-
# ```rb
|
49
|
-
# require "google/cloud/bigquery/data_transfer"
|
50
|
-
#
|
51
|
-
# data_transfer_client = Google::Cloud::Bigquery::DataTransfer.new
|
52
|
-
# formatted_parent = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferServiceClient.project_path(project_id)
|
53
|
-
#
|
54
|
-
# # Iterate over all results.
|
55
|
-
# data_transfer_client.list_data_sources(formatted_parent).each do |element|
|
56
|
-
# # Process element.
|
57
|
-
# end
|
58
|
-
#
|
59
|
-
# # Or iterate over results one page at a time.
|
60
|
-
# data_transfer_client.list_data_sources(formatted_parent).each_page do |page|
|
61
|
-
# # Process each page at a time.
|
62
|
-
# page.each do |element|
|
63
|
-
# # Process element.
|
64
|
-
# end
|
65
|
-
# end
|
66
|
-
# ```
|
67
|
-
#
|
68
|
-
# ### Next Steps
|
69
|
-
# - Read the [BigQuery Data Transfer API Product documentation][Product Documentation]
|
70
|
-
# to learn more about the product and see How-to Guides.
|
71
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
72
|
-
# to see the full list of Cloud APIs that we cover.
|
73
|
-
#
|
74
|
-
# [Product Documentation]: https://cloud.google.com/bigquery/transfer/
|
75
|
-
#
|
76
|
-
# ## Enabling Logging
|
77
|
-
#
|
78
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
79
|
-
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
80
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
81
|
-
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
82
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
83
|
-
#
|
84
|
-
# Configuring a Ruby stdlib logger:
|
85
|
-
#
|
86
|
-
# ```ruby
|
87
|
-
# require "logger"
|
88
|
-
#
|
89
|
-
# module MyLogger
|
90
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
91
|
-
# def logger
|
92
|
-
# LOGGER
|
93
|
-
# end
|
94
|
-
# end
|
95
|
-
#
|
96
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
97
|
-
# module GRPC
|
98
|
-
# extend MyLogger
|
99
|
-
# end
|
100
|
-
# ```
|
101
|
-
#
|
102
47
|
module DataTransfer
|
103
|
-
# rubocop:enable LineLength
|
104
|
-
|
105
|
-
FILE_DIR = File.realdirpath(Pathname.new(__FILE__).join("..").join("data_transfer"))
|
106
|
-
|
107
|
-
AVAILABLE_VERSIONS = Dir["#{FILE_DIR}/*"]
|
108
|
-
.select { |file| File.directory?(file) }
|
109
|
-
.select { |dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir)) }
|
110
|
-
.select { |dir| File.exist?(dir + ".rb") }
|
111
|
-
.map { |dir| File.basename(dir) }
|
112
|
-
|
113
48
|
##
|
49
|
+
# Create a new client object for DataTransferService.
|
50
|
+
#
|
51
|
+
# By default, this returns an instance of
|
52
|
+
# [Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client](https://googleapis.dev/ruby/google-cloud-bigquery-data_transfer-v1/latest/Google/Cloud/Bigquery/DataTransfer/V1/DataTransferService/Client.html)
|
53
|
+
# for version V1 of the API.
|
54
|
+
# However, you can specify specify a different API version by passing it in the
|
55
|
+
# `version` parameter. If the DataTransferService service is
|
56
|
+
# supported by that API version, and the corresponding gem is available, the
|
57
|
+
# appropriate versioned client will be returned.
|
58
|
+
#
|
59
|
+
# ## About DataTransferService
|
60
|
+
#
|
114
61
|
# The Google BigQuery Data Transfer Service API enables BigQuery users to
|
115
62
|
# configure the transfer of their data from other Google Products into
|
116
63
|
# BigQuery. This service contains methods that are end user exposed. It backs
|
117
64
|
# up the frontend.
|
118
65
|
#
|
119
|
-
# @param version [
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
66
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
67
|
+
# Defaults to `:v1`.
|
68
|
+
# @return [DataTransferService::Client] A client object for the specified version.
|
69
|
+
#
|
70
|
+
def self.data_transfer_service version: :v1, &block
|
71
|
+
require "google/cloud/bigquery/data_transfer/#{version.to_s.downcase}"
|
72
|
+
|
73
|
+
package_name = Google::Cloud::Bigquery::DataTransfer
|
74
|
+
.constants
|
75
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
76
|
+
.first
|
77
|
+
package_module = Google::Cloud::Bigquery::DataTransfer.const_get package_name
|
78
|
+
package_module.const_get(:DataTransferService).const_get(:Client).new(&block)
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Configure the google-cloud-bigquery-data_transfer library.
|
83
|
+
#
|
84
|
+
# The following configuration parameters are supported:
|
85
|
+
#
|
86
|
+
# * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
|
87
|
+
# The path to the keyfile as a String, the contents of the keyfile as a
|
88
|
+
# Hash, or a Google::Auth::Credentials object.
|
89
|
+
# * `lib_name` (*type:* `String`) -
|
90
|
+
# The library name as recorded in instrumentation and logging.
|
91
|
+
# * `lib_version` (*type:* `String`) -
|
92
|
+
# The library version as recorded in instrumentation and logging.
|
93
|
+
# * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
|
94
|
+
# An array of interceptors that are run before calls are executed.
|
95
|
+
# * `timeout` (*type:* `Numeric`) -
|
96
|
+
# Default timeout in seconds.
|
97
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
98
|
+
# Additional gRPC headers to be sent with the call.
|
99
|
+
# * `retry_policy` (*type:* `Hash`) -
|
100
|
+
# The retry policy. The value is a hash with the following keys:
|
101
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
102
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
103
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
104
|
+
# * `:retry_codes` (*type:* `Array<String>`) -
|
105
|
+
# The error codes that should trigger a retry.
|
106
|
+
#
|
107
|
+
# @return [::Google::Cloud::Config] The default configuration used by this library
|
108
|
+
#
|
109
|
+
def self.configure
|
110
|
+
yield ::Google::Cloud.configure.bigquery_data_transfer if block_given?
|
161
111
|
|
162
|
-
|
163
|
-
version_module = Google::Cloud::Bigquery::DataTransfer
|
164
|
-
.constants
|
165
|
-
.select {|sym| sym.to_s.downcase == version.to_s.downcase}
|
166
|
-
.first
|
167
|
-
Google::Cloud::Bigquery::DataTransfer.const_get(version_module).new(*args, **kwargs)
|
112
|
+
::Google::Cloud.configure.bigquery_data_transfer
|
168
113
|
end
|
169
114
|
end
|
170
115
|
end
|
171
116
|
end
|
172
117
|
end
|
118
|
+
|
119
|
+
helper_path = ::File.join __dir__, "data_transfer", "helpers.rb"
|
120
|
+
require "google/cloud/bigquery/data_transfer/helpers" if ::File.file? helper_path
|
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
2
4
|
#
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
# you may not use this file except in compliance with the License.
|
@@ -12,12 +14,14 @@
|
|
12
14
|
# See the License for the specific language governing permissions and
|
13
15
|
# limitations under the License.
|
14
16
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
15
19
|
|
16
20
|
module Google
|
17
21
|
module Cloud
|
18
22
|
module Bigquery
|
19
23
|
module DataTransfer
|
20
|
-
VERSION = "
|
24
|
+
VERSION = "1.1.2"
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|