google-cloud-automl-v1beta1 0.6.0 → 0.7.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 +2 -2
- data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/automl/client.rb +56 -66
- data/lib/google/cloud/automl/v1beta1/automl/operations.rb +20 -14
- data/lib/google/cloud/automl/v1beta1/automl/rest/client.rb +2222 -0
- data/lib/google/cloud/automl/v1beta1/automl/rest/operations.rb +935 -0
- data/lib/google/cloud/automl/v1beta1/automl/rest/service_stub.rb +1475 -0
- data/lib/google/cloud/automl/v1beta1/automl/rest.rb +66 -0
- data/lib/google/cloud/automl/v1beta1/automl.rb +7 -1
- data/lib/google/cloud/automl/v1beta1/classification_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +0 -3
- data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/detection_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/image_pb.rb +0 -3
- data/lib/google/cloud/automl/v1beta1/io_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/model_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/operations_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/prediction_service/client.rb +4 -4
- data/lib/google/cloud/automl/v1beta1/prediction_service/operations.rb +20 -14
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/client.rb +563 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/operations.rb +935 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest/service_stub.rb +168 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service/rest.rb +56 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service.rb +7 -1
- data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/regression_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/rest.rb +38 -0
- data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/tables_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/text_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +0 -2
- data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/translation_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1/version.rb +1 -1
- data/lib/google/cloud/automl/v1beta1/video_pb.rb +0 -1
- data/lib/google/cloud/automl/v1beta1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +20 -8
@@ -0,0 +1,168 @@
|
|
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
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/automl/v1beta1/prediction_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module AutoML
|
24
|
+
module V1beta1
|
25
|
+
module PredictionService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the PredictionService service.
|
29
|
+
# Service stub contains baseline method implementations
|
30
|
+
# including transcoding, making the REST call, and deserialing the response.
|
31
|
+
#
|
32
|
+
class ServiceStub
|
33
|
+
def initialize endpoint:, credentials:
|
34
|
+
# These require statements are intentionally placed here to initialize
|
35
|
+
# the REST modules only when it's required.
|
36
|
+
require "gapic/rest"
|
37
|
+
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
|
39
|
+
numeric_enums: true,
|
40
|
+
raise_faraday_errors: false
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Baseline implementation for the predict REST call
|
45
|
+
#
|
46
|
+
# @param request_pb [::Google::Cloud::AutoML::V1beta1::PredictRequest]
|
47
|
+
# A request object representing the call parameters. Required.
|
48
|
+
# @param options [::Gapic::CallOptions]
|
49
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
50
|
+
#
|
51
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
52
|
+
# @yieldparam result [::Google::Cloud::AutoML::V1beta1::PredictResponse]
|
53
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
54
|
+
#
|
55
|
+
# @return [::Google::Cloud::AutoML::V1beta1::PredictResponse]
|
56
|
+
# A result object deserialized from the server's reply
|
57
|
+
def predict request_pb, options = nil
|
58
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
59
|
+
|
60
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_predict_request request_pb
|
61
|
+
query_string_params = if query_string_params.any?
|
62
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
63
|
+
else
|
64
|
+
{}
|
65
|
+
end
|
66
|
+
|
67
|
+
response = @client_stub.make_http_request(
|
68
|
+
verb,
|
69
|
+
uri: uri,
|
70
|
+
body: body || "",
|
71
|
+
params: query_string_params,
|
72
|
+
options: options
|
73
|
+
)
|
74
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
75
|
+
result = ::Google::Cloud::AutoML::V1beta1::PredictResponse.decode_json response.body, ignore_unknown_fields: true
|
76
|
+
|
77
|
+
yield result, operation if block_given?
|
78
|
+
result
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Baseline implementation for the batch_predict REST call
|
83
|
+
#
|
84
|
+
# @param request_pb [::Google::Cloud::AutoML::V1beta1::BatchPredictRequest]
|
85
|
+
# A request object representing the call parameters. Required.
|
86
|
+
# @param options [::Gapic::CallOptions]
|
87
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
88
|
+
#
|
89
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
90
|
+
# @yieldparam result [::Google::Longrunning::Operation]
|
91
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
92
|
+
#
|
93
|
+
# @return [::Google::Longrunning::Operation]
|
94
|
+
# A result object deserialized from the server's reply
|
95
|
+
def batch_predict request_pb, options = nil
|
96
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
97
|
+
|
98
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_batch_predict_request request_pb
|
99
|
+
query_string_params = if query_string_params.any?
|
100
|
+
query_string_params.to_h { |p| p.split("=", 2) }
|
101
|
+
else
|
102
|
+
{}
|
103
|
+
end
|
104
|
+
|
105
|
+
response = @client_stub.make_http_request(
|
106
|
+
verb,
|
107
|
+
uri: uri,
|
108
|
+
body: body || "",
|
109
|
+
params: query_string_params,
|
110
|
+
options: options
|
111
|
+
)
|
112
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
113
|
+
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
114
|
+
|
115
|
+
yield result, operation if block_given?
|
116
|
+
result
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# @private
|
121
|
+
#
|
122
|
+
# GRPC transcoding helper method for the predict REST call
|
123
|
+
#
|
124
|
+
# @param request_pb [::Google::Cloud::AutoML::V1beta1::PredictRequest]
|
125
|
+
# A request object representing the call parameters. Required.
|
126
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
127
|
+
# Uri, Body, Query string parameters
|
128
|
+
def self.transcode_predict_request request_pb
|
129
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
130
|
+
.with_bindings(
|
131
|
+
uri_method: :post,
|
132
|
+
uri_template: "/v1beta1/{name}:predict",
|
133
|
+
body: "*",
|
134
|
+
matches: [
|
135
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false]
|
136
|
+
]
|
137
|
+
)
|
138
|
+
transcoder.transcode request_pb
|
139
|
+
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# @private
|
143
|
+
#
|
144
|
+
# GRPC transcoding helper method for the batch_predict REST call
|
145
|
+
#
|
146
|
+
# @param request_pb [::Google::Cloud::AutoML::V1beta1::BatchPredictRequest]
|
147
|
+
# A request object representing the call parameters. Required.
|
148
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
149
|
+
# Uri, Body, Query string parameters
|
150
|
+
def self.transcode_batch_predict_request request_pb
|
151
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
152
|
+
.with_bindings(
|
153
|
+
uri_method: :post,
|
154
|
+
uri_template: "/v1beta1/{name}:batchPredict",
|
155
|
+
body: "*",
|
156
|
+
matches: [
|
157
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false]
|
158
|
+
]
|
159
|
+
)
|
160
|
+
transcoder.transcode request_pb
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,56 @@
|
|
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
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/automl/v1beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/automl/v1beta1/prediction_service/credentials"
|
26
|
+
require "google/cloud/automl/v1beta1/prediction_service/paths"
|
27
|
+
require "google/cloud/automl/v1beta1/prediction_service/rest/operations"
|
28
|
+
require "google/cloud/automl/v1beta1/prediction_service/rest/client"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module AutoML
|
33
|
+
module V1beta1
|
34
|
+
##
|
35
|
+
# AutoML Prediction API.
|
36
|
+
#
|
37
|
+
# On any input that is documented to expect a string parameter in
|
38
|
+
# snake_case or kebab-case, either of those cases is accepted.
|
39
|
+
#
|
40
|
+
# To load this service and instantiate a REST client:
|
41
|
+
#
|
42
|
+
# require "google/cloud/automl/v1beta1/prediction_service/rest"
|
43
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new
|
44
|
+
#
|
45
|
+
module PredictionService
|
46
|
+
# Client for the REST transport
|
47
|
+
module Rest
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
56
|
+
require "google/cloud/automl/v1beta1/prediction_service/rest/helpers" if ::File.file? helper_path
|
@@ -26,6 +26,7 @@ require "google/cloud/automl/v1beta1/prediction_service/credentials"
|
|
26
26
|
require "google/cloud/automl/v1beta1/prediction_service/paths"
|
27
27
|
require "google/cloud/automl/v1beta1/prediction_service/operations"
|
28
28
|
require "google/cloud/automl/v1beta1/prediction_service/client"
|
29
|
+
require "google/cloud/automl/v1beta1/prediction_service/rest"
|
29
30
|
|
30
31
|
module Google
|
31
32
|
module Cloud
|
@@ -37,11 +38,16 @@ module Google
|
|
37
38
|
# On any input that is documented to expect a string parameter in
|
38
39
|
# snake_case or kebab-case, either of those cases is accepted.
|
39
40
|
#
|
40
|
-
#
|
41
|
+
# @example Load this service and instantiate a gRPC client
|
41
42
|
#
|
42
43
|
# require "google/cloud/automl/v1beta1/prediction_service"
|
43
44
|
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
|
44
45
|
#
|
46
|
+
# @example Load this service and instantiate a REST client
|
47
|
+
#
|
48
|
+
# require "google/cloud/automl/v1beta1/prediction_service/rest"
|
49
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new
|
50
|
+
#
|
45
51
|
module PredictionService
|
46
52
|
end
|
47
53
|
end
|
@@ -3,8 +3,6 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
-
require 'google/api/annotations_pb'
|
7
|
-
|
8
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
7
|
add_file("google/cloud/automl/v1beta1/ranges.proto", :syntax => :proto3) do
|
10
8
|
add_message "google.cloud.automl.v1beta1.DoubleRange" do
|
@@ -3,8 +3,6 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
-
require 'google/api/annotations_pb'
|
7
|
-
|
8
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
7
|
add_file("google/cloud/automl/v1beta1/regression.proto", :syntax => :proto3) do
|
10
8
|
add_message "google.cloud.automl.v1beta1.RegressionEvaluationMetrics" do
|
@@ -0,0 +1,38 @@
|
|
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
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/automl/v1beta1/prediction_service/rest"
|
20
|
+
require "google/cloud/automl/v1beta1/automl/rest"
|
21
|
+
require "google/cloud/automl/v1beta1/version"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module AutoML
|
26
|
+
##
|
27
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
#
|
31
|
+
# require "google/cloud/automl/v1beta1/rest"
|
32
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new
|
33
|
+
#
|
34
|
+
module V1beta1
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -5,7 +5,6 @@ require 'google/protobuf'
|
|
5
5
|
|
6
6
|
require 'google/api/resource_pb'
|
7
7
|
require 'google/cloud/automl/v1beta1/io_pb'
|
8
|
-
require 'google/api/annotations_pb'
|
9
8
|
|
10
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
10
|
add_file("google/cloud/automl/v1beta1/table_spec.proto", :syntax => :proto3) do
|
@@ -12,7 +12,6 @@ require 'google/cloud/automl/v1beta1/regression_pb'
|
|
12
12
|
require 'google/cloud/automl/v1beta1/temporal_pb'
|
13
13
|
require 'google/protobuf/struct_pb'
|
14
14
|
require 'google/protobuf/timestamp_pb'
|
15
|
-
require 'google/api/annotations_pb'
|
16
15
|
|
17
16
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
18
17
|
add_file("google/cloud/automl/v1beta1/tables.proto", :syntax => :proto3) do
|
@@ -4,7 +4,6 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
require 'google/cloud/automl/v1beta1/text_segment_pb'
|
7
|
-
require 'google/api/annotations_pb'
|
8
7
|
|
9
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
9
|
add_file("google/cloud/automl/v1beta1/text_extraction.proto", :syntax => :proto3) do
|
@@ -3,8 +3,6 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
-
require 'google/api/annotations_pb'
|
7
|
-
|
8
6
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
7
|
add_file("google/cloud/automl/v1beta1/text_segment.proto", :syntax => :proto3) do
|
10
8
|
add_message "google.cloud.automl.v1beta1.TextSegment" do
|
@@ -4,7 +4,6 @@
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
6
|
require 'google/cloud/automl/v1beta1/classification_pb'
|
7
|
-
require 'google/api/annotations_pb'
|
8
7
|
|
9
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
9
|
add_file("google/cloud/automl/v1beta1/text_sentiment.proto", :syntax => :proto3) do
|
@@ -5,7 +5,6 @@ require 'google/protobuf'
|
|
5
5
|
|
6
6
|
require 'google/api/field_behavior_pb'
|
7
7
|
require 'google/cloud/automl/v1beta1/data_items_pb'
|
8
|
-
require 'google/api/annotations_pb'
|
9
8
|
|
10
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
10
|
add_file("google/cloud/automl/v1beta1/translation.proto", :syntax => :proto3) do
|
@@ -24,13 +24,18 @@ module Google
|
|
24
24
|
module Cloud
|
25
25
|
module AutoML
|
26
26
|
##
|
27
|
-
#
|
27
|
+
# API client module.
|
28
28
|
#
|
29
|
-
# @example
|
29
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
30
30
|
#
|
31
31
|
# require "google/cloud/automl/v1beta1"
|
32
32
|
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Client.new
|
33
33
|
#
|
34
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
35
|
+
#
|
36
|
+
# require "google/cloud/automl/v1beta1"
|
37
|
+
# client = ::Google::Cloud::AutoML::V1beta1::PredictionService::Rest::Client.new
|
38
|
+
#
|
34
39
|
module V1beta1
|
35
40
|
end
|
36
41
|
end
|