google-cloud-bigquery-storage-v1 1.8.1 → 1.10.0

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/bigquery/storage/v1/big_query_read/client.rb +6 -2
  4. data/lib/google/cloud/bigquery/storage/v1/big_query_read/credentials.rb +1 -1
  5. data/lib/google/cloud/bigquery/storage/v1/big_query_read/paths.rb +1 -1
  6. data/lib/google/cloud/bigquery/storage/v1/big_query_read/rest/client.rb +694 -0
  7. data/lib/google/cloud/bigquery/storage/v1/big_query_read/rest/service_stub.rb +261 -0
  8. data/lib/google/cloud/bigquery/storage/v1/big_query_read/rest.rb +56 -0
  9. data/lib/google/cloud/bigquery/storage/v1/big_query_read.rb +7 -1
  10. data/lib/google/cloud/bigquery/storage/v1/big_query_write/client.rb +1 -1
  11. data/lib/google/cloud/bigquery/storage/v1/big_query_write/credentials.rb +1 -1
  12. data/lib/google/cloud/bigquery/storage/v1/big_query_write/paths.rb +1 -1
  13. data/lib/google/cloud/bigquery/storage/v1/big_query_write/rest/client.rb +830 -0
  14. data/lib/google/cloud/bigquery/storage/v1/big_query_write/rest/service_stub.rb +392 -0
  15. data/lib/google/cloud/bigquery/storage/v1/big_query_write/rest.rb +59 -0
  16. data/lib/google/cloud/bigquery/storage/v1/big_query_write.rb +7 -1
  17. data/lib/google/cloud/bigquery/storage/v1/rest.rb +40 -0
  18. data/lib/google/cloud/bigquery/storage/v1/storage_pb.rb +4 -1
  19. data/lib/google/cloud/bigquery/storage/v1/storage_services_pb.rb +1 -1
  20. data/lib/google/cloud/bigquery/storage/v1/stream_pb.rb +1 -1
  21. data/lib/google/cloud/bigquery/storage/v1/table_pb.rb +1 -1
  22. data/lib/google/cloud/bigquery/storage/v1/version.rb +1 -1
  23. data/lib/google/cloud/bigquery/storage/v1.rb +6 -1
  24. data/lib/google-cloud-bigquery-storage-v1.rb +1 -1
  25. data/proto_docs/google/api/client.rb +1 -1
  26. data/proto_docs/google/api/field_behavior.rb +1 -1
  27. data/proto_docs/google/api/launch_stage.rb +1 -1
  28. data/proto_docs/google/api/resource.rb +1 -1
  29. data/proto_docs/google/cloud/bigquery/storage/v1/arrow.rb +1 -1
  30. data/proto_docs/google/cloud/bigquery/storage/v1/avro.rb +1 -1
  31. data/proto_docs/google/cloud/bigquery/storage/v1/protobuf.rb +1 -1
  32. data/proto_docs/google/cloud/bigquery/storage/v1/storage.rb +81 -2
  33. data/proto_docs/google/cloud/bigquery/storage/v1/stream.rb +1 -1
  34. data/proto_docs/google/cloud/bigquery/storage/v1/table.rb +1 -1
  35. data/proto_docs/google/protobuf/any.rb +1 -1
  36. data/proto_docs/google/protobuf/duration.rb +1 -1
  37. data/proto_docs/google/protobuf/timestamp.rb +8 -7
  38. data/proto_docs/google/protobuf/wrappers.rb +1 -1
  39. data/proto_docs/google/rpc/status.rb +1 -1
  40. metadata +13 -6
