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