google-cloud-vision_ai-v1 0.a → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +144 -8
- data/lib/google/cloud/vision_ai/v1/app_platform/client.rb +3318 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb +47 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/operations.rb +809 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/paths.rb +151 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb +3106 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb +951 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb +1618 -0
- data/lib/google/cloud/vision_ai/v1/app_platform/rest.rb +53 -0
- data/lib/google/cloud/vision_ai/v1/app_platform.rb +56 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service/client.rb +456 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb +47 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb +52 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb +423 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb +128 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb +53 -0
- data/lib/google/cloud/vision_ai/v1/health_check_service.rb +56 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb +2375 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb +47 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb +809 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb +130 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb +2220 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb +951 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb +1139 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb +54 -0
- data/lib/google/cloud/vision_ai/v1/live_video_analytics.rb +57 -0
- data/lib/google/cloud/vision_ai/v1/rest.rb +42 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service/client.rb +915 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb +47 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb +54 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb +610 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb +249 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb +52 -0
- data/lib/google/cloud/vision_ai/v1/streaming_service.rb +55 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/client.rb +2931 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb +47 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/operations.rb +809 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/paths.rb +153 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb +2740 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb +951 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb +1437 -0
- data/lib/google/cloud/vision_ai/v1/streams_service/rest.rb +56 -0
- data/lib/google/cloud/vision_ai/v1/streams_service.rb +59 -0
- data/lib/google/cloud/vision_ai/v1/version.rb +8 -3
- data/lib/google/cloud/vision_ai/v1/warehouse/client.rb +6958 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb +47 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/operations.rb +809 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/paths.rb +237 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb +6403 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb +951 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb +3760 -0
- data/lib/google/cloud/vision_ai/v1/warehouse/rest.rb +53 -0
- data/lib/google/cloud/vision_ai/v1/warehouse.rb +56 -0
- data/lib/google/cloud/vision_ai/v1.rb +50 -0
- data/lib/google/cloud/visionai/v1/annotations_pb.rb +90 -0
- data/lib/google/cloud/visionai/v1/common_pb.rb +50 -0
- data/lib/google/cloud/visionai/v1/health_service_pb.rb +48 -0
- data/lib/google/cloud/visionai/v1/health_service_services_pb.rb +46 -0
- data/lib/google/cloud/visionai/v1/lva_pb.rb +54 -0
- data/lib/google/cloud/visionai/v1/lva_resources_pb.rb +51 -0
- data/lib/google/cloud/visionai/v1/lva_service_pb.rb +80 -0
- data/lib/google/cloud/visionai/v1/lva_service_services_pb.rb +81 -0
- data/lib/google/cloud/visionai/v1/platform_pb.rb +162 -0
- data/lib/google/cloud/visionai/v1/platform_services_pb.rb +111 -0
- data/lib/google/cloud/visionai/v1/streaming_resources_pb.rb +58 -0
- data/lib/google/cloud/visionai/v1/streaming_service_pb.rb +71 -0
- data/lib/google/cloud/visionai/v1/streaming_service_services_pb.rb +55 -0
- data/lib/google/cloud/visionai/v1/streams_resources_pb.rb +53 -0
- data/lib/google/cloud/visionai/v1/streams_service_pb.rb +85 -0
- data/lib/google/cloud/visionai/v1/streams_service_services_pb.rb +92 -0
- data/lib/google/cloud/visionai/v1/warehouse_pb.rb +251 -0
- data/lib/google/cloud/visionai/v1/warehouse_services_pb.rb +228 -0
- data/lib/google-cloud-vision_ai-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +420 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/cloud/visionai/v1/annotations.rb +787 -0
- data/proto_docs/google/cloud/visionai/v1/common.rb +134 -0
- data/proto_docs/google/cloud/visionai/v1/health_service.rb +61 -0
- data/proto_docs/google/cloud/visionai/v1/lva.rb +345 -0
- data/proto_docs/google/cloud/visionai/v1/lva_resources.rb +167 -0
- data/proto_docs/google/cloud/visionai/v1/lva_service.rb +543 -0
- data/proto_docs/google/cloud/visionai/v1/platform.rb +2228 -0
- data/proto_docs/google/cloud/visionai/v1/streaming_resources.rb +178 -0
- data/proto_docs/google/cloud/visionai/v1/streaming_service.rb +393 -0
- data/proto_docs/google/cloud/visionai/v1/streams_resources.rb +229 -0
- data/proto_docs/google/cloud/visionai/v1/streams_service.rb +644 -0
- data/proto_docs/google/cloud/visionai/v1/warehouse.rb +3055 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +145 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/rpc/status.rb +48 -0
- data/proto_docs/google/type/datetime.rb +99 -0
- data/proto_docs/google/type/expr.rb +75 -0
- metadata +183 -10
@@ -0,0 +1,423 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/errors"
|
20
|
+
require "google/cloud/visionai/v1/health_service_pb"
|
21
|
+
require "google/cloud/vision_ai/v1/health_check_service/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
require "google/iam/v1/rest"
|
24
|
+
|
25
|
+
module Google
|
26
|
+
module Cloud
|
27
|
+
module VisionAI
|
28
|
+
module V1
|
29
|
+
module HealthCheckService
|
30
|
+
module Rest
|
31
|
+
##
|
32
|
+
# REST client for the HealthCheckService service.
|
33
|
+
#
|
34
|
+
# HealthCheckService provides an interface for Vertex AI Vision Cluster Health
|
35
|
+
# Check.
|
36
|
+
#
|
37
|
+
class Client
|
38
|
+
# @private
|
39
|
+
API_VERSION = ""
|
40
|
+
|
41
|
+
# @private
|
42
|
+
DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$"
|
43
|
+
|
44
|
+
include Paths
|
45
|
+
|
46
|
+
# @private
|
47
|
+
attr_reader :health_check_service_stub
|
48
|
+
|
49
|
+
##
|
50
|
+
# Configure the HealthCheckService Client class.
|
51
|
+
#
|
52
|
+
# See {::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client::Configuration}
|
53
|
+
# for a description of the configuration fields.
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
#
|
57
|
+
# # Modify the configuration for all HealthCheckService clients
|
58
|
+
# ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.configure do |config|
|
59
|
+
# config.timeout = 10.0
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# @yield [config] Configure the Client client.
|
63
|
+
# @yieldparam config [Client::Configuration]
|
64
|
+
#
|
65
|
+
# @return [Client::Configuration]
|
66
|
+
#
|
67
|
+
def self.configure
|
68
|
+
@configure ||= begin
|
69
|
+
namespace = ["Google", "Cloud", "VisionAI", "V1"]
|
70
|
+
parent_config = while namespace.any?
|
71
|
+
parent_name = namespace.join "::"
|
72
|
+
parent_const = const_get parent_name
|
73
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
74
|
+
namespace.pop
|
75
|
+
end
|
76
|
+
default_config = Client::Configuration.new parent_config
|
77
|
+
|
78
|
+
default_config
|
79
|
+
end
|
80
|
+
yield @configure if block_given?
|
81
|
+
@configure
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Configure the HealthCheckService Client instance.
|
86
|
+
#
|
87
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
88
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
89
|
+
# should be made on {Client.configure}.
|
90
|
+
#
|
91
|
+
# See {::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client::Configuration}
|
92
|
+
# for a description of the configuration fields.
|
93
|
+
#
|
94
|
+
# @yield [config] Configure the Client client.
|
95
|
+
# @yieldparam config [Client::Configuration]
|
96
|
+
#
|
97
|
+
# @return [Client::Configuration]
|
98
|
+
#
|
99
|
+
def configure
|
100
|
+
yield @config if block_given?
|
101
|
+
@config
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# The effective universe domain
|
106
|
+
#
|
107
|
+
# @return [String]
|
108
|
+
#
|
109
|
+
def universe_domain
|
110
|
+
@health_check_service_stub.universe_domain
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Create a new HealthCheckService REST client object.
|
115
|
+
#
|
116
|
+
# @example
|
117
|
+
#
|
118
|
+
# # Create a client using the default configuration
|
119
|
+
# client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new
|
120
|
+
#
|
121
|
+
# # Create a client using a custom configuration
|
122
|
+
# client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config|
|
123
|
+
# config.timeout = 10.0
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
# @yield [config] Configure the HealthCheckService client.
|
127
|
+
# @yieldparam config [Client::Configuration]
|
128
|
+
#
|
129
|
+
def initialize
|
130
|
+
# Create the configuration object
|
131
|
+
@config = Configuration.new Client.configure
|
132
|
+
|
133
|
+
# Yield the configuration if needed
|
134
|
+
yield @config if block_given?
|
135
|
+
|
136
|
+
# Create credentials
|
137
|
+
credentials = @config.credentials
|
138
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
139
|
+
# but only if the default endpoint does not have a region prefix.
|
140
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
141
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
142
|
+
!@config.endpoint.split(".").first.include?("-"))
|
143
|
+
credentials ||= Credentials.default scope: @config.scope,
|
144
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
145
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
146
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
147
|
+
end
|
148
|
+
|
149
|
+
@quota_project_id = @config.quota_project
|
150
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
151
|
+
|
152
|
+
@health_check_service_stub = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::ServiceStub.new(
|
153
|
+
endpoint: @config.endpoint,
|
154
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
155
|
+
universe_domain: @config.universe_domain,
|
156
|
+
credentials: credentials
|
157
|
+
)
|
158
|
+
|
159
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
160
|
+
config.credentials = credentials
|
161
|
+
config.quota_project = @quota_project_id
|
162
|
+
config.endpoint = @health_check_service_stub.endpoint
|
163
|
+
config.universe_domain = @health_check_service_stub.universe_domain
|
164
|
+
end
|
165
|
+
|
166
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
167
|
+
config.credentials = credentials
|
168
|
+
config.quota_project = @quota_project_id
|
169
|
+
config.endpoint = @health_check_service_stub.endpoint
|
170
|
+
config.universe_domain = @health_check_service_stub.universe_domain
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# Get the associated client for mix-in of the Locations.
|
176
|
+
#
|
177
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
178
|
+
#
|
179
|
+
attr_reader :location_client
|
180
|
+
|
181
|
+
##
|
182
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
183
|
+
#
|
184
|
+
# @return [Google::Iam::V1::IAMPolicy::Rest::Client]
|
185
|
+
#
|
186
|
+
attr_reader :iam_policy_client
|
187
|
+
|
188
|
+
# Service calls
|
189
|
+
|
190
|
+
##
|
191
|
+
# HealthCheck method checks the health status of the cluster.
|
192
|
+
#
|
193
|
+
# @overload health_check(request, options = nil)
|
194
|
+
# Pass arguments to `health_check` via a request object, either of type
|
195
|
+
# {::Google::Cloud::VisionAI::V1::HealthCheckRequest} or an equivalent Hash.
|
196
|
+
#
|
197
|
+
# @param request [::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Hash]
|
198
|
+
# A request object representing the call parameters. Required. To specify no
|
199
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
200
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
201
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
202
|
+
#
|
203
|
+
# @overload health_check(cluster: nil)
|
204
|
+
# Pass arguments to `health_check` via keyword arguments. Note that at
|
205
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
206
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
207
|
+
#
|
208
|
+
# @param cluster [::String]
|
209
|
+
# The parent of the resource.
|
210
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
211
|
+
# @yieldparam result [::Google::Cloud::VisionAI::V1::HealthCheckResponse]
|
212
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
213
|
+
#
|
214
|
+
# @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse]
|
215
|
+
#
|
216
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
217
|
+
#
|
218
|
+
# @example Basic example
|
219
|
+
# require "google/cloud/vision_ai/v1"
|
220
|
+
#
|
221
|
+
# # Create a client object. The client can be reused for multiple calls.
|
222
|
+
# client = Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new
|
223
|
+
#
|
224
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
225
|
+
# request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new
|
226
|
+
#
|
227
|
+
# # Call the health_check method.
|
228
|
+
# result = client.health_check request
|
229
|
+
#
|
230
|
+
# # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse.
|
231
|
+
# p result
|
232
|
+
#
|
233
|
+
def health_check request, options = nil
|
234
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
235
|
+
|
236
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::HealthCheckRequest
|
237
|
+
|
238
|
+
# Converts hash and nil to an options object
|
239
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
240
|
+
|
241
|
+
# Customize the options with defaults
|
242
|
+
call_metadata = @config.rpcs.health_check.metadata.to_h
|
243
|
+
|
244
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
245
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
246
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
247
|
+
gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
|
248
|
+
transports_version_send: [:rest]
|
249
|
+
|
250
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
251
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
252
|
+
|
253
|
+
options.apply_defaults timeout: @config.rpcs.health_check.timeout,
|
254
|
+
metadata: call_metadata,
|
255
|
+
retry_policy: @config.rpcs.health_check.retry_policy
|
256
|
+
|
257
|
+
options.apply_defaults timeout: @config.timeout,
|
258
|
+
metadata: @config.metadata,
|
259
|
+
retry_policy: @config.retry_policy
|
260
|
+
|
261
|
+
@health_check_service_stub.health_check request, options do |result, operation|
|
262
|
+
yield result, operation if block_given?
|
263
|
+
return result
|
264
|
+
end
|
265
|
+
rescue ::Gapic::Rest::Error => e
|
266
|
+
raise ::Google::Cloud::Error.from_error(e)
|
267
|
+
end
|
268
|
+
|
269
|
+
##
|
270
|
+
# Configuration class for the HealthCheckService REST API.
|
271
|
+
#
|
272
|
+
# This class represents the configuration for HealthCheckService REST,
|
273
|
+
# providing control over timeouts, retry behavior, logging, transport
|
274
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
275
|
+
# applied individually to specific RPCs. See
|
276
|
+
# {::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client::Configuration::Rpcs}
|
277
|
+
# for a list of RPCs that can be configured independently.
|
278
|
+
#
|
279
|
+
# Configuration can be applied globally to all clients, or to a single client
|
280
|
+
# on construction.
|
281
|
+
#
|
282
|
+
# @example
|
283
|
+
#
|
284
|
+
# # Modify the global config, setting the timeout for
|
285
|
+
# # health_check to 20 seconds,
|
286
|
+
# # and all remaining timeouts to 10 seconds.
|
287
|
+
# ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.configure do |config|
|
288
|
+
# config.timeout = 10.0
|
289
|
+
# config.rpcs.health_check.timeout = 20.0
|
290
|
+
# end
|
291
|
+
#
|
292
|
+
# # Apply the above configuration only to a new client.
|
293
|
+
# client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config|
|
294
|
+
# config.timeout = 10.0
|
295
|
+
# config.rpcs.health_check.timeout = 20.0
|
296
|
+
# end
|
297
|
+
#
|
298
|
+
# @!attribute [rw] endpoint
|
299
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
300
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
301
|
+
# @return [::String,nil]
|
302
|
+
# @!attribute [rw] credentials
|
303
|
+
# Credentials to send with calls. You may provide any of the following types:
|
304
|
+
# * (`String`) The path to a service account key file in JSON format
|
305
|
+
# * (`Hash`) A service account key as a Hash
|
306
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
307
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
308
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
309
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
310
|
+
# * (`nil`) indicating no credentials
|
311
|
+
# @return [::Object]
|
312
|
+
# @!attribute [rw] scope
|
313
|
+
# The OAuth scopes
|
314
|
+
# @return [::Array<::String>]
|
315
|
+
# @!attribute [rw] lib_name
|
316
|
+
# The library name as recorded in instrumentation and logging
|
317
|
+
# @return [::String]
|
318
|
+
# @!attribute [rw] lib_version
|
319
|
+
# The library version as recorded in instrumentation and logging
|
320
|
+
# @return [::String]
|
321
|
+
# @!attribute [rw] timeout
|
322
|
+
# The call timeout in seconds.
|
323
|
+
# @return [::Numeric]
|
324
|
+
# @!attribute [rw] metadata
|
325
|
+
# Additional headers to be sent with the call.
|
326
|
+
# @return [::Hash{::Symbol=>::String}]
|
327
|
+
# @!attribute [rw] retry_policy
|
328
|
+
# The retry policy. The value is a hash with the following keys:
|
329
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
330
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
331
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
332
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
333
|
+
# trigger a retry.
|
334
|
+
# @return [::Hash]
|
335
|
+
# @!attribute [rw] quota_project
|
336
|
+
# A separate project against which to charge quota.
|
337
|
+
# @return [::String]
|
338
|
+
# @!attribute [rw] universe_domain
|
339
|
+
# The universe domain within which to make requests. This determines the
|
340
|
+
# default endpoint URL. The default value of nil uses the environment
|
341
|
+
# universe (usually the default "googleapis.com" universe).
|
342
|
+
# @return [::String,nil]
|
343
|
+
#
|
344
|
+
class Configuration
|
345
|
+
extend ::Gapic::Config
|
346
|
+
|
347
|
+
# @private
|
348
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
349
|
+
DEFAULT_ENDPOINT = "visionai.googleapis.com"
|
350
|
+
|
351
|
+
config_attr :endpoint, nil, ::String, nil
|
352
|
+
config_attr :credentials, nil do |value|
|
353
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
354
|
+
allowed.any? { |klass| klass === value }
|
355
|
+
end
|
356
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
357
|
+
config_attr :lib_name, nil, ::String, nil
|
358
|
+
config_attr :lib_version, nil, ::String, nil
|
359
|
+
config_attr :timeout, nil, ::Numeric, nil
|
360
|
+
config_attr :metadata, nil, ::Hash, nil
|
361
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
362
|
+
config_attr :quota_project, nil, ::String, nil
|
363
|
+
config_attr :universe_domain, nil, ::String, nil
|
364
|
+
|
365
|
+
# @private
|
366
|
+
def initialize parent_config = nil
|
367
|
+
@parent_config = parent_config unless parent_config.nil?
|
368
|
+
|
369
|
+
yield self if block_given?
|
370
|
+
end
|
371
|
+
|
372
|
+
##
|
373
|
+
# Configurations for individual RPCs
|
374
|
+
# @return [Rpcs]
|
375
|
+
#
|
376
|
+
def rpcs
|
377
|
+
@rpcs ||= begin
|
378
|
+
parent_rpcs = nil
|
379
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
380
|
+
Rpcs.new parent_rpcs
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
##
|
385
|
+
# Configuration RPC class for the HealthCheckService API.
|
386
|
+
#
|
387
|
+
# Includes fields providing the configuration for each RPC in this service.
|
388
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
389
|
+
# the following configuration fields:
|
390
|
+
#
|
391
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
392
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
393
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
394
|
+
# include the following keys:
|
395
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
396
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
397
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
398
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
399
|
+
# trigger a retry.
|
400
|
+
#
|
401
|
+
class Rpcs
|
402
|
+
##
|
403
|
+
# RPC-specific configuration for `health_check`
|
404
|
+
# @return [::Gapic::Config::Method]
|
405
|
+
#
|
406
|
+
attr_reader :health_check
|
407
|
+
|
408
|
+
# @private
|
409
|
+
def initialize parent_rpcs = nil
|
410
|
+
health_check_config = parent_rpcs.health_check if parent_rpcs.respond_to? :health_check
|
411
|
+
@health_check = ::Gapic::Config::Method.new health_check_config
|
412
|
+
|
413
|
+
yield self if block_given?
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/visionai/v1/health_service_pb"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module VisionAI
|
24
|
+
module V1
|
25
|
+
module HealthCheckService
|
26
|
+
module Rest
|
27
|
+
##
|
28
|
+
# REST service stub for the HealthCheckService 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:, endpoint_template:, universe_domain:, 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,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
42
|
+
numeric_enums: true,
|
43
|
+
raise_faraday_errors: false
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# The effective endpoint
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
#
|
60
|
+
def endpoint
|
61
|
+
@client_stub.endpoint
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Baseline implementation for the health_check REST call
|
66
|
+
#
|
67
|
+
# @param request_pb [::Google::Cloud::VisionAI::V1::HealthCheckRequest]
|
68
|
+
# A request object representing the call parameters. Required.
|
69
|
+
# @param options [::Gapic::CallOptions]
|
70
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
71
|
+
#
|
72
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
73
|
+
# @yieldparam result [::Google::Cloud::VisionAI::V1::HealthCheckResponse]
|
74
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
75
|
+
#
|
76
|
+
# @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse]
|
77
|
+
# A result object deserialized from the server's reply
|
78
|
+
def health_check request_pb, options = nil
|
79
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
80
|
+
|
81
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_health_check_request request_pb
|
82
|
+
query_string_params = if query_string_params.any?
|
83
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
84
|
+
else
|
85
|
+
{}
|
86
|
+
end
|
87
|
+
|
88
|
+
response = @client_stub.make_http_request(
|
89
|
+
verb,
|
90
|
+
uri: uri,
|
91
|
+
body: body || "",
|
92
|
+
params: query_string_params,
|
93
|
+
options: options
|
94
|
+
)
|
95
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
96
|
+
result = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.decode_json response.body, ignore_unknown_fields: true
|
97
|
+
|
98
|
+
yield result, operation if block_given?
|
99
|
+
result
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# @private
|
104
|
+
#
|
105
|
+
# GRPC transcoding helper method for the health_check REST call
|
106
|
+
#
|
107
|
+
# @param request_pb [::Google::Cloud::VisionAI::V1::HealthCheckRequest]
|
108
|
+
# A request object representing the call parameters. Required.
|
109
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
110
|
+
# Uri, Body, Query string parameters
|
111
|
+
def self.transcode_health_check_request request_pb
|
112
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
113
|
+
.with_bindings(
|
114
|
+
uri_method: :get,
|
115
|
+
uri_template: "/v1/{cluster}:healthCheck",
|
116
|
+
matches: [
|
117
|
+
["cluster", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false]
|
118
|
+
]
|
119
|
+
)
|
120
|
+
transcoder.transcode request_pb
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/vision_ai/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/vision_ai/v1/health_check_service/credentials"
|
26
|
+
require "google/cloud/vision_ai/v1/health_check_service/paths"
|
27
|
+
require "google/cloud/vision_ai/v1/health_check_service/rest/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module VisionAI
|
32
|
+
module V1
|
33
|
+
##
|
34
|
+
# HealthCheckService provides an interface for Vertex AI Vision Cluster Health
|
35
|
+
# Check.
|
36
|
+
#
|
37
|
+
# To load this service and instantiate a REST client:
|
38
|
+
#
|
39
|
+
# require "google/cloud/vision_ai/v1/health_check_service/rest"
|
40
|
+
# client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new
|
41
|
+
#
|
42
|
+
module HealthCheckService
|
43
|
+
# Client for the REST transport
|
44
|
+
module Rest
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
53
|
+
require "google/cloud/vision_ai/v1/health_check_service/rest/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 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/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/vision_ai/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/vision_ai/v1/health_check_service/credentials"
|
26
|
+
require "google/cloud/vision_ai/v1/health_check_service/paths"
|
27
|
+
require "google/cloud/vision_ai/v1/health_check_service/client"
|
28
|
+
require "google/cloud/vision_ai/v1/health_check_service/rest"
|
29
|
+
|
30
|
+
module Google
|
31
|
+
module Cloud
|
32
|
+
module VisionAI
|
33
|
+
module V1
|
34
|
+
##
|
35
|
+
# HealthCheckService provides an interface for Vertex AI Vision Cluster Health
|
36
|
+
# Check.
|
37
|
+
#
|
38
|
+
# @example Load this service and instantiate a gRPC client
|
39
|
+
#
|
40
|
+
# require "google/cloud/vision_ai/v1/health_check_service"
|
41
|
+
# client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new
|
42
|
+
#
|
43
|
+
# @example Load this service and instantiate a REST client
|
44
|
+
#
|
45
|
+
# require "google/cloud/vision_ai/v1/health_check_service/rest"
|
46
|
+
# client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new
|
47
|
+
#
|
48
|
+
module HealthCheckService
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
helper_path = ::File.join __dir__, "health_check_service", "helpers.rb"
|
56
|
+
require "google/cloud/vision_ai/v1/health_check_service/helpers" if ::File.file? helper_path
|