@@ -0,0 +1,261 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/bigquery/storage/v1/storage_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Bigquery
24
+ module Storage
25
+ module V1
26
+ module BigQueryRead
27
+ module Rest
28
+ ##
29
+ # REST service stub for the BigQueryRead service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
36
+ # These require statements are intentionally placed here to initialize
37
+ # the REST modules only when it's required.
38
+ require "gapic/rest"
39
+
40
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
41
+ endpoint_template: endpoint_template,
42
+ universe_domain: universe_domain,
43
+ credentials: credentials,
44
+ numeric_enums: false,
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
48
+ end
49
+
50
+ ##
51
+ # The effective universe domain
52
+ #
53
+ # @return [String]
54
+ #
55
+ def universe_domain
56
+ @client_stub.universe_domain
57
+ end
58
+
59
+ ##
60
+ # The effective endpoint
61
+ #
62
+ # @return [String]
63
+ #
64
+ def endpoint
65
+ @client_stub.endpoint
66
+ end
67
+
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
77
+ ##
78
+ # Baseline implementation for the create_read_session REST call
79
+ #
80
+ # @param request_pb [::Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest]
81
+ # A request object representing the call parameters. Required.
82
+ # @param options [::Gapic::CallOptions]
83
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
84
+ #
85
+ # @yield [result, operation] Access the result along with the TransportOperation object
86
+ # @yieldparam result [::Google::Cloud::Bigquery::Storage::V1::ReadSession]
87
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
88
+ #
89
+ # @return [::Google::Cloud::Bigquery::Storage::V1::ReadSession]
90
+ # A result object deserialized from the server's reply
91
+ def create_read_session request_pb, options = nil
92
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
93
+
94
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_read_session_request request_pb
95
+ query_string_params = if query_string_params.any?
96
+ query_string_params.to_h { |p| p.split "=", 2 }
97
+ else
98
+ {}
99
+ end
100
+
101
+ response = @client_stub.make_http_request(
102
+ verb,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "create_read_session",
107
+ options: options
108
+ )
109
+ operation = ::Gapic::Rest::TransportOperation.new response
110
+ result = ::Google::Cloud::Bigquery::Storage::V1::ReadSession.decode_json response.body, ignore_unknown_fields: true
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
115
+ end
116
+
117
+ ##
118
+ # Baseline implementation for the read_rows REST call
119
+ #
120
+ # @param request_pb [::Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest]
121
+ # A request object representing the call parameters. Required.
122
+ # @param options [::Gapic::CallOptions]
123
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
124
+ #
125
+ # @yieldparam chunk [::String] The chunk of data received during server streaming.
126
+ #
127
+ # @return [::Gapic::Rest::TransportOperation]
128
+ def read_rows(request_pb, options = nil, &)
129
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
130
+
131
+ verb, uri, query_string_params, body = ServiceStub.transcode_read_rows_request request_pb
132
+ query_string_params = if query_string_params.any?
133
+ query_string_params.to_h { |p| p.split "=", 2 }
134
+ else
135
+ {}
136
+ end
137
+
138
+ response = @client_stub.make_http_request(
139
+ verb,
140
+ uri: uri,
141
+ body: body || "",
142
+ params: query_string_params,
143
+ method_name: "read_rows",
144
+ options: options,
145
+ is_server_streaming: true,
146
+ &
147
+ )
148
+ ::Gapic::Rest::TransportOperation.new response
149
+ end
150
+
151
+ ##
152
+ # Baseline implementation for the split_read_stream REST call
153
+ #
154
+ # @param request_pb [::Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest]
155
+ # A request object representing the call parameters. Required.
156
+ # @param options [::Gapic::CallOptions]
157
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
158
+ #
159
+ # @yield [result, operation] Access the result along with the TransportOperation object
160
+ # @yieldparam result [::Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse]
161
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
162
+ #
163
+ # @return [::Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse]
164
+ # A result object deserialized from the server's reply
165
+ def split_read_stream request_pb, options = nil
166
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
167
+
168
+ verb, uri, query_string_params, body = ServiceStub.transcode_split_read_stream_request request_pb
169
+ query_string_params = if query_string_params.any?
170
+ query_string_params.to_h { |p| p.split "=", 2 }
171
+ else
172
+ {}
173
+ end
174
+
175
+ response = @client_stub.make_http_request(
176
+ verb,
177
+ uri: uri,
178
+ body: body || "",
179
+ params: query_string_params,
180
+ method_name: "split_read_stream",
181
+ options: options
182
+ )
183
+ operation = ::Gapic::Rest::TransportOperation.new response
184
+ result = ::Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse.decode_json response.body, ignore_unknown_fields: true
185
+ catch :response do
186
+ yield result, operation if block_given?
187
+ result
188
+ end
189
+ end
190
+
191
+ ##
192
+ # @private
193
+ #
194
+ # GRPC transcoding helper method for the create_read_session REST call
195
+ #
196
+ # @param request_pb [::Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest]
197
+ # A request object representing the call parameters. Required.
198
+ # @return [Array(String, [String, nil], Hash{String => String})]
199
+ # Uri, Body, Query string parameters
200
+ def self.transcode_create_read_session_request request_pb
201
+ transcoder = Gapic::Rest::GrpcTranscoder.new
202
+ .with_bindings(
203
+ uri_method: :post,
204
+ uri_template: "/v1/{read_session.table}",
205
+ body: "*",
206
+ matches: [
207
+ ["read_session.table", %r{^projects/[^/]+/datasets/[^/]+/tables/[^/]+/?$}, false]
208
+ ]
209
+ )
210
+ transcoder.transcode request_pb
211
+ end
212
+
213
+ ##
214
+ # @private
215
+ #
216
+ # GRPC transcoding helper method for the read_rows REST call
217
+ #
218
+ # @param request_pb [::Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest]
219
+ # A request object representing the call parameters. Required.
220
+ # @return [Array(String, [String, nil], Hash{String => String})]
221
+ # Uri, Body, Query string parameters
222
+ def self.transcode_read_rows_request request_pb
223
+ transcoder = Gapic::Rest::GrpcTranscoder.new
224
+ .with_bindings(
225
+ uri_method: :get,
226
+ uri_template: "/v1/{read_stream}",
227
+ matches: [
228
+ ["read_stream", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/streams/[^/]+/?$}, false]
229
+ ]
230
+ )
231
+ transcoder.transcode request_pb
232
+ end
233
+
234
+ ##
235
+ # @private
236
+ #
237
+ # GRPC transcoding helper method for the split_read_stream REST call
238
+ #
239
+ # @param request_pb [::Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest]
240
+ # A request object representing the call parameters. Required.
241
+ # @return [Array(String, [String, nil], Hash{String => String})]
242
+ # Uri, Body, Query string parameters
243
+ def self.transcode_split_read_stream_request request_pb
244
+ transcoder = Gapic::Rest::GrpcTranscoder.new
245
+ .with_bindings(
246
+ uri_method: :get,
247
+ uri_template: "/v1/{name}",
248
+ matches: [
249
+ ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/streams/[^/]+/?$}, false]
250
+ ]
251
+ )
252
+ transcoder.transcode request_pb
253
+ end
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/bigquery/storage/v1/version"
24
+
25
+ require "google/cloud/bigquery/storage/v1/big_query_read/credentials"
26
+ require "google/cloud/bigquery/storage/v1/big_query_read/paths"
27
+ require "google/cloud/bigquery/storage/v1/big_query_read/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Bigquery
32
+ module Storage
33
+ module V1
34
+ ##
35
+ # BigQuery Read API.
36
+ #
37
+ # The Read API can be used to read data from BigQuery.
38
+ #
39
+ # To load this service and instantiate a REST client:
40
+ #
41
+ # require "google/cloud/bigquery/storage/v1/big_query_read/rest"
42
+ # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Rest::Client.new
43
+ #
44
+ module BigQueryRead
45
+ # Client for the REST transport
46
+ module Rest
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
56
+ require "google/cloud/bigquery/storage/v1/big_query_read/rest/helpers" if ::File.file? helper_path
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ require "google/cloud/bigquery/storage/v1/version"
25
25
  require "google/cloud/bigquery/storage/v1/big_query_read/credentials"
26
26
  require "google/cloud/bigquery/storage/v1/big_query_read/paths"
27
27
  require "google/cloud/bigquery/storage/v1/big_query_read/client"
28
+ require "google/cloud/bigquery/storage/v1/big_query_read/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -41,6 +42,11 @@ module Google
41
42
  # require "google/cloud/bigquery/storage/v1/big_query_read"
42
43
  # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new
43
44
  #
45
+ # @example Load this service and instantiate a REST client
46
+ #
47
+ # require "google/cloud/bigquery/storage/v1/big_query_read/rest"
48
+ # client = ::Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Rest::Client.new
49
+ #
44
50
  module BigQueryRead
45
51
  end
46
52
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2021 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2021 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2021 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.