google-cloud-batch-v1 0.19.1 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_job REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_job",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Batch::V1::Job.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_job",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::Batch::V1::Job.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "delete_job",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "list_jobs",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::Batch::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "get_task",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::Batch::V1::Task.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -277,16 +299,18 @@ module Google
277
299
 
278
300
  response = @client_stub.make_http_request(
279
301
  verb,
280
- uri: uri,
281
- body: body || "",
282
- params: query_string_params,
302
+ uri: uri,
303
+ body: body || "",
304
+ params: query_string_params,
305
+ method_name: "list_tasks",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::Batch::V1::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true
287
-
288
- yield result, operation if block_given?
289
- result
310
+ catch :response do
311
+ yield result, operation if block_given?
312
+ result
313
+ end
290
314
  end
291
315
 
292
316
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Batch
23
23
  module V1
24
- VERSION = "0.19.1"
24
+ VERSION = "0.20.0"
25
25
  end
26
26
  end
27
27
  end
@@ -29,7 +29,6 @@ module Google
29
29
  #
30
30
  # API Overview
31
31
  #
32
- #
33
32
  # Manages Identity and Access Management (IAM) policies.
34
33
  #
35
34
  # Any implementation of an API that offers access control features
@@ -180,14 +179,26 @@ module Google
180
179
  universe_domain: @config.universe_domain,
181
180
  channel_args: @config.channel_args,
182
181
  interceptors: @config.interceptors,
183
- channel_pool_config: @config.channel_pool
182
+ channel_pool_config: @config.channel_pool,
183
+ logger: @config.logger
184
184
  )
185
185
 
186
+ @iam_policy_stub.stub_logger&.info do |entry|
187
+ entry.set_system_name
188
+ entry.set_service
189
+ entry.message = "Created client for #{entry.service}"
190
+ entry.set_credentials_fields credentials
191
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
192
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
193
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
194
+ end
195
+
186
196
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
187
197
  config.credentials = credentials
188
198
  config.quota_project = @quota_project_id
189
199
  config.endpoint = @iam_policy_stub.endpoint
190
200
  config.universe_domain = @iam_policy_stub.universe_domain
201
+ config.logger = @iam_policy_stub.logger if config.respond_to? :logger=
191
202
  end
192
203
  end
193
204
 
@@ -198,6 +209,15 @@ module Google
198
209
  #
199
210
  attr_reader :location_client
200
211
 
212
+ ##
213
+ # The logger used for request/response debug logging.
214
+ #
215
+ # @return [Logger]
216
+ #
217
+ def logger
218
+ @iam_policy_stub.logger
219
+ end
220
+
201
221
  # Service calls
202
222
 
203
223
  ##
@@ -295,7 +315,6 @@ module Google
295
315
 
296
316
  @iam_policy_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
297
317
  yield response, operation if block_given?
298
- return response
299
318
  end
300
319
  rescue ::GRPC::BadStatus => e
301
320
  raise ::Google::Cloud::Error.from_error(e)
@@ -387,7 +406,6 @@ module Google
387
406
 
388
407
  @iam_policy_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
389
408
  yield response, operation if block_given?
390
- return response
391
409
  end
392
410
  rescue ::GRPC::BadStatus => e
393
411
  raise ::Google::Cloud::Error.from_error(e)
@@ -485,7 +503,6 @@ module Google
485
503
 
486
504
  @iam_policy_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
487
505
  yield response, operation if block_given?
488
- return response
489
506
  end
490
507
  rescue ::GRPC::BadStatus => e
491
508
  raise ::Google::Cloud::Error.from_error(e)
@@ -574,6 +591,11 @@ module Google
574
591
  # default endpoint URL. The default value of nil uses the environment
575
592
  # universe (usually the default "googleapis.com" universe).
576
593
  # @return [::String,nil]
594
+ # @!attribute [rw] logger
595
+ # A custom logger to use for request/response debug logging, or the value
596
+ # `:default` (the default) to construct a default logger, or `nil` to
597
+ # explicitly disable logging.
598
+ # @return [::Logger,:default,nil]
577
599
  #
