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