google-cloud-ai_platform-v1 0.59.0 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +43 -20
  4. data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +9 -5
  5. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb +43 -20
  6. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +49 -35
  7. data/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb +166 -116
  8. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +34 -7
  9. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +9 -5
  10. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb +33 -7
  11. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +49 -35
  12. data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb +62 -38
  13. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +36 -10
  14. data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +9 -5
  15. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +36 -10
  16. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +49 -35
  17. data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +86 -56
  18. data/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb +29 -2
  19. data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb +29 -2
  20. data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb +22 -8
  21. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +38 -14
  22. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +9 -5
  23. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb +38 -14
  24. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +49 -35
  25. data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb +118 -80
  26. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +29 -3
  27. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb +29 -3
  28. data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb +30 -14
  29. data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +38 -12
  30. data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +9 -5
  31. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb +38 -12
  32. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +49 -35
  33. data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb +102 -68
  34. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +29 -4
  35. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb +29 -3
  36. data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb +31 -14
  37. data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +45 -22
  38. data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +9 -5
  39. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb +45 -22
  40. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +49 -35
  41. data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb +182 -128
  42. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +31 -6
  43. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +9 -5
  44. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +31 -6
  45. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +49 -35
  46. data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +54 -32
  47. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +35 -9
  48. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +9 -5
  49. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +35 -9
  50. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +49 -35
  51. data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb +78 -50
  52. data/lib/google/cloud/ai_platform/v1/index_service/client.rb +33 -8
  53. data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +9 -5
  54. data/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb +33 -8
  55. data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +49 -35
  56. data/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb +70 -44
  57. data/lib/google/cloud/ai_platform/v1/job_service/client.rb +44 -36
  58. data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +9 -5
  59. data/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb +44 -36
  60. data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +49 -35
  61. data/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb +294 -212
  62. data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +29 -3
  63. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +29 -3
  64. data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb +30 -14
  65. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +29 -3
  66. data/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb +29 -3
  67. data/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb +30 -14
  68. data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +42 -33
  69. data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +9 -5
  70. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb +42 -33
  71. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +49 -35
  72. data/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb +270 -194
  73. data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +31 -3
  74. data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +9 -5
  75. data/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb +31 -3
  76. data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +49 -35
  77. data/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb +30 -14
  78. data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +29 -2
  79. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +29 -2
  80. data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +22 -8
  81. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +39 -19
  82. data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +9 -5
  83. data/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb +39 -19
  84. data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +49 -35
  85. data/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb +158 -110
  86. data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +41 -17
  87. data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +9 -5
  88. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +41 -17
  89. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +49 -35
  90. data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +142 -98
  91. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +34 -7
  92. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +9 -5
  93. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +34 -7
  94. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +49 -35
  95. data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb +62 -38
  96. data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +35 -13
  97. data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +9 -5
  98. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb +35 -13
  99. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +49 -35
  100. data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb +110 -74
  101. data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +29 -14
  102. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +29 -7
  103. data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +65 -38
  104. data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +31 -8
  105. data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +9 -5
  106. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +31 -8
  107. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +49 -35
  108. data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +70 -44
  109. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +33 -6
  110. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +9 -5
  111. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +33 -6
  112. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +49 -35
  113. data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +54 -32
  114. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +40 -31
  115. data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +9 -5
  116. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +40 -30
  117. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +49 -35
  118. data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +247 -176
  119. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  120. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +36 -11
  121. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb +9 -5
  122. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +36 -11
  123. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +49 -35
  124. data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +94 -62
  125. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb +29 -4
  126. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb +29 -4
  127. data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb +38 -20
  128. data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -16
  129. data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +9 -5
  130. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +33 -16
  131. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +49 -35
  132. data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +134 -92
  133. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
  134. data/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb +2 -1
  135. data/proto_docs/google/api/client.rb +19 -0
  136. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  137. data/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb +15 -1
  138. metadata +5 -5
@@ -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_index 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_index",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Longrunning::Operation.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_index",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::AIPlatform::V1::Index.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: "list_indexes",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::AIPlatform::V1::ListIndexesResponse.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: "update_index",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Longrunning::Operation.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: "delete_index",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Longrunning::Operation.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: "upsert_datapoints",
283
306
  options: options
