google-cloud-ai_platform-v1 0.60.0 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) 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/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  135. metadata +4 -4
@@ -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 predict 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: "predict",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::AIPlatform::V1::PredictResponse.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: "raw_predict",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Api::HttpBody.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,6 +179,7 @@ module Google
163
179
  uri: uri,
164
180
  body: body || "",
165
181
  params: query_string_params,
182
+ method_name: "stream_raw_predict",
166
183
  options: options,
167
184
  is_server_streaming: true,
168
185
  &block
@@ -196,16 +213,18 @@ module Google
196
213
 
197
214
  response = @client_stub.make_http_request(
198
215
  verb,
199
- uri: uri,
200
- body: body || "",
201
- params: query_string_params,
216
+ uri: uri,
217
+ body: body || "",
218
+ params: query_string_params,
219
+ method_name: "direct_predict",
202
220
  options: options
203
221
  )
204
222
  operation = ::Gapic::Rest::TransportOperation.new response
205
223
  result = ::Google::Cloud::AIPlatform::V1::DirectPredictResponse.decode_json response.body, ignore_unknown_fields: true
206
-
207
- yield result, operation if block_given?
208
- result
224
+ catch :response do
225
+ yield result, operation if block_given?
226
+ result
227
+ end
209
228
  end
210
229
 
211
230
  ##
@@ -234,16 +253,18 @@ module Google
234
253
 
235
254
  response = @client_stub.make_http_request(
236
255
  verb,
237
- uri: uri,
238
- body: body || "",
239
- params: query_string_params,
256
+ uri: uri,
257
+ body: body || "",
258
+ params: query_string_params,
259
+ method_name: "direct_raw_predict",
240
260
  options: options
241
261
  )
242
262
  operation = ::Gapic::Rest::TransportOperation.new response
243
263
  result = ::Google::Cloud::AIPlatform::V1::DirectRawPredictResponse.decode_json response.body, ignore_unknown_fields: true
244
-
245
- yield result, operation if block_given?
246
- result
264
+ catch :response do
265
+ yield result, operation if block_given?
266
+ result
267
+ end
247
268
  end
248
269
 
249
270
  ##
@@ -272,6 +293,7 @@ module Google
272
293
  uri: uri,
273
294
  body: body || "",
274
295
  params: query_string_params,
296
+ method_name: "server_streaming_predict",
275
297
  options: options,
276
298
  is_server_streaming: true,
277
299
  &block
@@ -305,16 +327,18 @@ module Google
305
327
 
306
328
  response = @client_stub.make_http_request(
307
329
  verb,
308
- uri: uri,
309
- body: body || "",
310
- params: query_string_params,
330
+ uri: uri,
331
+ body: body || "",
332
+ params: query_string_params,
333
+ method_name: "explain",
311
334
  options: options
312
335
  )
313
336
  operation = ::Gapic::Rest::TransportOperation.new response
314
337
  result = ::Google::Cloud::AIPlatform::V1::ExplainResponse.decode_json response.body, ignore_unknown_fields: true
315
-
316
- yield result, operation if block_given?
317
- result
338
+ catch :response do
339
+ yield result, operation if block_given?
340
+ result
341
+ end
318
342
  end
319
343
 
320
344
  ##
@@ -343,16 +367,18 @@ module Google
343
367
 
344
368
  response = @client_stub.make_http_request(
345
369
  verb,
346
- uri: uri,
347
- body: body || "",
348
- params: query_string_params,
370
+ uri: uri,
371
+ body: body || "",
372
+ params: query_string_params,
373
+ method_name: "generate_content",
349
374
  options: options
350
375
  )
351
376
  operation = ::Gapic::Rest::TransportOperation.new response
352
377
  result = ::Google::Cloud::AIPlatform::V1::GenerateContentResponse.decode_json response.body, ignore_unknown_fields: true
353
-
354
- yield result, operation if block_given?
355
- result
378
+ catch :response do
379
+ yield result, operation if block_given?
380
+ result
381
+ end
356
382
  end
357
383
 
358
384
  ##
@@ -381,6 +407,7 @@ module Google
381
407
  uri: uri,
382
408
  body: body || "",
383
409
  params: query_string_params,
410
+ method_name: "stream_generate_content",
384
411
  options: options,
385
412
  is_server_streaming: true,
386
413
  &block
@@ -167,14 +167,26 @@ module Google
167
167
  universe_domain: @config.universe_domain,
168
168
  channel_args: @config.channel_args,
169
169
  interceptors: @config.interceptors,
170
- channel_pool_config: @config.channel_pool
170
+ channel_pool_config: @config.channel_pool,
171
+ logger: @config.logger
171
172
  )
172
173
 
174
+ @schedule_service_stub.stub_logger&.info do |entry|
175
+ entry.set_system_name
176
+ entry.set_service
177
+ entry.message = "Created client for #{entry.service}"
178
+ entry.set_credentials_fields credentials
179
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
180
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
181
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
182
+ end
183
+
173
184
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
174
185
  config.credentials = credentials
