google-cloud-app_hub-v1 0.a → 0.1.1

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