google-cloud-automl-v1 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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/v1/prediction_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module AutoML
24
+ module V1
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::V1::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::V1::PredictResponse]
53
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
54
+ #
55
+ # @return [::Google::Cloud::AutoML::V1::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::V1::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::V1::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::V1::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: "/v1/{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::V1::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: "/v1/{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/v1/version"
24
+
25
+ require "google/cloud/automl/v1/prediction_service/credentials"
26
+ require "google/cloud/automl/v1/prediction_service/paths"
27
+ require "google/cloud/automl/v1/prediction_service/rest/operations"
28
+ require "google/cloud/automl/v1/prediction_service/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module AutoML
33
+ module V1
34
+ ##
35
+ # AutoML Prediction API.
36
+ #
37
+ # On any input that is documented to expect a string parameter in
38
+ # snake_case or dash-case, either of those cases is accepted.
39
+ #
40
+ # To load this service and instantiate a REST client:
41
+ #
42
+ # require "google/cloud/automl/v1/prediction_service/rest"
43
+ # client = ::Google::Cloud::AutoML::V1::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/v1/prediction_service/rest/helpers" if ::File.file? helper_path
@@ -26,6 +26,7 @@ require "google/cloud/automl/v1/prediction_service/credentials"
26
26
  require "google/cloud/automl/v1/prediction_service/paths"
27
27
  require "google/cloud/automl/v1/prediction_service/operations"
28
28
  require "google/cloud/automl/v1/prediction_service/client"
29
+ require "google/cloud/automl/v1/prediction_service/rest"
29
30
 
30
31
  module Google
31
32
  module Cloud
@@ -42,6 +43,11 @@ module Google
42
43
  # require "google/cloud/automl/v1/prediction_service"
43
44
  # client = ::Google::Cloud::AutoML::V1::PredictionService::Client.new
44
45
  #
46
+ # @example Load this service and instantiate a REST client
47
+ #
48
+ # require "google/cloud/automl/v1/prediction_service/rest"
49
+ # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new
50
+ #
45
51
  module PredictionService
46
52
  end
47
53
  end
@@ -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/v1/prediction_service/rest"
20
+ require "google/cloud/automl/v1/automl/rest"
21
+ require "google/cloud/automl/v1/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/v1/rest"
32
+ # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new
33
+ #
34
+ module V1
35
+ end
36
+ end
37
+ end
38
+ end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module AutoML
23
23
  module V1
24
- VERSION = "0.5.1"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -31,6 +31,11 @@ module Google
31
31
  # require "google/cloud/automl/v1"
32
32
  # client = ::Google::Cloud::AutoML::V1::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/v1"
37
+ # client = ::Google::Cloud::AutoML::V1::PredictionService::Rest::Client.new
38
+ #
34
39
  module V1
35
40
  end
36
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-automl-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.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: 2023-02-17 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.1
19
+ version: 0.18.0
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.17.1
29
+ version: 0.18.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -182,6 +182,10 @@ files:
182
182
  - lib/google/cloud/automl/v1/automl/credentials.rb
183
183
  - lib/google/cloud/automl/v1/automl/operations.rb
184
184
  - lib/google/cloud/automl/v1/automl/paths.rb
185
+ - lib/google/cloud/automl/v1/automl/rest.rb
186
+ - lib/google/cloud/automl/v1/automl/rest/client.rb
187
+ - lib/google/cloud/automl/v1/automl/rest/operations.rb
188
+ - lib/google/cloud/automl/v1/automl/rest/service_stub.rb
185
189
  - lib/google/cloud/automl/v1/classification_pb.rb
186
190
  - lib/google/cloud/automl/v1/data_items_pb.rb
187
191
  - lib/google/cloud/automl/v1/dataset_pb.rb
@@ -197,8 +201,13 @@ files:
197
201
  - lib/google/cloud/automl/v1/prediction_service/credentials.rb
198
202
  - lib/google/cloud/automl/v1/prediction_service/operations.rb
199
203
  - lib/google/cloud/automl/v1/prediction_service/paths.rb
204
+ - lib/google/cloud/automl/v1/prediction_service/rest.rb
205
+ - lib/google/cloud/automl/v1/prediction_service/rest/client.rb
206
+ - lib/google/cloud/automl/v1/prediction_service/rest/operations.rb
207
+ - lib/google/cloud/automl/v1/prediction_service/rest/service_stub.rb
200
208
  - lib/google/cloud/automl/v1/prediction_service_pb.rb
201
209
  - lib/google/cloud/automl/v1/prediction_service_services_pb.rb
210
+ - lib/google/cloud/automl/v1/rest.rb
202
211
  - lib/google/cloud/automl/v1/service_pb.rb
203
212
  - lib/google/cloud/automl/v1/service_services_pb.rb
204
213
  - lib/google/cloud/automl/v1/text_extraction_pb.rb
@@ -260,5 +269,6 @@ requirements: []
260
269
  rubygems_version: 3.4.2
261
270
  signing_key:
262
271
  specification_version: 4
263
- summary: API Client library for the Cloud AutoML V1 API
272
+ summary: Train high-quality custom machine learning models with minimum effort and
273
+ machine learning expertise.
264
274
  test_files: []