175
186
  config.quota_project = @quota_project_id
176
187
  config.endpoint = @schedule_service_stub.endpoint
177
188
  config.universe_domain = @schedule_service_stub.universe_domain
189
+ config.logger = @schedule_service_stub.logger if config.respond_to? :logger=
178
190
  end
179
191
 
180
192
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
@@ -182,6 +194,7 @@ module Google
182
194
  config.quota_project = @quota_project_id
183
195
  config.endpoint = @schedule_service_stub.endpoint
184
196
  config.universe_domain = @schedule_service_stub.universe_domain
197
+ config.logger = @schedule_service_stub.logger if config.respond_to? :logger=
185
198
  end
186
199
  end
187
200
 
@@ -206,6 +219,15 @@ module Google
206
219
  #
207
220
  attr_reader :iam_policy_client
208
221
 
222
+ ##
223
+ # The logger used for request/response debug logging.
224
+ #
225
+ # @return [Logger]
226
+ #
227
+ def logger
228
+ @schedule_service_stub.logger
229
+ end
230
+
209
231
  # Service calls
210
232
 
211
233
  ##
@@ -291,7 +313,6 @@ module Google
291
313
 
292
314
  @schedule_service_stub.call_rpc :create_schedule, 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)
@@ -387,7 +408,7 @@ module Google
387
408
  @schedule_service_stub.call_rpc :delete_schedule, request, options: options do |response, operation|
388
409
  response = ::Gapic::Operation.new response, @operations_client, options: options
389
410
  yield response, operation if block_given?
390
- return response
411
+ throw :response, response
391
412
  end
392
413
  rescue ::GRPC::BadStatus => e
393
414
  raise ::Google::Cloud::Error.from_error(e)
@@ -475,7 +496,6 @@ module Google
475
496
 
476
497
  @schedule_service_stub.call_rpc :get_schedule, request, options: options do |response, operation|
477
498
  yield response, operation if block_given?
478
- return response
479
499
  end
480
500
  rescue ::GRPC::BadStatus => e
481
501
  raise ::Google::Cloud::Error.from_error(e)
@@ -626,7 +646,7 @@ module Google
626
646
  @schedule_service_stub.call_rpc :list_schedules, request, options: options do |response, operation|
627
647
  response = ::Gapic::PagedEnumerable.new @schedule_service_stub, :list_schedules, request, response, operation, options
628
648
  yield response, operation if block_given?
629
- return response
649
+ throw :response, response
630
650
  end
631
651
  rescue ::GRPC::BadStatus => e
632
652
  raise ::Google::Cloud::Error.from_error(e)
@@ -717,7 +737,6 @@ module Google
717
737
 
718
738
  @schedule_service_stub.call_rpc :pause_schedule, request, options: options do |response, operation|
719
739
  yield response, operation if block_given?
720
- return response
721
740
  end
722
741
  rescue ::GRPC::BadStatus => e
723
742
  raise ::Google::Cloud::Error.from_error(e)
@@ -819,7 +838,6 @@ module Google
819
838
 
820
839
  @schedule_service_stub.call_rpc :resume_schedule, request, options: options do |response, operation|
821
840
  yield response, operation if block_given?
822
- return response
823
841
  end
824
842
  rescue ::GRPC::BadStatus => e
825
843
  raise ::Google::Cloud::Error.from_error(e)
@@ -919,7 +937,6 @@ module Google
919
937
 
920
938
  @schedule_service_stub.call_rpc :update_schedule, request, options: options do |response, operation|
921
939
  yield response, operation if block_given?
922
- return response
923
940
  end
924
941
  rescue ::GRPC::BadStatus => e
925
942
  raise ::Google::Cloud::Error.from_error(e)
@@ -1008,6 +1025,11 @@ module Google
1008
1025
  # default endpoint URL. The default value of nil uses the environment
1009
1026
  # universe (usually the default "googleapis.com" universe).
1010
1027
  # @return [::String,nil]
1028
+ # @!attribute [rw] logger
1029
+ # A custom logger to use for request/response debug logging, or the value
1030
+ # `:default` (the default) to construct a default logger, or `nil` to
1031
+ # explicitly disable logging.
1032
+ # @return [::Logger,:default,nil]
1011
1033
  #
1012
1034
  class Configuration
1013
1035
  extend ::Gapic::Config
@@ -1032,6 +1054,7 @@ module Google
1032
1054
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1033
1055
  config_attr :quota_project, nil, ::String, nil
1034
1056
  config_attr :universe_domain, nil, ::String, nil
1057
+ config_attr :logger, :default, ::Logger, nil, :default
1035
1058
 
1036
1059
  # @private
1037
1060
  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
@@ -160,15 +160,27 @@ module Google
160
160
  endpoint: @config.endpoint,
161
161
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
162
  universe_domain: @config.universe_domain,
163
- credentials: credentials
163
+ credentials: credentials,
164
+ logger: @config.logger
164
165
  )
165
166
 