578
600
  class Configuration
579
601
  extend ::Gapic::Config
@@ -598,6 +620,7 @@ module Google
598
620
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
599
621
  config_attr :quota_project, nil, ::String, nil
600
622
  config_attr :universe_domain, nil, ::String, nil
623
+ config_attr :logger, :default, ::Logger, nil, :default
601
624
 
602
625
  # @private
603
626
  def initialize parent_config = nil
@@ -31,7 +31,6 @@ module Google
31
31
  #
32
32
  # API Overview
33
33
  #
34
- #
35
34
  # Manages Identity and Access Management (IAM) policies.
36
35
  #
37
36
  # Any implementation of an API that offers access control features
@@ -173,15 +172,27 @@ module Google
173
172
  endpoint: @config.endpoint,
174
173
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
174
  universe_domain: @config.universe_domain,
176
- credentials: credentials
175
+ credentials: credentials,
176
+ logger: @config.logger
177
177
  )
178
178
 
179
+ @iam_policy_stub.logger(stub: true)&.info do |entry|
180
+ entry.set_system_name
181
+ entry.set_service
182
+ entry.message = "Created client for #{entry.service}"
183
+ entry.set_credentials_fields credentials
184
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
185
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
186
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
187
+ end
188
+
179
189
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
180
190
  config.credentials = credentials
181
191
  config.quota_project = @quota_project_id
182
192
  config.endpoint = @iam_policy_stub.endpoint
183
193
  config.universe_domain = @iam_policy_stub.universe_domain
184
194
  config.bindings_override = @config.bindings_override
195
+ config.logger = @iam_policy_stub.logger if config.respond_to? :logger=
185
196
  end
186
197
  end
187
198
 
@@ -192,6 +203,15 @@ module Google
192
203
  #
193
204
  attr_reader :location_client
194
205
 
206
+ ##
207
+ # The logger used for request/response debug logging.
208
+ #
209
+ # @return [Logger]
210
+ #
211
+ def logger
212
+ @iam_policy_stub.logger
213
+ end
214
+
195
215
  # Service calls
196
216
 
197
217
  ##
@@ -282,7 +302,6 @@ module Google
282
302
 
283
303
  @iam_policy_stub.set_iam_policy request, options do |result, operation|
284
304
  yield result, operation if block_given?
285
- return result
286
305
  end
287
306
  rescue ::Gapic::Rest::Error => e
288
307
  raise ::Google::Cloud::Error.from_error(e)
@@ -367,7 +386,6 @@ module Google
367
386
 
368
387
  @iam_policy_stub.get_iam_policy request, options do |result, operation|
369
388
  yield result, operation if block_given?
370
- return result
371
389
  end
372
390
  rescue ::Gapic::Rest::Error => e
373
391
  raise ::Google::Cloud::Error.from_error(e)
@@ -458,7 +476,6 @@ module Google
458
476
 
459
477
  @iam_policy_stub.test_iam_permissions request, options do |result, operation|
460
478
  yield result, operation if block_given?
461
- return result
462
479
  end
463
480
  rescue ::Gapic::Rest::Error => e
464
481
  raise ::Google::Cloud::Error.from_error(e)
@@ -538,6 +555,11 @@ module Google
538
555
  # default endpoint URL. The default value of nil uses the environment
539
556
  # universe (usually the default "googleapis.com" universe).
540
557
  # @return [::String,nil]
558
+ # @!attribute [rw] logger
559
+ # A custom logger to use for request/response debug logging, or the value
560
+ # `:default` (the default) to construct a default logger, or `nil` to
561
+ # explicitly disable logging.
562
+ # @return [::Logger,:default,nil]
541
563
  #
542
564
  class Configuration
543
565
  extend ::Gapic::Config
@@ -566,6 +588,7 @@ module Google
566
588
  # by the host service.
567
589
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
568
590
  config_attr :bindings_override, {}, ::Hash, nil
