google-cloud-automl 1.2.0 → 1.3.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/AUTHENTICATION.md +1 -1
- data/README.md +0 -26
- data/lib/google/cloud/automl/helpers.rb +31 -0
- data/lib/google/cloud/automl/version.rb +1 -1
- data/lib/google/cloud/automl.rb +21 -13
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b10a1929f314b5edb9e9c678f2fdc15ca2a46b73d36945dc004c9f577dee0ef9
|
4
|
+
data.tar.gz: 274fe34d6706ec998fb13f6a64f7b661a3167d4481c02a36d4d0422c55853f16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa2a32fc73a5f9b5caf18674f04301b2a3d51c42190cb2ccdfedcb787e40f2088b0dfc6a8b72a5a56f3dc86a58575aae867921004a520ba4981a29acb1504637
|
7
|
+
data.tar.gz: 10fda5552328032c69217e0b61197b9a61737e4d453f8133246719e841dc27d3440485600217627ef2c27336f26a7bce030d1b9de152074dda6961e65f238cba
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -43,32 +43,6 @@ and includes substantial interface changes. Existing code written for earlier
|
|
43
43
|
versions of this library will likely require updates to use this version.
|
44
44
|
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
45
45
|
|
46
|
-
## Enabling Logging
|
47
|
-
|
48
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
50
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
|
-
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
53
|
-
|
54
|
-
Configuring a Ruby stdlib logger:
|
55
|
-
|
56
|
-
```ruby
|
57
|
-
require "logger"
|
58
|
-
|
59
|
-
module MyLogger
|
60
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
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
|
69
|
-
end
|
70
|
-
```
|
71
|
-
|
72
46
|
## Supported Ruby Versions
|
73
47
|
|
74
48
|
This library is supported on Ruby 2.6+.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
module Google
|
19
|
+
module Cloud
|
20
|
+
module AutoML
|
21
|
+
class << self
|
22
|
+
# Backwards-compatibility hack: Define "auto_ml" as an alternative name
|
23
|
+
# for the "automl" method. The generator changed this name due to
|
24
|
+
# https://github.com/googleapis/gapic-generator-ruby/pull/935.
|
25
|
+
if public_method_defined?(:automl) && !public_method_defined?(:auto_ml)
|
26
|
+
alias auto_ml automl
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/google/cloud/automl.rb
CHANGED
@@ -49,11 +49,13 @@ module Google
|
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
51
|
# [Google::Cloud::AutoML::V1::PredictionService::Client](https://googleapis.dev/ruby/google-cloud-automl-v1/latest/Google/Cloud/AutoML/V1/PredictionService/Client.html)
|
52
|
-
# for version V1 of the API.
|
53
|
-
# However, you can specify
|
52
|
+
# for a gRPC client for version V1 of the API.
|
53
|
+
# However, you can specify a different API version by passing it in the
|
54
54
|
# `version` parameter. If the PredictionService service is
|
55
55
|
# supported by that API version, and the corresponding gem is available, the
|
56
56
|
# appropriate versioned client will be returned.
|
57
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
58
|
+
# the `transport` parameter.
|
57
59
|
#
|
58
60
|
# ## About PredictionService
|
59
61
|
#
|
@@ -64,17 +66,19 @@ module Google
|
|
64
66
|
#
|
65
67
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
66
68
|
# Defaults to `:v1`.
|
67
|
-
# @
|
69
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
70
|
+
# @return [::Object] A client object for the specified version.
|
68
71
|
#
|
69
|
-
def self.prediction_service version: :v1, &block
|
72
|
+
def self.prediction_service version: :v1, transport: :grpc, &block
|
70
73
|
require "google/cloud/automl/#{version.to_s.downcase}"
|
71
74
|
|
72
75
|
package_name = Google::Cloud::AutoML
|
73
76
|
.constants
|
74
77
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
75
78
|
.first
|
76
|
-
|
77
|
-
|
79
|
+
service_module = Google::Cloud::AutoML.const_get(package_name).const_get(:PredictionService)
|
80
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
81
|
+
service_module.const_get(:Client).new(&block)
|
78
82
|
end
|
79
83
|
|
80
84
|
##
|
@@ -82,11 +86,13 @@ module Google
|
|
82
86
|
#
|
83
87
|
# By default, this returns an instance of
|
84
88
|
# [Google::Cloud::AutoML::V1::AutoML::Client](https://googleapis.dev/ruby/google-cloud-automl-v1/latest/Google/Cloud/AutoML/V1/AutoML/Client.html)
|
85
|
-
# for version V1 of the API.
|
86
|
-
# However, you can specify
|
89
|
+
# for a gRPC client for version V1 of the API.
|
90
|
+
# However, you can specify a different API version by passing it in the
|
87
91
|
# `version` parameter. If the AutoML service is
|
88
92
|
# supported by that API version, and the corresponding gem is available, the
|
89
93
|
# appropriate versioned client will be returned.
|
94
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
95
|
+
# the `transport` parameter.
|
90
96
|
#
|
91
97
|
# ## About AutoML
|
92
98
|
#
|
@@ -107,17 +113,19 @@ module Google
|
|
107
113
|
#
|
108
114
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
109
115
|
# Defaults to `:v1`.
|
110
|
-
# @
|
116
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
117
|
+
# @return [::Object] A client object for the specified version.
|
111
118
|
#
|
112
|
-
def self.auto_ml version: :v1, &block
|
119
|
+
def self.auto_ml version: :v1, transport: :grpc, &block
|
113
120
|
require "google/cloud/automl/#{version.to_s.downcase}"
|
114
121
|
|
115
122
|
package_name = Google::Cloud::AutoML
|
116
123
|
.constants
|
117
124
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
118
125
|
.first
|
119
|
-
|
120
|
-
|
126
|
+
service_module = Google::Cloud::AutoML.const_get(package_name).const_get(:AutoML)
|
127
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
128
|
+
service_module.const_get(:Client).new(&block)
|
121
129
|
end
|
122
130
|
|
123
131
|
##
|
@@ -137,7 +145,7 @@ module Google
|
|
137
145
|
# * `timeout` (*type:* `Numeric`) -
|
138
146
|
# Default timeout in seconds.
|
139
147
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
140
|
-
# Additional
|
148
|
+
# Additional headers to be sent with the call.
|
141
149
|
# * `retry_policy` (*type:* `Hash`) -
|
142
150
|
# The retry policy. The value is a hash with the following keys:
|
143
151
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-automl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-automl-v1
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.6'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.6'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.7'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 2.a
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0.
|
49
|
+
version: '0.7'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 2.a
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- README.md
|
194
194
|
- lib/google-cloud-automl.rb
|
195
195
|
- lib/google/cloud/automl.rb
|
196
|
+
- lib/google/cloud/automl/helpers.rb
|
196
197
|
- lib/google/cloud/automl/version.rb
|
197
198
|
homepage: https://github.com/googleapis/google-cloud-ruby
|
198
199
|
licenses:
|
@@ -213,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
214
|
- !ruby/object:Gem::Version
|
214
215
|
version: '0'
|
215
216
|
requirements: []
|
216
|
-
rubygems_version: 3.
|
217
|
+
rubygems_version: 3.4.2
|
217
218
|
signing_key:
|
218
219
|
specification_version: 4
|
219
220
|
summary: API Client library for the Cloud AutoML API
|