google-cloud-automl-v1 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +31 -21
- data/lib/google/cloud/automl/v1/automl/client.rb +50 -19
- data/lib/google/cloud/automl/v1/automl/operations.rb +19 -15
- data/lib/google/cloud/automl/v1/automl/rest/client.rb +50 -19
- data/lib/google/cloud/automl/v1/automl/rest/operations.rb +59 -45
- data/lib/google/cloud/automl/v1/automl/rest/service_stub.rb +158 -110
- data/lib/google/cloud/automl/v1/prediction_service/client.rb +35 -3
- data/lib/google/cloud/automl/v1/prediction_service/operations.rb +19 -15
- data/lib/google/cloud/automl/v1/prediction_service/rest/client.rb +35 -3
- data/lib/google/cloud/automl/v1/prediction_service/rest/operations.rb +59 -45
- data/lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/automl/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/automl/v1/annotation_payload.rb +10 -0
- data/proto_docs/google/cloud/automl/v1/data_items.rb +6 -0
- data/proto_docs/google/cloud/automl/v1/dataset.rb +12 -0
- data/proto_docs/google/cloud/automl/v1/io.rb +37 -49
- data/proto_docs/google/cloud/automl/v1/model.rb +12 -0
- data/proto_docs/google/cloud/automl/v1/model_evaluation.rb +10 -0
- data/proto_docs/google/cloud/automl/v1/operations.rb +18 -0
- data/proto_docs/google/cloud/automl/v1/service.rb +4 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0b99404e166007974e5acabfff5799662e94e99445ca5afc059478842691a4c
|
4
|
+
data.tar.gz: c9e626ddd01c1526e748383d045ec2a8fcfb05a746b3c1fc182525679683527e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39bca7e99f90b58fc0d21fc1fc0fa9486710e511963fe4f782463c91dd48d7c478e6256ae9b05485a147e61fef39d3749832c7766ac6f1f9099dc4f0461378b9
|
7
|
+
data.tar.gz: b7d2a1dc190ce887929c844b10f5c369238c5e441a6072998a92bbcb96c4bf0152b6e96d5554d51d101bc040c2e87b68b01b03a1697c2e0028bd6414e27b9060
|
data/README.md
CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/automl)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/cloud/automl/v1"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
76
86
|
|
77
87
|
## Supported Ruby Versions
|
78
88
|
|
79
|
-
This library is supported on Ruby
|
89
|
+
This library is supported on Ruby 3.0+.
|
80
90
|
|
81
91
|
Google provides official support for Ruby versions that are actively supported
|
82
92
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -240,8 +240,19 @@ module Google
|
|
240
240
|
universe_domain: @config.universe_domain,
|
241
241
|
channel_args: @config.channel_args,
|
242
242
|
interceptors: @config.interceptors,
|
243
|
-
channel_pool_config: @config.channel_pool
|
243
|
+
channel_pool_config: @config.channel_pool,
|
244
|
+
logger: @config.logger
|
244
245
|
)
|
246
|
+
|
247
|
+
@auto_ml_stub.stub_logger&.info do |entry|
|
248
|
+
entry.set_system_name
|
249
|
+
entry.set_service
|
250
|
+
entry.message = "Created client for #{entry.service}"
|
251
|
+
entry.set_credentials_fields credentials
|
252
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
253
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
254
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
255
|
+
end
|
245
256
|
end
|
246
257
|
|
247
258
|
##
|
@@ -251,6 +262,15 @@ module Google
|
|
251
262
|
#
|
252
263
|
attr_reader :operations_client
|
253
264
|
|
265
|
+
##
|
266
|
+
# The logger used for request/response debug logging.
|
267
|
+
#
|
268
|
+
# @return [Logger]
|
269
|
+
#
|
270
|
+
def logger
|
271
|
+
@auto_ml_stub.logger
|
272
|
+
end
|
273
|
+
|
254
274
|
# Service calls
|
255
275
|
|
256
276
|
##
|
@@ -343,7 +363,7 @@ module Google
|
|
343
363
|
@auto_ml_stub.call_rpc :create_dataset, request, options: options do |response, operation|
|
344
364
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
345
365
|
yield response, operation if block_given?
|
346
|
-
|
366
|
+
throw :response, response
|
347
367
|
end
|
348
368
|
rescue ::GRPC::BadStatus => e
|
349
369
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -429,7 +449,6 @@ module Google
|
|
429
449
|
|
430
450
|
@auto_ml_stub.call_rpc :get_dataset, request, options: options do |response, operation|
|
431
451
|
yield response, operation if block_given?
|
432
|
-
return response
|
433
452
|
end
|
434
453
|
rescue ::GRPC::BadStatus => e
|
435
454
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -536,7 +555,7 @@ module Google
|
|
536
555
|
@auto_ml_stub.call_rpc :list_datasets, request, options: options do |response, operation|
|
537
556
|
response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_datasets, request, response, operation, options
|
538
557
|
yield response, operation if block_given?
|
539
|
-
|
558
|
+
throw :response, response
|
540
559
|
end
|
541
560
|
rescue ::GRPC::BadStatus => e
|
542
561
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -624,7 +643,6 @@ module Google
|
|
624
643
|
|
625
644
|
@auto_ml_stub.call_rpc :update_dataset, request, options: options do |response, operation|
|
626
645
|
yield response, operation if block_given?
|
627
|
-
return response
|
628
646
|
end
|
629
647
|
rescue ::GRPC::BadStatus => e
|
630
648
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -722,7 +740,7 @@ module Google
|
|
722
740
|
@auto_ml_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
|
723
741
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
724
742
|
yield response, operation if block_given?
|
725
|
-
|
743
|
+
throw :response, response
|
726
744
|
end
|
727
745
|
rescue ::GRPC::BadStatus => e
|
728
746
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -828,7 +846,7 @@ module Google
|
|
828
846
|
@auto_ml_stub.call_rpc :import_data, request, options: options do |response, operation|
|
829
847
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
830
848
|
yield response, operation if block_given?
|
831
|
-
|
849
|
+
throw :response, response
|
832
850
|
end
|
833
851
|
rescue ::GRPC::BadStatus => e
|
834
852
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -926,7 +944,7 @@ module Google
|
|
926
944
|
@auto_ml_stub.call_rpc :export_data, request, options: options do |response, operation|
|
927
945
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
928
946
|
yield response, operation if block_given?
|
929
|
-
|
947
|
+
throw :response, response
|
930
948
|
end
|
931
949
|
rescue ::GRPC::BadStatus => e
|
932
950
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1012,7 +1030,6 @@ module Google
|
|
1012
1030
|
|
1013
1031
|
@auto_ml_stub.call_rpc :get_annotation_spec, request, options: options do |response, operation|
|
1014
1032
|
yield response, operation if block_given?
|
1015
|
-
return response
|
1016
1033
|
end
|
1017
1034
|
rescue ::GRPC::BadStatus => e
|
1018
1035
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1112,7 +1129,7 @@ module Google
|
|
1112
1129
|
@auto_ml_stub.call_rpc :create_model, request, options: options do |response, operation|
|
1113
1130
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1114
1131
|
yield response, operation if block_given?
|
1115
|
-
|
1132
|
+
throw :response, response
|
1116
1133
|
end
|
1117
1134
|
rescue ::GRPC::BadStatus => e
|
1118
1135
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1198,7 +1215,6 @@ module Google
|
|
1198
1215
|
|
1199
1216
|
@auto_ml_stub.call_rpc :get_model, request, options: options do |response, operation|
|
1200
1217
|
yield response, operation if block_given?
|
1201
|
-
return response
|
1202
1218
|
end
|
1203
1219
|
rescue ::GRPC::BadStatus => e
|
1204
1220
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1306,7 +1322,7 @@ module Google
|
|
1306
1322
|
@auto_ml_stub.call_rpc :list_models, request, options: options do |response, operation|
|
1307
1323
|
response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_models, request, response, operation, options
|
1308
1324
|
yield response, operation if block_given?
|
1309
|
-
|
1325
|
+
throw :response, response
|
1310
1326
|
end
|
1311
1327
|
rescue ::GRPC::BadStatus => e
|
1312
1328
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1404,7 +1420,7 @@ module Google
|
|
1404
1420
|
@auto_ml_stub.call_rpc :delete_model, request, options: options do |response, operation|
|
1405
1421
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1406
1422
|
yield response, operation if block_given?
|
1407
|
-
|
1423
|
+
throw :response, response
|
1408
1424
|
end
|
1409
1425
|
rescue ::GRPC::BadStatus => e
|
1410
1426
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1492,7 +1508,6 @@ module Google
|
|
1492
1508
|
|
1493
1509
|
@auto_ml_stub.call_rpc :update_model, request, options: options do |response, operation|
|
1494
1510
|
yield response, operation if block_given?
|
1495
|
-
return response
|
1496
1511
|
end
|
1497
1512
|
rescue ::GRPC::BadStatus => e
|
1498
1513
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1528,8 +1543,12 @@ module Google
|
|
1528
1543
|
#
|
1529
1544
|
# @param image_object_detection_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata, ::Hash]
|
1530
1545
|
# Model deployment metadata specific to Image Object Detection.
|
1546
|
+
#
|
1547
|
+
# Note: The following fields are mutually exclusive: `image_object_detection_model_deployment_metadata`, `image_classification_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
1531
1548
|
# @param image_classification_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageClassificationModelDeploymentMetadata, ::Hash]
|
1532
1549
|
# Model deployment metadata specific to Image Classification.
|
1550
|
+
#
|
1551
|
+
# Note: The following fields are mutually exclusive: `image_classification_model_deployment_metadata`, `image_object_detection_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
1533
1552
|
# @param name [::String]
|
1534
1553
|
# Required. Resource name of the model to deploy.
|
1535
1554
|
#
|
@@ -1600,7 +1619,7 @@ module Google
|
|
1600
1619
|
@auto_ml_stub.call_rpc :deploy_model, request, options: options do |response, operation|
|
1601
1620
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1602
1621
|
yield response, operation if block_given?
|
1603
|
-
|
1622
|
+
throw :response, response
|
1604
1623
|
end
|
1605
1624
|
rescue ::GRPC::BadStatus => e
|
1606
1625
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1700,7 +1719,7 @@ module Google
|
|
1700
1719
|
@auto_ml_stub.call_rpc :undeploy_model, request, options: options do |response, operation|
|
1701
1720
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1702
1721
|
yield response, operation if block_given?
|
1703
|
-
|
1722
|
+
throw :response, response
|
1704
1723
|
end
|
1705
1724
|
rescue ::GRPC::BadStatus => e
|
1706
1725
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1802,7 +1821,7 @@ module Google
|
|
1802
1821
|
@auto_ml_stub.call_rpc :export_model, request, options: options do |response, operation|
|
1803
1822
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1804
1823
|
yield response, operation if block_given?
|
1805
|
-
|
1824
|
+
throw :response, response
|
1806
1825
|
end
|
1807
1826
|
rescue ::GRPC::BadStatus => e
|
1808
1827
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1888,7 +1907,6 @@ module Google
|
|
1888
1907
|
|
1889
1908
|
@auto_ml_stub.call_rpc :get_model_evaluation, request, options: options do |response, operation|
|
1890
1909
|
yield response, operation if block_given?
|
1891
|
-
return response
|
1892
1910
|
end
|
1893
1911
|
rescue ::GRPC::BadStatus => e
|
1894
1912
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2000,7 +2018,7 @@ module Google
|
|
2000
2018
|
@auto_ml_stub.call_rpc :list_model_evaluations, request, options: options do |response, operation|
|
2001
2019
|
response = ::Gapic::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, request, response, operation, options
|
2002
2020
|
yield response, operation if block_given?
|
2003
|
-
|
2021
|
+
throw :response, response
|
2004
2022
|
end
|
2005
2023
|
rescue ::GRPC::BadStatus => e
|
2006
2024
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2050,6 +2068,13 @@ module Google
|
|
2050
2068
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
2051
2069
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
2052
2070
|
# * (`nil`) indicating no credentials
|
2071
|
+
#
|
2072
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
2073
|
+
# external source for authentication to Google Cloud, you must validate it before
|
2074
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
2075
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
2076
|
+
# For more information, refer to [Validate credential configurations from external
|
2077
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
2053
2078
|
# @return [::Object]
|
2054
2079
|
# @!attribute [rw] scope
|
2055
2080
|
# The OAuth scopes
|
@@ -2089,6 +2114,11 @@ module Google
|
|
2089
2114
|
# default endpoint URL. The default value of nil uses the environment
|
2090
2115
|
# universe (usually the default "googleapis.com" universe).
|
2091
2116
|
# @return [::String,nil]
|
2117
|
+
# @!attribute [rw] logger
|
2118
|
+
# A custom logger to use for request/response debug logging, or the value
|
2119
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2120
|
+
# explicitly disable logging.
|
2121
|
+
# @return [::Logger,:default,nil]
|
2092
2122
|
#
|
2093
2123
|
class Configuration
|
2094
2124
|
extend ::Gapic::Config
|
@@ -2113,6 +2143,7 @@ module Google
|
|
2113
2143
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2114
2144
|
config_attr :quota_project, nil, ::String, nil
|
2115
2145
|
config_attr :universe_domain, nil, ::String, nil
|
2146
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2116
2147
|
|
2117
2148
|
# @private
|
2118
2149
|
def initialize parent_config = nil
|
@@ -124,14 +124,6 @@ module Google
|
|
124
124
|
# Lists operations that match the specified filter in the request. If the
|
125
125
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
126
126
|
#
|
127
|
-
# NOTE: the `name` binding allows API services to override the binding
|
128
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
129
|
-
# override the binding, API services can add a binding such as
|
130
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
131
|
-
# For backwards compatibility, the default name includes the operations
|
132
|
-
# collection id, however overriding users must ensure the name binding
|
133
|
-
# is the parent resource, without the operations collection id.
|
134
|
-
#
|
135
127
|
# @overload list_operations(request, options = nil)
|
136
128
|
# Pass arguments to `list_operations` via a request object, either of type
|
137
129
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -221,7 +213,7 @@ module Google
|
|
221
213
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
222
214
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
223
215
|
yield response, operation if block_given?
|
224
|
-
|
216
|
+
throw :response, response
|
225
217
|
end
|
226
218
|
rescue ::GRPC::BadStatus => e
|
227
219
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -317,7 +309,7 @@ module Google
|
|
317
309
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
318
310
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
319
311
|
yield response, operation if block_given?
|
320
|
-
|
312
|
+
throw :response, response
|
321
313
|
end
|
322
314
|
rescue ::GRPC::BadStatus => e
|
323
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -406,7 +398,6 @@ module Google
|
|
406
398
|
|
407
399
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
408
400
|
yield response, operation if block_given?
|
409
|
-
return response
|
410
401
|
end
|
411
402
|
rescue ::GRPC::BadStatus => e
|
412
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -421,8 +412,9 @@ module Google
|
|
421
412
|
# other methods to check whether the cancellation succeeded or whether the
|
422
413
|
# operation completed despite cancellation. On successful cancellation,
|
423
414
|
# the operation is not deleted; instead, it becomes an operation with
|
424
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
425
|
-
# corresponding to
|
415
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
416
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
417
|
+
# `Code.CANCELLED`.
|
426
418
|
#
|
427
419
|
# @overload cancel_operation(request, options = nil)
|
428
420
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -501,7 +493,6 @@ module Google
|
|
501
493
|
|
502
494
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
503
495
|
yield response, operation if block_given?
|
504
|
-
return response
|
505
496
|
end
|
506
497
|
rescue ::GRPC::BadStatus => e
|
507
498
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -607,7 +598,7 @@ module Google
|
|
607
598
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
608
599
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
609
600
|
yield response, operation if block_given?
|
610
|
-
|
601
|
+
throw :response, response
|
611
602
|
end
|
612
603
|
rescue ::GRPC::BadStatus => e
|
613
604
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -657,6 +648,13 @@ module Google
|
|
657
648
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
658
649
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
659
650
|
# * (`nil`) indicating no credentials
|
651
|
+
#
|
652
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
653
|
+
# external source for authentication to Google Cloud, you must validate it before
|
654
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
655
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
656
|
+
# For more information, refer to [Validate credential configurations from external
|
657
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
660
658
|
# @return [::Object]
|
661
659
|
# @!attribute [rw] scope
|
662
660
|
# The OAuth scopes
|
@@ -696,6 +694,11 @@ module Google
|
|
696
694
|
# default endpoint URL. The default value of nil uses the environment
|
697
695
|
# universe (usually the default "googleapis.com" universe).
|
698
696
|
# @return [::String,nil]
|
697
|
+
# @!attribute [rw] logger
|
698
|
+
# A custom logger to use for request/response debug logging, or the value
|
699
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
700
|
+
# explicitly disable logging.
|
701
|
+
# @return [::Logger,:default,nil]
|
699
702
|
#
|
700
703
|
class Configuration
|
701
704
|
extend ::Gapic::Config
|
@@ -720,6 +723,7 @@ module Google
|
|
720
723
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
721
724
|
config_attr :quota_project, nil, ::String, nil
|
722
725
|
config_attr :universe_domain, nil, ::String, nil
|
726
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
723
727
|
|
724
728
|
# @private
|
725
729
|
def initialize parent_config = nil
|
@@ -233,8 +233,19 @@ module Google
|
|
233
233
|
endpoint: @config.endpoint,
|
234
234
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
235
235
|
universe_domain: @config.universe_domain,
|
236
|
-
credentials: credentials
|
236
|
+
credentials: credentials,
|
237
|
+
logger: @config.logger
|
237
238
|
)
|
239
|
+
|
240
|
+
@auto_ml_stub.logger(stub: true)&.info do |entry|
|
241
|
+
entry.set_system_name
|
242
|
+
entry.set_service
|
243
|
+
entry.message = "Created client for #{entry.service}"
|
244
|
+
entry.set_credentials_fields credentials
|
245
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
246
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
247
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
248
|
+
end
|
238
249
|
end
|
239
250
|
|
240
251
|
##
|
@@ -244,6 +255,15 @@ module Google
|
|
244
255
|
#
|
245
256
|
attr_reader :operations_client
|
246
257
|
|
258
|
+
##
|
259
|
+
# The logger used for request/response debug logging.
|
260
|
+
#
|
261
|
+
# @return [Logger]
|
262
|
+
#
|
263
|
+
def logger
|
264
|
+
@auto_ml_stub.logger
|
265
|
+
end
|
266
|
+
|
247
267
|
# Service calls
|
248
268
|
|
249
269
|
##
|
@@ -329,7 +349,7 @@ module Google
|
|
329
349
|
@auto_ml_stub.create_dataset request, options do |result, operation|
|
330
350
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
331
351
|
yield result, operation if block_given?
|
332
|
-
|
352
|
+
throw :response, result
|
333
353
|
end
|
334
354
|
rescue ::Gapic::Rest::Error => e
|
335
355
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -408,7 +428,6 @@ module Google
|
|
408
428
|
|
409
429
|
@auto_ml_stub.get_dataset request, options do |result, operation|
|
410
430
|
yield result, operation if block_given?
|
411
|
-
return result
|
412
431
|
end
|
413
432
|
rescue ::Gapic::Rest::Error => e
|
414
433
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -508,7 +527,7 @@ module Google
|
|
508
527
|
@auto_ml_stub.list_datasets request, options do |result, operation|
|
509
528
|
result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_datasets, "datasets", request, result, options
|
510
529
|
yield result, operation if block_given?
|
511
|
-
|
530
|
+
throw :response, result
|
512
531
|
end
|
513
532
|
rescue ::Gapic::Rest::Error => e
|
514
533
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -589,7 +608,6 @@ module Google
|
|
589
608
|
|
590
609
|
@auto_ml_stub.update_dataset request, options do |result, operation|
|
591
610
|
yield result, operation if block_given?
|
592
|
-
return result
|
593
611
|
end
|
594
612
|
rescue ::Gapic::Rest::Error => e
|
595
613
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -680,7 +698,7 @@ module Google
|
|
680
698
|
@auto_ml_stub.delete_dataset request, options do |result, operation|
|
681
699
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
682
700
|
yield result, operation if block_given?
|
683
|
-
|
701
|
+
throw :response, result
|
684
702
|
end
|
685
703
|
rescue ::Gapic::Rest::Error => e
|
686
704
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -779,7 +797,7 @@ module Google
|
|
779
797
|
@auto_ml_stub.import_data request, options do |result, operation|
|
780
798
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
781
799
|
yield result, operation if block_given?
|
782
|
-
|
800
|
+
throw :response, result
|
783
801
|
end
|
784
802
|
rescue ::Gapic::Rest::Error => e
|
785
803
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -870,7 +888,7 @@ module Google
|
|
870
888
|
@auto_ml_stub.export_data request, options do |result, operation|
|
871
889
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
872
890
|
yield result, operation if block_given?
|
873
|
-
|
891
|
+
throw :response, result
|
874
892
|
end
|
875
893
|
rescue ::Gapic::Rest::Error => e
|
876
894
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -949,7 +967,6 @@ module Google
|
|
949
967
|
|
950
968
|
@auto_ml_stub.get_annotation_spec request, options do |result, operation|
|
951
969
|
yield result, operation if block_given?
|
952
|
-
return result
|
953
970
|
end
|
954
971
|
rescue ::Gapic::Rest::Error => e
|
955
972
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1042,7 +1059,7 @@ module Google
|
|
1042
1059
|
@auto_ml_stub.create_model request, options do |result, operation|
|
1043
1060
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1044
1061
|
yield result, operation if block_given?
|
1045
|
-
|
1062
|
+
throw :response, result
|
1046
1063
|
end
|
1047
1064
|
rescue ::Gapic::Rest::Error => e
|
1048
1065
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1121,7 +1138,6 @@ module Google
|
|
1121
1138
|
|
1122
1139
|
@auto_ml_stub.get_model request, options do |result, operation|
|
1123
1140
|
yield result, operation if block_given?
|
1124
|
-
return result
|
1125
1141
|
end
|
1126
1142
|
rescue ::Gapic::Rest::Error => e
|
1127
1143
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1222,7 +1238,7 @@ module Google
|
|
1222
1238
|
@auto_ml_stub.list_models request, options do |result, operation|
|
1223
1239
|
result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_models, "model", request, result, options
|
1224
1240
|
yield result, operation if block_given?
|
1225
|
-
|
1241
|
+
throw :response, result
|
1226
1242
|
end
|
1227
1243
|
rescue ::Gapic::Rest::Error => e
|
1228
1244
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1313,7 +1329,7 @@ module Google
|
|
1313
1329
|
@auto_ml_stub.delete_model request, options do |result, operation|
|
1314
1330
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1315
1331
|
yield result, operation if block_given?
|
1316
|
-
|
1332
|
+
throw :response, result
|
1317
1333
|
end
|
1318
1334
|
rescue ::Gapic::Rest::Error => e
|
1319
1335
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1394,7 +1410,6 @@ module Google
|
|
1394
1410
|
|
1395
1411
|
@auto_ml_stub.update_model request, options do |result, operation|
|
1396
1412
|
yield result, operation if block_given?
|
1397
|
-
return result
|
1398
1413
|
end
|
1399
1414
|
rescue ::Gapic::Rest::Error => e
|
1400
1415
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1430,8 +1445,12 @@ module Google
|
|
1430
1445
|
#
|
1431
1446
|
# @param image_object_detection_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageObjectDetectionModelDeploymentMetadata, ::Hash]
|
1432
1447
|
# Model deployment metadata specific to Image Object Detection.
|
1448
|
+
#
|
1449
|
+
# Note: The following fields are mutually exclusive: `image_object_detection_model_deployment_metadata`, `image_classification_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
1433
1450
|
# @param image_classification_model_deployment_metadata [::Google::Cloud::AutoML::V1::ImageClassificationModelDeploymentMetadata, ::Hash]
|
1434
1451
|
# Model deployment metadata specific to Image Classification.
|
1452
|
+
#
|
1453
|
+
# Note: The following fields are mutually exclusive: `image_classification_model_deployment_metadata`, `image_object_detection_model_deployment_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
1435
1454
|
# @param name [::String]
|
1436
1455
|
# Required. Resource name of the model to deploy.
|
1437
1456
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -1495,7 +1514,7 @@ module Google
|
|
1495
1514
|
@auto_ml_stub.deploy_model request, options do |result, operation|
|
1496
1515
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1497
1516
|
yield result, operation if block_given?
|
1498
|
-
|
1517
|
+
throw :response, result
|
1499
1518
|
end
|
1500
1519
|
rescue ::Gapic::Rest::Error => e
|
1501
1520
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1588,7 +1607,7 @@ module Google
|
|
1588
1607
|
@auto_ml_stub.undeploy_model request, options do |result, operation|
|
1589
1608
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1590
1609
|
yield result, operation if block_given?
|
1591
|
-
|
1610
|
+
throw :response, result
|
1592
1611
|
end
|
1593
1612
|
rescue ::Gapic::Rest::Error => e
|
1594
1613
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1683,7 +1702,7 @@ module Google
|
|
1683
1702
|
@auto_ml_stub.export_model request, options do |result, operation|
|
1684
1703
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1685
1704
|
yield result, operation if block_given?
|
1686
|
-
|
1705
|
+
throw :response, result
|
1687
1706
|
end
|
1688
1707
|
rescue ::Gapic::Rest::Error => e
|
1689
1708
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1762,7 +1781,6 @@ module Google
|
|
1762
1781
|
|
1763
1782
|
@auto_ml_stub.get_model_evaluation request, options do |result, operation|
|
1764
1783
|
yield result, operation if block_given?
|
1765
|
-
return result
|
1766
1784
|
end
|
1767
1785
|
rescue ::Gapic::Rest::Error => e
|
1768
1786
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1867,7 +1885,7 @@ module Google
|
|
1867
1885
|
@auto_ml_stub.list_model_evaluations request, options do |result, operation|
|
1868
1886
|
result = ::Gapic::Rest::PagedEnumerable.new @auto_ml_stub, :list_model_evaluations, "model_evaluation", request, result, options
|
1869
1887
|
yield result, operation if block_given?
|
1870
|
-
|
1888
|
+
throw :response, result
|
1871
1889
|
end
|
1872
1890
|
rescue ::Gapic::Rest::Error => e
|
1873
1891
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1915,6 +1933,13 @@ module Google
|
|
1915
1933
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1916
1934
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1917
1935
|
# * (`nil`) indicating no credentials
|
1936
|
+
#
|
1937
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1938
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1939
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1940
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1941
|
+
# For more information, refer to [Validate credential configurations from external
|
1942
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1918
1943
|
# @return [::Object]
|
1919
1944
|
# @!attribute [rw] scope
|
1920
1945
|
# The OAuth scopes
|
@@ -1947,6 +1972,11 @@ module Google
|
|
1947
1972
|
# default endpoint URL. The default value of nil uses the environment
|
1948
1973
|
# universe (usually the default "googleapis.com" universe).
|
1949
1974
|
# @return [::String,nil]
|
1975
|
+
# @!attribute [rw] logger
|
1976
|
+
# A custom logger to use for request/response debug logging, or the value
|
1977
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1978
|
+
# explicitly disable logging.
|
1979
|
+
# @return [::Logger,:default,nil]
|
1950
1980
|
#
|
1951
1981
|
class Configuration
|
1952
1982
|
extend ::Gapic::Config
|
@@ -1968,6 +1998,7 @@ module Google
|
|
1968
1998
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1969
1999
|
config_attr :quota_project, nil, ::String, nil
|
1970
2000
|
config_attr :universe_domain, nil, ::String, nil
|
2001
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1971
2002
|
|
1972
2003
|
# @private
|
1973
2004
|
def initialize parent_config = nil
|