167
+ @schedule_service_stub.logger(stub: true)&.info do |entry|
168
+ entry.set_system_name
169
+ entry.set_service
170
+ entry.message = "Created client for #{entry.service}"
171
+ entry.set_credentials_fields credentials
172
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
173
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
174
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
175
+ end
176
+
166
177
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
167
178
  config.credentials = credentials
168
179
  config.quota_project = @quota_project_id
169
180
  config.endpoint = @schedule_service_stub.endpoint
170
181
  config.universe_domain = @schedule_service_stub.universe_domain
171
182
  config.bindings_override = @config.bindings_override
183
+ config.logger = @schedule_service_stub.logger if config.respond_to? :logger=
172
184
  end
173
185
 
174
186
  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
@@ -177,6 +189,7 @@ module Google
177
189
  config.endpoint = @schedule_service_stub.endpoint
178
190
  config.universe_domain = @schedule_service_stub.universe_domain
179
191
  config.bindings_override = @config.bindings_override
192
+ config.logger = @schedule_service_stub.logger if config.respond_to? :logger=
180
193
  end
181
194
  end
182
195
 
@@ -201,6 +214,15 @@ module Google
201
214
  #
202
215
  attr_reader :iam_policy_client
203
216
 
217
+ ##
218
+ # The logger used for request/response debug logging.
219
+ #
220
+ # @return [Logger]
221
+ #
222
+ def logger
223
+ @schedule_service_stub.logger
224
+ end
225
+
204
226
  # Service calls
205
227
 
206
228
  ##
@@ -279,7 +301,6 @@ module Google
279
301
 
280
302
  @schedule_service_stub.create_schedule request, options do |result, operation|
281
303
  yield result, operation if block_given?
282
- return result
283
304
  end
284
305
  rescue ::Gapic::Rest::Error => e
285
306
  raise ::Google::Cloud::Error.from_error(e)
@@ -368,7 +389,7 @@ module Google
368
389
  @schedule_service_stub.delete_schedule request, options do |result, operation|
369
390
  result = ::Gapic::Operation.new result, @operations_client, options: options
370
391
  yield result, operation if block_given?
371
- return result
392
+ throw :response, result
372
393
  end
373
394
  rescue ::Gapic::Rest::Error => e
374
395
  raise ::Google::Cloud::Error.from_error(e)
@@ -449,7 +470,6 @@ module Google
449
470
 
450
471
  @schedule_service_stub.get_schedule request, options do |result, operation|
451
472
  yield result, operation if block_given?
452
- return result
453
473
  end
454
474
  rescue ::Gapic::Rest::Error => e
455
475
  raise ::Google::Cloud::Error.from_error(e)
@@ -593,7 +613,7 @@ module Google
593
613
  @schedule_service_stub.list_schedules request, options do |result, operation|
594
614
  result = ::Gapic::Rest::PagedEnumerable.new @schedule_service_stub, :list_schedules, "schedules", request, result, options
595
615
  yield result, operation if block_given?
596
- return result
616
+ throw :response, result
597
617
  end
598
618
  rescue ::Gapic::Rest::Error => e
599
619
  raise ::Google::Cloud::Error.from_error(e)
@@ -677,7 +697,6 @@ module Google
677
697
 
678
698
  @schedule_service_stub.pause_schedule request, options do |result, operation|
679
699
  yield result, operation if block_given?
680
- return result
681
700
  end
682
701
  rescue ::Gapic::Rest::Error => e
683
702
  raise ::Google::Cloud::Error.from_error(e)
@@ -772,7 +791,6 @@ module Google
772
791
 
773
792
  @schedule_service_stub.resume_schedule request, options do |result, operation|
774
793
  yield result, operation if block_given?
775
- return result
776
794
  end
777
795
  rescue ::Gapic::Rest::Error => e
778
796
  raise ::Google::Cloud::Error.from_error(e)
@@ -865,7 +883,6 @@ module Google
865
883
 
866
884
  @schedule_service_stub.update_schedule request, options do |result, operation|
867
885
  yield result, operation if block_given?
868
- return result
869
886
  end
870
887
  rescue ::Gapic::Rest::Error => e
871
888
  raise ::Google::Cloud::Error.from_error(e)
@@ -945,6 +962,11 @@ module Google
945
962
  # default endpoint URL. The default value of nil uses the environment
946
963
  # universe (usually the default "googleapis.com" universe).
947
964
  # @return [::String,nil]
965
+ # @!attribute [rw] logger
966
+ # A custom logger to use for request/response debug logging, or the value
967
+ # `:default` (the default) to construct a default logger, or `nil` to
968
+ # explicitly disable logging.
969
+ # @return [::Logger,:default,nil]
948
970
  #
949
971
  class Configuration
950
972
  extend ::Gapic::Config
@@ -973,6 +995,7 @@ module Google
973
995
  # by the host service.
974
996
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
975
997
  config_attr :bindings_override, {}, ::Hash, nil
998
+ config_attr :logger, :default, ::Logger, nil, :default
976
999
 
977
1000
  # @private
978
1001
  def initialize parent_config = nil