284
307
  )
285
308
  operation = ::Gapic::Rest::TransportOperation.new response
286
309
  result = ::Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse.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
  ##
@@ -315,16 +339,18 @@ module Google
315
339
 
316
340
  response = @client_stub.make_http_request(
317
341
  verb,
318
- uri: uri,
319
- body: body || "",
320
- params: query_string_params,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "remove_datapoints",
321
346
  options: options
322
347
  )
323
348
  operation = ::Gapic::Rest::TransportOperation.new response
324
349
  result = ::Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse.decode_json response.body, ignore_unknown_fields: true
325
-
326
- yield result, operation if block_given?
327
- result
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
328
354
  end
329
355
 
330
356
  ##
@@ -166,14 +166,26 @@ module Google
166
166
  universe_domain: @config.universe_domain,
167
167
  channel_args: @config.channel_args,
168
168
  interceptors: @config.interceptors,
169
- channel_pool_config: @config.channel_pool
169
+ channel_pool_config: @config.channel_pool,
170
+ logger: @config.logger
170
171
  )
171
172
 
173
+ @job_service_stub.stub_logger&.info do |entry|
174
+ entry.set_system_name
175
+ entry.set_service
176
+ entry.message = "Created client for #{entry.service}"
177
+ entry.set_credentials_fields credentials
178
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
179
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
180
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
181
+ end
182
+
172
183
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
173
184
  config.credentials = credentials
174
185
  config.quota_project = @quota_project_id
175
186
  config.endpoint = @job_service_stub.endpoint
176
187
  config.universe_domain = @job_service_stub.universe_domain
188
+ config.logger = @job_service_stub.logger if config.respond_to? :logger=
177
189
  end
178
190
 
179
191
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -181,6 +193,7 @@ module Google
181
193
  config.quota_project = @quota_project_id
182
194
  config.endpoint = @job_service_stub.endpoint
183
195
  config.universe_domain = @job_service_stub.universe_domain
196
+ config.logger = @job_service_stub.logger if config.respond_to? :logger=
184
197
  end
185
198
  end
186
199
 
@@ -205,6 +218,15 @@ module Google
205
218
  #
206
219
  attr_reader :iam_policy_client
207
220
 
221
+ ##
222
+ # The logger used for request/response debug logging.
223
+ #
224
+ # @return [Logger]
225
+ #
226
+ def logger
227
+ @job_service_stub.logger
228
+ end
229
+
208
230
  # Service calls
209
231
 
210
232
  ##
@@ -291,7 +313,6 @@ module Google
291
313
 
292
314
  @job_service_stub.call_rpc :create_custom_job, request, options: options do |response, operation|
293
315
  yield response, operation if block_given?
294
- return response
295
316
  end
296
317
  rescue ::GRPC::BadStatus => e
297
318
  raise ::Google::Cloud::Error.from_error(e)
@@ -379,7 +400,6 @@ module Google
379
400
 
380
401
  @job_service_stub.call_rpc :get_custom_job, request, options: options do |response, operation|
381
402
  yield response, operation if block_given?
382
- return response
383
403
  end
384
404
  rescue ::GRPC::BadStatus => e
385
405
  raise ::Google::Cloud::Error.from_error(e)
@@ -503,7 +523,7 @@ module Google
503
523
  @job_service_stub.call_rpc :list_custom_jobs, request, options: options do |response, operation|
504
524
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_custom_jobs, request, response, operation, options
505
525
  yield response, operation if block_given?
506
- return response
526
+ throw :response, response
507
527
  end
508
528
  rescue ::GRPC::BadStatus => e
509
529
  raise ::Google::Cloud::Error.from_error(e)
@@ -599,7 +619,7 @@ module Google
599
619
  @job_service_stub.call_rpc :delete_custom_job, request, options: options do |response, operation|
600
620
  response = ::Gapic::Operation.new response, @operations_client, options: options
601
621
  yield response, operation if block_given?
602
- return response
622
+ throw :response, response
603
623
  end
604
624
  rescue ::GRPC::BadStatus => e
605
625
  raise ::Google::Cloud::Error.from_error(e)
@@ -699,7 +719,6 @@ module Google
699
719
 
