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.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/ai_platform/v1/dataset_service/client.rb +43 -20
- data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb +43 -20
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/service_stub.rb +166 -116
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/client.rb +34 -7
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/client.rb +33 -7
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/service_stub.rb +62 -38
- data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +36 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +36 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +86 -56
- data/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +38 -14
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb +38 -14
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/service_stub.rb +118 -80
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/feature_online_store_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +38 -12
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb +38 -12
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/service_stub.rb +102 -68
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/client.rb +29 -4
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/featurestore_online_serving_service/rest/service_stub.rb +31 -14
- data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +45 -22
- data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/client.rb +45 -22
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/service_stub.rb +182 -128
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +31 -6
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +31 -6
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +35 -9
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +35 -9
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/service_stub.rb +78 -50
- data/lib/google/cloud/ai_platform/v1/index_service/client.rb +33 -8
- data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/index_service/rest/client.rb +33 -8
- data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/index_service/rest/service_stub.rb +70 -44
- data/lib/google/cloud/ai_platform/v1/job_service/client.rb +44 -36
- data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/job_service/rest/client.rb +44 -36
- data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/job_service/rest/service_stub.rb +294 -212
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/match_service/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/match_service/rest/client.rb +29 -3
- data/lib/google/cloud/ai_platform/v1/match_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +42 -33
- data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/client.rb +42 -33
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/service_stub.rb +270 -194
- data/lib/google/cloud/ai_platform/v1/migration_service/client.rb +31 -3
- data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/client.rb +31 -3
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/ai_platform/v1/model_garden_service/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/client.rb +29 -2
- data/lib/google/cloud/ai_platform/v1/model_garden_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/ai_platform/v1/model_service/client.rb +39 -19
- data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/model_service/rest/client.rb +39 -19
- data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/model_service/rest/service_stub.rb +158 -110
- data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +41 -17
- data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +41 -17
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/service_stub.rb +142 -98
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +34 -7
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +34 -7
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/service_stub.rb +62 -38
- data/lib/google/cloud/ai_platform/v1/pipeline_service/client.rb +35 -13
- data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/client.rb +35 -13
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/service_stub.rb +110 -74
- data/lib/google/cloud/ai_platform/v1/prediction_service/client.rb +29 -14
- data/lib/google/cloud/ai_platform/v1/prediction_service/rest/client.rb +29 -7
- data/lib/google/cloud/ai_platform/v1/prediction_service/rest/service_stub.rb +65 -38
- data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +31 -8
- data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +31 -8
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/service_stub.rb +70 -44
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/client.rb +33 -6
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/client.rb +33 -6
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +40 -31
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/client.rb +40 -30
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/service_stub.rb +247 -176
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +36 -11
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +36 -11
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +94 -62
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb +29 -4
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb +29 -4
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb +38 -20
- data/lib/google/cloud/ai_platform/v1/vizier_service/client.rb +33 -16
- data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +9 -5
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/client.rb +33 -16
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +49 -35
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/service_stub.rb +134 -92
- data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
- 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
|
-
|
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
|
-
|
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 get_publisher_model 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:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "get_publisher_model",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::AIPlatform::V1::PublisherModel.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -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
|
+
@model_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 = @model_service_stub.endpoint
|
176
187
|
config.universe_domain = @model_service_stub.universe_domain
|
188
|
+
config.logger = @model_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 = @model_service_stub.endpoint
|
183
195
|
config.universe_domain = @model_service_stub.universe_domain
|
196
|
+
config.logger = @model_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
|
+
@model_service_stub.logger
|
228
|
+
end
|
229
|
+
|
208
230
|
# Service calls
|
209
231
|
|
210
232
|
##
|
@@ -315,7 +337,7 @@ module Google
|
|
315
337
|
@model_service_stub.call_rpc :upload_model, request, options: options do |response, operation|
|
316
338
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
317
339
|
yield response, operation if block_given?
|
318
|
-
|
340
|
+
throw :response, response
|
319
341
|
end
|
320
342
|
rescue ::GRPC::BadStatus => e
|
321
343
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -412,7 +434,6 @@ module Google
|
|
412
434
|
|
413
435
|
@model_service_stub.call_rpc :get_model, request, options: options do |response, operation|
|
414
436
|
yield response, operation if block_given?
|
415
|
-
return response
|
416
437
|
end
|
417
438
|
rescue ::GRPC::BadStatus => e
|
418
439
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -545,7 +566,7 @@ module Google
|
|
545
566
|
@model_service_stub.call_rpc :list_models, request, options: options do |response, operation|
|
546
567
|
response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_models, request, response, operation, options
|
547
568
|
yield response, operation if block_given?
|
548
|
-
|
569
|
+
throw :response, response
|
549
570
|
end
|
550
571
|
rescue ::GRPC::BadStatus => e
|
551
572
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -668,7 +689,7 @@ module Google
|
|
668
689
|
@model_service_stub.call_rpc :list_model_versions, request, options: options do |response, operation|
|
669
690
|
response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_versions, request, response, operation, options
|
670
691
|
yield response, operation if block_given?
|
671
|
-
|
692
|
+
throw :response, response
|
672
693
|
end
|
673
694
|
rescue ::GRPC::BadStatus => e
|
674
695
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -775,7 +796,6 @@ module Google
|
|
775
796
|
|
776
797
|
@model_service_stub.call_rpc :update_model, request, options: options do |response, operation|
|
777
798
|
yield response, operation if block_given?
|
778
|
-
return response
|
779
799
|
end
|
780
800
|
rescue ::GRPC::BadStatus => e
|
781
801
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -872,7 +892,7 @@ module Google
|
|
872
892
|
@model_service_stub.call_rpc :update_explanation_dataset, request, options: options do |response, operation|
|
873
893
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
874
894
|
yield response, operation if block_given?
|
875
|
-
|
895
|
+
throw :response, response
|
876
896
|
end
|
877
897
|
rescue ::GRPC::BadStatus => e
|
878
898
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -974,7 +994,7 @@ module Google
|
|
974
994
|
@model_service_stub.call_rpc :delete_model, request, options: options do |response, operation|
|
975
995
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
976
996
|
yield response, operation if block_given?
|
977
|
-
|
997
|
+
throw :response, response
|
978
998
|
end
|
979
999
|
rescue ::GRPC::BadStatus => e
|
980
1000
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1077,7 +1097,7 @@ module Google
|
|
1077
1097
|
@model_service_stub.call_rpc :delete_model_version, request, options: options do |response, operation|
|
1078
1098
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1079
1099
|
yield response, operation if block_given?
|
1080
|
-
|
1100
|
+
throw :response, response
|
1081
1101
|
end
|
1082
1102
|
rescue ::GRPC::BadStatus => e
|
1083
1103
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1179,7 +1199,6 @@ module Google
|
|
1179
1199
|
|
1180
1200
|
@model_service_stub.call_rpc :merge_version_aliases, request, options: options do |response, operation|
|
1181
1201
|
yield response, operation if block_given?
|
1182
|
-
return response
|
1183
1202
|
end
|
1184
1203
|
rescue ::GRPC::BadStatus => e
|
1185
1204
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1280,7 +1299,7 @@ module Google
|
|
1280
1299
|
@model_service_stub.call_rpc :export_model, request, options: options do |response, operation|
|
1281
1300
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1282
1301
|
yield response, operation if block_given?
|
1283
|
-
|
1302
|
+
throw :response, response
|
1284
1303
|
end
|
1285
1304
|
rescue ::GRPC::BadStatus => e
|
1286
1305
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1397,7 +1416,7 @@ module Google
|
|
1397
1416
|
@model_service_stub.call_rpc :copy_model, request, options: options do |response, operation|
|
1398
1417
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1399
1418
|
yield response, operation if block_given?
|
1400
|
-
|
1419
|
+
throw :response, response
|
1401
1420
|
end
|
1402
1421
|
rescue ::GRPC::BadStatus => e
|
1403
1422
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1486,7 +1505,6 @@ module Google
|
|
1486
1505
|
|
1487
1506
|
@model_service_stub.call_rpc :import_model_evaluation, request, options: options do |response, operation|
|
1488
1507
|
yield response, operation if block_given?
|
1489
|
-
return response
|
1490
1508
|
end
|
1491
1509
|
rescue ::GRPC::BadStatus => e
|
1492
1510
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1576,7 +1594,6 @@ module Google
|
|
1576
1594
|
|
1577
1595
|
@model_service_stub.call_rpc :batch_import_model_evaluation_slices, request, options: options do |response, operation|
|
1578
1596
|
yield response, operation if block_given?
|
1579
|
-
return response
|
1580
1597
|
end
|
1581
1598
|
rescue ::GRPC::BadStatus => e
|
1582
1599
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1666,7 +1683,6 @@ module Google
|
|
1666
1683
|
|
1667
1684
|
@model_service_stub.call_rpc :batch_import_evaluated_annotations, request, options: options do |response, operation|
|
1668
1685
|
yield response, operation if block_given?
|
1669
|
-
return response
|
1670
1686
|
end
|
1671
1687
|
rescue ::GRPC::BadStatus => e
|
1672
1688
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1754,7 +1770,6 @@ module Google
|
|
1754
1770
|
|
1755
1771
|
@model_service_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
|
1756
1772
|
yield response, operation if block_given?
|
1757
|
-
return response
|
1758
1773
|
end
|
1759
1774
|
rescue ::GRPC::BadStatus => e
|
1760
1775
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1859,7 +1874,7 @@ module Google
|
|
1859
1874
|
@model_service_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
|
1860
1875
|
response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_evaluations, request, response, operation, options
|
1861
1876
|
yield response, operation if block_given?
|
1862
|
-
|
1877
|
+
throw :response, response
|
1863
1878
|
end
|
1864
1879
|
rescue ::GRPC::BadStatus => e
|
1865
1880
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1947,7 +1962,6 @@ module Google
|
|
1947
1962
|
|
1948
1963
|
@model_service_stub.call_rpc :get_model_evaluation_slice, request, options: options do |response, operation|
|
1949
1964
|
yield response, operation if block_given?
|
1950
|
-
return response
|
1951
1965
|
end
|
1952
1966
|
rescue ::GRPC::BadStatus => e
|
1953
1967
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2055,7 +2069,7 @@ module Google
|
|
2055
2069
|
@model_service_stub.call_rpc :list_model_evaluation_slices, request, options: options do |response, operation|
|
2056
2070
|
response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_model_evaluation_slices, request, response, operation, options
|
2057
2071
|
yield response, operation if block_given?
|
2058
|
-
|
2072
|
+
throw :response, response
|
2059
2073
|
end
|
2060
2074
|
rescue ::GRPC::BadStatus => e
|
2061
2075
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2144,6 +2158,11 @@ module Google
|
|
2144
2158
|
# default endpoint URL. The default value of nil uses the environment
|
2145
2159
|
# universe (usually the default "googleapis.com" universe).
|
2146
2160
|
# @return [::String,nil]
|
2161
|
+
# @!attribute [rw] logger
|
2162
|
+
# A custom logger to use for request/response debug logging, or the value
|
2163
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2164
|
+
# explicitly disable logging.
|
2165
|
+
# @return [::Logger,:default,nil]
|
2147
2166
|
#
|
2148
2167
|
class Configuration
|
2149
2168
|
extend ::Gapic::Config
|
@@ -2168,6 +2187,7 @@ module Google
|
|
2168
2187
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2169
2188
|
config_attr :quota_project, nil, ::String, nil
|
2170
2189
|
config_attr :universe_domain, nil, ::String, nil
|
2190
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2171
2191
|
|
2172
2192
|
# @private
|
2173
2193
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
@@ -159,15 +159,27 @@ module Google
|
|
159
159
|
endpoint: @config.endpoint,
|
160
160
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
161
161
|
universe_domain: @config.universe_domain,
|
162
|
-
credentials: credentials
|
162
|
+
credentials: credentials,
|
163
|
+
logger: @config.logger
|
163
164
|
)
|
164
165
|
|
166
|
+
@model_service_stub.logger(stub: true)&.info do |entry|
|
167
|
+
entry.set_system_name
|
168
|
+
entry.set_service
|
169
|
+
entry.message = "Created client for #{entry.service}"
|
170
|
+
entry.set_credentials_fields credentials
|
171
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
172
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
173
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
174
|
+
end
|
175
|
+
|
165
176
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
166
177
|
config.credentials = credentials
|
167
178
|
config.quota_project = @quota_project_id
|
168
179
|
config.endpoint = @model_service_stub.endpoint
|
169
180
|
config.universe_domain = @model_service_stub.universe_domain
|
170
181
|
config.bindings_override = @config.bindings_override
|
182
|
+
config.logger = @model_service_stub.logger if config.respond_to? :logger=
|
171
183
|
end
|
172
184
|
|
173
185
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -176,6 +188,7 @@ module Google
|
|
176
188
|
config.endpoint = @model_service_stub.endpoint
|
177
189
|
config.universe_domain = @model_service_stub.universe_domain
|
178
190
|
config.bindings_override = @config.bindings_override
|
191
|
+
config.logger = @model_service_stub.logger if config.respond_to? :logger=
|
179
192
|
end
|
180
193
|
end
|
181
194
|
|
@@ -200,6 +213,15 @@ module Google
|
|
200
213
|
#
|
201
214
|
attr_reader :iam_policy_client
|
202
215
|
|
216
|
+
##
|
217
|
+
# The logger used for request/response debug logging.
|
218
|
+
#
|
219
|
+
# @return [Logger]
|
220
|
+
#
|
221
|
+
def logger
|
222
|
+
@model_service_stub.logger
|
223
|
+
end
|
224
|
+
|
203
225
|
# Service calls
|
204
226
|
|
205
227
|
##
|
@@ -303,7 +325,7 @@ module Google
|
|
303
325
|
@model_service_stub.upload_model request, options do |result, operation|
|
304
326
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
305
327
|
yield result, operation if block_given?
|
306
|
-
|
328
|
+
throw :response, result
|
307
329
|
end
|
308
330
|
rescue ::Gapic::Rest::Error => e
|
309
331
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -393,7 +415,6 @@ module Google
|
|
393
415
|
|
394
416
|
@model_service_stub.get_model request, options do |result, operation|
|
395
417
|
yield result, operation if block_given?
|
396
|
-
return result
|
397
418
|
end
|
398
419
|
rescue ::Gapic::Rest::Error => e
|
399
420
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -519,7 +540,7 @@ module Google
|
|
519
540
|
@model_service_stub.list_models request, options do |result, operation|
|
520
541
|
result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_models, "models", request, result, options
|
521
542
|
yield result, operation if block_given?
|
522
|
-
|
543
|
+
throw :response, result
|
523
544
|
end
|
524
545
|
rescue ::Gapic::Rest::Error => e
|
525
546
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -635,7 +656,7 @@ module Google
|
|
635
656
|
@model_service_stub.list_model_versions request, options do |result, operation|
|
636
657
|
result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_model_versions, "models", request, result, options
|
637
658
|
yield result, operation if block_given?
|
638
|
-
|
659
|
+
throw :response, result
|
639
660
|
end
|
640
661
|
rescue ::Gapic::Rest::Error => e
|
641
662
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -735,7 +756,6 @@ module Google
|
|
735
756
|
|
736
757
|
@model_service_stub.update_model request, options do |result, operation|
|
737
758
|
yield result, operation if block_given?
|
738
|
-
return result
|
739
759
|
end
|
740
760
|
rescue ::Gapic::Rest::Error => e
|
741
761
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -825,7 +845,7 @@ module Google
|
|
825
845
|
@model_service_stub.update_explanation_dataset request, options do |result, operation|
|
826
846
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
827
847
|
yield result, operation if block_given?
|
828
|
-
|
848
|
+
throw :response, result
|
829
849
|
end
|
830
850
|
rescue ::Gapic::Rest::Error => e
|
831
851
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -920,7 +940,7 @@ module Google
|
|
920
940
|
@model_service_stub.delete_model request, options do |result, operation|
|
921
941
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
922
942
|
yield result, operation if block_given?
|
923
|
-
|
943
|
+
throw :response, result
|
924
944
|
end
|
925
945
|
rescue ::Gapic::Rest::Error => e
|
926
946
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1016,7 +1036,7 @@ module Google
|
|
1016
1036
|
@model_service_stub.delete_model_version request, options do |result, operation|
|
1017
1037
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1018
1038
|
yield result, operation if block_given?
|
1019
|
-
|
1039
|
+
throw :response, result
|
1020
1040
|
end
|
1021
1041
|
rescue ::Gapic::Rest::Error => e
|
1022
1042
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1111,7 +1131,6 @@ module Google
|
|
1111
1131
|
|
1112
1132
|
@model_service_stub.merge_version_aliases request, options do |result, operation|
|
1113
1133
|
yield result, operation if block_given?
|
1114
|
-
return result
|
1115
1134
|
end
|
1116
1135
|
rescue ::Gapic::Rest::Error => e
|
1117
1136
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1205,7 +1224,7 @@ module Google
|
|
1205
1224
|
@model_service_stub.export_model request, options do |result, operation|
|
1206
1225
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1207
1226
|
yield result, operation if block_given?
|
1208
|
-
|
1227
|
+
throw :response, result
|
1209
1228
|
end
|
1210
1229
|
rescue ::Gapic::Rest::Error => e
|
1211
1230
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1315,7 +1334,7 @@ module Google
|
|
1315
1334
|
@model_service_stub.copy_model request, options do |result, operation|
|
1316
1335
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1317
1336
|
yield result, operation if block_given?
|
1318
|
-
|
1337
|
+
throw :response, result
|
1319
1338
|
end
|
1320
1339
|
rescue ::Gapic::Rest::Error => e
|
1321
1340
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1397,7 +1416,6 @@ module Google
|
|
1397
1416
|
|
1398
1417
|
@model_service_stub.import_model_evaluation request, options do |result, operation|
|
1399
1418
|
yield result, operation if block_given?
|
1400
|
-
return result
|
1401
1419
|
end
|
1402
1420
|
rescue ::Gapic::Rest::Error => e
|
1403
1421
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1480,7 +1498,6 @@ module Google
|
|
1480
1498
|
|
1481
1499
|
@model_service_stub.batch_import_model_evaluation_slices request, options do |result, operation|
|
1482
1500
|
yield result, operation if block_given?
|
1483
|
-
return result
|
1484
1501
|
end
|
1485
1502
|
rescue ::Gapic::Rest::Error => e
|
1486
1503
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1563,7 +1580,6 @@ module Google
|
|
1563
1580
|
|
1564
1581
|
@model_service_stub.batch_import_evaluated_annotations request, options do |result, operation|
|
1565
1582
|
yield result, operation if block_given?
|
1566
|
-
return result
|
1567
1583
|
end
|
1568
1584
|
rescue ::Gapic::Rest::Error => e
|
1569
1585
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1644,7 +1660,6 @@ module Google
|
|
1644
1660
|
|
1645
1661
|
@model_service_stub.get_model_evaluation request, options do |result, operation|
|
1646
1662
|
yield result, operation if block_given?
|
1647
|
-
return result
|
1648
1663
|
end
|
1649
1664
|
rescue ::Gapic::Rest::Error => e
|
1650
1665
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1742,7 +1757,7 @@ module Google
|
|
1742
1757
|
@model_service_stub.list_model_evaluations request, options do |result, operation|
|
1743
1758
|
result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_model_evaluations, "model_evaluations", request, result, options
|
1744
1759
|
yield result, operation if block_given?
|
1745
|
-
|
1760
|
+
throw :response, result
|
1746
1761
|
end
|
1747
1762
|
rescue ::Gapic::Rest::Error => e
|
1748
1763
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1823,7 +1838,6 @@ module Google
|
|
1823
1838
|
|
1824
1839
|
@model_service_stub.get_model_evaluation_slice request, options do |result, operation|
|
1825
1840
|
yield result, operation if block_given?
|
1826
|
-
return result
|
1827
1841
|
end
|
1828
1842
|
rescue ::Gapic::Rest::Error => e
|
1829
1843
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1924,7 +1938,7 @@ module Google
|
|
1924
1938
|
@model_service_stub.list_model_evaluation_slices request, options do |result, operation|
|
1925
1939
|
result = ::Gapic::Rest::PagedEnumerable.new @model_service_stub, :list_model_evaluation_slices, "model_evaluation_slices", request, result, options
|
1926
1940
|
yield result, operation if block_given?
|
1927
|
-
|
1941
|
+
throw :response, result
|
1928
1942
|
end
|
1929
1943
|
rescue ::Gapic::Rest::Error => e
|
1930
1944
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2004,6 +2018,11 @@ module Google
|
|
2004
2018
|
# default endpoint URL. The default value of nil uses the environment
|
2005
2019
|
# universe (usually the default "googleapis.com" universe).
|
2006
2020
|
# @return [::String,nil]
|
2021
|
+
# @!attribute [rw] logger
|
2022
|
+
# A custom logger to use for request/response debug logging, or the value
|
2023
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2024
|
+
# explicitly disable logging.
|
2025
|
+
# @return [::Logger,:default,nil]
|
2007
2026
|
#
|
2008
2027
|
class Configuration
|
2009
2028
|
extend ::Gapic::Config
|
@@ -2032,6 +2051,7 @@ module Google
|
|
2032
2051
|
# by the host service.
|
2033
2052
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
2034
2053
|
config_attr :bindings_override, {}, ::Hash, nil
|
2054
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2035
2055
|
|
2036
2056
|
# @private
|
2037
2057
|
def initialize parent_config = nil
|