google-cloud-rapid_migration_assessment-v1 0.a → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/rapid_migration_assessment/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/client.rb +1439 -0
  7. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/credentials.rb +47 -0
  8. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/operations.rb +779 -0
  9. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/paths.rb +88 -0
  10. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/client.rb +1347 -0
  11. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/operations.rb +870 -0
  12. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub.rb +644 -0
  13. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest.rb +54 -0
  14. data/lib/google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment.rb +56 -0
  15. data/lib/google/cloud/rapid_migration_assessment/v1/rest.rb +38 -0
  16. data/lib/google/cloud/rapid_migration_assessment/v1/version.rb +7 -2
  17. data/lib/google/cloud/rapid_migration_assessment/v1.rb +45 -0
  18. data/lib/google/cloud/rapidmigrationassessment/v1/api_entities_pb.rb +52 -0
  19. data/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb.rb +65 -0
  20. data/lib/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_services_pb.rb +64 -0
  21. data/lib/google-cloud-rapid_migration_assessment-v1.rb +21 -0
  22. data/proto_docs/README.md +4 -0
  23. data/proto_docs/google/api/client.rb +381 -0
  24. data/proto_docs/google/api/field_behavior.rb +85 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +222 -0
  27. data/proto_docs/google/cloud/rapidmigrationassessment/v1/api_entities.rb +184 -0
  28. data/proto_docs/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.rb +272 -0
  29. data/proto_docs/google/longrunning/operations.rb +164 -0
  30. data/proto_docs/google/protobuf/any.rb +144 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  35. data/proto_docs/google/rpc/status.rb +48 -0
  36. metadata +211 -13