700
720
  @job_service_stub.call_rpc :cancel_custom_job, request, options: options do |response, operation|
701
721
  yield response, operation if block_given?
702
- return response
703
722
  end
704
723
  rescue ::GRPC::BadStatus => e
705
724
  raise ::Google::Cloud::Error.from_error(e)
@@ -788,7 +807,6 @@ module Google
788
807
 
789
808
  @job_service_stub.call_rpc :create_data_labeling_job, request, options: options do |response, operation|
790
809
  yield response, operation if block_given?
791
- return response
792
810
  end
793
811
  rescue ::GRPC::BadStatus => e
794
812
  raise ::Google::Cloud::Error.from_error(e)
@@ -876,7 +894,6 @@ module Google
876
894
 
877
895
  @job_service_stub.call_rpc :get_data_labeling_job, request, options: options do |response, operation|
878
896
  yield response, operation if block_given?
879
- return response
880
897
  end
881
898
  rescue ::GRPC::BadStatus => e
882
899
  raise ::Google::Cloud::Error.from_error(e)
@@ -1002,7 +1019,7 @@ module Google
1002
1019
  @job_service_stub.call_rpc :list_data_labeling_jobs, request, options: options do |response, operation|
1003
1020
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_data_labeling_jobs, request, response, operation, options
1004
1021
  yield response, operation if block_given?
1005
- return response
1022
+ throw :response, response
1006
1023
  end
1007
1024
  rescue ::GRPC::BadStatus => e
1008
1025
  raise ::Google::Cloud::Error.from_error(e)
@@ -1098,7 +1115,7 @@ module Google
1098
1115
  @job_service_stub.call_rpc :delete_data_labeling_job, request, options: options do |response, operation|
1099
1116
  response = ::Gapic::Operation.new response, @operations_client, options: options
1100
1117
  yield response, operation if block_given?
1101
- return response
1118
+ throw :response, response
1102
1119
  end
1103
1120
  rescue ::GRPC::BadStatus => e
1104
1121
  raise ::Google::Cloud::Error.from_error(e)
@@ -1186,7 +1203,6 @@ module Google
1186
1203
 
1187
1204
  @job_service_stub.call_rpc :cancel_data_labeling_job, request, options: options do |response, operation|
1188
1205
  yield response, operation if block_given?
1189
- return response
1190
1206
  end
1191
1207
  rescue ::GRPC::BadStatus => e
1192
1208
  raise ::Google::Cloud::Error.from_error(e)
@@ -1276,7 +1292,6 @@ module Google
1276
1292
 
1277
1293
  @job_service_stub.call_rpc :create_hyperparameter_tuning_job, request, options: options do |response, operation|
1278
1294
  yield response, operation if block_given?
1279
- return response
1280
1295
  end
1281
1296
  rescue ::GRPC::BadStatus => e
1282
1297
  raise ::Google::Cloud::Error.from_error(e)
@@ -1364,7 +1379,6 @@ module Google
1364
1379
 
1365
1380
  @job_service_stub.call_rpc :get_hyperparameter_tuning_job, request, options: options do |response, operation|
1366
1381
  yield response, operation if block_given?
1367
- return response
1368
1382
  end
1369
1383
  rescue ::GRPC::BadStatus => e
1370
1384
  raise ::Google::Cloud::Error.from_error(e)
@@ -1489,7 +1503,7 @@ module Google
1489
1503
  @job_service_stub.call_rpc :list_hyperparameter_tuning_jobs, request, options: options do |response, operation|
1490
1504
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_hyperparameter_tuning_jobs, request, response, operation, options
1491
1505
  yield response, operation if block_given?
1492
- return response
1506
+ throw :response, response
1493
1507
  end
1494
1508
  rescue ::GRPC::BadStatus => e
1495
1509
  raise ::Google::Cloud::Error.from_error(e)
@@ -1585,7 +1599,7 @@ module Google
1585
1599
  @job_service_stub.call_rpc :delete_hyperparameter_tuning_job, request, options: options do |response, operation|
1586
1600
  response = ::Gapic::Operation.new response, @operations_client, options: options
1587
1601
  yield response, operation if block_given?
1588
- return response
1602
+ throw :response, response
1589
1603
  end
1590
1604
  rescue ::GRPC::BadStatus => e
1591
1605
  raise ::Google::Cloud::Error.from_error(e)
@@ -1686,7 +1700,6 @@ module Google
1686
1700
 
1687
1701
  @job_service_stub.call_rpc :cancel_hyperparameter_tuning_job, request, options: options do |response, operation|
1688
1702
  yield response, operation if block_given?
1689
- return response
1690
1703
  end
1691
1704
  rescue ::GRPC::BadStatus => e
1692
1705
  raise ::Google::Cloud::Error.from_error(e)
@@ -1775,7 +1788,6 @@ module Google
1775
1788
 
1776
1789
  @job_service_stub.call_rpc :create_nas_job, request, options: options do |response, operation|
1777
1790
  yield response, operation if block_given?
1778
- return response
1779
1791
  end
1780
1792
  rescue ::GRPC::BadStatus => e
1781
1793
  raise ::Google::Cloud::Error.from_error(e)
@@ -1863,7 +1875,6 @@ module Google
1863
1875
 
1864
1876
  @job_service_stub.call_rpc :get_nas_job, request, options: options do |response, operation|
1865
1877
  yield response, operation if block_given?
1866
- return response
1867
1878
  end
1868
1879
  rescue ::GRPC::BadStatus => e
1869
1880
  raise ::Google::Cloud::Error.from_error(e)
@@ -1987,7 +1998,7 @@ module Google
1987
1998
  @job_service_stub.call_rpc :list_nas_jobs, request, options: options do |response, operation|
1988
1999
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_nas_jobs, request, response, operation, options
1989
2000
  yield response, operation if block_given?
1990
- return response
2001
+ throw :response, response
1991
2002
  end
1992
2003
  rescue ::GRPC::BadStatus => e
1993
2004
  raise ::Google::Cloud::Error.from_error(e)
@@ -2083,7 +2094,7 @@ module Google
2083
2094
  @job_service_stub.call_rpc :delete_nas_job, request, options: options do |response, operation|
2084
2095
  response = ::Gapic::Operation.new response, @operations_client, options: options
2085
2096
  yield response, operation if block_given?
2086
- return response
2097
+ throw :response, response
2087
2098
  end
2088
2099
  rescue ::GRPC::BadStatus => e
2089
2100
  raise ::Google::Cloud::Error.from_error(e)
@@ -2183,7 +2194,6 @@ module Google
2183
2194
 
2184
2195
  @job_service_stub.call_rpc :cancel_nas_job, request, options: options do |response, operation|
2185
2196
  yield response, operation if block_given?
2186
- return response
2187
2197
  end
2188
2198
  rescue ::GRPC::BadStatus => e
2189
2199
  raise ::Google::Cloud::Error.from_error(e)
@@ -2271,7 +2281,6 @@ module Google
2271
2281
 
2272
2282
  @job_service_stub.call_rpc :get_nas_trial_detail, request, options: options do |response, operation|
2273
2283
  yield response, operation if block_given?
2274
- return response
2275
2284
  end
2276
2285
  rescue ::GRPC::BadStatus => e
2277
2286
  raise ::Google::Cloud::Error.from_error(e)
@@ -2373,7 +2382,7 @@ module Google
2373
2382
  @job_service_stub.call_rpc :list_nas_trial_details, request, options: options do |response, operation|
2374
2383
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_nas_trial_details, request, response, operation, options
2375
2384
  yield response, operation if block_given?
2376
- return response
2385
+ throw :response, response
2377
2386
  end
2378
2387
  rescue ::GRPC::BadStatus => e
2379
2388
  raise ::Google::Cloud::Error.from_error(e)
@@ -2463,7 +2472,6 @@ module Google
2463
2472
 
2464
2473
  @job_service_stub.call_rpc :create_batch_prediction_job, request, options: options do |response, operation|
2465
2474
  yield response, operation if block_given?
2466
- return response
2467
2475
  end
2468
2476
  rescue ::GRPC::BadStatus => e
2469
2477
  raise ::Google::Cloud::Error.from_error(e)
@@ -2551,7 +2559,6 @@ module Google
2551
2559
 
2552
2560
  @job_service_stub.call_rpc :get_batch_prediction_job, request, options: options do |response, operation|