591
+ config_attr :logger, :default, ::Logger, nil, :default
569
592
 
570
593
  # @private
571
594
  def initialize parent_config = nil
@@ -29,7 +29,8 @@ module Google
29
29
  # including transcoding, making the REST call, and deserialing the response.
30
30
  #
31
31
  class ServiceStub
32
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
32
+ # @private
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
33
34
  # These require statements are intentionally placed here to initialize
34
35
  # the REST modules only when it's required.
35
36
  require "gapic/rest"
@@ -39,7 +40,9 @@ module Google
39
40
  universe_domain: universe_domain,
40
41
  credentials: credentials,
41
42
  numeric_enums: true,
42
- raise_faraday_errors: false
43
+ service_name: self.class,
44
+ raise_faraday_errors: false,
45
+ logger: logger
43
46
  end
44
47
 
45
48
  ##
@@ -60,6 +63,15 @@ module Google
60
63
  @client_stub.endpoint
61
64
  end
62
65
 
66
+ ##
67
+ # The logger used for request/response debug logging.
68
+ #
69
+ # @return [Logger]
70
+ #
71
+ def logger stub: false
72
+ stub ? @client_stub.stub_logger : @client_stub.logger
73
+ end
74
+
63
75
  ##
64
76
  # Baseline implementation for the set_iam_policy REST call
65
77
  #
@@ -86,16 +98,18 @@ module Google
86
98
 
87
99
  response = @client_stub.make_http_request(
88
100
  verb,
89
- uri: uri,
90
- body: body || "",
91
- params: query_string_params,
101
+ uri: uri,
102
+ body: body || "",
103
+ params: query_string_params,
104
+ method_name: "set_iam_policy",
92
105
  options: options
93
106
  )
94
107
  operation = ::Gapic::Rest::TransportOperation.new response
95
108
  result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
96
-
97
- yield result, operation if block_given?
98
- result
109
+ catch :response do
110
+ yield result, operation if block_given?
111
+ result
112
+ end
99
113
  end
100
114
 
101
115
  ##
@@ -124,16 +138,18 @@ module Google
124
138
 
125
139
  response = @client_stub.make_http_request(
126
140
  verb,
127
- uri: uri,
128
- body: body || "",
129
- params: query_string_params,
141
+ uri: uri,
142
+ body: body || "",
143
+ params: query_string_params,
144
+ method_name: "get_iam_policy",
130
145
  options: options
131
146
  )
132
147
  operation = ::Gapic::Rest::TransportOperation.new response
133
148
  result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true
134
-
135
- yield result, operation if block_given?
136
- result
149
+ catch :response do
150
+ yield result, operation if block_given?
151
+ result
152
+ end
137
153
  end
138
154
 
139
155
  ##
@@ -162,16 +178,18 @@ module Google
162
178
 
163
179
  response = @client_stub.make_http_request(
164
180
  verb,
165
- uri: uri,
166
- body: body || "",
167
- params: query_string_params,
181
+ uri: uri,
182
+ body: body || "",
183
+ params: query_string_params,
184
+ method_name: "test_iam_permissions",
168
185
  options: options
169
186
  )
170
187
  operation = ::Gapic::Rest::TransportOperation.new response
171
188
  result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
172
-
173
- yield result, operation if block_given?
174
- result
189
+ catch :response do
190
+ yield result, operation if block_given?
191
+ result
192
+ end
175
193
  end
176
194
 
177
195
  ##
@@ -32,7 +32,6 @@ module Google
32
32
  ##
33
33
  # API Overview
34
34
  #
35
- #
36
35
  # Manages Identity and Access Management (IAM) policies.
37
36
  #
38
37
  # Any implementation of an API that offers access control features
@@ -32,7 +32,6 @@ module Google
32
32
  ##
33
33
  # API Overview
34
34
  #
35
- #
36
35
  # Manages Identity and Access Management (IAM) policies.
37
36
  #
38
37
  # Any implementation of an API that offers access control features
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization