google-cloud-vision_ai-v1 0.a → 0.1.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 +6957 -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 +6402 -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 +250 -0
  75. data/lib/google/cloud/visionai/v1/warehouse_services_pb.rb +227 -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 +403 -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 +3002 -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,3106 @@
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/platform_pb"
21
+ require "google/cloud/vision_ai/v1/app_platform/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 AppPlatform
30
+ module Rest
31
+ ##
32
+ # REST client for the AppPlatform service.
33
+ #
34
+ # Service describing handlers for resources
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :app_platform_stub
47
+
48
+ ##
49
+ # Configure the AppPlatform Client class.
50
+ #
51
+ # See {::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all AppPlatform clients
57
+ # ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "VisionAI", "V1"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the AppPlatform Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # The effective universe domain
105
+ #
106
+ # @return [String]
107
+ #
108
+ def universe_domain
109
+ @app_platform_stub.universe_domain
110
+ end
111
+
112
+ ##
113
+ # Create a new AppPlatform REST client object.
114
+ #
115
+ # @example
116
+ #
117
+ # # Create a client using the default configuration
118
+ # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
119
+ #
120
+ # # Create a client using a custom configuration
121
+ # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config|
122
+ # config.timeout = 10.0
123
+ # end
124
+ #
125
+ # @yield [config] Configure the AppPlatform client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ def initialize
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @operations_client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Operations.new do |config|
152
+ config.credentials = credentials
153
+ config.quota_project = @quota_project_id
154
+ config.endpoint = @config.endpoint
155
+ config.universe_domain = @config.universe_domain
156
+ end
157
+
158
+ @app_platform_stub = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::ServiceStub.new(
159
+ endpoint: @config.endpoint,
160
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
161
+ universe_domain: @config.universe_domain,
162
+ credentials: credentials
163
+ )
164
+
165
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
166
+ config.credentials = credentials
167
+ config.quota_project = @quota_project_id
168
+ config.endpoint = @app_platform_stub.endpoint
169
+ config.universe_domain = @app_platform_stub.universe_domain
170
+ end
171
+
172
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
173
+ config.credentials = credentials
174
+ config.quota_project = @quota_project_id
175
+ config.endpoint = @app_platform_stub.endpoint
176
+ config.universe_domain = @app_platform_stub.universe_domain
177
+ end
178
+ end
179
+
180
+ ##
181
+ # Get the associated client for long-running operations.
182
+ #
183
+ # @return [::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Operations]
184
+ #
185
+ attr_reader :operations_client
186
+
187
+ ##
188
+ # Get the associated client for mix-in of the Locations.
189
+ #
190
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
191
+ #
192
+ attr_reader :location_client
193
+
194
+ ##
195
+ # Get the associated client for mix-in of the IAMPolicy.
196
+ #
197
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
198
+ #
199
+ attr_reader :iam_policy_client
200
+
201
+ # Service calls
202
+
203
+ ##
204
+ # Lists Applications in a given project and location.
205
+ #
206
+ # @overload list_applications(request, options = nil)
207
+ # Pass arguments to `list_applications` via a request object, either of type
208
+ # {::Google::Cloud::VisionAI::V1::ListApplicationsRequest} or an equivalent Hash.
209
+ #
210
+ # @param request [::Google::Cloud::VisionAI::V1::ListApplicationsRequest, ::Hash]
211
+ # A request object representing the call parameters. Required. To specify no
212
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
213
+ # @param options [::Gapic::CallOptions, ::Hash]
214
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
215
+ #
216
+ # @overload list_applications(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
217
+ # Pass arguments to `list_applications` via keyword arguments. Note that at
218
+ # least one keyword argument is required. To specify no parameters, or to keep all
219
+ # the default parameter values, pass an empty Hash as a request object (see above).
220
+ #
221
+ # @param parent [::String]
222
+ # Required. Parent value for ListApplicationsRequest.
223
+ # @param page_size [::Integer]
224
+ # Requested page size. Server may return fewer items than requested.
225
+ # If unspecified, server will pick an appropriate default.
226
+ # @param page_token [::String]
227
+ # A token identifying a page of results the server should return.
228
+ # @param filter [::String]
229
+ # Filtering results.
230
+ # @param order_by [::String]
231
+ # Hint for how to order the results.
232
+ # @yield [result, operation] Access the result along with the TransportOperation object
233
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListApplicationsResponse]
234
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
235
+ #
236
+ # @return [::Google::Cloud::VisionAI::V1::ListApplicationsResponse]
237
+ #
238
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
239
+ #
240
+ # @example Basic example
241
+ # require "google/cloud/vision_ai/v1"
242
+ #
243
+ # # Create a client object. The client can be reused for multiple calls.
244
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
245
+ #
246
+ # # Create a request. To set request fields, pass in keyword arguments.
247
+ # request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new
248
+ #
249
+ # # Call the list_applications method.
250
+ # result = client.list_applications request
251
+ #
252
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
253
+ # # over elements, and API calls will be issued to fetch pages as needed.
254
+ # result.each do |item|
255
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Application.
256
+ # p item
257
+ # end
258
+ #
259
+ def list_applications request, options = nil
260
+ raise ::ArgumentError, "request must be provided" if request.nil?
261
+
262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListApplicationsRequest
263
+
264
+ # Converts hash and nil to an options object
265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
266
+
267
+ # Customize the options with defaults
268
+ call_metadata = @config.rpcs.list_applications.metadata.to_h
269
+
270
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
271
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
273
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
274
+ transports_version_send: [:rest]
275
+
276
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
277
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
278
+
279
+ options.apply_defaults timeout: @config.rpcs.list_applications.timeout,
280
+ metadata: call_metadata,
281
+ retry_policy: @config.rpcs.list_applications.retry_policy
282
+
283
+ options.apply_defaults timeout: @config.timeout,
284
+ metadata: @config.metadata,
285
+ retry_policy: @config.retry_policy
286
+
287
+ @app_platform_stub.list_applications request, options do |result, operation|
288
+ yield result, operation if block_given?
289
+ return result
290
+ end
291
+ rescue ::Gapic::Rest::Error => e
292
+ raise ::Google::Cloud::Error.from_error(e)
293
+ end
294
+
295
+ ##
296
+ # Gets details of a single Application.
297
+ #
298
+ # @overload get_application(request, options = nil)
299
+ # Pass arguments to `get_application` via a request object, either of type
300
+ # {::Google::Cloud::VisionAI::V1::GetApplicationRequest} or an equivalent Hash.
301
+ #
302
+ # @param request [::Google::Cloud::VisionAI::V1::GetApplicationRequest, ::Hash]
303
+ # A request object representing the call parameters. Required. To specify no
304
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
305
+ # @param options [::Gapic::CallOptions, ::Hash]
306
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
307
+ #
308
+ # @overload get_application(name: nil)
309
+ # Pass arguments to `get_application` via keyword arguments. Note that at
310
+ # least one keyword argument is required. To specify no parameters, or to keep all
311
+ # the default parameter values, pass an empty Hash as a request object (see above).
312
+ #
313
+ # @param name [::String]
314
+ # Required. Name of the resource.
315
+ # @yield [result, operation] Access the result along with the TransportOperation object
316
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Application]
317
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
318
+ #
319
+ # @return [::Google::Cloud::VisionAI::V1::Application]
320
+ #
321
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
322
+ #
323
+ # @example Basic example
324
+ # require "google/cloud/vision_ai/v1"
325
+ #
326
+ # # Create a client object. The client can be reused for multiple calls.
327
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
328
+ #
329
+ # # Create a request. To set request fields, pass in keyword arguments.
330
+ # request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new
331
+ #
332
+ # # Call the get_application method.
333
+ # result = client.get_application request
334
+ #
335
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Application.
336
+ # p result
337
+ #
338
+ def get_application request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetApplicationRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ call_metadata = @config.rpcs.get_application.metadata.to_h
348
+
349
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
350
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
353
+ transports_version_send: [:rest]
354
+
355
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
356
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ options.apply_defaults timeout: @config.rpcs.get_application.timeout,
359
+ metadata: call_metadata,
360
+ retry_policy: @config.rpcs.get_application.retry_policy
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @app_platform_stub.get_application request, options do |result, operation|
367
+ yield result, operation if block_given?
368
+ return result
369
+ end
370
+ rescue ::Gapic::Rest::Error => e
371
+ raise ::Google::Cloud::Error.from_error(e)
372
+ end
373
+
374
+ ##
375
+ # Creates a new Application in a given project and location.
376
+ #
377
+ # @overload create_application(request, options = nil)
378
+ # Pass arguments to `create_application` via a request object, either of type
379
+ # {::Google::Cloud::VisionAI::V1::CreateApplicationRequest} or an equivalent Hash.
380
+ #
381
+ # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationRequest, ::Hash]
382
+ # A request object representing the call parameters. Required. To specify no
383
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
384
+ # @param options [::Gapic::CallOptions, ::Hash]
385
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
386
+ #
387
+ # @overload create_application(parent: nil, application_id: nil, application: nil, request_id: nil)
388
+ # Pass arguments to `create_application` via keyword arguments. Note that at
389
+ # least one keyword argument is required. To specify no parameters, or to keep all
390
+ # the default parameter values, pass an empty Hash as a request object (see above).
391
+ #
392
+ # @param parent [::String]
393
+ # Required. Value for parent.
394
+ # @param application_id [::String]
395
+ # Required. Id of the requesting object.
396
+ # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash]
397
+ # Required. The resource being created.
398
+ # @param request_id [::String]
399
+ # Optional. An optional request ID to identify requests. Specify a unique
400
+ # request ID so that if you must retry your request, the server will know to
401
+ # ignore the request if it has already been completed. The server will
402
+ # guarantee that for at least 60 minutes since the first request.
403
+ #
404
+ # For example, consider a situation where you make an initial request and
405
+ # the request times out. If you make the request again with the same request
406
+ # ID, the server can check if original operation with the same request ID
407
+ # was received, and if so, will ignore the second request. This prevents
408
+ # clients from accidentally creating duplicate commitments.
409
+ #
410
+ # The request ID must be a valid UUID with the exception that zero UUID is
411
+ # not supported (00000000-0000-0000-0000-000000000000).
412
+ # @yield [result, operation] Access the result along with the TransportOperation object
413
+ # @yieldparam result [::Gapic::Operation]
414
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
415
+ #
416
+ # @return [::Gapic::Operation]
417
+ #
418
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
419
+ #
420
+ # @example Basic example
421
+ # require "google/cloud/vision_ai/v1"
422
+ #
423
+ # # Create a client object. The client can be reused for multiple calls.
424
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
425
+ #
426
+ # # Create a request. To set request fields, pass in keyword arguments.
427
+ # request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new
428
+ #
429
+ # # Call the create_application method.
430
+ # result = client.create_application request
431
+ #
432
+ # # The returned object is of type Gapic::Operation. You can use it to
433
+ # # check the status of an operation, cancel it, or wait for results.
434
+ # # Here is how to wait for a response.
435
+ # result.wait_until_done! timeout: 60
436
+ # if result.response?
437
+ # p result.response
438
+ # else
439
+ # puts "No response received."
440
+ # end
441
+ #
442
+ def create_application request, options = nil
443
+ raise ::ArgumentError, "request must be provided" if request.nil?
444
+
445
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationRequest
446
+
447
+ # Converts hash and nil to an options object
448
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
449
+
450
+ # Customize the options with defaults
451
+ call_metadata = @config.rpcs.create_application.metadata.to_h
452
+
453
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
454
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
455
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
456
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
457
+ transports_version_send: [:rest]
458
+
459
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
460
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
461
+
462
+ options.apply_defaults timeout: @config.rpcs.create_application.timeout,
463
+ metadata: call_metadata,
464
+ retry_policy: @config.rpcs.create_application.retry_policy
465
+
466
+ options.apply_defaults timeout: @config.timeout,
467
+ metadata: @config.metadata,
468
+ retry_policy: @config.retry_policy
469
+
470
+ @app_platform_stub.create_application request, options do |result, operation|
471
+ result = ::Gapic::Operation.new result, @operations_client, options: options
472
+ yield result, operation if block_given?
473
+ return result
474
+ end
475
+ rescue ::Gapic::Rest::Error => e
476
+ raise ::Google::Cloud::Error.from_error(e)
477
+ end
478
+
479
+ ##
480
+ # Updates the parameters of a single Application.
481
+ #
482
+ # @overload update_application(request, options = nil)
483
+ # Pass arguments to `update_application` via a request object, either of type
484
+ # {::Google::Cloud::VisionAI::V1::UpdateApplicationRequest} or an equivalent Hash.
485
+ #
486
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, ::Hash]
487
+ # A request object representing the call parameters. Required. To specify no
488
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
489
+ # @param options [::Gapic::CallOptions, ::Hash]
490
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
491
+ #
492
+ # @overload update_application(update_mask: nil, application: nil, request_id: nil)
493
+ # Pass arguments to `update_application` via keyword arguments. Note that at
494
+ # least one keyword argument is required. To specify no parameters, or to keep all
495
+ # the default parameter values, pass an empty Hash as a request object (see above).
496
+ #
497
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
498
+ # Optional. Field mask is used to specify the fields to be overwritten in the
499
+ # Application resource by the update.
500
+ # The fields specified in the update_mask are relative to the resource, not
501
+ # the full request. A field will be overwritten if it is in the mask. If the
502
+ # user does not provide a mask then all fields will be overwritten.
503
+ # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash]
504
+ # Required. The resource being updated.
505
+ # @param request_id [::String]
506
+ # Optional. An optional request ID to identify requests. Specify a unique
507
+ # request ID so that if you must retry your request, the server will know to
508
+ # ignore the request if it has already been completed. The server will
509
+ # guarantee that for at least 60 minutes since the first request.
510
+ #
511
+ # For example, consider a situation where you make an initial request and
512
+ # the request times out. If you make the request again with the same request
513
+ # ID, the server can check if original operation with the same request ID
514
+ # was received, and if so, will ignore the second request. This prevents
515
+ # clients from accidentally creating duplicate commitments.
516
+ #
517
+ # The request ID must be a valid UUID with the exception that zero UUID is
518
+ # not supported (00000000-0000-0000-0000-000000000000).
519
+ # @yield [result, operation] Access the result along with the TransportOperation object
520
+ # @yieldparam result [::Gapic::Operation]
521
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
522
+ #
523
+ # @return [::Gapic::Operation]
524
+ #
525
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
526
+ #
527
+ # @example Basic example
528
+ # require "google/cloud/vision_ai/v1"
529
+ #
530
+ # # Create a client object. The client can be reused for multiple calls.
531
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
532
+ #
533
+ # # Create a request. To set request fields, pass in keyword arguments.
534
+ # request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new
535
+ #
536
+ # # Call the update_application method.
537
+ # result = client.update_application request
538
+ #
539
+ # # The returned object is of type Gapic::Operation. You can use it to
540
+ # # check the status of an operation, cancel it, or wait for results.
541
+ # # Here is how to wait for a response.
542
+ # result.wait_until_done! timeout: 60
543
+ # if result.response?
544
+ # p result.response
545
+ # else
546
+ # puts "No response received."
547
+ # end
548
+ #
549
+ def update_application request, options = nil
550
+ raise ::ArgumentError, "request must be provided" if request.nil?
551
+
552
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest
553
+
554
+ # Converts hash and nil to an options object
555
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
556
+
557
+ # Customize the options with defaults
558
+ call_metadata = @config.rpcs.update_application.metadata.to_h
559
+
560
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
561
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
562
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
563
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
564
+ transports_version_send: [:rest]
565
+
566
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
567
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
568
+
569
+ options.apply_defaults timeout: @config.rpcs.update_application.timeout,
570
+ metadata: call_metadata,
571
+ retry_policy: @config.rpcs.update_application.retry_policy
572
+
573
+ options.apply_defaults timeout: @config.timeout,
574
+ metadata: @config.metadata,
575
+ retry_policy: @config.retry_policy
576
+
577
+ @app_platform_stub.update_application request, options do |result, operation|
578
+ result = ::Gapic::Operation.new result, @operations_client, options: options
579
+ yield result, operation if block_given?
580
+ return result
581
+ end
582
+ rescue ::Gapic::Rest::Error => e
583
+ raise ::Google::Cloud::Error.from_error(e)
584
+ end
585
+
586
+ ##
587
+ # Deletes a single Application.
588
+ #
589
+ # @overload delete_application(request, options = nil)
590
+ # Pass arguments to `delete_application` via a request object, either of type
591
+ # {::Google::Cloud::VisionAI::V1::DeleteApplicationRequest} or an equivalent Hash.
592
+ #
593
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, ::Hash]
594
+ # A request object representing the call parameters. Required. To specify no
595
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
596
+ # @param options [::Gapic::CallOptions, ::Hash]
597
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
598
+ #
599
+ # @overload delete_application(name: nil, request_id: nil, force: nil)
600
+ # Pass arguments to `delete_application` via keyword arguments. Note that at
601
+ # least one keyword argument is required. To specify no parameters, or to keep all
602
+ # the default parameter values, pass an empty Hash as a request object (see above).
603
+ #
604
+ # @param name [::String]
605
+ # Required. Name of the resource.
606
+ # @param request_id [::String]
607
+ # Optional. An optional request ID to identify requests. Specify a unique
608
+ # request ID so that if you must retry your request, the server will know to
609
+ # ignore the request if it has already been completed. The server will
610
+ # guarantee that for at least 60 minutes after the first request.
611
+ #
612
+ # For example, consider a situation where you make an initial request and
613
+ # the request times out. If you make the request again with the same request
614
+ # ID, the server can check if original operation with the same request ID
615
+ # was received, and if so, will ignore the second request. This prevents
616
+ # clients from accidentally creating duplicate commitments.
617
+ #
618
+ # The request ID must be a valid UUID with the exception that zero UUID is
619
+ # not supported (00000000-0000-0000-0000-000000000000).
620
+ # @param force [::Boolean]
621
+ # Optional. If set to true, any instances and drafts from this application
622
+ # will also be deleted. (Otherwise, the request will only work if the
623
+ # application has no instances and drafts.)
624
+ # @yield [result, operation] Access the result along with the TransportOperation object
625
+ # @yieldparam result [::Gapic::Operation]
626
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
627
+ #
628
+ # @return [::Gapic::Operation]
629
+ #
630
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
631
+ #
632
+ # @example Basic example
633
+ # require "google/cloud/vision_ai/v1"
634
+ #
635
+ # # Create a client object. The client can be reused for multiple calls.
636
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
637
+ #
638
+ # # Create a request. To set request fields, pass in keyword arguments.
639
+ # request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new
640
+ #
641
+ # # Call the delete_application method.
642
+ # result = client.delete_application request
643
+ #
644
+ # # The returned object is of type Gapic::Operation. You can use it to
645
+ # # check the status of an operation, cancel it, or wait for results.
646
+ # # Here is how to wait for a response.
647
+ # result.wait_until_done! timeout: 60
648
+ # if result.response?
649
+ # p result.response
650
+ # else
651
+ # puts "No response received."
652
+ # end
653
+ #
654
+ def delete_application request, options = nil
655
+ raise ::ArgumentError, "request must be provided" if request.nil?
656
+
657
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest
658
+
659
+ # Converts hash and nil to an options object
660
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
661
+
662
+ # Customize the options with defaults
663
+ call_metadata = @config.rpcs.delete_application.metadata.to_h
664
+
665
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
666
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
667
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
668
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
669
+ transports_version_send: [:rest]
670
+
671
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
672
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
673
+
674
+ options.apply_defaults timeout: @config.rpcs.delete_application.timeout,
675
+ metadata: call_metadata,
676
+ retry_policy: @config.rpcs.delete_application.retry_policy
677
+
678
+ options.apply_defaults timeout: @config.timeout,
679
+ metadata: @config.metadata,
680
+ retry_policy: @config.retry_policy
681
+
682
+ @app_platform_stub.delete_application request, options do |result, operation|
683
+ result = ::Gapic::Operation.new result, @operations_client, options: options
684
+ yield result, operation if block_given?
685
+ return result
686
+ end
687
+ rescue ::Gapic::Rest::Error => e
688
+ raise ::Google::Cloud::Error.from_error(e)
689
+ end
690
+
691
+ ##
692
+ # Deploys a single Application.
693
+ #
694
+ # @overload deploy_application(request, options = nil)
695
+ # Pass arguments to `deploy_application` via a request object, either of type
696
+ # {::Google::Cloud::VisionAI::V1::DeployApplicationRequest} or an equivalent Hash.
697
+ #
698
+ # @param request [::Google::Cloud::VisionAI::V1::DeployApplicationRequest, ::Hash]
699
+ # A request object representing the call parameters. Required. To specify no
700
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
701
+ # @param options [::Gapic::CallOptions, ::Hash]
702
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
703
+ #
704
+ # @overload deploy_application(name: nil, validate_only: nil, request_id: nil, enable_monitoring: nil)
705
+ # Pass arguments to `deploy_application` via keyword arguments. Note that at
706
+ # least one keyword argument is required. To specify no parameters, or to keep all
707
+ # the default parameter values, pass an empty Hash as a request object (see above).
708
+ #
709
+ # @param name [::String]
710
+ # Required. the name of the application to retrieve.
711
+ # Format:
712
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
713
+ # @param validate_only [::Boolean]
714
+ # If set, validate the request and preview the application graph, but do not
715
+ # actually deploy it.
716
+ # @param request_id [::String]
717
+ # Optional. An optional request ID to identify requests. Specify a unique
718
+ # request ID so that if you must retry your request, the server will know to
719
+ # ignore the request if it has already been completed. The server will
720
+ # guarantee that for at least 60 minutes since the first request.
721
+ #
722
+ # For example, consider a situation where you make an initial request and
723
+ # the request times out. If you make the request again with the same request
724
+ # ID, the server can check if original operation with the same request ID
725
+ # was received, and if so, will ignore the second request. This prevents
726
+ # clients from accidentally creating duplicate commitments.
727
+ #
728
+ # The request ID must be a valid UUID with the exception that zero UUID is
729
+ # not supported (00000000-0000-0000-0000-000000000000).
730
+ # @param enable_monitoring [::Boolean]
731
+ # Optional. Whether or not to enable monitoring for the application on
732
+ # deployment.
733
+ # @yield [result, operation] Access the result along with the TransportOperation object
734
+ # @yieldparam result [::Gapic::Operation]
735
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
736
+ #
737
+ # @return [::Gapic::Operation]
738
+ #
739
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
740
+ #
741
+ # @example Basic example
742
+ # require "google/cloud/vision_ai/v1"
743
+ #
744
+ # # Create a client object. The client can be reused for multiple calls.
745
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
746
+ #
747
+ # # Create a request. To set request fields, pass in keyword arguments.
748
+ # request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new
749
+ #
750
+ # # Call the deploy_application method.
751
+ # result = client.deploy_application request
752
+ #
753
+ # # The returned object is of type Gapic::Operation. You can use it to
754
+ # # check the status of an operation, cancel it, or wait for results.
755
+ # # Here is how to wait for a response.
756
+ # result.wait_until_done! timeout: 60
757
+ # if result.response?
758
+ # p result.response
759
+ # else
760
+ # puts "No response received."
761
+ # end
762
+ #
763
+ def deploy_application request, options = nil
764
+ raise ::ArgumentError, "request must be provided" if request.nil?
765
+
766
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployApplicationRequest
767
+
768
+ # Converts hash and nil to an options object
769
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
770
+
771
+ # Customize the options with defaults
772
+ call_metadata = @config.rpcs.deploy_application.metadata.to_h
773
+
774
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
775
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
776
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
777
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
778
+ transports_version_send: [:rest]
779
+
780
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
781
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
782
+
783
+ options.apply_defaults timeout: @config.rpcs.deploy_application.timeout,
784
+ metadata: call_metadata,
785
+ retry_policy: @config.rpcs.deploy_application.retry_policy
786
+
787
+ options.apply_defaults timeout: @config.timeout,
788
+ metadata: @config.metadata,
789
+ retry_policy: @config.retry_policy
790
+
791
+ @app_platform_stub.deploy_application request, options do |result, operation|
792
+ result = ::Gapic::Operation.new result, @operations_client, options: options
793
+ yield result, operation if block_given?
794
+ return result
795
+ end
796
+ rescue ::Gapic::Rest::Error => e
797
+ raise ::Google::Cloud::Error.from_error(e)
798
+ end
799
+
800
+ ##
801
+ # Undeploys a single Application.
802
+ #
803
+ # @overload undeploy_application(request, options = nil)
804
+ # Pass arguments to `undeploy_application` via a request object, either of type
805
+ # {::Google::Cloud::VisionAI::V1::UndeployApplicationRequest} or an equivalent Hash.
806
+ #
807
+ # @param request [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, ::Hash]
808
+ # A request object representing the call parameters. Required. To specify no
809
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
810
+ # @param options [::Gapic::CallOptions, ::Hash]
811
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
812
+ #
813
+ # @overload undeploy_application(name: nil, request_id: nil)
814
+ # Pass arguments to `undeploy_application` via keyword arguments. Note that at
815
+ # least one keyword argument is required. To specify no parameters, or to keep all
816
+ # the default parameter values, pass an empty Hash as a request object (see above).
817
+ #
818
+ # @param name [::String]
819
+ # Required. the name of the application to retrieve.
820
+ # Format:
821
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
822
+ # @param request_id [::String]
823
+ # Optional. An optional request ID to identify requests. Specify a unique
824
+ # request ID so that if you must retry your request, the server will know to
825
+ # ignore the request if it has already been completed. The server will
826
+ # guarantee that for at least 60 minutes since the first request.
827
+ #
828
+ # For example, consider a situation where you make an initial request and
829
+ # the request times out. If you make the request again with the same request
830
+ # ID, the server can check if original operation with the same request ID
831
+ # was received, and if so, will ignore the second request. This prevents
832
+ # clients from accidentally creating duplicate commitments.
833
+ #
834
+ # The request ID must be a valid UUID with the exception that zero UUID is
835
+ # not supported (00000000-0000-0000-0000-000000000000).
836
+ # @yield [result, operation] Access the result along with the TransportOperation object
837
+ # @yieldparam result [::Gapic::Operation]
838
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
839
+ #
840
+ # @return [::Gapic::Operation]
841
+ #
842
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
843
+ #
844
+ # @example Basic example
845
+ # require "google/cloud/vision_ai/v1"
846
+ #
847
+ # # Create a client object. The client can be reused for multiple calls.
848
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
849
+ #
850
+ # # Create a request. To set request fields, pass in keyword arguments.
851
+ # request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new
852
+ #
853
+ # # Call the undeploy_application method.
854
+ # result = client.undeploy_application request
855
+ #
856
+ # # The returned object is of type Gapic::Operation. You can use it to
857
+ # # check the status of an operation, cancel it, or wait for results.
858
+ # # Here is how to wait for a response.
859
+ # result.wait_until_done! timeout: 60
860
+ # if result.response?
861
+ # p result.response
862
+ # else
863
+ # puts "No response received."
864
+ # end
865
+ #
866
+ def undeploy_application request, options = nil
867
+ raise ::ArgumentError, "request must be provided" if request.nil?
868
+
869
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest
870
+
871
+ # Converts hash and nil to an options object
872
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
873
+
874
+ # Customize the options with defaults
875
+ call_metadata = @config.rpcs.undeploy_application.metadata.to_h
876
+
877
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
878
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
879
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
880
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
881
+ transports_version_send: [:rest]
882
+
883
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
884
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
885
+
886
+ options.apply_defaults timeout: @config.rpcs.undeploy_application.timeout,
887
+ metadata: call_metadata,
888
+ retry_policy: @config.rpcs.undeploy_application.retry_policy
889
+
890
+ options.apply_defaults timeout: @config.timeout,
891
+ metadata: @config.metadata,
892
+ retry_policy: @config.retry_policy
893
+
894
+ @app_platform_stub.undeploy_application request, options do |result, operation|
895
+ result = ::Gapic::Operation.new result, @operations_client, options: options
896
+ yield result, operation if block_given?
897
+ return result
898
+ end
899
+ rescue ::Gapic::Rest::Error => e
900
+ raise ::Google::Cloud::Error.from_error(e)
901
+ end
902
+
903
+ ##
904
+ # Adds target stream input to the Application.
905
+ # If the Application is deployed, the corresponding new Application instance
906
+ # will be created. If the stream has already been in the Application, the RPC
907
+ # will fail.
908
+ #
909
+ # @overload add_application_stream_input(request, options = nil)
910
+ # Pass arguments to `add_application_stream_input` via a request object, either of type
911
+ # {::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest} or an equivalent Hash.
912
+ #
913
+ # @param request [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, ::Hash]
914
+ # A request object representing the call parameters. Required. To specify no
915
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
916
+ # @param options [::Gapic::CallOptions, ::Hash]
917
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
918
+ #
919
+ # @overload add_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil)
920
+ # Pass arguments to `add_application_stream_input` via keyword arguments. Note that at
921
+ # least one keyword argument is required. To specify no parameters, or to keep all
922
+ # the default parameter values, pass an empty Hash as a request object (see above).
923
+ #
924
+ # @param name [::String]
925
+ # Required. the name of the application to retrieve.
926
+ # Format:
927
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
928
+ # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>]
929
+ # The stream inputs to add, the stream resource name is the key of each
930
+ # StreamInput, and it must be unique within each application.
931
+ # @param request_id [::String]
932
+ # Optional. An optional request ID to identify requests. Specify a unique
933
+ # request ID so that if you must retry your request, the server will know to
934
+ # ignore the request if it has already been completed. The server will
935
+ # guarantee that for at least 60 minutes since the first request.
936
+ #
937
+ # For example, consider a situation where you make an initial request and
938
+ # the request times out. If you make the request again with the same request
939
+ # ID, the server can check if original operation with the same request ID
940
+ # was received, and if so, will ignore the second request. This prevents
941
+ # clients from accidentally creating duplicate commitments.
942
+ #
943
+ # The request ID must be a valid UUID with the exception that zero UUID is
944
+ # not supported (00000000-0000-0000-0000-000000000000).
945
+ # @yield [result, operation] Access the result along with the TransportOperation object
946
+ # @yieldparam result [::Gapic::Operation]
947
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
948
+ #
949
+ # @return [::Gapic::Operation]
950
+ #
951
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
952
+ #
953
+ # @example Basic example
954
+ # require "google/cloud/vision_ai/v1"
955
+ #
956
+ # # Create a client object. The client can be reused for multiple calls.
957
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
958
+ #
959
+ # # Create a request. To set request fields, pass in keyword arguments.
960
+ # request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new
961
+ #
962
+ # # Call the add_application_stream_input method.
963
+ # result = client.add_application_stream_input request
964
+ #
965
+ # # The returned object is of type Gapic::Operation. You can use it to
966
+ # # check the status of an operation, cancel it, or wait for results.
967
+ # # Here is how to wait for a response.
968
+ # result.wait_until_done! timeout: 60
969
+ # if result.response?
970
+ # p result.response
971
+ # else
972
+ # puts "No response received."
973
+ # end
974
+ #
975
+ def add_application_stream_input request, options = nil
976
+ raise ::ArgumentError, "request must be provided" if request.nil?
977
+
978
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest
979
+
980
+ # Converts hash and nil to an options object
981
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
982
+
983
+ # Customize the options with defaults
984
+ call_metadata = @config.rpcs.add_application_stream_input.metadata.to_h
985
+
986
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
987
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
988
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
989
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
990
+ transports_version_send: [:rest]
991
+
992
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
993
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
994
+
995
+ options.apply_defaults timeout: @config.rpcs.add_application_stream_input.timeout,
996
+ metadata: call_metadata,
997
+ retry_policy: @config.rpcs.add_application_stream_input.retry_policy
998
+
999
+ options.apply_defaults timeout: @config.timeout,
1000
+ metadata: @config.metadata,
1001
+ retry_policy: @config.retry_policy
1002
+
1003
+ @app_platform_stub.add_application_stream_input request, options do |result, operation|
1004
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1005
+ yield result, operation if block_given?
1006
+ return result
1007
+ end
1008
+ rescue ::Gapic::Rest::Error => e
1009
+ raise ::Google::Cloud::Error.from_error(e)
1010
+ end
1011
+
1012
+ ##
1013
+ # Remove target stream input to the Application, if the Application is
1014
+ # deployed, the corresponding instance based will be deleted. If the stream
1015
+ # is not in the Application, the RPC will fail.
1016
+ #
1017
+ # @overload remove_application_stream_input(request, options = nil)
1018
+ # Pass arguments to `remove_application_stream_input` via a request object, either of type
1019
+ # {::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest} or an equivalent Hash.
1020
+ #
1021
+ # @param request [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, ::Hash]
1022
+ # A request object representing the call parameters. Required. To specify no
1023
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1024
+ # @param options [::Gapic::CallOptions, ::Hash]
1025
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1026
+ #
1027
+ # @overload remove_application_stream_input(name: nil, target_stream_inputs: nil, request_id: nil)
1028
+ # Pass arguments to `remove_application_stream_input` via keyword arguments. Note that at
1029
+ # least one keyword argument is required. To specify no parameters, or to keep all
1030
+ # the default parameter values, pass an empty Hash as a request object (see above).
1031
+ #
1032
+ # @param name [::String]
1033
+ # Required. the name of the application to retrieve.
1034
+ # Format:
1035
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
1036
+ # @param target_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, ::Hash>]
1037
+ # The target stream to remove.
1038
+ # @param request_id [::String]
1039
+ # Optional. An optional request ID to identify requests. Specify a unique
1040
+ # request ID so that if you must retry your request, the server will know to
1041
+ # ignore the request if it has already been completed. The server will
1042
+ # guarantee that for at least 60 minutes since the first request.
1043
+ #
1044
+ # For example, consider a situation where you make an initial request and
1045
+ # the request times out. If you make the request again with the same request
1046
+ # ID, the server can check if original operation with the same request ID
1047
+ # was received, and if so, will ignore the second request. This prevents
1048
+ # clients from accidentally creating duplicate commitments.
1049
+ #
1050
+ # The request ID must be a valid UUID with the exception that zero UUID is
1051
+ # not supported (00000000-0000-0000-0000-000000000000).
1052
+ # @yield [result, operation] Access the result along with the TransportOperation object
1053
+ # @yieldparam result [::Gapic::Operation]
1054
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1055
+ #
1056
+ # @return [::Gapic::Operation]
1057
+ #
1058
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1059
+ #
1060
+ # @example Basic example
1061
+ # require "google/cloud/vision_ai/v1"
1062
+ #
1063
+ # # Create a client object. The client can be reused for multiple calls.
1064
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1065
+ #
1066
+ # # Create a request. To set request fields, pass in keyword arguments.
1067
+ # request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new
1068
+ #
1069
+ # # Call the remove_application_stream_input method.
1070
+ # result = client.remove_application_stream_input request
1071
+ #
1072
+ # # The returned object is of type Gapic::Operation. You can use it to
1073
+ # # check the status of an operation, cancel it, or wait for results.
1074
+ # # Here is how to wait for a response.
1075
+ # result.wait_until_done! timeout: 60
1076
+ # if result.response?
1077
+ # p result.response
1078
+ # else
1079
+ # puts "No response received."
1080
+ # end
1081
+ #
1082
+ def remove_application_stream_input request, options = nil
1083
+ raise ::ArgumentError, "request must be provided" if request.nil?
1084
+
1085
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest
1086
+
1087
+ # Converts hash and nil to an options object
1088
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1089
+
1090
+ # Customize the options with defaults
1091
+ call_metadata = @config.rpcs.remove_application_stream_input.metadata.to_h
1092
+
1093
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1094
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1095
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1096
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1097
+ transports_version_send: [:rest]
1098
+
1099
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1100
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1101
+
1102
+ options.apply_defaults timeout: @config.rpcs.remove_application_stream_input.timeout,
1103
+ metadata: call_metadata,
1104
+ retry_policy: @config.rpcs.remove_application_stream_input.retry_policy
1105
+
1106
+ options.apply_defaults timeout: @config.timeout,
1107
+ metadata: @config.metadata,
1108
+ retry_policy: @config.retry_policy
1109
+
1110
+ @app_platform_stub.remove_application_stream_input request, options do |result, operation|
1111
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1112
+ yield result, operation if block_given?
1113
+ return result
1114
+ end
1115
+ rescue ::Gapic::Rest::Error => e
1116
+ raise ::Google::Cloud::Error.from_error(e)
1117
+ end
1118
+
1119
+ ##
1120
+ # Update target stream input to the Application, if the Application is
1121
+ # deployed, the corresponding instance based will be deployed. For
1122
+ # CreateOrUpdate behavior, set allow_missing to true.
1123
+ #
1124
+ # @overload update_application_stream_input(request, options = nil)
1125
+ # Pass arguments to `update_application_stream_input` via a request object, either of type
1126
+ # {::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest} or an equivalent Hash.
1127
+ #
1128
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, ::Hash]
1129
+ # A request object representing the call parameters. Required. To specify no
1130
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1131
+ # @param options [::Gapic::CallOptions, ::Hash]
1132
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1133
+ #
1134
+ # @overload update_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil, allow_missing: nil)
1135
+ # Pass arguments to `update_application_stream_input` via keyword arguments. Note that at
1136
+ # least one keyword argument is required. To specify no parameters, or to keep all
1137
+ # the default parameter values, pass an empty Hash as a request object (see above).
1138
+ #
1139
+ # @param name [::String]
1140
+ # Required. the name of the application to retrieve.
1141
+ # Format:
1142
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
1143
+ # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>]
1144
+ # The stream inputs to update, the stream resource name is the key of each
1145
+ # StreamInput, and it must be unique within each application.
1146
+ # @param request_id [::String]
1147
+ # Optional. An optional request ID to identify requests. Specify a unique
1148
+ # request ID so that if you must retry your request, the server will know to
1149
+ # ignore the request if it has already been completed. The server will
1150
+ # guarantee that for at least 60 minutes since the first request.
1151
+ #
1152
+ # For example, consider a situation where you make an initial request and
1153
+ # the request times out. If you make the request again with the same request
1154
+ # ID, the server can check if original operation with the same request ID
1155
+ # was received, and if so, will ignore the second request. This prevents
1156
+ # clients from accidentally creating duplicate commitments.
1157
+ #
1158
+ # The request ID must be a valid UUID with the exception that zero UUID is
1159
+ # not supported (00000000-0000-0000-0000-000000000000).
1160
+ # @param allow_missing [::Boolean]
1161
+ # If true, UpdateApplicationStreamInput will insert stream input to
1162
+ # application even if the target stream is not included in the application.
1163
+ # @yield [result, operation] Access the result along with the TransportOperation object
1164
+ # @yieldparam result [::Gapic::Operation]
1165
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1166
+ #
1167
+ # @return [::Gapic::Operation]
1168
+ #
1169
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1170
+ #
1171
+ # @example Basic example
1172
+ # require "google/cloud/vision_ai/v1"
1173
+ #
1174
+ # # Create a client object. The client can be reused for multiple calls.
1175
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1176
+ #
1177
+ # # Create a request. To set request fields, pass in keyword arguments.
1178
+ # request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new
1179
+ #
1180
+ # # Call the update_application_stream_input method.
1181
+ # result = client.update_application_stream_input request
1182
+ #
1183
+ # # The returned object is of type Gapic::Operation. You can use it to
1184
+ # # check the status of an operation, cancel it, or wait for results.
1185
+ # # Here is how to wait for a response.
1186
+ # result.wait_until_done! timeout: 60
1187
+ # if result.response?
1188
+ # p result.response
1189
+ # else
1190
+ # puts "No response received."
1191
+ # end
1192
+ #
1193
+ def update_application_stream_input request, options = nil
1194
+ raise ::ArgumentError, "request must be provided" if request.nil?
1195
+
1196
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest
1197
+
1198
+ # Converts hash and nil to an options object
1199
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1200
+
1201
+ # Customize the options with defaults
1202
+ call_metadata = @config.rpcs.update_application_stream_input.metadata.to_h
1203
+
1204
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1205
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1206
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1207
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1208
+ transports_version_send: [:rest]
1209
+
1210
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1211
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1212
+
1213
+ options.apply_defaults timeout: @config.rpcs.update_application_stream_input.timeout,
1214
+ metadata: call_metadata,
1215
+ retry_policy: @config.rpcs.update_application_stream_input.retry_policy
1216
+
1217
+ options.apply_defaults timeout: @config.timeout,
1218
+ metadata: @config.metadata,
1219
+ retry_policy: @config.retry_policy
1220
+
1221
+ @app_platform_stub.update_application_stream_input request, options do |result, operation|
1222
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1223
+ yield result, operation if block_given?
1224
+ return result
1225
+ end
1226
+ rescue ::Gapic::Rest::Error => e
1227
+ raise ::Google::Cloud::Error.from_error(e)
1228
+ end
1229
+
1230
+ ##
1231
+ # Lists Instances in a given project and location.
1232
+ #
1233
+ # @overload list_instances(request, options = nil)
1234
+ # Pass arguments to `list_instances` via a request object, either of type
1235
+ # {::Google::Cloud::VisionAI::V1::ListInstancesRequest} or an equivalent Hash.
1236
+ #
1237
+ # @param request [::Google::Cloud::VisionAI::V1::ListInstancesRequest, ::Hash]
1238
+ # A request object representing the call parameters. Required. To specify no
1239
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1240
+ # @param options [::Gapic::CallOptions, ::Hash]
1241
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1242
+ #
1243
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1244
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
1245
+ # least one keyword argument is required. To specify no parameters, or to keep all
1246
+ # the default parameter values, pass an empty Hash as a request object (see above).
1247
+ #
1248
+ # @param parent [::String]
1249
+ # Required. Parent value for ListInstancesRequest.
1250
+ # @param page_size [::Integer]
1251
+ # Requested page size. Server may return fewer items than requested.
1252
+ # If unspecified, server will pick an appropriate default.
1253
+ # @param page_token [::String]
1254
+ # A token identifying a page of results the server should return.
1255
+ # @param filter [::String]
1256
+ # Filtering results.
1257
+ # @param order_by [::String]
1258
+ # Hint for how to order the results.
1259
+ # @yield [result, operation] Access the result along with the TransportOperation object
1260
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListInstancesResponse]
1261
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1262
+ #
1263
+ # @return [::Google::Cloud::VisionAI::V1::ListInstancesResponse]
1264
+ #
1265
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1266
+ #
1267
+ # @example Basic example
1268
+ # require "google/cloud/vision_ai/v1"
1269
+ #
1270
+ # # Create a client object. The client can be reused for multiple calls.
1271
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1272
+ #
1273
+ # # Create a request. To set request fields, pass in keyword arguments.
1274
+ # request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new
1275
+ #
1276
+ # # Call the list_instances method.
1277
+ # result = client.list_instances request
1278
+ #
1279
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1280
+ # # over elements, and API calls will be issued to fetch pages as needed.
1281
+ # result.each do |item|
1282
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Instance.
1283
+ # p item
1284
+ # end
1285
+ #
1286
+ def list_instances request, options = nil
1287
+ raise ::ArgumentError, "request must be provided" if request.nil?
1288
+
1289
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListInstancesRequest
1290
+
1291
+ # Converts hash and nil to an options object
1292
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1293
+
1294
+ # Customize the options with defaults
1295
+ call_metadata = @config.rpcs.list_instances.metadata.to_h
1296
+
1297
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1298
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1299
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1300
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1301
+ transports_version_send: [:rest]
1302
+
1303
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1304
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1305
+
1306
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
1307
+ metadata: call_metadata,
1308
+ retry_policy: @config.rpcs.list_instances.retry_policy
1309
+
1310
+ options.apply_defaults timeout: @config.timeout,
1311
+ metadata: @config.metadata,
1312
+ retry_policy: @config.retry_policy
1313
+
1314
+ @app_platform_stub.list_instances request, options do |result, operation|
1315
+ yield result, operation if block_given?
1316
+ return result
1317
+ end
1318
+ rescue ::Gapic::Rest::Error => e
1319
+ raise ::Google::Cloud::Error.from_error(e)
1320
+ end
1321
+
1322
+ ##
1323
+ # Gets details of a single Instance.
1324
+ #
1325
+ # @overload get_instance(request, options = nil)
1326
+ # Pass arguments to `get_instance` via a request object, either of type
1327
+ # {::Google::Cloud::VisionAI::V1::GetInstanceRequest} or an equivalent Hash.
1328
+ #
1329
+ # @param request [::Google::Cloud::VisionAI::V1::GetInstanceRequest, ::Hash]
1330
+ # A request object representing the call parameters. Required. To specify no
1331
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1332
+ # @param options [::Gapic::CallOptions, ::Hash]
1333
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1334
+ #
1335
+ # @overload get_instance(name: nil)
1336
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
1337
+ # least one keyword argument is required. To specify no parameters, or to keep all
1338
+ # the default parameter values, pass an empty Hash as a request object (see above).
1339
+ #
1340
+ # @param name [::String]
1341
+ # Required. Name of the resource.
1342
+ # @yield [result, operation] Access the result along with the TransportOperation object
1343
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Instance]
1344
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1345
+ #
1346
+ # @return [::Google::Cloud::VisionAI::V1::Instance]
1347
+ #
1348
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1349
+ #
1350
+ # @example Basic example
1351
+ # require "google/cloud/vision_ai/v1"
1352
+ #
1353
+ # # Create a client object. The client can be reused for multiple calls.
1354
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1355
+ #
1356
+ # # Create a request. To set request fields, pass in keyword arguments.
1357
+ # request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new
1358
+ #
1359
+ # # Call the get_instance method.
1360
+ # result = client.get_instance request
1361
+ #
1362
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Instance.
1363
+ # p result
1364
+ #
1365
+ def get_instance request, options = nil
1366
+ raise ::ArgumentError, "request must be provided" if request.nil?
1367
+
1368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetInstanceRequest
1369
+
1370
+ # Converts hash and nil to an options object
1371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1372
+
1373
+ # Customize the options with defaults
1374
+ call_metadata = @config.rpcs.get_instance.metadata.to_h
1375
+
1376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1377
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1379
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1380
+ transports_version_send: [:rest]
1381
+
1382
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1383
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1384
+
1385
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
1386
+ metadata: call_metadata,
1387
+ retry_policy: @config.rpcs.get_instance.retry_policy
1388
+
1389
+ options.apply_defaults timeout: @config.timeout,
1390
+ metadata: @config.metadata,
1391
+ retry_policy: @config.retry_policy
1392
+
1393
+ @app_platform_stub.get_instance request, options do |result, operation|
1394
+ yield result, operation if block_given?
1395
+ return result
1396
+ end
1397
+ rescue ::Gapic::Rest::Error => e
1398
+ raise ::Google::Cloud::Error.from_error(e)
1399
+ end
1400
+
1401
+ ##
1402
+ # Adds target stream input to the Application.
1403
+ # If the Application is deployed, the corresponding new Application instance
1404
+ # will be created. If the stream has already been in the Application, the RPC
1405
+ # will fail.
1406
+ #
1407
+ # @overload create_application_instances(request, options = nil)
1408
+ # Pass arguments to `create_application_instances` via a request object, either of type
1409
+ # {::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest} or an equivalent Hash.
1410
+ #
1411
+ # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, ::Hash]
1412
+ # A request object representing the call parameters. Required. To specify no
1413
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1414
+ # @param options [::Gapic::CallOptions, ::Hash]
1415
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1416
+ #
1417
+ # @overload create_application_instances(name: nil, application_instances: nil, request_id: nil)
1418
+ # Pass arguments to `create_application_instances` via keyword arguments. Note that at
1419
+ # least one keyword argument is required. To specify no parameters, or to keep all
1420
+ # the default parameter values, pass an empty Hash as a request object (see above).
1421
+ #
1422
+ # @param name [::String]
1423
+ # Required. the name of the application to retrieve.
1424
+ # Format:
1425
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
1426
+ # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance, ::Hash>]
1427
+ # Required. The resources being created.
1428
+ # @param request_id [::String]
1429
+ # Optional. An optional request ID to identify requests. Specify a unique
1430
+ # request ID so that if you must retry your request, the server will know to
1431
+ # ignore the request if it has already been completed. The server will
1432
+ # guarantee that for at least 60 minutes since the first request.
1433
+ #
1434
+ # For example, consider a situation where you make an initial request and
1435
+ # the request times out. If you make the request again with the same request
1436
+ # ID, the server can check if original operation with the same request ID
1437
+ # was received, and if so, will ignore the second request. This prevents
1438
+ # clients from accidentally creating duplicate commitments.
1439
+ #
1440
+ # The request ID must be a valid UUID with the exception that zero UUID is
1441
+ # not supported (00000000-0000-0000-0000-000000000000).
1442
+ # @yield [result, operation] Access the result along with the TransportOperation object
1443
+ # @yieldparam result [::Gapic::Operation]
1444
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1445
+ #
1446
+ # @return [::Gapic::Operation]
1447
+ #
1448
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1449
+ #
1450
+ # @example Basic example
1451
+ # require "google/cloud/vision_ai/v1"
1452
+ #
1453
+ # # Create a client object. The client can be reused for multiple calls.
1454
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1455
+ #
1456
+ # # Create a request. To set request fields, pass in keyword arguments.
1457
+ # request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new
1458
+ #
1459
+ # # Call the create_application_instances method.
1460
+ # result = client.create_application_instances request
1461
+ #
1462
+ # # The returned object is of type Gapic::Operation. You can use it to
1463
+ # # check the status of an operation, cancel it, or wait for results.
1464
+ # # Here is how to wait for a response.
1465
+ # result.wait_until_done! timeout: 60
1466
+ # if result.response?
1467
+ # p result.response
1468
+ # else
1469
+ # puts "No response received."
1470
+ # end
1471
+ #
1472
+ def create_application_instances request, options = nil
1473
+ raise ::ArgumentError, "request must be provided" if request.nil?
1474
+
1475
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest
1476
+
1477
+ # Converts hash and nil to an options object
1478
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1479
+
1480
+ # Customize the options with defaults
1481
+ call_metadata = @config.rpcs.create_application_instances.metadata.to_h
1482
+
1483
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1484
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1485
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1486
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1487
+ transports_version_send: [:rest]
1488
+
1489
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1490
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1491
+
1492
+ options.apply_defaults timeout: @config.rpcs.create_application_instances.timeout,
1493
+ metadata: call_metadata,
1494
+ retry_policy: @config.rpcs.create_application_instances.retry_policy
1495
+
1496
+ options.apply_defaults timeout: @config.timeout,
1497
+ metadata: @config.metadata,
1498
+ retry_policy: @config.retry_policy
1499
+
1500
+ @app_platform_stub.create_application_instances request, options do |result, operation|
1501
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1502
+ yield result, operation if block_given?
1503
+ return result
1504
+ end
1505
+ rescue ::Gapic::Rest::Error => e
1506
+ raise ::Google::Cloud::Error.from_error(e)
1507
+ end
1508
+
1509
+ ##
1510
+ # Remove target stream input to the Application, if the Application is
1511
+ # deployed, the corresponding instance based will be deleted. If the stream
1512
+ # is not in the Application, the RPC will fail.
1513
+ #
1514
+ # @overload delete_application_instances(request, options = nil)
1515
+ # Pass arguments to `delete_application_instances` via a request object, either of type
1516
+ # {::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest} or an equivalent Hash.
1517
+ #
1518
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, ::Hash]
1519
+ # A request object representing the call parameters. Required. To specify no
1520
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1521
+ # @param options [::Gapic::CallOptions, ::Hash]
1522
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1523
+ #
1524
+ # @overload delete_application_instances(name: nil, instance_ids: nil, request_id: nil)
1525
+ # Pass arguments to `delete_application_instances` via keyword arguments. Note that at
1526
+ # least one keyword argument is required. To specify no parameters, or to keep all
1527
+ # the default parameter values, pass an empty Hash as a request object (see above).
1528
+ #
1529
+ # @param name [::String]
1530
+ # Required. the name of the application to retrieve.
1531
+ # Format:
1532
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
1533
+ # @param instance_ids [::Array<::String>]
1534
+ # Required. Id of the requesting object.
1535
+ # @param request_id [::String]
1536
+ # Optional. An optional request ID to identify requests. Specify a unique
1537
+ # request ID so that if you must retry your request, the server will know to
1538
+ # ignore the request if it has already been completed. The server will
1539
+ # guarantee that for at least 60 minutes since the first request.
1540
+ #
1541
+ # For example, consider a situation where you make an initial request and
1542
+ # the request times out. If you make the request again with the same request
1543
+ # ID, the server can check if original operation with the same request ID
1544
+ # was received, and if so, will ignore the second request. This prevents
1545
+ # clients from accidentally creating duplicate commitments.
1546
+ #
1547
+ # The request ID must be a valid UUID with the exception that zero UUID is
1548
+ # not supported (00000000-0000-0000-0000-000000000000).
1549
+ # @yield [result, operation] Access the result along with the TransportOperation object
1550
+ # @yieldparam result [::Gapic::Operation]
1551
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1552
+ #
1553
+ # @return [::Gapic::Operation]
1554
+ #
1555
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1556
+ #
1557
+ # @example Basic example
1558
+ # require "google/cloud/vision_ai/v1"
1559
+ #
1560
+ # # Create a client object. The client can be reused for multiple calls.
1561
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1562
+ #
1563
+ # # Create a request. To set request fields, pass in keyword arguments.
1564
+ # request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new
1565
+ #
1566
+ # # Call the delete_application_instances method.
1567
+ # result = client.delete_application_instances request
1568
+ #
1569
+ # # The returned object is of type Gapic::Operation. You can use it to
1570
+ # # check the status of an operation, cancel it, or wait for results.
1571
+ # # Here is how to wait for a response.
1572
+ # result.wait_until_done! timeout: 60
1573
+ # if result.response?
1574
+ # p result.response
1575
+ # else
1576
+ # puts "No response received."
1577
+ # end
1578
+ #
1579
+ def delete_application_instances request, options = nil
1580
+ raise ::ArgumentError, "request must be provided" if request.nil?
1581
+
1582
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest
1583
+
1584
+ # Converts hash and nil to an options object
1585
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1586
+
1587
+ # Customize the options with defaults
1588
+ call_metadata = @config.rpcs.delete_application_instances.metadata.to_h
1589
+
1590
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1591
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1592
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1593
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1594
+ transports_version_send: [:rest]
1595
+
1596
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1597
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1598
+
1599
+ options.apply_defaults timeout: @config.rpcs.delete_application_instances.timeout,
1600
+ metadata: call_metadata,
1601
+ retry_policy: @config.rpcs.delete_application_instances.retry_policy
1602
+
1603
+ options.apply_defaults timeout: @config.timeout,
1604
+ metadata: @config.metadata,
1605
+ retry_policy: @config.retry_policy
1606
+
1607
+ @app_platform_stub.delete_application_instances request, options do |result, operation|
1608
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1609
+ yield result, operation if block_given?
1610
+ return result
1611
+ end
1612
+ rescue ::Gapic::Rest::Error => e
1613
+ raise ::Google::Cloud::Error.from_error(e)
1614
+ end
1615
+
1616
+ ##
1617
+ # Adds target stream input to the Application.
1618
+ # If the Application is deployed, the corresponding new Application instance
1619
+ # will be created. If the stream has already been in the Application, the RPC
1620
+ # will fail.
1621
+ #
1622
+ # @overload update_application_instances(request, options = nil)
1623
+ # Pass arguments to `update_application_instances` via a request object, either of type
1624
+ # {::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest} or an equivalent Hash.
1625
+ #
1626
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, ::Hash]
1627
+ # A request object representing the call parameters. Required. To specify no
1628
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1629
+ # @param options [::Gapic::CallOptions, ::Hash]
1630
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1631
+ #
1632
+ # @overload update_application_instances(name: nil, application_instances: nil, request_id: nil, allow_missing: nil)
1633
+ # Pass arguments to `update_application_instances` via keyword arguments. Note that at
1634
+ # least one keyword argument is required. To specify no parameters, or to keep all
1635
+ # the default parameter values, pass an empty Hash as a request object (see above).
1636
+ #
1637
+ # @param name [::String]
1638
+ # Required. the name of the application to retrieve.
1639
+ # Format:
1640
+ # "projects/\\{project}/locations/\\{location}/applications/\\{application}"
1641
+ # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, ::Hash>]
1642
+ # @param request_id [::String]
1643
+ # Optional. An optional request ID to identify requests. Specify a unique
1644
+ # request ID so that if you must retry your request, the server will know to
1645
+ # ignore the request if it has already been completed. The server will
1646
+ # guarantee that for at least 60 minutes since the first request.
1647
+ #
1648
+ # For example, consider a situation where you make an initial request and
1649
+ # the request times out. If you make the request again with the same request
1650
+ # ID, the server can check if original operation with the same request ID
1651
+ # was received, and if so, will ignore the second request. This prevents
1652
+ # clients from accidentally creating duplicate commitments.
1653
+ #
1654
+ # The request ID must be a valid UUID with the exception that zero UUID is
1655
+ # not supported (00000000-0000-0000-0000-000000000000).
1656
+ # @param allow_missing [::Boolean]
1657
+ # If true, Update Request will create one resource if the target resource
1658
+ # doesn't exist, this time, the field_mask will be ignored.
1659
+ # @yield [result, operation] Access the result along with the TransportOperation object
1660
+ # @yieldparam result [::Gapic::Operation]
1661
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1662
+ #
1663
+ # @return [::Gapic::Operation]
1664
+ #
1665
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1666
+ #
1667
+ # @example Basic example
1668
+ # require "google/cloud/vision_ai/v1"
1669
+ #
1670
+ # # Create a client object. The client can be reused for multiple calls.
1671
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1672
+ #
1673
+ # # Create a request. To set request fields, pass in keyword arguments.
1674
+ # request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new
1675
+ #
1676
+ # # Call the update_application_instances method.
1677
+ # result = client.update_application_instances request
1678
+ #
1679
+ # # The returned object is of type Gapic::Operation. You can use it to
1680
+ # # check the status of an operation, cancel it, or wait for results.
1681
+ # # Here is how to wait for a response.
1682
+ # result.wait_until_done! timeout: 60
1683
+ # if result.response?
1684
+ # p result.response
1685
+ # else
1686
+ # puts "No response received."
1687
+ # end
1688
+ #
1689
+ def update_application_instances request, options = nil
1690
+ raise ::ArgumentError, "request must be provided" if request.nil?
1691
+
1692
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest
1693
+
1694
+ # Converts hash and nil to an options object
1695
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1696
+
1697
+ # Customize the options with defaults
1698
+ call_metadata = @config.rpcs.update_application_instances.metadata.to_h
1699
+
1700
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1701
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1702
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1703
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1704
+ transports_version_send: [:rest]
1705
+
1706
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1707
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1708
+
1709
+ options.apply_defaults timeout: @config.rpcs.update_application_instances.timeout,
1710
+ metadata: call_metadata,
1711
+ retry_policy: @config.rpcs.update_application_instances.retry_policy
1712
+
1713
+ options.apply_defaults timeout: @config.timeout,
1714
+ metadata: @config.metadata,
1715
+ retry_policy: @config.retry_policy
1716
+
1717
+ @app_platform_stub.update_application_instances request, options do |result, operation|
1718
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1719
+ yield result, operation if block_given?
1720
+ return result
1721
+ end
1722
+ rescue ::Gapic::Rest::Error => e
1723
+ raise ::Google::Cloud::Error.from_error(e)
1724
+ end
1725
+
1726
+ ##
1727
+ # Lists Drafts in a given project and location.
1728
+ #
1729
+ # @overload list_drafts(request, options = nil)
1730
+ # Pass arguments to `list_drafts` via a request object, either of type
1731
+ # {::Google::Cloud::VisionAI::V1::ListDraftsRequest} or an equivalent Hash.
1732
+ #
1733
+ # @param request [::Google::Cloud::VisionAI::V1::ListDraftsRequest, ::Hash]
1734
+ # A request object representing the call parameters. Required. To specify no
1735
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1736
+ # @param options [::Gapic::CallOptions, ::Hash]
1737
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1738
+ #
1739
+ # @overload list_drafts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1740
+ # Pass arguments to `list_drafts` via keyword arguments. Note that at
1741
+ # least one keyword argument is required. To specify no parameters, or to keep all
1742
+ # the default parameter values, pass an empty Hash as a request object (see above).
1743
+ #
1744
+ # @param parent [::String]
1745
+ # Required. Parent value for ListDraftsRequest.
1746
+ # @param page_size [::Integer]
1747
+ # Requested page size. Server may return fewer items than requested.
1748
+ # If unspecified, server will pick an appropriate default.
1749
+ # @param page_token [::String]
1750
+ # A token identifying a page of results the server should return.
1751
+ # @param filter [::String]
1752
+ # Filtering results.
1753
+ # @param order_by [::String]
1754
+ # Hint for how to order the results.
1755
+ # @yield [result, operation] Access the result along with the TransportOperation object
1756
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListDraftsResponse]
1757
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1758
+ #
1759
+ # @return [::Google::Cloud::VisionAI::V1::ListDraftsResponse]
1760
+ #
1761
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1762
+ #
1763
+ # @example Basic example
1764
+ # require "google/cloud/vision_ai/v1"
1765
+ #
1766
+ # # Create a client object. The client can be reused for multiple calls.
1767
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1768
+ #
1769
+ # # Create a request. To set request fields, pass in keyword arguments.
1770
+ # request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new
1771
+ #
1772
+ # # Call the list_drafts method.
1773
+ # result = client.list_drafts request
1774
+ #
1775
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1776
+ # # over elements, and API calls will be issued to fetch pages as needed.
1777
+ # result.each do |item|
1778
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Draft.
1779
+ # p item
1780
+ # end
1781
+ #
1782
+ def list_drafts request, options = nil
1783
+ raise ::ArgumentError, "request must be provided" if request.nil?
1784
+
1785
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDraftsRequest
1786
+
1787
+ # Converts hash and nil to an options object
1788
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1789
+
1790
+ # Customize the options with defaults
1791
+ call_metadata = @config.rpcs.list_drafts.metadata.to_h
1792
+
1793
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1794
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1795
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1796
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1797
+ transports_version_send: [:rest]
1798
+
1799
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1800
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1801
+
1802
+ options.apply_defaults timeout: @config.rpcs.list_drafts.timeout,
1803
+ metadata: call_metadata,
1804
+ retry_policy: @config.rpcs.list_drafts.retry_policy
1805
+
1806
+ options.apply_defaults timeout: @config.timeout,
1807
+ metadata: @config.metadata,
1808
+ retry_policy: @config.retry_policy
1809
+
1810
+ @app_platform_stub.list_drafts request, options do |result, operation|
1811
+ yield result, operation if block_given?
1812
+ return result
1813
+ end
1814
+ rescue ::Gapic::Rest::Error => e
1815
+ raise ::Google::Cloud::Error.from_error(e)
1816
+ end
1817
+
1818
+ ##
1819
+ # Gets details of a single Draft.
1820
+ #
1821
+ # @overload get_draft(request, options = nil)
1822
+ # Pass arguments to `get_draft` via a request object, either of type
1823
+ # {::Google::Cloud::VisionAI::V1::GetDraftRequest} or an equivalent Hash.
1824
+ #
1825
+ # @param request [::Google::Cloud::VisionAI::V1::GetDraftRequest, ::Hash]
1826
+ # A request object representing the call parameters. Required. To specify no
1827
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1828
+ # @param options [::Gapic::CallOptions, ::Hash]
1829
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1830
+ #
1831
+ # @overload get_draft(name: nil)
1832
+ # Pass arguments to `get_draft` via keyword arguments. Note that at
1833
+ # least one keyword argument is required. To specify no parameters, or to keep all
1834
+ # the default parameter values, pass an empty Hash as a request object (see above).
1835
+ #
1836
+ # @param name [::String]
1837
+ # Required. Name of the resource.
1838
+ # @yield [result, operation] Access the result along with the TransportOperation object
1839
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Draft]
1840
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1841
+ #
1842
+ # @return [::Google::Cloud::VisionAI::V1::Draft]
1843
+ #
1844
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1845
+ #
1846
+ # @example Basic example
1847
+ # require "google/cloud/vision_ai/v1"
1848
+ #
1849
+ # # Create a client object. The client can be reused for multiple calls.
1850
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1851
+ #
1852
+ # # Create a request. To set request fields, pass in keyword arguments.
1853
+ # request = Google::Cloud::VisionAI::V1::GetDraftRequest.new
1854
+ #
1855
+ # # Call the get_draft method.
1856
+ # result = client.get_draft request
1857
+ #
1858
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Draft.
1859
+ # p result
1860
+ #
1861
+ def get_draft request, options = nil
1862
+ raise ::ArgumentError, "request must be provided" if request.nil?
1863
+
1864
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDraftRequest
1865
+
1866
+ # Converts hash and nil to an options object
1867
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1868
+
1869
+ # Customize the options with defaults
1870
+ call_metadata = @config.rpcs.get_draft.metadata.to_h
1871
+
1872
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1873
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1874
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1875
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1876
+ transports_version_send: [:rest]
1877
+
1878
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1879
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1880
+
1881
+ options.apply_defaults timeout: @config.rpcs.get_draft.timeout,
1882
+ metadata: call_metadata,
1883
+ retry_policy: @config.rpcs.get_draft.retry_policy
1884
+
1885
+ options.apply_defaults timeout: @config.timeout,
1886
+ metadata: @config.metadata,
1887
+ retry_policy: @config.retry_policy
1888
+
1889
+ @app_platform_stub.get_draft request, options do |result, operation|
1890
+ yield result, operation if block_given?
1891
+ return result
1892
+ end
1893
+ rescue ::Gapic::Rest::Error => e
1894
+ raise ::Google::Cloud::Error.from_error(e)
1895
+ end
1896
+
1897
+ ##
1898
+ # Creates a new Draft in a given project and location.
1899
+ #
1900
+ # @overload create_draft(request, options = nil)
1901
+ # Pass arguments to `create_draft` via a request object, either of type
1902
+ # {::Google::Cloud::VisionAI::V1::CreateDraftRequest} or an equivalent Hash.
1903
+ #
1904
+ # @param request [::Google::Cloud::VisionAI::V1::CreateDraftRequest, ::Hash]
1905
+ # A request object representing the call parameters. Required. To specify no
1906
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1907
+ # @param options [::Gapic::CallOptions, ::Hash]
1908
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1909
+ #
1910
+ # @overload create_draft(parent: nil, draft_id: nil, draft: nil, request_id: nil)
1911
+ # Pass arguments to `create_draft` via keyword arguments. Note that at
1912
+ # least one keyword argument is required. To specify no parameters, or to keep all
1913
+ # the default parameter values, pass an empty Hash as a request object (see above).
1914
+ #
1915
+ # @param parent [::String]
1916
+ # Required. Value for parent.
1917
+ # @param draft_id [::String]
1918
+ # Required. Id of the requesting object.
1919
+ # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash]
1920
+ # Required. The resource being created.
1921
+ # @param request_id [::String]
1922
+ # Optional. An optional request ID to identify requests. Specify a unique
1923
+ # request ID so that if you must retry your request, the server will know to
1924
+ # ignore the request if it has already been completed. The server will
1925
+ # guarantee that for at least 60 minutes since the first request.
1926
+ #
1927
+ # For example, consider a situation where you make an initial request and
1928
+ # the request times out. If you make the request again with the same request
1929
+ # ID, the server can check if original operation with the same request ID
1930
+ # was received, and if so, will ignore the second request. This prevents
1931
+ # clients from accidentally creating duplicate commitments.
1932
+ #
1933
+ # The request ID must be a valid UUID with the exception that zero UUID is
1934
+ # not supported (00000000-0000-0000-0000-000000000000).
1935
+ # @yield [result, operation] Access the result along with the TransportOperation object
1936
+ # @yieldparam result [::Gapic::Operation]
1937
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1938
+ #
1939
+ # @return [::Gapic::Operation]
1940
+ #
1941
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1942
+ #
1943
+ # @example Basic example
1944
+ # require "google/cloud/vision_ai/v1"
1945
+ #
1946
+ # # Create a client object. The client can be reused for multiple calls.
1947
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
1948
+ #
1949
+ # # Create a request. To set request fields, pass in keyword arguments.
1950
+ # request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new
1951
+ #
1952
+ # # Call the create_draft method.
1953
+ # result = client.create_draft request
1954
+ #
1955
+ # # The returned object is of type Gapic::Operation. You can use it to
1956
+ # # check the status of an operation, cancel it, or wait for results.
1957
+ # # Here is how to wait for a response.
1958
+ # result.wait_until_done! timeout: 60
1959
+ # if result.response?
1960
+ # p result.response
1961
+ # else
1962
+ # puts "No response received."
1963
+ # end
1964
+ #
1965
+ def create_draft request, options = nil
1966
+ raise ::ArgumentError, "request must be provided" if request.nil?
1967
+
1968
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDraftRequest
1969
+
1970
+ # Converts hash and nil to an options object
1971
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1972
+
1973
+ # Customize the options with defaults
1974
+ call_metadata = @config.rpcs.create_draft.metadata.to_h
1975
+
1976
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1977
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1978
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1979
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
1980
+ transports_version_send: [:rest]
1981
+
1982
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1983
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1984
+
1985
+ options.apply_defaults timeout: @config.rpcs.create_draft.timeout,
1986
+ metadata: call_metadata,
1987
+ retry_policy: @config.rpcs.create_draft.retry_policy
1988
+
1989
+ options.apply_defaults timeout: @config.timeout,
1990
+ metadata: @config.metadata,
1991
+ retry_policy: @config.retry_policy
1992
+
1993
+ @app_platform_stub.create_draft request, options do |result, operation|
1994
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1995
+ yield result, operation if block_given?
1996
+ return result
1997
+ end
1998
+ rescue ::Gapic::Rest::Error => e
1999
+ raise ::Google::Cloud::Error.from_error(e)
2000
+ end
2001
+
2002
+ ##
2003
+ # Updates the parameters of a single Draft.
2004
+ #
2005
+ # @overload update_draft(request, options = nil)
2006
+ # Pass arguments to `update_draft` via a request object, either of type
2007
+ # {::Google::Cloud::VisionAI::V1::UpdateDraftRequest} or an equivalent Hash.
2008
+ #
2009
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateDraftRequest, ::Hash]
2010
+ # A request object representing the call parameters. Required. To specify no
2011
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2012
+ # @param options [::Gapic::CallOptions, ::Hash]
2013
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2014
+ #
2015
+ # @overload update_draft(update_mask: nil, draft: nil, request_id: nil, allow_missing: nil)
2016
+ # Pass arguments to `update_draft` via keyword arguments. Note that at
2017
+ # least one keyword argument is required. To specify no parameters, or to keep all
2018
+ # the default parameter values, pass an empty Hash as a request object (see above).
2019
+ #
2020
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2021
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2022
+ # Draft resource by the update.
2023
+ # The fields specified in the update_mask are relative to the resource, not
2024
+ # the full request. A field will be overwritten if it is in the mask. If the
2025
+ # user does not provide a mask then all fields will be overwritten.
2026
+ # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash]
2027
+ # Required. The resource being updated.
2028
+ # @param request_id [::String]
2029
+ # Optional. An optional request ID to identify requests. Specify a unique
2030
+ # request ID so that if you must retry your request, the server will know to
2031
+ # ignore the request if it has already been completed. The server will
2032
+ # guarantee that for at least 60 minutes since the first request.
2033
+ #
2034
+ # For example, consider a situation where you make an initial request and
2035
+ # the request times out. If you make the request again with the same request
2036
+ # ID, the server can check if original operation with the same request ID
2037
+ # was received, and if so, will ignore the second request. This prevents
2038
+ # clients from accidentally creating duplicate commitments.
2039
+ #
2040
+ # The request ID must be a valid UUID with the exception that zero UUID is
2041
+ # not supported (00000000-0000-0000-0000-000000000000).
2042
+ # @param allow_missing [::Boolean]
2043
+ # If true, UpdateDraftRequest will create one resource if the target resource
2044
+ # doesn't exist, this time, the field_mask will be ignored.
2045
+ # @yield [result, operation] Access the result along with the TransportOperation object
2046
+ # @yieldparam result [::Gapic::Operation]
2047
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2048
+ #
2049
+ # @return [::Gapic::Operation]
2050
+ #
2051
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2052
+ #
2053
+ # @example Basic example
2054
+ # require "google/cloud/vision_ai/v1"
2055
+ #
2056
+ # # Create a client object. The client can be reused for multiple calls.
2057
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2058
+ #
2059
+ # # Create a request. To set request fields, pass in keyword arguments.
2060
+ # request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new
2061
+ #
2062
+ # # Call the update_draft method.
2063
+ # result = client.update_draft request
2064
+ #
2065
+ # # The returned object is of type Gapic::Operation. You can use it to
2066
+ # # check the status of an operation, cancel it, or wait for results.
2067
+ # # Here is how to wait for a response.
2068
+ # result.wait_until_done! timeout: 60
2069
+ # if result.response?
2070
+ # p result.response
2071
+ # else
2072
+ # puts "No response received."
2073
+ # end
2074
+ #
2075
+ def update_draft request, options = nil
2076
+ raise ::ArgumentError, "request must be provided" if request.nil?
2077
+
2078
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDraftRequest
2079
+
2080
+ # Converts hash and nil to an options object
2081
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2082
+
2083
+ # Customize the options with defaults
2084
+ call_metadata = @config.rpcs.update_draft.metadata.to_h
2085
+
2086
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2087
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2088
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2089
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2090
+ transports_version_send: [:rest]
2091
+
2092
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2093
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2094
+
2095
+ options.apply_defaults timeout: @config.rpcs.update_draft.timeout,
2096
+ metadata: call_metadata,
2097
+ retry_policy: @config.rpcs.update_draft.retry_policy
2098
+
2099
+ options.apply_defaults timeout: @config.timeout,
2100
+ metadata: @config.metadata,
2101
+ retry_policy: @config.retry_policy
2102
+
2103
+ @app_platform_stub.update_draft request, options do |result, operation|
2104
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2105
+ yield result, operation if block_given?
2106
+ return result
2107
+ end
2108
+ rescue ::Gapic::Rest::Error => e
2109
+ raise ::Google::Cloud::Error.from_error(e)
2110
+ end
2111
+
2112
+ ##
2113
+ # Deletes a single Draft.
2114
+ #
2115
+ # @overload delete_draft(request, options = nil)
2116
+ # Pass arguments to `delete_draft` via a request object, either of type
2117
+ # {::Google::Cloud::VisionAI::V1::DeleteDraftRequest} or an equivalent Hash.
2118
+ #
2119
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteDraftRequest, ::Hash]
2120
+ # A request object representing the call parameters. Required. To specify no
2121
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2122
+ # @param options [::Gapic::CallOptions, ::Hash]
2123
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2124
+ #
2125
+ # @overload delete_draft(name: nil, request_id: nil)
2126
+ # Pass arguments to `delete_draft` via keyword arguments. Note that at
2127
+ # least one keyword argument is required. To specify no parameters, or to keep all
2128
+ # the default parameter values, pass an empty Hash as a request object (see above).
2129
+ #
2130
+ # @param name [::String]
2131
+ # Required. Name of the resource.
2132
+ # @param request_id [::String]
2133
+ # Optional. An optional request ID to identify requests. Specify a unique
2134
+ # request ID so that if you must retry your request, the server will know to
2135
+ # ignore the request if it has already been completed. The server will
2136
+ # guarantee that for at least 60 minutes after the first request.
2137
+ #
2138
+ # For example, consider a situation where you make an initial request and
2139
+ # the request times out. If you make the request again with the same request
2140
+ # ID, the server can check if original operation with the same request ID
2141
+ # was received, and if so, will ignore the second request. This prevents
2142
+ # clients from accidentally creating duplicate commitments.
2143
+ #
2144
+ # The request ID must be a valid UUID with the exception that zero UUID is
2145
+ # not supported (00000000-0000-0000-0000-000000000000).
2146
+ # @yield [result, operation] Access the result along with the TransportOperation object
2147
+ # @yieldparam result [::Gapic::Operation]
2148
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2149
+ #
2150
+ # @return [::Gapic::Operation]
2151
+ #
2152
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2153
+ #
2154
+ # @example Basic example
2155
+ # require "google/cloud/vision_ai/v1"
2156
+ #
2157
+ # # Create a client object. The client can be reused for multiple calls.
2158
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2159
+ #
2160
+ # # Create a request. To set request fields, pass in keyword arguments.
2161
+ # request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new
2162
+ #
2163
+ # # Call the delete_draft method.
2164
+ # result = client.delete_draft request
2165
+ #
2166
+ # # The returned object is of type Gapic::Operation. You can use it to
2167
+ # # check the status of an operation, cancel it, or wait for results.
2168
+ # # Here is how to wait for a response.
2169
+ # result.wait_until_done! timeout: 60
2170
+ # if result.response?
2171
+ # p result.response
2172
+ # else
2173
+ # puts "No response received."
2174
+ # end
2175
+ #
2176
+ def delete_draft request, options = nil
2177
+ raise ::ArgumentError, "request must be provided" if request.nil?
2178
+
2179
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDraftRequest
2180
+
2181
+ # Converts hash and nil to an options object
2182
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2183
+
2184
+ # Customize the options with defaults
2185
+ call_metadata = @config.rpcs.delete_draft.metadata.to_h
2186
+
2187
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2188
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2189
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2190
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2191
+ transports_version_send: [:rest]
2192
+
2193
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2194
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2195
+
2196
+ options.apply_defaults timeout: @config.rpcs.delete_draft.timeout,
2197
+ metadata: call_metadata,
2198
+ retry_policy: @config.rpcs.delete_draft.retry_policy
2199
+
2200
+ options.apply_defaults timeout: @config.timeout,
2201
+ metadata: @config.metadata,
2202
+ retry_policy: @config.retry_policy
2203
+
2204
+ @app_platform_stub.delete_draft request, options do |result, operation|
2205
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2206
+ yield result, operation if block_given?
2207
+ return result
2208
+ end
2209
+ rescue ::Gapic::Rest::Error => e
2210
+ raise ::Google::Cloud::Error.from_error(e)
2211
+ end
2212
+
2213
+ ##
2214
+ # Lists Processors in a given project and location.
2215
+ #
2216
+ # @overload list_processors(request, options = nil)
2217
+ # Pass arguments to `list_processors` via a request object, either of type
2218
+ # {::Google::Cloud::VisionAI::V1::ListProcessorsRequest} or an equivalent Hash.
2219
+ #
2220
+ # @param request [::Google::Cloud::VisionAI::V1::ListProcessorsRequest, ::Hash]
2221
+ # A request object representing the call parameters. Required. To specify no
2222
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2223
+ # @param options [::Gapic::CallOptions, ::Hash]
2224
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2225
+ #
2226
+ # @overload list_processors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2227
+ # Pass arguments to `list_processors` via keyword arguments. Note that at
2228
+ # least one keyword argument is required. To specify no parameters, or to keep all
2229
+ # the default parameter values, pass an empty Hash as a request object (see above).
2230
+ #
2231
+ # @param parent [::String]
2232
+ # Required. Parent value for ListProcessorsRequest.
2233
+ # @param page_size [::Integer]
2234
+ # Requested page size. Server may return fewer items than requested.
2235
+ # If unspecified, server will pick an appropriate default.
2236
+ # @param page_token [::String]
2237
+ # A token identifying a page of results the server should return.
2238
+ # @param filter [::String]
2239
+ # Filtering results.
2240
+ # @param order_by [::String]
2241
+ # Hint for how to order the results.
2242
+ # @yield [result, operation] Access the result along with the TransportOperation object
2243
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListProcessorsResponse]
2244
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2245
+ #
2246
+ # @return [::Google::Cloud::VisionAI::V1::ListProcessorsResponse]
2247
+ #
2248
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2249
+ #
2250
+ # @example Basic example
2251
+ # require "google/cloud/vision_ai/v1"
2252
+ #
2253
+ # # Create a client object. The client can be reused for multiple calls.
2254
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2255
+ #
2256
+ # # Create a request. To set request fields, pass in keyword arguments.
2257
+ # request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new
2258
+ #
2259
+ # # Call the list_processors method.
2260
+ # result = client.list_processors request
2261
+ #
2262
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2263
+ # # over elements, and API calls will be issued to fetch pages as needed.
2264
+ # result.each do |item|
2265
+ # # Each element is of type ::Google::Cloud::VisionAI::V1::Processor.
2266
+ # p item
2267
+ # end
2268
+ #
2269
+ def list_processors request, options = nil
2270
+ raise ::ArgumentError, "request must be provided" if request.nil?
2271
+
2272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessorsRequest
2273
+
2274
+ # Converts hash and nil to an options object
2275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2276
+
2277
+ # Customize the options with defaults
2278
+ call_metadata = @config.rpcs.list_processors.metadata.to_h
2279
+
2280
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2281
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2283
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2284
+ transports_version_send: [:rest]
2285
+
2286
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2287
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2288
+
2289
+ options.apply_defaults timeout: @config.rpcs.list_processors.timeout,
2290
+ metadata: call_metadata,
2291
+ retry_policy: @config.rpcs.list_processors.retry_policy
2292
+
2293
+ options.apply_defaults timeout: @config.timeout,
2294
+ metadata: @config.metadata,
2295
+ retry_policy: @config.retry_policy
2296
+
2297
+ @app_platform_stub.list_processors request, options do |result, operation|
2298
+ yield result, operation if block_given?
2299
+ return result
2300
+ end
2301
+ rescue ::Gapic::Rest::Error => e
2302
+ raise ::Google::Cloud::Error.from_error(e)
2303
+ end
2304
+
2305
+ ##
2306
+ # ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt
2307
+ # Processors.
2308
+ #
2309
+ # @overload list_prebuilt_processors(request, options = nil)
2310
+ # Pass arguments to `list_prebuilt_processors` via a request object, either of type
2311
+ # {::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest} or an equivalent Hash.
2312
+ #
2313
+ # @param request [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, ::Hash]
2314
+ # A request object representing the call parameters. Required. To specify no
2315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2316
+ # @param options [::Gapic::CallOptions, ::Hash]
2317
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2318
+ #
2319
+ # @overload list_prebuilt_processors(parent: nil)
2320
+ # Pass arguments to `list_prebuilt_processors` via keyword arguments. Note that at
2321
+ # least one keyword argument is required. To specify no parameters, or to keep all
2322
+ # the default parameter values, pass an empty Hash as a request object (see above).
2323
+ #
2324
+ # @param parent [::String]
2325
+ # Required. Parent path.
2326
+ # @yield [result, operation] Access the result along with the TransportOperation object
2327
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse]
2328
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2329
+ #
2330
+ # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse]
2331
+ #
2332
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2333
+ #
2334
+ # @example Basic example
2335
+ # require "google/cloud/vision_ai/v1"
2336
+ #
2337
+ # # Create a client object. The client can be reused for multiple calls.
2338
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2339
+ #
2340
+ # # Create a request. To set request fields, pass in keyword arguments.
2341
+ # request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new
2342
+ #
2343
+ # # Call the list_prebuilt_processors method.
2344
+ # result = client.list_prebuilt_processors request
2345
+ #
2346
+ # # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.
2347
+ # p result
2348
+ #
2349
+ def list_prebuilt_processors request, options = nil
2350
+ raise ::ArgumentError, "request must be provided" if request.nil?
2351
+
2352
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest
2353
+
2354
+ # Converts hash and nil to an options object
2355
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2356
+
2357
+ # Customize the options with defaults
2358
+ call_metadata = @config.rpcs.list_prebuilt_processors.metadata.to_h
2359
+
2360
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2361
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2362
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2363
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2364
+ transports_version_send: [:rest]
2365
+
2366
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2367
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2368
+
2369
+ options.apply_defaults timeout: @config.rpcs.list_prebuilt_processors.timeout,
2370
+ metadata: call_metadata,
2371
+ retry_policy: @config.rpcs.list_prebuilt_processors.retry_policy
2372
+
2373
+ options.apply_defaults timeout: @config.timeout,
2374
+ metadata: @config.metadata,
2375
+ retry_policy: @config.retry_policy
2376
+
2377
+ @app_platform_stub.list_prebuilt_processors request, options do |result, operation|
2378
+ yield result, operation if block_given?
2379
+ return result
2380
+ end
2381
+ rescue ::Gapic::Rest::Error => e
2382
+ raise ::Google::Cloud::Error.from_error(e)
2383
+ end
2384
+
2385
+ ##
2386
+ # Gets details of a single Processor.
2387
+ #
2388
+ # @overload get_processor(request, options = nil)
2389
+ # Pass arguments to `get_processor` via a request object, either of type
2390
+ # {::Google::Cloud::VisionAI::V1::GetProcessorRequest} or an equivalent Hash.
2391
+ #
2392
+ # @param request [::Google::Cloud::VisionAI::V1::GetProcessorRequest, ::Hash]
2393
+ # A request object representing the call parameters. Required. To specify no
2394
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2395
+ # @param options [::Gapic::CallOptions, ::Hash]
2396
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2397
+ #
2398
+ # @overload get_processor(name: nil)
2399
+ # Pass arguments to `get_processor` via keyword arguments. Note that at
2400
+ # least one keyword argument is required. To specify no parameters, or to keep all
2401
+ # the default parameter values, pass an empty Hash as a request object (see above).
2402
+ #
2403
+ # @param name [::String]
2404
+ # Required. Name of the resource.
2405
+ # @yield [result, operation] Access the result along with the TransportOperation object
2406
+ # @yieldparam result [::Google::Cloud::VisionAI::V1::Processor]
2407
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2408
+ #
2409
+ # @return [::Google::Cloud::VisionAI::V1::Processor]
2410
+ #
2411
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2412
+ #
2413
+ # @example Basic example
2414
+ # require "google/cloud/vision_ai/v1"
2415
+ #
2416
+ # # Create a client object. The client can be reused for multiple calls.
2417
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2418
+ #
2419
+ # # Create a request. To set request fields, pass in keyword arguments.
2420
+ # request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new
2421
+ #
2422
+ # # Call the get_processor method.
2423
+ # result = client.get_processor request
2424
+ #
2425
+ # # The returned object is of type Google::Cloud::VisionAI::V1::Processor.
2426
+ # p result
2427
+ #
2428
+ def get_processor request, options = nil
2429
+ raise ::ArgumentError, "request must be provided" if request.nil?
2430
+
2431
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessorRequest
2432
+
2433
+ # Converts hash and nil to an options object
2434
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2435
+
2436
+ # Customize the options with defaults
2437
+ call_metadata = @config.rpcs.get_processor.metadata.to_h
2438
+
2439
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2440
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2441
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2442
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2443
+ transports_version_send: [:rest]
2444
+
2445
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2446
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2447
+
2448
+ options.apply_defaults timeout: @config.rpcs.get_processor.timeout,
2449
+ metadata: call_metadata,
2450
+ retry_policy: @config.rpcs.get_processor.retry_policy
2451
+
2452
+ options.apply_defaults timeout: @config.timeout,
2453
+ metadata: @config.metadata,
2454
+ retry_policy: @config.retry_policy
2455
+
2456
+ @app_platform_stub.get_processor request, options do |result, operation|
2457
+ yield result, operation if block_given?
2458
+ return result
2459
+ end
2460
+ rescue ::Gapic::Rest::Error => e
2461
+ raise ::Google::Cloud::Error.from_error(e)
2462
+ end
2463
+
2464
+ ##
2465
+ # Creates a new Processor in a given project and location.
2466
+ #
2467
+ # @overload create_processor(request, options = nil)
2468
+ # Pass arguments to `create_processor` via a request object, either of type
2469
+ # {::Google::Cloud::VisionAI::V1::CreateProcessorRequest} or an equivalent Hash.
2470
+ #
2471
+ # @param request [::Google::Cloud::VisionAI::V1::CreateProcessorRequest, ::Hash]
2472
+ # A request object representing the call parameters. Required. To specify no
2473
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2474
+ # @param options [::Gapic::CallOptions, ::Hash]
2475
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2476
+ #
2477
+ # @overload create_processor(parent: nil, processor_id: nil, processor: nil, request_id: nil)
2478
+ # Pass arguments to `create_processor` via keyword arguments. Note that at
2479
+ # least one keyword argument is required. To specify no parameters, or to keep all
2480
+ # the default parameter values, pass an empty Hash as a request object (see above).
2481
+ #
2482
+ # @param parent [::String]
2483
+ # Required. Value for parent.
2484
+ # @param processor_id [::String]
2485
+ # Required. Id of the requesting object.
2486
+ # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash]
2487
+ # Required. The resource being created.
2488
+ # @param request_id [::String]
2489
+ # Optional. An optional request ID to identify requests. Specify a unique
2490
+ # request ID so that if you must retry your request, the server will know to
2491
+ # ignore the request if it has already been completed. The server will
2492
+ # guarantee that for at least 60 minutes since the first request.
2493
+ #
2494
+ # For example, consider a situation where you make an initial request and
2495
+ # the request times out. If you make the request again with the same request
2496
+ # ID, the server can check if original operation with the same request ID
2497
+ # was received, and if so, will ignore the second request. This prevents
2498
+ # clients from accidentally creating duplicate commitments.
2499
+ #
2500
+ # The request ID must be a valid UUID with the exception that zero UUID is
2501
+ # not supported (00000000-0000-0000-0000-000000000000).
2502
+ # @yield [result, operation] Access the result along with the TransportOperation object
2503
+ # @yieldparam result [::Gapic::Operation]
2504
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2505
+ #
2506
+ # @return [::Gapic::Operation]
2507
+ #
2508
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2509
+ #
2510
+ # @example Basic example
2511
+ # require "google/cloud/vision_ai/v1"
2512
+ #
2513
+ # # Create a client object. The client can be reused for multiple calls.
2514
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2515
+ #
2516
+ # # Create a request. To set request fields, pass in keyword arguments.
2517
+ # request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new
2518
+ #
2519
+ # # Call the create_processor method.
2520
+ # result = client.create_processor request
2521
+ #
2522
+ # # The returned object is of type Gapic::Operation. You can use it to
2523
+ # # check the status of an operation, cancel it, or wait for results.
2524
+ # # Here is how to wait for a response.
2525
+ # result.wait_until_done! timeout: 60
2526
+ # if result.response?
2527
+ # p result.response
2528
+ # else
2529
+ # puts "No response received."
2530
+ # end
2531
+ #
2532
+ def create_processor request, options = nil
2533
+ raise ::ArgumentError, "request must be provided" if request.nil?
2534
+
2535
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessorRequest
2536
+
2537
+ # Converts hash and nil to an options object
2538
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2539
+
2540
+ # Customize the options with defaults
2541
+ call_metadata = @config.rpcs.create_processor.metadata.to_h
2542
+
2543
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2544
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2545
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2546
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2547
+ transports_version_send: [:rest]
2548
+
2549
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2550
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2551
+
2552
+ options.apply_defaults timeout: @config.rpcs.create_processor.timeout,
2553
+ metadata: call_metadata,
2554
+ retry_policy: @config.rpcs.create_processor.retry_policy
2555
+
2556
+ options.apply_defaults timeout: @config.timeout,
2557
+ metadata: @config.metadata,
2558
+ retry_policy: @config.retry_policy
2559
+
2560
+ @app_platform_stub.create_processor request, options do |result, operation|
2561
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2562
+ yield result, operation if block_given?
2563
+ return result
2564
+ end
2565
+ rescue ::Gapic::Rest::Error => e
2566
+ raise ::Google::Cloud::Error.from_error(e)
2567
+ end
2568
+
2569
+ ##
2570
+ # Updates the parameters of a single Processor.
2571
+ #
2572
+ # @overload update_processor(request, options = nil)
2573
+ # Pass arguments to `update_processor` via a request object, either of type
2574
+ # {::Google::Cloud::VisionAI::V1::UpdateProcessorRequest} or an equivalent Hash.
2575
+ #
2576
+ # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, ::Hash]
2577
+ # A request object representing the call parameters. Required. To specify no
2578
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2579
+ # @param options [::Gapic::CallOptions, ::Hash]
2580
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2581
+ #
2582
+ # @overload update_processor(update_mask: nil, processor: nil, request_id: nil)
2583
+ # Pass arguments to `update_processor` via keyword arguments. Note that at
2584
+ # least one keyword argument is required. To specify no parameters, or to keep all
2585
+ # the default parameter values, pass an empty Hash as a request object (see above).
2586
+ #
2587
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2588
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2589
+ # Processor resource by the update.
2590
+ # The fields specified in the update_mask are relative to the resource, not
2591
+ # the full request. A field will be overwritten if it is in the mask. If the
2592
+ # user does not provide a mask then all fields will be overwritten.
2593
+ # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash]
2594
+ # Required. The resource being updated.
2595
+ # @param request_id [::String]
2596
+ # Optional. An optional request ID to identify requests. Specify a unique
2597
+ # request ID so that if you must retry your request, the server will know to
2598
+ # ignore the request if it has already been completed. The server will
2599
+ # guarantee that for at least 60 minutes since the first request.
2600
+ #
2601
+ # For example, consider a situation where you make an initial request and
2602
+ # the request times out. If you make the request again with the same request
2603
+ # ID, the server can check if original operation with the same request ID
2604
+ # was received, and if so, will ignore the second request. This prevents
2605
+ # clients from accidentally creating duplicate commitments.
2606
+ #
2607
+ # The request ID must be a valid UUID with the exception that zero UUID is
2608
+ # not supported (00000000-0000-0000-0000-000000000000).
2609
+ # @yield [result, operation] Access the result along with the TransportOperation object
2610
+ # @yieldparam result [::Gapic::Operation]
2611
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2612
+ #
2613
+ # @return [::Gapic::Operation]
2614
+ #
2615
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2616
+ #
2617
+ # @example Basic example
2618
+ # require "google/cloud/vision_ai/v1"
2619
+ #
2620
+ # # Create a client object. The client can be reused for multiple calls.
2621
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2622
+ #
2623
+ # # Create a request. To set request fields, pass in keyword arguments.
2624
+ # request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new
2625
+ #
2626
+ # # Call the update_processor method.
2627
+ # result = client.update_processor request
2628
+ #
2629
+ # # The returned object is of type Gapic::Operation. You can use it to
2630
+ # # check the status of an operation, cancel it, or wait for results.
2631
+ # # Here is how to wait for a response.
2632
+ # result.wait_until_done! timeout: 60
2633
+ # if result.response?
2634
+ # p result.response
2635
+ # else
2636
+ # puts "No response received."
2637
+ # end
2638
+ #
2639
+ def update_processor request, options = nil
2640
+ raise ::ArgumentError, "request must be provided" if request.nil?
2641
+
2642
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest
2643
+
2644
+ # Converts hash and nil to an options object
2645
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2646
+
2647
+ # Customize the options with defaults
2648
+ call_metadata = @config.rpcs.update_processor.metadata.to_h
2649
+
2650
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2651
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2652
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2653
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2654
+ transports_version_send: [:rest]
2655
+
2656
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2657
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2658
+
2659
+ options.apply_defaults timeout: @config.rpcs.update_processor.timeout,
2660
+ metadata: call_metadata,
2661
+ retry_policy: @config.rpcs.update_processor.retry_policy
2662
+
2663
+ options.apply_defaults timeout: @config.timeout,
2664
+ metadata: @config.metadata,
2665
+ retry_policy: @config.retry_policy
2666
+
2667
+ @app_platform_stub.update_processor request, options do |result, operation|
2668
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2669
+ yield result, operation if block_given?
2670
+ return result
2671
+ end
2672
+ rescue ::Gapic::Rest::Error => e
2673
+ raise ::Google::Cloud::Error.from_error(e)
2674
+ end
2675
+
2676
+ ##
2677
+ # Deletes a single Processor.
2678
+ #
2679
+ # @overload delete_processor(request, options = nil)
2680
+ # Pass arguments to `delete_processor` via a request object, either of type
2681
+ # {::Google::Cloud::VisionAI::V1::DeleteProcessorRequest} or an equivalent Hash.
2682
+ #
2683
+ # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, ::Hash]
2684
+ # A request object representing the call parameters. Required. To specify no
2685
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2686
+ # @param options [::Gapic::CallOptions, ::Hash]
2687
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2688
+ #
2689
+ # @overload delete_processor(name: nil, request_id: nil)
2690
+ # Pass arguments to `delete_processor` via keyword arguments. Note that at
2691
+ # least one keyword argument is required. To specify no parameters, or to keep all
2692
+ # the default parameter values, pass an empty Hash as a request object (see above).
2693
+ #
2694
+ # @param name [::String]
2695
+ # Required. Name of the resource
2696
+ # @param request_id [::String]
2697
+ # Optional. An optional request ID to identify requests. Specify a unique
2698
+ # request ID so that if you must retry your request, the server will know to
2699
+ # ignore the request if it has already been completed. The server will
2700
+ # guarantee that for at least 60 minutes after the first request.
2701
+ #
2702
+ # For example, consider a situation where you make an initial request and
2703
+ # the request times out. If you make the request again with the same request
2704
+ # ID, the server can check if original operation with the same request ID
2705
+ # was received, and if so, will ignore the second request. This prevents
2706
+ # clients from accidentally creating duplicate commitments.
2707
+ #
2708
+ # The request ID must be a valid UUID with the exception that zero UUID is
2709
+ # not supported (00000000-0000-0000-0000-000000000000).
2710
+ # @yield [result, operation] Access the result along with the TransportOperation object
2711
+ # @yieldparam result [::Gapic::Operation]
2712
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2713
+ #
2714
+ # @return [::Gapic::Operation]
2715
+ #
2716
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2717
+ #
2718
+ # @example Basic example
2719
+ # require "google/cloud/vision_ai/v1"
2720
+ #
2721
+ # # Create a client object. The client can be reused for multiple calls.
2722
+ # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new
2723
+ #
2724
+ # # Create a request. To set request fields, pass in keyword arguments.
2725
+ # request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new
2726
+ #
2727
+ # # Call the delete_processor method.
2728
+ # result = client.delete_processor request
2729
+ #
2730
+ # # The returned object is of type Gapic::Operation. You can use it to
2731
+ # # check the status of an operation, cancel it, or wait for results.
2732
+ # # Here is how to wait for a response.
2733
+ # result.wait_until_done! timeout: 60
2734
+ # if result.response?
2735
+ # p result.response
2736
+ # else
2737
+ # puts "No response received."
2738
+ # end
2739
+ #
2740
+ def delete_processor request, options = nil
2741
+ raise ::ArgumentError, "request must be provided" if request.nil?
2742
+
2743
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest
2744
+
2745
+ # Converts hash and nil to an options object
2746
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2747
+
2748
+ # Customize the options with defaults
2749
+ call_metadata = @config.rpcs.delete_processor.metadata.to_h
2750
+
2751
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2752
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2753
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2754
+ gapic_version: ::Google::Cloud::VisionAI::V1::VERSION,
2755
+ transports_version_send: [:rest]
2756
+
2757
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2758
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2759
+
2760
+ options.apply_defaults timeout: @config.rpcs.delete_processor.timeout,
2761
+ metadata: call_metadata,
2762
+ retry_policy: @config.rpcs.delete_processor.retry_policy
2763
+
2764
+ options.apply_defaults timeout: @config.timeout,
2765
+ metadata: @config.metadata,
2766
+ retry_policy: @config.retry_policy
2767
+
2768
+ @app_platform_stub.delete_processor request, options do |result, operation|
2769
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2770
+ yield result, operation if block_given?
2771
+ return result
2772
+ end
2773
+ rescue ::Gapic::Rest::Error => e
2774
+ raise ::Google::Cloud::Error.from_error(e)
2775
+ end
2776
+
2777
+ ##
2778
+ # Configuration class for the AppPlatform REST API.
2779
+ #
2780
+ # This class represents the configuration for AppPlatform REST,
2781
+ # providing control over timeouts, retry behavior, logging, transport
2782
+ # parameters, and other low-level controls. Certain parameters can also be
2783
+ # applied individually to specific RPCs. See
2784
+ # {::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client::Configuration::Rpcs}
2785
+ # for a list of RPCs that can be configured independently.
2786
+ #
2787
+ # Configuration can be applied globally to all clients, or to a single client
2788
+ # on construction.
2789
+ #
2790
+ # @example
2791
+ #
2792
+ # # Modify the global config, setting the timeout for
2793
+ # # list_applications to 20 seconds,
2794
+ # # and all remaining timeouts to 10 seconds.
2795
+ # ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.configure do |config|
2796
+ # config.timeout = 10.0
2797
+ # config.rpcs.list_applications.timeout = 20.0
2798
+ # end
2799
+ #
2800
+ # # Apply the above configuration only to a new client.
2801
+ # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config|
2802
+ # config.timeout = 10.0
2803
+ # config.rpcs.list_applications.timeout = 20.0
2804
+ # end
2805
+ #
2806
+ # @!attribute [rw] endpoint
2807
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2808
+ # nil, indicating to use the default endpoint in the current universe domain.
2809
+ # @return [::String,nil]
2810
+ # @!attribute [rw] credentials
2811
+ # Credentials to send with calls. You may provide any of the following types:
2812
+ # * (`String`) The path to a service account key file in JSON format
2813
+ # * (`Hash`) A service account key as a Hash
2814
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2815
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2816
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2817
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2818
+ # * (`nil`) indicating no credentials
2819
+ # @return [::Object]
2820
+ # @!attribute [rw] scope
2821
+ # The OAuth scopes
2822
+ # @return [::Array<::String>]
2823
+ # @!attribute [rw] lib_name
2824
+ # The library name as recorded in instrumentation and logging
2825
+ # @return [::String]
2826
+ # @!attribute [rw] lib_version
2827
+ # The library version as recorded in instrumentation and logging
2828
+ # @return [::String]
2829
+ # @!attribute [rw] timeout
2830
+ # The call timeout in seconds.
2831
+ # @return [::Numeric]
2832
+ # @!attribute [rw] metadata
2833
+ # Additional headers to be sent with the call.
2834
+ # @return [::Hash{::Symbol=>::String}]
2835
+ # @!attribute [rw] retry_policy
2836
+ # The retry policy. The value is a hash with the following keys:
2837
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2838
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2839
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2840
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2841
+ # trigger a retry.
2842
+ # @return [::Hash]
2843
+ # @!attribute [rw] quota_project
2844
+ # A separate project against which to charge quota.
2845
+ # @return [::String]
2846
+ # @!attribute [rw] universe_domain
2847
+ # The universe domain within which to make requests. This determines the
2848
+ # default endpoint URL. The default value of nil uses the environment
2849
+ # universe (usually the default "googleapis.com" universe).
2850
+ # @return [::String,nil]
2851
+ #
2852
+ class Configuration
2853
+ extend ::Gapic::Config
2854
+
2855
+ # @private
2856
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2857
+ DEFAULT_ENDPOINT = "visionai.googleapis.com"
2858
+
2859
+ config_attr :endpoint, nil, ::String, nil
2860
+ config_attr :credentials, nil do |value|
2861
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2862
+ allowed.any? { |klass| klass === value }
2863
+ end
2864
+ config_attr :scope, nil, ::String, ::Array, nil
2865
+ config_attr :lib_name, nil, ::String, nil
2866
+ config_attr :lib_version, nil, ::String, nil
2867
+ config_attr :timeout, nil, ::Numeric, nil
2868
+ config_attr :metadata, nil, ::Hash, nil
2869
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2870
+ config_attr :quota_project, nil, ::String, nil
2871
+ config_attr :universe_domain, nil, ::String, nil
2872
+
2873
+ # @private
2874
+ def initialize parent_config = nil
2875
+ @parent_config = parent_config unless parent_config.nil?
2876
+
2877
+ yield self if block_given?
2878
+ end
2879
+
2880
+ ##
2881
+ # Configurations for individual RPCs
2882
+ # @return [Rpcs]
2883
+ #
2884
+ def rpcs
2885
+ @rpcs ||= begin
2886
+ parent_rpcs = nil
2887
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2888
+ Rpcs.new parent_rpcs
2889
+ end
2890
+ end
2891
+
2892
+ ##
2893
+ # Configuration RPC class for the AppPlatform API.
2894
+ #
2895
+ # Includes fields providing the configuration for each RPC in this service.
2896
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2897
+ # the following configuration fields:
2898
+ #
2899
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2900
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2901
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2902
+ # include the following keys:
2903
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2904
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2905
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2906
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2907
+ # trigger a retry.
2908
+ #
2909
+ class Rpcs
2910
+ ##
2911
+ # RPC-specific configuration for `list_applications`
2912
+ # @return [::Gapic::Config::Method]
2913
+ #
2914
+ attr_reader :list_applications
2915
+ ##
2916
+ # RPC-specific configuration for `get_application`
2917
+ # @return [::Gapic::Config::Method]
2918
+ #
2919
+ attr_reader :get_application
2920
+ ##
2921
+ # RPC-specific configuration for `create_application`
2922
+ # @return [::Gapic::Config::Method]
2923
+ #
2924
+ attr_reader :create_application
2925
+ ##
2926
+ # RPC-specific configuration for `update_application`
2927
+ # @return [::Gapic::Config::Method]
2928
+ #
2929
+ attr_reader :update_application
2930
+ ##
2931
+ # RPC-specific configuration for `delete_application`
2932
+ # @return [::Gapic::Config::Method]
2933
+ #
2934
+ attr_reader :delete_application
2935
+ ##
2936
+ # RPC-specific configuration for `deploy_application`
2937
+ # @return [::Gapic::Config::Method]
2938
+ #
2939
+ attr_reader :deploy_application
2940
+ ##
2941
+ # RPC-specific configuration for `undeploy_application`
2942
+ # @return [::Gapic::Config::Method]
2943
+ #
2944
+ attr_reader :undeploy_application
2945
+ ##
2946
+ # RPC-specific configuration for `add_application_stream_input`
2947
+ # @return [::Gapic::Config::Method]
2948
+ #
2949
+ attr_reader :add_application_stream_input
2950
+ ##
2951
+ # RPC-specific configuration for `remove_application_stream_input`
2952
+ # @return [::Gapic::Config::Method]
2953
+ #
2954
+ attr_reader :remove_application_stream_input
2955
+ ##
2956
+ # RPC-specific configuration for `update_application_stream_input`
2957
+ # @return [::Gapic::Config::Method]
2958
+ #
2959
+ attr_reader :update_application_stream_input
2960
+ ##
2961
+ # RPC-specific configuration for `list_instances`
2962
+ # @return [::Gapic::Config::Method]
2963
+ #
2964
+ attr_reader :list_instances
2965
+ ##
2966
+ # RPC-specific configuration for `get_instance`
2967
+ # @return [::Gapic::Config::Method]
2968
+ #
2969
+ attr_reader :get_instance
2970
+ ##
2971
+ # RPC-specific configuration for `create_application_instances`
2972
+ # @return [::Gapic::Config::Method]
2973
+ #
2974
+ attr_reader :create_application_instances
2975
+ ##
2976
+ # RPC-specific configuration for `delete_application_instances`
2977
+ # @return [::Gapic::Config::Method]
2978
+ #
2979
+ attr_reader :delete_application_instances
2980
+ ##
2981
+ # RPC-specific configuration for `update_application_instances`
2982
+ # @return [::Gapic::Config::Method]
2983
+ #
2984
+ attr_reader :update_application_instances
2985
+ ##
2986
+ # RPC-specific configuration for `list_drafts`
2987
+ # @return [::Gapic::Config::Method]
2988
+ #
2989
+ attr_reader :list_drafts
2990
+ ##
2991
+ # RPC-specific configuration for `get_draft`
2992
+ # @return [::Gapic::Config::Method]
2993
+ #
2994
+ attr_reader :get_draft
2995
+ ##
2996
+ # RPC-specific configuration for `create_draft`
2997
+ # @return [::Gapic::Config::Method]
2998
+ #
2999
+ attr_reader :create_draft
3000
+ ##
3001
+ # RPC-specific configuration for `update_draft`
3002
+ # @return [::Gapic::Config::Method]
3003
+ #
3004
+ attr_reader :update_draft
3005
+ ##
3006
+ # RPC-specific configuration for `delete_draft`
3007
+ # @return [::Gapic::Config::Method]
3008
+ #
3009
+ attr_reader :delete_draft
3010
+ ##
3011
+ # RPC-specific configuration for `list_processors`
3012
+ # @return [::Gapic::Config::Method]
3013
+ #
3014
+ attr_reader :list_processors
3015
+ ##
3016
+ # RPC-specific configuration for `list_prebuilt_processors`
3017
+ # @return [::Gapic::Config::Method]
3018
+ #
3019
+ attr_reader :list_prebuilt_processors
3020
+ ##
3021
+ # RPC-specific configuration for `get_processor`
3022
+ # @return [::Gapic::Config::Method]
3023
+ #
3024
+ attr_reader :get_processor
3025
+ ##
3026
+ # RPC-specific configuration for `create_processor`
3027
+ # @return [::Gapic::Config::Method]
3028
+ #
3029
+ attr_reader :create_processor
3030
+ ##
3031
+ # RPC-specific configuration for `update_processor`
3032
+ # @return [::Gapic::Config::Method]
3033
+ #
3034
+ attr_reader :update_processor
3035
+ ##
3036
+ # RPC-specific configuration for `delete_processor`
3037
+ # @return [::Gapic::Config::Method]
3038
+ #
3039
+ attr_reader :delete_processor
3040
+
3041
+ # @private
3042
+ def initialize parent_rpcs = nil
3043
+ list_applications_config = parent_rpcs.list_applications if parent_rpcs.respond_to? :list_applications
3044
+ @list_applications = ::Gapic::Config::Method.new list_applications_config
3045
+ get_application_config = parent_rpcs.get_application if parent_rpcs.respond_to? :get_application
3046
+ @get_application = ::Gapic::Config::Method.new get_application_config
3047
+ create_application_config = parent_rpcs.create_application if parent_rpcs.respond_to? :create_application
3048
+ @create_application = ::Gapic::Config::Method.new create_application_config
3049
+ update_application_config = parent_rpcs.update_application if parent_rpcs.respond_to? :update_application
3050
+ @update_application = ::Gapic::Config::Method.new update_application_config
3051
+ delete_application_config = parent_rpcs.delete_application if parent_rpcs.respond_to? :delete_application
3052
+ @delete_application = ::Gapic::Config::Method.new delete_application_config
3053
+ deploy_application_config = parent_rpcs.deploy_application if parent_rpcs.respond_to? :deploy_application
3054
+ @deploy_application = ::Gapic::Config::Method.new deploy_application_config
3055
+ undeploy_application_config = parent_rpcs.undeploy_application if parent_rpcs.respond_to? :undeploy_application
3056
+ @undeploy_application = ::Gapic::Config::Method.new undeploy_application_config
3057
+ add_application_stream_input_config = parent_rpcs.add_application_stream_input if parent_rpcs.respond_to? :add_application_stream_input
3058
+ @add_application_stream_input = ::Gapic::Config::Method.new add_application_stream_input_config
3059
+ remove_application_stream_input_config = parent_rpcs.remove_application_stream_input if parent_rpcs.respond_to? :remove_application_stream_input
3060
+ @remove_application_stream_input = ::Gapic::Config::Method.new remove_application_stream_input_config
3061
+ update_application_stream_input_config = parent_rpcs.update_application_stream_input if parent_rpcs.respond_to? :update_application_stream_input
3062
+ @update_application_stream_input = ::Gapic::Config::Method.new update_application_stream_input_config
3063
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
3064
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
3065
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
3066
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
3067
+ create_application_instances_config = parent_rpcs.create_application_instances if parent_rpcs.respond_to? :create_application_instances
3068
+ @create_application_instances = ::Gapic::Config::Method.new create_application_instances_config
3069
+ delete_application_instances_config = parent_rpcs.delete_application_instances if parent_rpcs.respond_to? :delete_application_instances
3070
+ @delete_application_instances = ::Gapic::Config::Method.new delete_application_instances_config
3071
+ update_application_instances_config = parent_rpcs.update_application_instances if parent_rpcs.respond_to? :update_application_instances
3072
+ @update_application_instances = ::Gapic::Config::Method.new update_application_instances_config
3073
+ list_drafts_config = parent_rpcs.list_drafts if parent_rpcs.respond_to? :list_drafts
3074
+ @list_drafts = ::Gapic::Config::Method.new list_drafts_config
3075
+ get_draft_config = parent_rpcs.get_draft if parent_rpcs.respond_to? :get_draft
3076
+ @get_draft = ::Gapic::Config::Method.new get_draft_config
3077
+ create_draft_config = parent_rpcs.create_draft if parent_rpcs.respond_to? :create_draft
3078
+ @create_draft = ::Gapic::Config::Method.new create_draft_config
3079
+ update_draft_config = parent_rpcs.update_draft if parent_rpcs.respond_to? :update_draft
3080
+ @update_draft = ::Gapic::Config::Method.new update_draft_config
3081
+ delete_draft_config = parent_rpcs.delete_draft if parent_rpcs.respond_to? :delete_draft
3082
+ @delete_draft = ::Gapic::Config::Method.new delete_draft_config
3083
+ list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors
3084
+ @list_processors = ::Gapic::Config::Method.new list_processors_config
3085
+ list_prebuilt_processors_config = parent_rpcs.list_prebuilt_processors if parent_rpcs.respond_to? :list_prebuilt_processors
3086
+ @list_prebuilt_processors = ::Gapic::Config::Method.new list_prebuilt_processors_config
3087
+ get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor
3088
+ @get_processor = ::Gapic::Config::Method.new get_processor_config
3089
+ create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor
3090
+ @create_processor = ::Gapic::Config::Method.new create_processor_config
3091
+ update_processor_config = parent_rpcs.update_processor if parent_rpcs.respond_to? :update_processor
3092
+ @update_processor = ::Gapic::Config::Method.new update_processor_config
3093
+ delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor
3094
+ @delete_processor = ::Gapic::Config::Method.new delete_processor_config
3095
+
3096
+ yield self if block_given?
3097
+ end
3098
+ end
3099
+ end
3100
+ end
3101
+ end
3102
+ end
3103
+ end
3104
+ end
3105
+ end
3106
+ end