2553
2561
  yield response, operation if block_given?
2554
- return response
2555
2562
  end
2556
2563
  rescue ::GRPC::BadStatus => e
2557
2564
  raise ::Google::Cloud::Error.from_error(e)
@@ -2676,7 +2683,7 @@ module Google
2676
2683
  @job_service_stub.call_rpc :list_batch_prediction_jobs, request, options: options do |response, operation|
2677
2684
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_batch_prediction_jobs, request, response, operation, options
2678
2685
  yield response, operation if block_given?
2679
- return response
2686
+ throw :response, response
2680
2687
  end
2681
2688
  rescue ::GRPC::BadStatus => e
2682
2689
  raise ::Google::Cloud::Error.from_error(e)
@@ -2773,7 +2780,7 @@ module Google
2773
2780
  @job_service_stub.call_rpc :delete_batch_prediction_job, request, options: options do |response, operation|
2774
2781
  response = ::Gapic::Operation.new response, @operations_client, options: options
2775
2782
  yield response, operation if block_given?
2776
- return response
2783
+ throw :response, response
2777
2784
  end
2778
2785
  rescue ::GRPC::BadStatus => e
2779
2786
  raise ::Google::Cloud::Error.from_error(e)
@@ -2872,7 +2879,6 @@ module Google
2872
2879
 
2873
2880
  @job_service_stub.call_rpc :cancel_batch_prediction_job, request, options: options do |response, operation|
2874
2881
  yield response, operation if block_given?
2875
- return response
2876
2882
  end
2877
2883
  rescue ::GRPC::BadStatus => e
2878
2884
  raise ::Google::Cloud::Error.from_error(e)
@@ -2962,7 +2968,6 @@ module Google
2962
2968
 
2963
2969
  @job_service_stub.call_rpc :create_model_deployment_monitoring_job, request, options: options do |response, operation|
2964
2970
  yield response, operation if block_given?
2965
- return response
2966
2971
  end
2967
2972
  rescue ::GRPC::BadStatus => e
2968
2973
  raise ::Google::Cloud::Error.from_error(e)
@@ -3077,7 +3082,7 @@ module Google
3077
3082
  @job_service_stub.call_rpc :search_model_deployment_monitoring_stats_anomalies, request, options: options do |response, operation|
3078
3083
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :search_model_deployment_monitoring_stats_anomalies, request, response, operation, options
3079
3084
  yield response, operation if block_given?
3080
- return response
3085
+ throw :response, response
3081
3086
  end
3082
3087
  rescue ::GRPC::BadStatus => e
3083
3088
  raise ::Google::Cloud::Error.from_error(e)
@@ -3165,7 +3170,6 @@ module Google
3165
3170
 
3166
3171
  @job_service_stub.call_rpc :get_model_deployment_monitoring_job, request, options: options do |response, operation|
3167
3172
  yield response, operation if block_given?
3168
- return response
3169
3173
  end
3170
3174
  rescue ::GRPC::BadStatus => e
3171
3175
  raise ::Google::Cloud::Error.from_error(e)
@@ -3284,7 +3288,7 @@ module Google
3284
3288
  @job_service_stub.call_rpc :list_model_deployment_monitoring_jobs, request, options: options do |response, operation|
3285
3289
  response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_model_deployment_monitoring_jobs, request, response, operation, options
3286
3290
  yield response, operation if block_given?
3287
- return response
3291
+ throw :response, response
3288
3292
  end
3289
3293
  rescue ::GRPC::BadStatus => e
3290
3294
  raise ::Google::Cloud::Error.from_error(e)
@@ -3406,7 +3410,7 @@ module Google
3406
3410
  @job_service_stub.call_rpc :update_model_deployment_monitoring_job, request, options: options do |response, operation|
3407
3411
  response = ::Gapic::Operation.new response, @operations_client, options: options
3408
3412
  yield response, operation if block_given?
3409
- return response
3413
+ throw :response, response
3410
3414
  end
3411
3415
  rescue ::GRPC::BadStatus => e
3412
3416
  raise ::Google::Cloud::Error.from_error(e)
@@ -3502,7 +3506,7 @@ module Google
3502
3506
  @job_service_stub.call_rpc :delete_model_deployment_monitoring_job, request, options: options do |response, operation|
