google-cloud-assured_workloads-v1beta1 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,534 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/assuredworkloads/v1beta1/assuredworkloads_service_pb"
21
+ require "google/cloud/assured_workloads/v1beta1/assured_workloads_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module AssuredWorkloads
26
+ module V1beta1
27
+ module AssuredWorkloadsService
28
+ module Rest
29
+ ##
30
+ # REST client for the AssuredWorkloadsService service.
31
+ #
32
+ # Service to manage AssuredWorkloads.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :assured_workloads_service_stub
39
+
40
+ ##
41
+ # Configure the AssuredWorkloadsService Client class.
42
+ #
43
+ # See {::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all AssuredWorkloadsService clients
49
+ # ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "AssuredWorkloads", "V1beta1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_workload.timeout = 60.0
70
+
71
+ default_config.rpcs.delete_workload.timeout = 60.0
72
+ default_config.rpcs.delete_workload.retry_policy = {
73
+ initial_delay: 0.2, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the AssuredWorkloadsService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # Create a new AssuredWorkloadsService REST client object.
104
+ #
105
+ # @example
106
+ #
107
+ # # Create a client using the default configuration
108
+ # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client.new
109
+ #
110
+ # # Create a client using a custom configuration
111
+ # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client.new do |config|
112
+ # config.timeout = 10.0
113
+ # end
114
+ #
115
+ # @yield [config] Configure the AssuredWorkloadsService client.
116
+ # @yieldparam config [Client::Configuration]
117
+ #
118
+ def initialize
119
+ # Create the configuration object
120
+ @config = Configuration.new Client.configure
121
+
122
+ # Yield the configuration if needed
123
+ yield @config if block_given?
124
+
125
+ # Create credentials
126
+ credentials = @config.credentials
127
+ # Use self-signed JWT if the endpoint is unchanged from default,
128
+ # but only if the default endpoint does not have a region prefix.
129
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
130
+ !@config.endpoint.split(".").first.include?("-")
131
+ credentials ||= Credentials.default scope: @config.scope,
132
+ enable_self_signed_jwt: enable_self_signed_jwt
133
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
134
+ credentials = Credentials.new credentials, scope: @config.scope
135
+ end
136
+
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @operations_client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Operations.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ end
145
+
146
+ @assured_workloads_service_stub = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
147
+ end
148
+
149
+ ##
150
+ # Get the associated client for long-running operations.
151
+ #
152
+ # @return [::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Operations]
153
+ #
154
+ attr_reader :operations_client
155
+
156
+ # Service calls
157
+
158
+ ##
159
+ # Creates Assured Workload.
160
+ #
161
+ # @overload create_workload(request, options = nil)
162
+ # Pass arguments to `create_workload` via a request object, either of type
163
+ # {::Google::Cloud::AssuredWorkloads::V1beta1::CreateWorkloadRequest} or an equivalent Hash.
164
+ #
165
+ # @param request [::Google::Cloud::AssuredWorkloads::V1beta1::CreateWorkloadRequest, ::Hash]
166
+ # A request object representing the call parameters. Required. To specify no
167
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
168
+ # @param options [::Gapic::CallOptions, ::Hash]
169
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
170
+ #
171
+ # @overload create_workload(parent: nil, workload: nil, external_id: nil)
172
+ # Pass arguments to `create_workload` via keyword arguments. Note that at
173
+ # least one keyword argument is required. To specify no parameters, or to keep all
174
+ # the default parameter values, pass an empty Hash as a request object (see above).
175
+ #
176
+ # @param parent [::String]
177
+ # Required. The resource name of the new Workload's parent.
178
+ # Must be of the form `organizations/{org_id}/locations/{location_id}`.
179
+ # @param workload [::Google::Cloud::AssuredWorkloads::V1beta1::Workload, ::Hash]
180
+ # Required. Assured Workload to create
181
+ # @param external_id [::String]
182
+ # Optional. A identifier associated with the workload and underlying projects which
183
+ # allows for the break down of billing costs for a workload. The value
184
+ # provided for the identifier will add a label to the workload and contained
185
+ # projects with the identifier as the value.
186
+ # @yield [result, operation] Access the result along with the TransportOperation object
187
+ # @yieldparam result [::Gapic::Operation]
188
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
189
+ #
190
+ # @return [::Gapic::Operation]
191
+ #
192
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
193
+ def create_workload request, options = nil
194
+ raise ::ArgumentError, "request must be provided" if request.nil?
195
+
196
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AssuredWorkloads::V1beta1::CreateWorkloadRequest
197
+
198
+ # Converts hash and nil to an options object
199
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
200
+
201
+ # Customize the options with defaults
202
+ call_metadata = @config.rpcs.create_workload.metadata.to_h
203
+
204
+ # Set x-goog-api-client and x-goog-user-project headers
205
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
206
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
207
+ gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION,
208
+ transports_version_send: [:rest]
209
+
210
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
211
+
212
+ options.apply_defaults timeout: @config.rpcs.create_workload.timeout,
213
+ metadata: call_metadata,
214
+ retry_policy: @config.rpcs.create_workload.retry_policy
215
+
216
+ options.apply_defaults timeout: @config.timeout,
217
+ metadata: @config.metadata,
218
+ retry_policy: @config.retry_policy
219
+
220
+ @assured_workloads_service_stub.create_workload request, options do |result, operation|
221
+ result = ::Gapic::Operation.new result, @operations_client, options: options
222
+ yield result, operation if block_given?
223
+ return result
224
+ end
225
+ rescue ::Gapic::Rest::Error => e
226
+ raise ::Google::Cloud::Error.from_error(e)
227
+ end
228
+
229
+ ##
230
+ # Restrict the list of resources allowed in the Workload environment.
231
+ # The current list of allowed products can be found at
232
+ # https://cloud.google.com/assured-workloads/docs/supported-products
233
+ # In addition to assuredworkloads.workload.update permission, the user should
234
+ # also have orgpolicy.policy.set permission on the folder resource
235
+ # to use this functionality.
236
+ #
237
+ # @overload restrict_allowed_resources(request, options = nil)
238
+ # Pass arguments to `restrict_allowed_resources` via a request object, either of type
239
+ # {::Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesRequest} or an equivalent Hash.
240
+ #
241
+ # @param request [::Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesRequest, ::Hash]
242
+ # A request object representing the call parameters. Required. To specify no
243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
244
+ # @param options [::Gapic::CallOptions, ::Hash]
245
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
246
+ #
247
+ # @overload restrict_allowed_resources(name: nil, restriction_type: nil)
248
+ # Pass arguments to `restrict_allowed_resources` via keyword arguments. Note that at
249
+ # least one keyword argument is required. To specify no parameters, or to keep all
250
+ # the default parameter values, pass an empty Hash as a request object (see above).
251
+ #
252
+ # @param name [::String]
253
+ # Required. The resource name of the Workload. This is the workloads's
254
+ # relative path in the API, formatted as
255
+ # "organizations/\\{organization_id}/locations/\\{location_id}/workloads/\\{workload_id}".
256
+ # For example,
257
+ # "organizations/123/locations/us-east1/workloads/assured-workload-1".
258
+ # @param restriction_type [::Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesRequest::RestrictionType]
259
+ # Required. The type of restriction for using gcp products in the Workload environment.
260
+ # @yield [result, operation] Access the result along with the TransportOperation object
261
+ # @yieldparam result [::Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesResponse]
262
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
263
+ #
264
+ # @return [::Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesResponse]
265
+ #
266
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
267
+ def restrict_allowed_resources request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ call_metadata = @config.rpcs.restrict_allowed_resources.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION,
282
+ transports_version_send: [:rest]
283
+
284
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ options.apply_defaults timeout: @config.rpcs.restrict_allowed_resources.timeout,
287
+ metadata: call_metadata,
288
+ retry_policy: @config.rpcs.restrict_allowed_resources.retry_policy
289
+
290
+ options.apply_defaults timeout: @config.timeout,
291
+ metadata: @config.metadata,
292
+ retry_policy: @config.retry_policy
293
+
294
+ @assured_workloads_service_stub.restrict_allowed_resources request, options do |result, operation|
295
+ yield result, operation if block_given?
296
+ return result
297
+ end
298
+ rescue ::Gapic::Rest::Error => e
299
+ raise ::Google::Cloud::Error.from_error(e)
300
+ end
301
+
302
+ ##
303
+ # Deletes the workload. Make sure that workload's direct children are already
304
+ # in a deleted state, otherwise the request will fail with a
305
+ # FAILED_PRECONDITION error.
306
+ # In addition to assuredworkloads.workload.delete permission, the user should
307
+ # also have orgpolicy.policy.set permission on the deleted folder to remove
308
+ # Assured Workloads OrgPolicies.
309
+ #
310
+ # @overload delete_workload(request, options = nil)
311
+ # Pass arguments to `delete_workload` via a request object, either of type
312
+ # {::Google::Cloud::AssuredWorkloads::V1beta1::DeleteWorkloadRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::AssuredWorkloads::V1beta1::DeleteWorkloadRequest, ::Hash]
315
+ # A request object representing the call parameters. Required. To specify no
316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
317
+ # @param options [::Gapic::CallOptions, ::Hash]
318
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
319
+ #
320
+ # @overload delete_workload(name: nil, etag: nil)
321
+ # Pass arguments to `delete_workload` via keyword arguments. Note that at
322
+ # least one keyword argument is required. To specify no parameters, or to keep all
323
+ # the default parameter values, pass an empty Hash as a request object (see above).
324
+ #
325
+ # @param name [::String]
326
+ # Required. The `name` field is used to identify the workload.
327
+ # Format:
328
+ # organizations/\\{org_id}/locations/\\{location_id}/workloads/\\{workload_id}
329
+ # @param etag [::String]
330
+ # Optional. The etag of the workload.
331
+ # If this is provided, it must match the server's etag.
332
+ # @yield [result, operation] Access the result along with the TransportOperation object
333
+ # @yieldparam result [::Google::Protobuf::Empty]
334
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
335
+ #
336
+ # @return [::Google::Protobuf::Empty]
337
+ #
338
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
339
+ def delete_workload request, options = nil
340
+ raise ::ArgumentError, "request must be provided" if request.nil?
341
+
342
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AssuredWorkloads::V1beta1::DeleteWorkloadRequest
343
+
344
+ # Converts hash and nil to an options object
345
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
346
+
347
+ # Customize the options with defaults
348
+ call_metadata = @config.rpcs.delete_workload.metadata.to_h
349
+
350
+ # Set x-goog-api-client and x-goog-user-project headers
351
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
352
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
353
+ gapic_version: ::Google::Cloud::AssuredWorkloads::V1beta1::VERSION,
354
+ transports_version_send: [:rest]
355
+
356
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ options.apply_defaults timeout: @config.rpcs.delete_workload.timeout,
359
+ metadata: call_metadata,
360
+ retry_policy: @config.rpcs.delete_workload.retry_policy
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @assured_workloads_service_stub.delete_workload request, options do |result, operation|
367
+ yield result, operation if block_given?
368
+ return result
369
+ end
370
+ rescue ::Gapic::Rest::Error => e
371
+ raise ::Google::Cloud::Error.from_error(e)
372
+ end
373
+
374
+ ##
375
+ # Configuration class for the AssuredWorkloadsService REST API.
376
+ #
377
+ # This class represents the configuration for AssuredWorkloadsService REST,
378
+ # providing control over timeouts, retry behavior, logging, transport
379
+ # parameters, and other low-level controls. Certain parameters can also be
380
+ # applied individually to specific RPCs. See
381
+ # {::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client::Configuration::Rpcs}
382
+ # for a list of RPCs that can be configured independently.
383
+ #
384
+ # Configuration can be applied globally to all clients, or to a single client
385
+ # on construction.
386
+ #
387
+ # @example
388
+ #
389
+ # # Modify the global config, setting the timeout for
390
+ # # create_workload to 20 seconds,
391
+ # # and all remaining timeouts to 10 seconds.
392
+ # ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client.configure do |config|
393
+ # config.timeout = 10.0
394
+ # config.rpcs.create_workload.timeout = 20.0
395
+ # end
396
+ #
397
+ # # Apply the above configuration only to a new client.
398
+ # client = ::Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Rest::Client.new do |config|
399
+ # config.timeout = 10.0
400
+ # config.rpcs.create_workload.timeout = 20.0
401
+ # end
402
+ #
403
+ # @!attribute [rw] endpoint
404
+ # The hostname or hostname:port of the service endpoint.
405
+ # Defaults to `"assuredworkloads.googleapis.com"`.
406
+ # @return [::String]
407
+ # @!attribute [rw] credentials
408
+ # Credentials to send with calls. You may provide any of the following types:
409
+ # * (`String`) The path to a service account key file in JSON format
410
+ # * (`Hash`) A service account key as a Hash
411
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
412
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
413
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
414
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
415
+ # * (`nil`) indicating no credentials
416
+ # @return [::Object]
417
+ # @!attribute [rw] scope
418
+ # The OAuth scopes
419
+ # @return [::Array<::String>]
420
+ # @!attribute [rw] lib_name
421
+ # The library name as recorded in instrumentation and logging
422
+ # @return [::String]
423
+ # @!attribute [rw] lib_version
424
+ # The library version as recorded in instrumentation and logging
425
+ # @return [::String]
426
+ # @!attribute [rw] timeout
427
+ # The call timeout in seconds.
428
+ # @return [::Numeric]
429
+ # @!attribute [rw] metadata
430
+ # Additional headers to be sent with the call.
431
+ # @return [::Hash{::Symbol=>::String}]
432
+ # @!attribute [rw] retry_policy
433
+ # The retry policy. The value is a hash with the following keys:
434
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
435
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
436
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
437
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
438
+ # trigger a retry.
439
+ # @return [::Hash]
440
+ # @!attribute [rw] quota_project
441
+ # A separate project against which to charge quota.
442
+ # @return [::String]
443
+ #
444
+ class Configuration
445
+ extend ::Gapic::Config
446
+
447
+ DEFAULT_ENDPOINT = "assuredworkloads.googleapis.com"
448
+
449
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
450
+ config_attr :credentials, nil do |value|
451
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
452
+ allowed.any? { |klass| klass === value }
453
+ end
454
+ config_attr :scope, nil, ::String, ::Array, nil
455
+ config_attr :lib_name, nil, ::String, nil
456
+ config_attr :lib_version, nil, ::String, nil
457
+ config_attr :timeout, nil, ::Numeric, nil
458
+ config_attr :metadata, nil, ::Hash, nil
459
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
460
+ config_attr :quota_project, nil, ::String, nil
461
+
462
+ # @private
463
+ def initialize parent_config = nil
464
+ @parent_config = parent_config unless parent_config.nil?
465
+
466
+ yield self if block_given?
467
+ end
468
+
469
+ ##
470
+ # Configurations for individual RPCs
471
+ # @return [Rpcs]
472
+ #
473
+ def rpcs
474
+ @rpcs ||= begin
475
+ parent_rpcs = nil
476
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
477
+ Rpcs.new parent_rpcs
478
+ end
479
+ end
480
+
481
+ ##
482
+ # Configuration RPC class for the AssuredWorkloadsService API.
483
+ #
484
+ # Includes fields providing the configuration for each RPC in this service.
485
+ # Each configuration object is of type `Gapic::Config::Method` and includes
486
+ # the following configuration fields:
487
+ #
488
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
489
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
490
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
491
+ # include the following keys:
492
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
493
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
494
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
495
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
496
+ # trigger a retry.
497
+ #
498
+ class Rpcs
499
+ ##
500
+ # RPC-specific configuration for `create_workload`
501
+ # @return [::Gapic::Config::Method]
502
+ #
503
+ attr_reader :create_workload
504
+ ##
505
+ # RPC-specific configuration for `restrict_allowed_resources`
506
+ # @return [::Gapic::Config::Method]
507
+ #
508
+ attr_reader :restrict_allowed_resources
509
+ ##
510
+ # RPC-specific configuration for `delete_workload`
511
+ # @return [::Gapic::Config::Method]
512
+ #
513
+ attr_reader :delete_workload
514
+
515
+ # @private
516
+ def initialize parent_rpcs = nil
517
+ create_workload_config = parent_rpcs.create_workload if parent_rpcs.respond_to? :create_workload
518
+ @create_workload = ::Gapic::Config::Method.new create_workload_config
519
+ restrict_allowed_resources_config = parent_rpcs.restrict_allowed_resources if parent_rpcs.respond_to? :restrict_allowed_resources
520
+ @restrict_allowed_resources = ::Gapic::Config::Method.new restrict_allowed_resources_config
521
+ delete_workload_config = parent_rpcs.delete_workload if parent_rpcs.respond_to? :delete_workload
522
+ @delete_workload = ::Gapic::Config::Method.new delete_workload_config
523
+
524
+ yield self if block_given?
525
+ end
526
+ end
527
+ end
528
+ end
529
+ end
530
+ end
531
+ end
532
+ end
533
+ end
534
+ end