@@ -0,0 +1,1347 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment_pb"
21
+ require "google/cloud/rapid_migration_assessment/v1/rapid_migration_assessment/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module RapidMigrationAssessment
27
+ module V1
28
+ module RapidMigrationAssessment
29
+ module Rest
30
+ ##
31
+ # REST client for the RapidMigrationAssessment service.
32
+ #
33
+ # Rapid Migration Assessment service
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :rapid_migration_assessment_stub
40
+
41
+ ##
42
+ # Configure the RapidMigrationAssessment Client class.
43
+ #
44
+ # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all RapidMigrationAssessment clients
50
+ # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "RapidMigrationAssessment", "V1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.rpcs.create_collector.timeout = 60.0
71
+
72
+ default_config.rpcs.create_annotation.timeout = 60.0
73
+
74
+ default_config.rpcs.get_annotation.timeout = 60.0
75
+ default_config.rpcs.get_annotation.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
77
+ }
78
+
79
+ default_config.rpcs.list_collectors.timeout = 60.0
80
+ default_config.rpcs.list_collectors.retry_policy = {
81
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
82
+ }
83
+
84
+ default_config.rpcs.get_collector.timeout = 60.0
85
+ default_config.rpcs.get_collector.retry_policy = {
86
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4]
87
+ }
88
+
89
+ default_config.rpcs.update_collector.timeout = 60.0
90
+
91
+ default_config.rpcs.delete_collector.timeout = 60.0
92
+
93
+ default_config.rpcs.resume_collector.timeout = 60.0
94
+
95
+ default_config.rpcs.register_collector.timeout = 60.0
96
+
97
+ default_config.rpcs.pause_collector.timeout = 60.0
98
+
99
+ default_config
100
+ end
101
+ yield @configure if block_given?
102
+ @configure
103
+ end
104
+
105
+ ##
106
+ # Configure the RapidMigrationAssessment Client instance.
107
+ #
108
+ # The configuration is set to the derived mode, meaning that values can be changed,
109
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
110
+ # should be made on {Client.configure}.
111
+ #
112
+ # See {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration}
113
+ # for a description of the configuration fields.
114
+ #
115
+ # @yield [config] Configure the Client client.
116
+ # @yieldparam config [Client::Configuration]
117
+ #
118
+ # @return [Client::Configuration]
119
+ #
120
+ def configure
121
+ yield @config if block_given?
122
+ @config
123
+ end
124
+
125
+ ##
126
+ # Create a new RapidMigrationAssessment REST client object.
127
+ #
128
+ # @example
129
+ #
130
+ # # Create a client using the default configuration
131
+ # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
132
+ #
133
+ # # Create a client using a custom configuration
134
+ # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config|
135
+ # config.timeout = 10.0
136
+ # end
137
+ #
138
+ # @yield [config] Configure the RapidMigrationAssessment client.
139
+ # @yieldparam config [Client::Configuration]
140
+ #
141
+ def initialize
142
+ # Create the configuration object
143
+ @config = Configuration.new Client.configure
144
+
145
+ # Yield the configuration if needed
146
+ yield @config if block_given?
147
+
148
+ # Create credentials
149
+ credentials = @config.credentials
150
+ # Use self-signed JWT if the endpoint is unchanged from default,
151
+ # but only if the default endpoint does not have a region prefix.
152
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-")
154
+ credentials ||= Credentials.default scope: @config.scope,
155
+ enable_self_signed_jwt: enable_self_signed_jwt
156
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
157
+ credentials = Credentials.new credentials, scope: @config.scope
158
+ end
159
+
160
+ @quota_project_id = @config.quota_project
161
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
162
+
163
+ @operations_client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Operations.new do |config|
164
+ config.credentials = credentials
165
+ config.quota_project = @quota_project_id
166
+ config.endpoint = @config.endpoint
167
+ end
168
+
169
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
170
+ config.credentials = credentials
171
+ config.quota_project = @quota_project_id
172
+ config.endpoint = @config.endpoint
173
+ config.bindings_override = @config.bindings_override
174
+ end
175
+
176
+ @rapid_migration_assessment_stub = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
177
+ end
178
+
179
+ ##
180
+ # Get the associated client for long-running operations.
181
+ #
182
+ # @return [::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Operations]
183
+ #
184
+ attr_reader :operations_client
185
+
186
+ ##
187
+ # Get the associated client for mix-in of the Locations.
188
+ #
189
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
190
+ #
191
+ attr_reader :location_client
192
+
193
+ # Service calls
194
+
195
+ ##
196
+ # Create a Collector to manage the on-prem appliance which collects
197
+ # information about Customer assets.
198
+ #
199
+ # @overload create_collector(request, options = nil)
200
+ # Pass arguments to `create_collector` via a request object, either of type
201
+ # {::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest} or an equivalent Hash.
202
+ #
203
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest, ::Hash]
204
+ # A request object representing the call parameters. Required. To specify no
205
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
206
+ # @param options [::Gapic::CallOptions, ::Hash]
207
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
208
+ #
209
+ # @overload create_collector(parent: nil, collector_id: nil, collector: nil, request_id: nil)
210
+ # Pass arguments to `create_collector` via keyword arguments. Note that at
211
+ # least one keyword argument is required. To specify no parameters, or to keep all
212
+ # the default parameter values, pass an empty Hash as a request object (see above).
213
+ #
214
+ # @param parent [::String]
215
+ # Required. Name of the parent (project+location).
216
+ # @param collector_id [::String]
217
+ # Required. Id of the requesting object.
218
+ # @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash]
219
+ # Required. The resource being created.
220
+ # @param request_id [::String]
221
+ # Optional. An optional request ID to identify requests.
222
+ # @yield [result, operation] Access the result along with the TransportOperation object
223
+ # @yieldparam result [::Gapic::Operation]
224
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
225
+ #
226
+ # @return [::Gapic::Operation]
227
+ #
228
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
229
+ #
230
+ # @example Basic example
231
+ # require "google/cloud/rapid_migration_assessment/v1"
232
+ #
233
+ # # Create a client object. The client can be reused for multiple calls.
234
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
235
+ #
236
+ # # Create a request. To set request fields, pass in keyword arguments.
237
+ # request = Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest.new
238
+ #
239
+ # # Call the create_collector method.
240
+ # result = client.create_collector request
241
+ #
242
+ # # The returned object is of type Gapic::Operation. You can use it to
243
+ # # check the status of an operation, cancel it, or wait for results.
244
+ # # Here is how to wait for a response.
245
+ # result.wait_until_done! timeout: 60
246
+ # if result.response?
247
+ # p result.response
248
+ # else
249
+ # puts "No response received."
250
+ # end
251
+ #
252
+ def create_collector request, options = nil
253
+ raise ::ArgumentError, "request must be provided" if request.nil?
254
+
255
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateCollectorRequest
256
+
257
+ # Converts hash and nil to an options object
258
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
259
+
260
+ # Customize the options with defaults
261
+ call_metadata = @config.rpcs.create_collector.metadata.to_h
262
+
263
+ # Set x-goog-api-client and x-goog-user-project headers
264
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
265
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
266
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
267
+ transports_version_send: [:rest]
268
+
269
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
270
+
271
+ options.apply_defaults timeout: @config.rpcs.create_collector.timeout,
272
+ metadata: call_metadata,
273
+ retry_policy: @config.rpcs.create_collector.retry_policy
274
+
275
+ options.apply_defaults timeout: @config.timeout,
276
+ metadata: @config.metadata,
277
+ retry_policy: @config.retry_policy
278
+
279
+ @rapid_migration_assessment_stub.create_collector request, options do |result, operation|
280
+ result = ::Gapic::Operation.new result, @operations_client, options: options
281
+ yield result, operation if block_given?
282
+ return result
283
+ end
284
+ rescue ::Gapic::Rest::Error => e
285
+ raise ::Google::Cloud::Error.from_error(e)
286
+ end
287
+
288
+ ##
289
+ # Creates an Annotation
290
+ #
291
+ # @overload create_annotation(request, options = nil)
292
+ # Pass arguments to `create_annotation` via a request object, either of type
293
+ # {::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest} or an equivalent Hash.
294
+ #
295
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest, ::Hash]
296
+ # A request object representing the call parameters. Required. To specify no
297
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
298
+ # @param options [::Gapic::CallOptions, ::Hash]
299
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
300
+ #
301
+ # @overload create_annotation(parent: nil, annotation: nil, request_id: nil)
302
+ # Pass arguments to `create_annotation` via keyword arguments. Note that at
303
+ # least one keyword argument is required. To specify no parameters, or to keep all
304
+ # the default parameter values, pass an empty Hash as a request object (see above).
305
+ #
306
+ # @param parent [::String]
307
+ # Required. Name of the parent (project+location).
308
+ # @param annotation [::Google::Cloud::RapidMigrationAssessment::V1::Annotation, ::Hash]
309
+ # Required. The resource being created.
310
+ # @param request_id [::String]
311
+ # Optional. An optional request ID to identify requests.
312
+ # @yield [result, operation] Access the result along with the TransportOperation object
313
+ # @yieldparam result [::Gapic::Operation]
314
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
315
+ #
316
+ # @return [::Gapic::Operation]
317
+ #
318
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
319
+ #
320
+ # @example Basic example
321
+ # require "google/cloud/rapid_migration_assessment/v1"
322
+ #
323
+ # # Create a client object. The client can be reused for multiple calls.
324
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
325
+ #
326
+ # # Create a request. To set request fields, pass in keyword arguments.
327
+ # request = Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest.new
328
+ #
329
+ # # Call the create_annotation method.
330
+ # result = client.create_annotation request
331
+ #
332
+ # # The returned object is of type Gapic::Operation. You can use it to
333
+ # # check the status of an operation, cancel it, or wait for results.
334
+ # # Here is how to wait for a response.
335
+ # result.wait_until_done! timeout: 60
336
+ # if result.response?
337
+ # p result.response
338
+ # else
339
+ # puts "No response received."
340
+ # end
341
+ #
342
+ def create_annotation request, options = nil
343
+ raise ::ArgumentError, "request must be provided" if request.nil?
344
+
345
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::CreateAnnotationRequest
346
+
347
+ # Converts hash and nil to an options object
348
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
349
+
350
+ # Customize the options with defaults
351
+ call_metadata = @config.rpcs.create_annotation.metadata.to_h
352
+
353
+ # Set x-goog-api-client and x-goog-user-project headers
354
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
355
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
356
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
357
+ transports_version_send: [:rest]
358
+
359
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
360
+
361
+ options.apply_defaults timeout: @config.rpcs.create_annotation.timeout,
362
+ metadata: call_metadata,
363
+ retry_policy: @config.rpcs.create_annotation.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @rapid_migration_assessment_stub.create_annotation request, options do |result, operation|
370
+ result = ::Gapic::Operation.new result, @operations_client, options: options
371
+ yield result, operation if block_given?
372
+ return result
373
+ end
374
+ rescue ::Gapic::Rest::Error => e
375
+ raise ::Google::Cloud::Error.from_error(e)
376
+ end
377
+
378
+ ##
379
+ # Gets details of a single Annotation.
380
+ #
381
+ # @overload get_annotation(request, options = nil)
382
+ # Pass arguments to `get_annotation` via a request object, either of type
383
+ # {::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest} or an equivalent Hash.
384
+ #
385
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest, ::Hash]
386
+ # A request object representing the call parameters. Required. To specify no
387
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
388
+ # @param options [::Gapic::CallOptions, ::Hash]
389
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
390
+ #
391
+ # @overload get_annotation(name: nil)
392
+ # Pass arguments to `get_annotation` via keyword arguments. Note that at
393
+ # least one keyword argument is required. To specify no parameters, or to keep all
394
+ # the default parameter values, pass an empty Hash as a request object (see above).
395
+ #
396
+ # @param name [::String]
397
+ # Required. Name of the resource.
398
+ # @yield [result, operation] Access the result along with the TransportOperation object
399
+ # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Annotation]
400
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
401
+ #
402
+ # @return [::Google::Cloud::RapidMigrationAssessment::V1::Annotation]
403
+ #
404
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
405
+ #
406
+ # @example Basic example
407
+ # require "google/cloud/rapid_migration_assessment/v1"
408
+ #
409
+ # # Create a client object. The client can be reused for multiple calls.
410
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
411
+ #
412
+ # # Create a request. To set request fields, pass in keyword arguments.
413
+ # request = Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest.new
414
+ #
415
+ # # Call the get_annotation method.
416
+ # result = client.get_annotation request
417
+ #
418
+ # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Annotation.
419
+ # p result
420
+ #
421
+ def get_annotation request, options = nil
422
+ raise ::ArgumentError, "request must be provided" if request.nil?
423
+
424
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetAnnotationRequest
425
+
426
+ # Converts hash and nil to an options object
427
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
428
+
429
+ # Customize the options with defaults
430
+ call_metadata = @config.rpcs.get_annotation.metadata.to_h
431
+
432
+ # Set x-goog-api-client and x-goog-user-project headers
433
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
434
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
435
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
436
+ transports_version_send: [:rest]
437
+
438
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
+
440
+ options.apply_defaults timeout: @config.rpcs.get_annotation.timeout,
441
+ metadata: call_metadata,
442
+ retry_policy: @config.rpcs.get_annotation.retry_policy
443
+
444
+ options.apply_defaults timeout: @config.timeout,
445
+ metadata: @config.metadata,
446
+ retry_policy: @config.retry_policy
447
+
448
+ @rapid_migration_assessment_stub.get_annotation request, options do |result, operation|
449
+ yield result, operation if block_given?
450
+ return result
451
+ end
452
+ rescue ::Gapic::Rest::Error => e
453
+ raise ::Google::Cloud::Error.from_error(e)
454
+ end
455
+
456
+ ##
457
+ # Lists Collectors in a given project and location.
458
+ #
459
+ # @overload list_collectors(request, options = nil)
460
+ # Pass arguments to `list_collectors` via a request object, either of type
461
+ # {::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest} or an equivalent Hash.
462
+ #
463
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest, ::Hash]
464
+ # A request object representing the call parameters. Required. To specify no
465
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
466
+ # @param options [::Gapic::CallOptions, ::Hash]
467
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
468
+ #
469
+ # @overload list_collectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
470
+ # Pass arguments to `list_collectors` via keyword arguments. Note that at
471
+ # least one keyword argument is required. To specify no parameters, or to keep all
472
+ # the default parameter values, pass an empty Hash as a request object (see above).
473
+ #
474
+ # @param parent [::String]
475
+ # Required. Parent value for ListCollectorsRequest.
476
+ # @param page_size [::Integer]
477
+ # Requested page size. Server may return fewer items than requested.
478
+ # If unspecified, server will pick an appropriate default.
479
+ # @param page_token [::String]
480
+ # A token identifying a page of results the server should return.
481
+ # @param filter [::String]
482
+ # Filtering results.
483
+ # @param order_by [::String]
484
+ # Hint for how to order the results.
485
+ # @yield [result, operation] Access the result along with the TransportOperation object
486
+ # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse]
487
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
488
+ #
489
+ # @return [::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsResponse]
490
+ #
491
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
492
+ #
493
+ # @example Basic example
494
+ # require "google/cloud/rapid_migration_assessment/v1"
495
+ #
496
+ # # Create a client object. The client can be reused for multiple calls.
497
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
498
+ #
499
+ # # Create a request. To set request fields, pass in keyword arguments.
500
+ # request = Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest.new
501
+ #
502
+ # # Call the list_collectors method.
503
+ # result = client.list_collectors request
504
+ #
505
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
506
+ # # over elements, and API calls will be issued to fetch pages as needed.
507
+ # result.each do |item|
508
+ # # Each element is of type ::Google::Cloud::RapidMigrationAssessment::V1::Collector.
509
+ # p item
510
+ # end
511
+ #
512
+ def list_collectors request, options = nil
513
+ raise ::ArgumentError, "request must be provided" if request.nil?
514
+
515
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ListCollectorsRequest
516
+
517
+ # Converts hash and nil to an options object
518
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
519
+
520
+ # Customize the options with defaults
521
+ call_metadata = @config.rpcs.list_collectors.metadata.to_h
522
+
523
+ # Set x-goog-api-client and x-goog-user-project headers
524
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
525
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
526
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
527
+ transports_version_send: [:rest]
528
+
529
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
530
+
531
+ options.apply_defaults timeout: @config.rpcs.list_collectors.timeout,
532
+ metadata: call_metadata,
533
+ retry_policy: @config.rpcs.list_collectors.retry_policy
534
+
535
+ options.apply_defaults timeout: @config.timeout,
536
+ metadata: @config.metadata,
537
+ retry_policy: @config.retry_policy
538
+
539
+ @rapid_migration_assessment_stub.list_collectors request, options do |result, operation|
540
+ yield result, operation if block_given?
541
+ return result
542
+ end
543
+ rescue ::Gapic::Rest::Error => e
544
+ raise ::Google::Cloud::Error.from_error(e)
545
+ end
546
+
547
+ ##
548
+ # Gets details of a single Collector.
549
+ #
550
+ # @overload get_collector(request, options = nil)
551
+ # Pass arguments to `get_collector` via a request object, either of type
552
+ # {::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest} or an equivalent Hash.
553
+ #
554
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest, ::Hash]
555
+ # A request object representing the call parameters. Required. To specify no
556
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
557
+ # @param options [::Gapic::CallOptions, ::Hash]
558
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
559
+ #
560
+ # @overload get_collector(name: nil)
561
+ # Pass arguments to `get_collector` via keyword arguments. Note that at
562
+ # least one keyword argument is required. To specify no parameters, or to keep all
563
+ # the default parameter values, pass an empty Hash as a request object (see above).
564
+ #
565
+ # @param name [::String]
566
+ # Required. Name of the resource.
567
+ # @yield [result, operation] Access the result along with the TransportOperation object
568
+ # @yieldparam result [::Google::Cloud::RapidMigrationAssessment::V1::Collector]
569
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
570
+ #
571
+ # @return [::Google::Cloud::RapidMigrationAssessment::V1::Collector]
572
+ #
573
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
574
+ #
575
+ # @example Basic example
576
+ # require "google/cloud/rapid_migration_assessment/v1"
577
+ #
578
+ # # Create a client object. The client can be reused for multiple calls.
579
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
580
+ #
581
+ # # Create a request. To set request fields, pass in keyword arguments.
582
+ # request = Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest.new
583
+ #
584
+ # # Call the get_collector method.
585
+ # result = client.get_collector request
586
+ #
587
+ # # The returned object is of type Google::Cloud::RapidMigrationAssessment::V1::Collector.
588
+ # p result
589
+ #
590
+ def get_collector request, options = nil
591
+ raise ::ArgumentError, "request must be provided" if request.nil?
592
+
593
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::GetCollectorRequest
594
+
595
+ # Converts hash and nil to an options object
596
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
597
+
598
+ # Customize the options with defaults
599
+ call_metadata = @config.rpcs.get_collector.metadata.to_h
600
+
601
+ # Set x-goog-api-client and x-goog-user-project headers
602
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
603
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
604
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
605
+ transports_version_send: [:rest]
606
+
607
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
608
+
609
+ options.apply_defaults timeout: @config.rpcs.get_collector.timeout,
610
+ metadata: call_metadata,
611
+ retry_policy: @config.rpcs.get_collector.retry_policy
612
+
613
+ options.apply_defaults timeout: @config.timeout,
614
+ metadata: @config.metadata,
615
+ retry_policy: @config.retry_policy
616
+
617
+ @rapid_migration_assessment_stub.get_collector request, options do |result, operation|
618
+ yield result, operation if block_given?
619
+ return result
620
+ end
621
+ rescue ::Gapic::Rest::Error => e
622
+ raise ::Google::Cloud::Error.from_error(e)
623
+ end
624
+
625
+ ##
626
+ # Updates the parameters of a single Collector.
627
+ #
628
+ # @overload update_collector(request, options = nil)
629
+ # Pass arguments to `update_collector` via a request object, either of type
630
+ # {::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest} or an equivalent Hash.
631
+ #
632
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest, ::Hash]
633
+ # A request object representing the call parameters. Required. To specify no
634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
635
+ # @param options [::Gapic::CallOptions, ::Hash]
636
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
637
+ #
638
+ # @overload update_collector(update_mask: nil, collector: nil, request_id: nil)
639
+ # Pass arguments to `update_collector` via keyword arguments. Note that at
640
+ # least one keyword argument is required. To specify no parameters, or to keep all
641
+ # the default parameter values, pass an empty Hash as a request object (see above).
642
+ #
643
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
644
+ # Required. Field mask is used to specify the fields to be overwritten in the
645
+ # Collector resource by the update.
646
+ # The fields specified in the update_mask are relative to the resource, not
647
+ # the full request. A field will be overwritten if it is in the mask. If the
648
+ # user does not provide a mask then all fields will be overwritten.
649
+ # @param collector [::Google::Cloud::RapidMigrationAssessment::V1::Collector, ::Hash]
650
+ # Required. The resource being updated.
651
+ # @param request_id [::String]
652
+ # Optional. An optional request ID to identify requests. Specify a unique
653
+ # request ID so that if you must retry your request, the server will know to
654
+ # ignore the request if it has already been completed. The server will
655
+ # guarantee that for at least 60 minutes since the first request.
656
+ #
657
+ # For example, consider a situation where you make an initial request and
658
+ # the request times out. If you make the request again with the same request
659
+ # ID, the server can check if original operation with the same request ID
660
+ # was received, and if so, will ignore the second request. This prevents
661
+ # clients from accidentally creating duplicate commitments.
662
+ #
663
+ # The request ID must be a valid UUID with the exception that zero UUID is
664
+ # not supported (00000000-0000-0000-0000-000000000000).
665
+ # @yield [result, operation] Access the result along with the TransportOperation object
666
+ # @yieldparam result [::Gapic::Operation]
667
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
668
+ #
669
+ # @return [::Gapic::Operation]
670
+ #
671
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
672
+ #
673
+ # @example Basic example
674
+ # require "google/cloud/rapid_migration_assessment/v1"
675
+ #
676
+ # # Create a client object. The client can be reused for multiple calls.
677
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
678
+ #
679
+ # # Create a request. To set request fields, pass in keyword arguments.
680
+ # request = Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest.new
681
+ #
682
+ # # Call the update_collector method.
683
+ # result = client.update_collector request
684
+ #
685
+ # # The returned object is of type Gapic::Operation. You can use it to
686
+ # # check the status of an operation, cancel it, or wait for results.
687
+ # # Here is how to wait for a response.
688
+ # result.wait_until_done! timeout: 60
689
+ # if result.response?
690
+ # p result.response
691
+ # else
692
+ # puts "No response received."
693
+ # end
694
+ #
695
+ def update_collector request, options = nil
696
+ raise ::ArgumentError, "request must be provided" if request.nil?
697
+
698
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::UpdateCollectorRequest
699
+
700
+ # Converts hash and nil to an options object
701
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
702
+
703
+ # Customize the options with defaults
704
+ call_metadata = @config.rpcs.update_collector.metadata.to_h
705
+
706
+ # Set x-goog-api-client and x-goog-user-project headers
707
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
708
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
709
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
710
+ transports_version_send: [:rest]
711
+
712
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
713
+
714
+ options.apply_defaults timeout: @config.rpcs.update_collector.timeout,
715
+ metadata: call_metadata,
716
+ retry_policy: @config.rpcs.update_collector.retry_policy
717
+
718
+ options.apply_defaults timeout: @config.timeout,
719
+ metadata: @config.metadata,
720
+ retry_policy: @config.retry_policy
721
+
722
+ @rapid_migration_assessment_stub.update_collector request, options do |result, operation|
723
+ result = ::Gapic::Operation.new result, @operations_client, options: options
724
+ yield result, operation if block_given?
725
+ return result
726
+ end
727
+ rescue ::Gapic::Rest::Error => e
728
+ raise ::Google::Cloud::Error.from_error(e)
729
+ end
730
+
731
+ ##
732
+ # Deletes a single Collector - changes state of collector to "Deleting".
733
+ #
734
+ # @overload delete_collector(request, options = nil)
735
+ # Pass arguments to `delete_collector` via a request object, either of type
736
+ # {::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest} or an equivalent Hash.
737
+ #
738
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest, ::Hash]
739
+ # A request object representing the call parameters. Required. To specify no
740
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
741
+ # @param options [::Gapic::CallOptions, ::Hash]
742
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
743
+ #
744
+ # @overload delete_collector(name: nil, request_id: nil)
745
+ # Pass arguments to `delete_collector` via keyword arguments. Note that at
746
+ # least one keyword argument is required. To specify no parameters, or to keep all
747
+ # the default parameter values, pass an empty Hash as a request object (see above).
748
+ #
749
+ # @param name [::String]
750
+ # Required. Name of the resource.
751
+ # @param request_id [::String]
752
+ # Optional. An optional request ID to identify requests. Specify a unique
753
+ # request ID so that if you must retry your request, the server will know to
754
+ # ignore the request if it has already been completed. The server will
755
+ # guarantee that for at least 60 minutes after the first request.
756
+ #
757
+ # For example, consider a situation where you make an initial request and
758
+ # the request times out. If you make the request again with the same request
759
+ # ID, the server can check if original operation with the same request ID
760
+ # was received, and if so, will ignore the second request. This prevents
761
+ # clients from accidentally creating duplicate commitments.
762
+ #
763
+ # The request ID must be a valid UUID with the exception that zero UUID is
764
+ # not supported (00000000-0000-0000-0000-000000000000).
765
+ # @yield [result, operation] Access the result along with the TransportOperation object
766
+ # @yieldparam result [::Gapic::Operation]
767
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
768
+ #
769
+ # @return [::Gapic::Operation]
770
+ #
771
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
772
+ #
773
+ # @example Basic example
774
+ # require "google/cloud/rapid_migration_assessment/v1"
775
+ #
776
+ # # Create a client object. The client can be reused for multiple calls.
777
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
778
+ #
779
+ # # Create a request. To set request fields, pass in keyword arguments.
780
+ # request = Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest.new
781
+ #
782
+ # # Call the delete_collector method.
783
+ # result = client.delete_collector request
784
+ #
785
+ # # The returned object is of type Gapic::Operation. You can use it to
786
+ # # check the status of an operation, cancel it, or wait for results.
787
+ # # Here is how to wait for a response.
788
+ # result.wait_until_done! timeout: 60
789
+ # if result.response?
790
+ # p result.response
791
+ # else
792
+ # puts "No response received."
793
+ # end
794
+ #
795
+ def delete_collector request, options = nil
796
+ raise ::ArgumentError, "request must be provided" if request.nil?
797
+
798
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::DeleteCollectorRequest
799
+
800
+ # Converts hash and nil to an options object
801
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
802
+
803
+ # Customize the options with defaults
804
+ call_metadata = @config.rpcs.delete_collector.metadata.to_h
805
+
806
+ # Set x-goog-api-client and x-goog-user-project headers
807
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
808
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
809
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
810
+ transports_version_send: [:rest]
811
+
812
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
813
+
814
+ options.apply_defaults timeout: @config.rpcs.delete_collector.timeout,
815
+ metadata: call_metadata,
816
+ retry_policy: @config.rpcs.delete_collector.retry_policy
817
+
818
+ options.apply_defaults timeout: @config.timeout,
819
+ metadata: @config.metadata,
820
+ retry_policy: @config.retry_policy
821
+
822
+ @rapid_migration_assessment_stub.delete_collector request, options do |result, operation|
823
+ result = ::Gapic::Operation.new result, @operations_client, options: options
824
+ yield result, operation if block_given?
825
+ return result
826
+ end
827
+ rescue ::Gapic::Rest::Error => e
828
+ raise ::Google::Cloud::Error.from_error(e)
829
+ end
830
+
831
+ ##
832
+ # Resumes the given collector.
833
+ #
834
+ # @overload resume_collector(request, options = nil)
835
+ # Pass arguments to `resume_collector` via a request object, either of type
836
+ # {::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest} or an equivalent Hash.
837
+ #
838
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest, ::Hash]
839
+ # A request object representing the call parameters. Required. To specify no
840
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
841
+ # @param options [::Gapic::CallOptions, ::Hash]
842
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
843
+ #
844
+ # @overload resume_collector(name: nil, request_id: nil)
845
+ # Pass arguments to `resume_collector` via keyword arguments. Note that at
846
+ # least one keyword argument is required. To specify no parameters, or to keep all
847
+ # the default parameter values, pass an empty Hash as a request object (see above).
848
+ #
849
+ # @param name [::String]
850
+ # Required. Name of the resource.
851
+ # @param request_id [::String]
852
+ # Optional. An optional request ID to identify requests. Specify a unique
853
+ # request ID so that if you must retry your request, the server will know to
854
+ # ignore the request if it has already been completed. The server will
855
+ # guarantee that for at least 60 minutes after the first request.
856
+ #
857
+ # For example, consider a situation where you make an initial request and
858
+ # the request times out. If you make the request again with the same request
859
+ # ID, the server can check if original operation with the same request ID
860
+ # was received, and if so, will ignore the second request. This prevents
861
+ # clients from accidentally creating duplicate commitments.
862
+ #
863
+ # The request ID must be a valid UUID with the exception that zero UUID is
864
+ # not supported (00000000-0000-0000-0000-000000000000).
865
+ # @yield [result, operation] Access the result along with the TransportOperation object
866
+ # @yieldparam result [::Gapic::Operation]
867
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
868
+ #
869
+ # @return [::Gapic::Operation]
870
+ #
871
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
872
+ #
873
+ # @example Basic example
874
+ # require "google/cloud/rapid_migration_assessment/v1"
875
+ #
876
+ # # Create a client object. The client can be reused for multiple calls.
877
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
878
+ #
879
+ # # Create a request. To set request fields, pass in keyword arguments.
880
+ # request = Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest.new
881
+ #
882
+ # # Call the resume_collector method.
883
+ # result = client.resume_collector request
884
+ #
885
+ # # The returned object is of type Gapic::Operation. You can use it to
886
+ # # check the status of an operation, cancel it, or wait for results.
887
+ # # Here is how to wait for a response.
888
+ # result.wait_until_done! timeout: 60
889
+ # if result.response?
890
+ # p result.response
891
+ # else
892
+ # puts "No response received."
893
+ # end
894
+ #
895
+ def resume_collector request, options = nil
896
+ raise ::ArgumentError, "request must be provided" if request.nil?
897
+
898
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::ResumeCollectorRequest
899
+
900
+ # Converts hash and nil to an options object
901
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
902
+
903
+ # Customize the options with defaults
904
+ call_metadata = @config.rpcs.resume_collector.metadata.to_h
905
+
906
+ # Set x-goog-api-client and x-goog-user-project headers
907
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
908
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
909
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
910
+ transports_version_send: [:rest]
911
+
912
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
913
+
914
+ options.apply_defaults timeout: @config.rpcs.resume_collector.timeout,
915
+ metadata: call_metadata,
916
+ retry_policy: @config.rpcs.resume_collector.retry_policy
917
+
918
+ options.apply_defaults timeout: @config.timeout,
919
+ metadata: @config.metadata,
920
+ retry_policy: @config.retry_policy
921
+
922
+ @rapid_migration_assessment_stub.resume_collector request, options do |result, operation|
923
+ result = ::Gapic::Operation.new result, @operations_client, options: options
924
+ yield result, operation if block_given?
925
+ return result
926
+ end
927
+ rescue ::Gapic::Rest::Error => e
928
+ raise ::Google::Cloud::Error.from_error(e)
929
+ end
930
+
931
+ ##
932
+ # Registers the given collector.
933
+ #
934
+ # @overload register_collector(request, options = nil)
935
+ # Pass arguments to `register_collector` via a request object, either of type
936
+ # {::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest} or an equivalent Hash.
937
+ #
938
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest, ::Hash]
939
+ # A request object representing the call parameters. Required. To specify no
940
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
941
+ # @param options [::Gapic::CallOptions, ::Hash]
942
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
943
+ #
944
+ # @overload register_collector(name: nil, request_id: nil)
945
+ # Pass arguments to `register_collector` via keyword arguments. Note that at
946
+ # least one keyword argument is required. To specify no parameters, or to keep all
947
+ # the default parameter values, pass an empty Hash as a request object (see above).
948
+ #
949
+ # @param name [::String]
950
+ # Required. Name of the resource.
951
+ # @param request_id [::String]
952
+ # Optional. An optional request ID to identify requests. Specify a unique
953
+ # request ID so that if you must retry your request, the server will know to
954
+ # ignore the request if it has already been completed. The server will
955
+ # guarantee that for at least 60 minutes after the first request.
956
+ #
957
+ # For example, consider a situation where you make an initial request and
958
+ # the request times out. If you make the request again with the same request
959
+ # ID, the server can check if original operation with the same request ID
960
+ # was received, and if so, will ignore the second request. This prevents
961
+ # clients from accidentally creating duplicate commitments.
962
+ #
963
+ # The request ID must be a valid UUID with the exception that zero UUID is
964
+ # not supported (00000000-0000-0000-0000-000000000000).
965
+ # @yield [result, operation] Access the result along with the TransportOperation object
966
+ # @yieldparam result [::Gapic::Operation]
967
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
968
+ #
969
+ # @return [::Gapic::Operation]
970
+ #
971
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
972
+ #
973
+ # @example Basic example
974
+ # require "google/cloud/rapid_migration_assessment/v1"
975
+ #
976
+ # # Create a client object. The client can be reused for multiple calls.
977
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
978
+ #
979
+ # # Create a request. To set request fields, pass in keyword arguments.
980
+ # request = Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest.new
981
+ #
982
+ # # Call the register_collector method.
983
+ # result = client.register_collector request
984
+ #
985
+ # # The returned object is of type Gapic::Operation. You can use it to
986
+ # # check the status of an operation, cancel it, or wait for results.
987
+ # # Here is how to wait for a response.
988
+ # result.wait_until_done! timeout: 60
989
+ # if result.response?
990
+ # p result.response
991
+ # else
992
+ # puts "No response received."
993
+ # end
994
+ #
995
+ def register_collector request, options = nil
996
+ raise ::ArgumentError, "request must be provided" if request.nil?
997
+
998
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::RegisterCollectorRequest
999
+
1000
+ # Converts hash and nil to an options object
1001
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1002
+
1003
+ # Customize the options with defaults
1004
+ call_metadata = @config.rpcs.register_collector.metadata.to_h
1005
+
1006
+ # Set x-goog-api-client and x-goog-user-project headers
1007
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1008
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1009
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
1010
+ transports_version_send: [:rest]
1011
+
1012
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1013
+
1014
+ options.apply_defaults timeout: @config.rpcs.register_collector.timeout,
1015
+ metadata: call_metadata,
1016
+ retry_policy: @config.rpcs.register_collector.retry_policy
1017
+
1018
+ options.apply_defaults timeout: @config.timeout,
1019
+ metadata: @config.metadata,
1020
+ retry_policy: @config.retry_policy
1021
+
1022
+ @rapid_migration_assessment_stub.register_collector request, options do |result, operation|
1023
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1024
+ yield result, operation if block_given?
1025
+ return result
1026
+ end
1027
+ rescue ::Gapic::Rest::Error => e
1028
+ raise ::Google::Cloud::Error.from_error(e)
1029
+ end
1030
+
1031
+ ##
1032
+ # Pauses the given collector.
1033
+ #
1034
+ # @overload pause_collector(request, options = nil)
1035
+ # Pass arguments to `pause_collector` via a request object, either of type
1036
+ # {::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest} or an equivalent Hash.
1037
+ #
1038
+ # @param request [::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest, ::Hash]
1039
+ # A request object representing the call parameters. Required. To specify no
1040
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1041
+ # @param options [::Gapic::CallOptions, ::Hash]
1042
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1043
+ #
1044
+ # @overload pause_collector(name: nil, request_id: nil)
1045
+ # Pass arguments to `pause_collector` via keyword arguments. Note that at
1046
+ # least one keyword argument is required. To specify no parameters, or to keep all
1047
+ # the default parameter values, pass an empty Hash as a request object (see above).
1048
+ #
1049
+ # @param name [::String]
1050
+ # Required. Name of the resource.
1051
+ # @param request_id [::String]
1052
+ # Optional. An optional request ID to identify requests. Specify a unique
1053
+ # request ID so that if you must retry your request, the server will know to
1054
+ # ignore the request if it has already been completed. The server will
1055
+ # guarantee that for at least 60 minutes after the first request.
1056
+ #
1057
+ # For example, consider a situation where you make an initial request and
1058
+ # the request times out. If you make the request again with the same request
1059
+ # ID, the server can check if original operation with the same request ID
1060
+ # was received, and if so, will ignore the second request. This prevents
1061
+ # clients from accidentally creating duplicate commitments.
1062
+ #
1063
+ # The request ID must be a valid UUID with the exception that zero UUID is
1064
+ # not supported (00000000-0000-0000-0000-000000000000).
1065
+ # @yield [result, operation] Access the result along with the TransportOperation object
1066
+ # @yieldparam result [::Gapic::Operation]
1067
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1068
+ #
1069
+ # @return [::Gapic::Operation]
1070
+ #
1071
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1072
+ #
1073
+ # @example Basic example
1074
+ # require "google/cloud/rapid_migration_assessment/v1"
1075
+ #
1076
+ # # Create a client object. The client can be reused for multiple calls.
1077
+ # client = Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new
1078
+ #
1079
+ # # Create a request. To set request fields, pass in keyword arguments.
1080
+ # request = Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest.new
1081
+ #
1082
+ # # Call the pause_collector method.
1083
+ # result = client.pause_collector request
1084
+ #
1085
+ # # The returned object is of type Gapic::Operation. You can use it to
1086
+ # # check the status of an operation, cancel it, or wait for results.
1087
+ # # Here is how to wait for a response.
1088
+ # result.wait_until_done! timeout: 60
1089
+ # if result.response?
1090
+ # p result.response
1091
+ # else
1092
+ # puts "No response received."
1093
+ # end
1094
+ #
1095
+ def pause_collector request, options = nil
1096
+ raise ::ArgumentError, "request must be provided" if request.nil?
1097
+
1098
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RapidMigrationAssessment::V1::PauseCollectorRequest
1099
+
1100
+ # Converts hash and nil to an options object
1101
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1102
+
1103
+ # Customize the options with defaults
1104
+ call_metadata = @config.rpcs.pause_collector.metadata.to_h
1105
+
1106
+ # Set x-goog-api-client and x-goog-user-project headers
1107
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1108
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1109
+ gapic_version: ::Google::Cloud::RapidMigrationAssessment::V1::VERSION,
1110
+ transports_version_send: [:rest]
1111
+
1112
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1113
+
1114
+ options.apply_defaults timeout: @config.rpcs.pause_collector.timeout,
1115
+ metadata: call_metadata,
1116
+ retry_policy: @config.rpcs.pause_collector.retry_policy
1117
+
1118
+ options.apply_defaults timeout: @config.timeout,
1119
+ metadata: @config.metadata,
1120
+ retry_policy: @config.retry_policy
1121
+
1122
+ @rapid_migration_assessment_stub.pause_collector request, options do |result, operation|
1123
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1124
+ yield result, operation if block_given?
1125
+ return result
1126
+ end
1127
+ rescue ::Gapic::Rest::Error => e
1128
+ raise ::Google::Cloud::Error.from_error(e)
1129
+ end
1130
+
1131
+ ##
1132
+ # Configuration class for the RapidMigrationAssessment REST API.
1133
+ #
1134
+ # This class represents the configuration for RapidMigrationAssessment REST,
1135
+ # providing control over timeouts, retry behavior, logging, transport
1136
+ # parameters, and other low-level controls. Certain parameters can also be
1137
+ # applied individually to specific RPCs. See
1138
+ # {::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client::Configuration::Rpcs}
1139
+ # for a list of RPCs that can be configured independently.
1140
+ #
1141
+ # Configuration can be applied globally to all clients, or to a single client
1142
+ # on construction.
1143
+ #
1144
+ # @example
1145
+ #
1146
+ # # Modify the global config, setting the timeout for
1147
+ # # create_collector to 20 seconds,
1148
+ # # and all remaining timeouts to 10 seconds.
1149
+ # ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.configure do |config|
1150
+ # config.timeout = 10.0
1151
+ # config.rpcs.create_collector.timeout = 20.0
1152
+ # end
1153
+ #
1154
+ # # Apply the above configuration only to a new client.
1155
+ # client = ::Google::Cloud::RapidMigrationAssessment::V1::RapidMigrationAssessment::Rest::Client.new do |config|
1156
+ # config.timeout = 10.0
1157
+ # config.rpcs.create_collector.timeout = 20.0
1158
+ # end
1159
+ #
1160
+ # @!attribute [rw] endpoint
1161
+ # The hostname or hostname:port of the service endpoint.
1162
+ # Defaults to `"rapidmigrationassessment.googleapis.com"`.
1163
+ # @return [::String]
1164
+ # @!attribute [rw] credentials
1165
+ # Credentials to send with calls. You may provide any of the following types:
1166
+ # * (`String`) The path to a service account key file in JSON format
1167
+ # * (`Hash`) A service account key as a Hash
1168
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1169
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1170
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1171
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1172
+ # * (`nil`) indicating no credentials
1173
+ # @return [::Object]
1174
+ # @!attribute [rw] scope
1175
+ # The OAuth scopes
1176
+ # @return [::Array<::String>]
1177
+ # @!attribute [rw] lib_name
1178
+ # The library name as recorded in instrumentation and logging
1179
+ # @return [::String]
1180
+ # @!attribute [rw] lib_version
1181
+ # The library version as recorded in instrumentation and logging
1182
+ # @return [::String]
1183
+ # @!attribute [rw] timeout
1184
+ # The call timeout in seconds.
1185
+ # @return [::Numeric]
1186
+ # @!attribute [rw] metadata
1187
+ # Additional headers to be sent with the call.
1188
+ # @return [::Hash{::Symbol=>::String}]
1189
+ # @!attribute [rw] retry_policy
1190
+ # The retry policy. The value is a hash with the following keys:
1191
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1192
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1193
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1194
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1195
+ # trigger a retry.
1196
+ # @return [::Hash]
1197
+ # @!attribute [rw] quota_project
1198
+ # A separate project against which to charge quota.
1199
+ # @return [::String]
1200
+ #
1201
+ class Configuration
1202
+ extend ::Gapic::Config
1203
+
1204
+ DEFAULT_ENDPOINT = "rapidmigrationassessment.googleapis.com"
1205
+
1206
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1207
+ config_attr :credentials, nil do |value|
1208
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1209
+ allowed.any? { |klass| klass === value }
1210
+ end
1211
+ config_attr :scope, nil, ::String, ::Array, nil
1212
+ config_attr :lib_name, nil, ::String, nil
1213
+ config_attr :lib_version, nil, ::String, nil
1214
+ config_attr :timeout, nil, ::Numeric, nil
1215
+ config_attr :metadata, nil, ::Hash, nil
1216
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1217
+ config_attr :quota_project, nil, ::String, nil
1218
+
1219
+ # @private
1220
+ # Overrides for http bindings for the RPCs of this service
1221
+ # are only used when this service is used as mixin, and only
1222
+ # by the host service.
1223
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1224
+ config_attr :bindings_override, {}, ::Hash, nil
1225
+
1226
+ # @private
1227
+ def initialize parent_config = nil
1228
+ @parent_config = parent_config unless parent_config.nil?
1229
+
1230
+ yield self if block_given?
1231
+ end
1232
+
1233
+ ##
1234
+ # Configurations for individual RPCs
1235
+ # @return [Rpcs]
1236
+ #
1237
+ def rpcs
1238
+ @rpcs ||= begin
1239
+ parent_rpcs = nil
1240
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1241
+ Rpcs.new parent_rpcs
1242
+ end
1243
+ end
1244
+
1245
+ ##
1246
+ # Configuration RPC class for the RapidMigrationAssessment API.
1247
+ #
1248
+ # Includes fields providing the configuration for each RPC in this service.
1249
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1250
+ # the following configuration fields:
1251
+ #
1252
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1253
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1254
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1255
+ # include the following keys:
1256
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1257
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1258
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1259
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1260
+ # trigger a retry.
1261
+ #
1262
+ class Rpcs
1263
+ ##
1264
+ # RPC-specific configuration for `create_collector`
1265
+ # @return [::Gapic::Config::Method]
1266
+ #
1267
+ attr_reader :create_collector
1268
+ ##
1269
+ # RPC-specific configuration for `create_annotation`
1270
+ # @return [::Gapic::Config::Method]
1271
+ #
1272
+ attr_reader :create_annotation
1273
+ ##
1274
+ # RPC-specific configuration for `get_annotation`
1275
+ # @return [::Gapic::Config::Method]
1276
+ #
1277
+ attr_reader :get_annotation
1278
+ ##
1279
+ # RPC-specific configuration for `list_collectors`
1280
+ # @return [::Gapic::Config::Method]
1281
+ #
1282
+ attr_reader :list_collectors
1283
+ ##
1284
+ # RPC-specific configuration for `get_collector`
1285
+ # @return [::Gapic::Config::Method]
1286
+ #
1287
+ attr_reader :get_collector
1288
+ ##
1289
+ # RPC-specific configuration for `update_collector`
1290
+ # @return [::Gapic::Config::Method]
1291
+ #
1292
+ attr_reader :update_collector
1293
+ ##
1294
+ # RPC-specific configuration for `delete_collector`
1295
+ # @return [::Gapic::Config::Method]
1296
+ #
1297
+ attr_reader :delete_collector
1298
+ ##
1299
+ # RPC-specific configuration for `resume_collector`
1300
+ # @return [::Gapic::Config::Method]
1301
+ #
1302
+ attr_reader :resume_collector
1303
+ ##
1304
+ # RPC-specific configuration for `register_collector`
1305
+ # @return [::Gapic::Config::Method]
1306
+ #
1307
+ attr_reader :register_collector
1308
+ ##
1309
+ # RPC-specific configuration for `pause_collector`
1310
+ # @return [::Gapic::Config::Method]
1311
+ #
1312
+ attr_reader :pause_collector
1313
+
1314
+ # @private
1315
+ def initialize parent_rpcs = nil
1316
+ create_collector_config = parent_rpcs.create_collector if parent_rpcs.respond_to? :create_collector
1317
+ @create_collector = ::Gapic::Config::Method.new create_collector_config
1318
+ create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation
1319
+ @create_annotation = ::Gapic::Config::Method.new create_annotation_config
1320
+ get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation
1321
+ @get_annotation = ::Gapic::Config::Method.new get_annotation_config
1322
+ list_collectors_config = parent_rpcs.list_collectors if parent_rpcs.respond_to? :list_collectors
1323
+ @list_collectors = ::Gapic::Config::Method.new list_collectors_config
1324
+ get_collector_config = parent_rpcs.get_collector if parent_rpcs.respond_to? :get_collector
1325
+ @get_collector = ::Gapic::Config::Method.new get_collector_config
1326
+ update_collector_config = parent_rpcs.update_collector if parent_rpcs.respond_to? :update_collector
1327
+ @update_collector = ::Gapic::Config::Method.new update_collector_config
1328
+ delete_collector_config = parent_rpcs.delete_collector if parent_rpcs.respond_to? :delete_collector
1329
+ @delete_collector = ::Gapic::Config::Method.new delete_collector_config
1330
+ resume_collector_config = parent_rpcs.resume_collector if parent_rpcs.respond_to? :resume_collector
1331
+ @resume_collector = ::Gapic::Config::Method.new resume_collector_config
1332
+ register_collector_config = parent_rpcs.register_collector if parent_rpcs.respond_to? :register_collector
1333
+ @register_collector = ::Gapic::Config::Method.new register_collector_config
1334
+ pause_collector_config = parent_rpcs.pause_collector if parent_rpcs.respond_to? :pause_collector
1335
+ @pause_collector = ::Gapic::Config::Method.new pause_collector_config
1336
+
1337
+ yield self if block_given?
1338
+ end
1339
+ end
1340
+ end
1341
+ end
1342
+ end
1343
+ end
1344
+ end
1345
+ end
1346
+ end
1347
+ end