3503
3507
  response = ::Gapic::Operation.new response, @operations_client, options: options
3504
3508
  yield response, operation if block_given?
3505
- return response
3509
+ throw :response, response
3506
3510
  end
3507
3511
  rescue ::GRPC::BadStatus => e
3508
3512
  raise ::Google::Cloud::Error.from_error(e)
@@ -3593,7 +3597,6 @@ module Google
3593
3597
 
3594
3598
  @job_service_stub.call_rpc :pause_model_deployment_monitoring_job, request, options: options do |response, operation|
3595
3599
  yield response, operation if block_given?
3596
- return response
3597
3600
  end
3598
3601
  rescue ::GRPC::BadStatus => e
3599
3602
  raise ::Google::Cloud::Error.from_error(e)
@@ -3683,7 +3686,6 @@ module Google
3683
3686
 
3684
3687
  @job_service_stub.call_rpc :resume_model_deployment_monitoring_job, request, options: options do |response, operation|
3685
3688
  yield response, operation if block_given?
3686
- return response
3687
3689
  end
3688
3690
  rescue ::GRPC::BadStatus => e
3689
3691
  raise ::Google::Cloud::Error.from_error(e)
@@ -3772,6 +3774,11 @@ module Google
3772
3774
  # default endpoint URL. The default value of nil uses the environment
3773
3775
  # universe (usually the default "googleapis.com" universe).
3774
3776
  # @return [::String,nil]
3777
+ # @!attribute [rw] logger
3778
+ # A custom logger to use for request/response debug logging, or the value
3779
+ # `:default` (the default) to construct a default logger, or `nil` to
3780
+ # explicitly disable logging.
3781
+ # @return [::Logger,:default,nil]
3775
3782
  #
3776
3783
  class Configuration
3777
3784
  extend ::Gapic::Config
@@ -3796,6 +3803,7 @@ module Google
3796
3803
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3797
3804
  config_attr :quota_project, nil, ::String, nil
3798
3805
  config_attr :universe_domain, nil, ::String, nil
3806
+ config_attr :logger, :default, ::Logger, nil, :default
3799
3807
 
3800
3808
  # @private
3801
3809
  def initialize parent_config = nil
@@ -213,7 +213,7 @@ module Google
213
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
214
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
215
215
  yield response, operation if block_given?
216
- return response
216
+ throw :response, response
217
217
  end
218
218
  rescue ::GRPC::BadStatus => e
219
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -309,7 +309,7 @@ module Google
309
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
310
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
311
  yield response, operation if block_given?
312
- return response
312
+ throw :response, response
313
313
  end
314
314
  rescue ::GRPC::BadStatus => e
315
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +398,6 @@ module Google
398
398
 
399
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
400
400
  yield response, operation if block_given?
401
- return response
402
401
  end
403
402
  rescue ::GRPC::BadStatus => e
404
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -494,7 +493,6 @@ module Google
494
493
 
495
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
495
  yield response, operation if block_given?
497
- return response
498
496
  end
499
497
  rescue ::GRPC::BadStatus => e
500
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +598,7 @@ module Google
600
598
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
599
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
600
  yield response, operation if block_given?
603
- return response
601
+ throw :response, response
604
602
  end
605
603
  rescue ::GRPC::BadStatus => e
606
604
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,6 +687,11 @@ module Google
689
687
  # default endpoint URL. The default value of nil uses the environment
690
688
  # universe (usually the default "googleapis.com" universe).
691
689
  # @return [::String,nil]
690
+ # @!attribute [rw] logger
691
+ # A custom logger to use for request/response debug logging, or the value
692
+ # `:default` (the default) to construct a default logger, or `nil` to
693
+ # explicitly disable logging.
694
+ # @return [::Logger,:default,nil]
692
695
  #
693
696
  class Configuration
694
697
  extend ::Gapic::Config
@@ -713,6 +716,7 @@ module Google
713
716
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
717
  config_attr :quota_project, nil, ::String, nil
715
718
  config_attr :universe_domain, nil, ::String, nil
719
+ config_attr :logger, :default, ::Logger, nil, :default
716
720
 
717
721
  # @private
718
722
  def initialize parent_config = nil