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