google-cloud-os_config-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/os_config/v1"
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/os_config/v1/os_config_service"
20
+ require "google/cloud/os_config/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module OsConfig
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/os_config/v1"
29
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new
30
+ #
31
+ module V1
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/os_config/v1/version"
24
+
25
+ require "google/cloud/os_config/v1/os_config_service/credentials"
26
+ require "google/cloud/os_config/v1/os_config_service/paths"
27
+ require "google/cloud/os_config/v1/os_config_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module OsConfig
32
+ module V1
33
+ ##
34
+ # OS Config API
35
+ #
36
+ # The OS Config service is a server-side component that you can use to
37
+ # manage package installations and patch jobs for virtual machine instances.
38
+ #
39
+ # To load this service and instantiate a client:
40
+ #
41
+ # require "google/cloud/os_config/v1/os_config_service"
42
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new
43
+ #
44
+ module OsConfigService
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "os_config_service", "helpers.rb"
52
+ require "google/cloud/os_config/v1/os_config_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,1021 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/osconfig/v1/osconfig_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module OsConfig
25
+ module V1
26
+ module OsConfigService
27
+ ##
28
+ # Client for the OsConfigService service.
29
+ #
30
+ # OS Config API
31
+ #
32
+ # The OS Config service is a server-side component that you can use to
33
+ # manage package installations and patch jobs for virtual machine instances.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :os_config_service_stub
40
+
41
+ ##
42
+ # Configure the OsConfigService Client class.
43
+ #
44
+ # See {::Google::Cloud::OsConfig::V1::OsConfigService::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # ## Example
48
+ #
49
+ # To modify the configuration for all OsConfigService clients:
50
+ #
51
+ # ::Google::Cloud::OsConfig::V1::OsConfigService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "OsConfig", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const&.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 60.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 1.0,
74
+ max_delay: 60.0,
75
+ multiplier: 1.3,
76
+ retry_codes: ["UNAVAILABLE"]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the OsConfigService Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::OsConfig::V1::OsConfigService::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # Create a new OsConfigService client object.
107
+ #
108
+ # ## Examples
109
+ #
110
+ # To create a new OsConfigService client with the default
111
+ # configuration:
112
+ #
113
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new
114
+ #
115
+ # To create a new OsConfigService client with a custom
116
+ # configuration:
117
+ #
118
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the OsConfigService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/osconfig/v1/osconfig_service_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ credentials ||= Credentials.default scope: @config.scope
141
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
142
+ credentials = Credentials.new credentials, scope: @config.scope
143
+ end
144
+ @quota_project_id = @config.quota_project
145
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
146
+
147
+ @os_config_service_stub = ::Gapic::ServiceStub.new(
148
+ ::Google::Cloud::OsConfig::V1::OsConfigService::Stub,
149
+ credentials: credentials,
150
+ endpoint: @config.endpoint,
151
+ channel_args: @config.channel_args,
152
+ interceptors: @config.interceptors
153
+ )
154
+ end
155
+
156
+ # Service calls
157
+
158
+ ##
159
+ # Patch VM instances by creating and running a patch job.
160
+ #
161
+ # @overload execute_patch_job(request, options = nil)
162
+ # Pass arguments to `execute_patch_job` via a request object, either of type
163
+ # {::Google::Cloud::OsConfig::V1::ExecutePatchJobRequest} or an equivalent Hash.
164
+ #
165
+ # @param request [::Google::Cloud::OsConfig::V1::ExecutePatchJobRequest, ::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 execute_patch_job(parent: nil, description: nil, instance_filter: nil, patch_config: nil, duration: nil, dry_run: nil, display_name: nil)
172
+ # Pass arguments to `execute_patch_job` 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 project in which to run this patch in the form `projects/*`
178
+ # @param description [::String]
179
+ # Description of the patch job. Length of the description is limited
180
+ # to 1024 characters.
181
+ # @param instance_filter [::Google::Cloud::OsConfig::V1::PatchInstanceFilter, ::Hash]
182
+ # Required. Instances to patch, either explicitly or filtered by some criteria such
183
+ # as zone or labels.
184
+ # @param patch_config [::Google::Cloud::OsConfig::V1::PatchConfig, ::Hash]
185
+ # Patch configuration being applied. If omitted, instances are
186
+ # patched using the default configurations.
187
+ # @param duration [::Google::Protobuf::Duration, ::Hash]
188
+ # Duration of the patch job. After the duration ends, the patch job
189
+ # times out.
190
+ # @param dry_run [::Boolean]
191
+ # If this patch is a dry-run only, instances are contacted but
192
+ # will do nothing.
193
+ # @param display_name [::String]
194
+ # Display name for this patch job. This does not have to be unique.
195
+ #
196
+ # @yield [response, operation] Access the result along with the RPC operation
197
+ # @yieldparam response [::Google::Cloud::OsConfig::V1::PatchJob]
198
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
199
+ #
200
+ # @return [::Google::Cloud::OsConfig::V1::PatchJob]
201
+ #
202
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
203
+ #
204
+ def execute_patch_job request, options = nil
205
+ raise ::ArgumentError, "request must be provided" if request.nil?
206
+
207
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ExecutePatchJobRequest
208
+
209
+ # Converts hash and nil to an options object
210
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
211
+
212
+ # Customize the options with defaults
213
+ metadata = @config.rpcs.execute_patch_job.metadata.to_h
214
+
215
+ # Set x-goog-api-client and x-goog-user-project headers
216
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
217
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
218
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
219
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
220
+
221
+ header_params = {
222
+ "parent" => request.parent
223
+ }
224
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
225
+ metadata[:"x-goog-request-params"] ||= request_params_header
226
+
227
+ options.apply_defaults timeout: @config.rpcs.execute_patch_job.timeout,
228
+ metadata: metadata,
229
+ retry_policy: @config.rpcs.execute_patch_job.retry_policy
230
+ options.apply_defaults metadata: @config.metadata,
231
+ retry_policy: @config.retry_policy
232
+
233
+ @os_config_service_stub.call_rpc :execute_patch_job, request, options: options do |response, operation|
234
+ yield response, operation if block_given?
235
+ return response
236
+ end
237
+ rescue ::GRPC::BadStatus => e
238
+ raise ::Google::Cloud::Error.from_error(e)
239
+ end
240
+
241
+ ##
242
+ # Get the patch job. This can be used to track the progress of an
243
+ # ongoing patch job or review the details of completed jobs.
244
+ #
245
+ # @overload get_patch_job(request, options = nil)
246
+ # Pass arguments to `get_patch_job` via a request object, either of type
247
+ # {::Google::Cloud::OsConfig::V1::GetPatchJobRequest} or an equivalent Hash.
248
+ #
249
+ # @param request [::Google::Cloud::OsConfig::V1::GetPatchJobRequest, ::Hash]
250
+ # A request object representing the call parameters. Required. To specify no
251
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
252
+ # @param options [::Gapic::CallOptions, ::Hash]
253
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
254
+ #
255
+ # @overload get_patch_job(name: nil)
256
+ # Pass arguments to `get_patch_job` via keyword arguments. Note that at
257
+ # least one keyword argument is required. To specify no parameters, or to keep all
258
+ # the default parameter values, pass an empty Hash as a request object (see above).
259
+ #
260
+ # @param name [::String]
261
+ # Required. Name of the patch in the form `projects/*/patchJobs/*`
262
+ #
263
+ # @yield [response, operation] Access the result along with the RPC operation
264
+ # @yieldparam response [::Google::Cloud::OsConfig::V1::PatchJob]
265
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
266
+ #
267
+ # @return [::Google::Cloud::OsConfig::V1::PatchJob]
268
+ #
269
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
270
+ #
271
+ def get_patch_job request, options = nil
272
+ raise ::ArgumentError, "request must be provided" if request.nil?
273
+
274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetPatchJobRequest
275
+
276
+ # Converts hash and nil to an options object
277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
278
+
279
+ # Customize the options with defaults
280
+ metadata = @config.rpcs.get_patch_job.metadata.to_h
281
+
282
+ # Set x-goog-api-client and x-goog-user-project headers
283
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
285
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
286
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
+
288
+ header_params = {
289
+ "name" => request.name
290
+ }
291
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
292
+ metadata[:"x-goog-request-params"] ||= request_params_header
293
+
294
+ options.apply_defaults timeout: @config.rpcs.get_patch_job.timeout,
295
+ metadata: metadata,
296
+ retry_policy: @config.rpcs.get_patch_job.retry_policy
297
+ options.apply_defaults metadata: @config.metadata,
298
+ retry_policy: @config.retry_policy
299
+
300
+ @os_config_service_stub.call_rpc :get_patch_job, request, options: options do |response, operation|
301
+ yield response, operation if block_given?
302
+ return response
303
+ end
304
+ rescue ::GRPC::BadStatus => e
305
+ raise ::Google::Cloud::Error.from_error(e)
306
+ end
307
+
308
+ ##
309
+ # Cancel a patch job. The patch job must be active. Canceled patch jobs
310
+ # cannot be restarted.
311
+ #
312
+ # @overload cancel_patch_job(request, options = nil)
313
+ # Pass arguments to `cancel_patch_job` via a request object, either of type
314
+ # {::Google::Cloud::OsConfig::V1::CancelPatchJobRequest} or an equivalent Hash.
315
+ #
316
+ # @param request [::Google::Cloud::OsConfig::V1::CancelPatchJobRequest, ::Hash]
317
+ # A request object representing the call parameters. Required. To specify no
318
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
319
+ # @param options [::Gapic::CallOptions, ::Hash]
320
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
321
+ #
322
+ # @overload cancel_patch_job(name: nil)
323
+ # Pass arguments to `cancel_patch_job` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param name [::String]
328
+ # Required. Name of the patch in the form `projects/*/patchJobs/*`
329
+ #
330
+ # @yield [response, operation] Access the result along with the RPC operation
331
+ # @yieldparam response [::Google::Cloud::OsConfig::V1::PatchJob]
332
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
333
+ #
334
+ # @return [::Google::Cloud::OsConfig::V1::PatchJob]
335
+ #
336
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
337
+ #
338
+ def cancel_patch_job request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::CancelPatchJobRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ metadata = @config.rpcs.cancel_patch_job.metadata.to_h
348
+
349
+ # Set x-goog-api-client and x-goog-user-project headers
350
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
353
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
354
+
355
+ header_params = {
356
+ "name" => request.name
357
+ }
358
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
359
+ metadata[:"x-goog-request-params"] ||= request_params_header
360
+
361
+ options.apply_defaults timeout: @config.rpcs.cancel_patch_job.timeout,
362
+ metadata: metadata,
363
+ retry_policy: @config.rpcs.cancel_patch_job.retry_policy
364
+ options.apply_defaults metadata: @config.metadata,
365
+ retry_policy: @config.retry_policy
366
+
367
+ @os_config_service_stub.call_rpc :cancel_patch_job, request, options: options do |response, operation|
368
+ yield response, operation if block_given?
369
+ return response
370
+ end
371
+ rescue ::GRPC::BadStatus => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Get a list of patch jobs.
377
+ #
378
+ # @overload list_patch_jobs(request, options = nil)
379
+ # Pass arguments to `list_patch_jobs` via a request object, either of type
380
+ # {::Google::Cloud::OsConfig::V1::ListPatchJobsRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::OsConfig::V1::ListPatchJobsRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
387
+ #
388
+ # @overload list_patch_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil)
389
+ # Pass arguments to `list_patch_jobs` via keyword arguments. Note that at
390
+ # least one keyword argument is required. To specify no parameters, or to keep all
391
+ # the default parameter values, pass an empty Hash as a request object (see above).
392
+ #
393
+ # @param parent [::String]
394
+ # Required. In the form of `projects/*`
395
+ # @param page_size [::Integer]
396
+ # The maximum number of instance status to return.
397
+ # @param page_token [::String]
398
+ # A pagination token returned from a previous call
399
+ # that indicates where this listing should continue from.
400
+ # @param filter [::String]
401
+ # If provided, this field specifies the criteria that must be met by patch
402
+ # jobs to be included in the response.
403
+ # Currently, filtering is only available on the patch_deployment field.
404
+ #
405
+ # @yield [response, operation] Access the result along with the RPC operation
406
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::PatchJob>]
407
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
408
+ #
409
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::PatchJob>]
410
+ #
411
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
412
+ #
413
+ def list_patch_jobs request, options = nil
414
+ raise ::ArgumentError, "request must be provided" if request.nil?
415
+
416
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListPatchJobsRequest
417
+
418
+ # Converts hash and nil to an options object
419
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
420
+
421
+ # Customize the options with defaults
422
+ metadata = @config.rpcs.list_patch_jobs.metadata.to_h
423
+
424
+ # Set x-goog-api-client and x-goog-user-project headers
425
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
426
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
427
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
428
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
429
+
430
+ header_params = {
431
+ "parent" => request.parent
432
+ }
433
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
434
+ metadata[:"x-goog-request-params"] ||= request_params_header
435
+
436
+ options.apply_defaults timeout: @config.rpcs.list_patch_jobs.timeout,
437
+ metadata: metadata,
438
+ retry_policy: @config.rpcs.list_patch_jobs.retry_policy
439
+ options.apply_defaults metadata: @config.metadata,
440
+ retry_policy: @config.retry_policy
441
+
442
+ @os_config_service_stub.call_rpc :list_patch_jobs, request, options: options do |response, operation|
443
+ response = ::Gapic::PagedEnumerable.new @os_config_service_stub, :list_patch_jobs, request, response, operation, options
444
+ yield response, operation if block_given?
445
+ return response
446
+ end
447
+ rescue ::GRPC::BadStatus => e
448
+ raise ::Google::Cloud::Error.from_error(e)
449
+ end
450
+
451
+ ##
452
+ # Get a list of instance details for a given patch job.
453
+ #
454
+ # @overload list_patch_job_instance_details(request, options = nil)
455
+ # Pass arguments to `list_patch_job_instance_details` via a request object, either of type
456
+ # {::Google::Cloud::OsConfig::V1::ListPatchJobInstanceDetailsRequest} or an equivalent Hash.
457
+ #
458
+ # @param request [::Google::Cloud::OsConfig::V1::ListPatchJobInstanceDetailsRequest, ::Hash]
459
+ # A request object representing the call parameters. Required. To specify no
460
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
461
+ # @param options [::Gapic::CallOptions, ::Hash]
462
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
463
+ #
464
+ # @overload list_patch_job_instance_details(parent: nil, page_size: nil, page_token: nil, filter: nil)
465
+ # Pass arguments to `list_patch_job_instance_details` via keyword arguments. Note that at
466
+ # least one keyword argument is required. To specify no parameters, or to keep all
467
+ # the default parameter values, pass an empty Hash as a request object (see above).
468
+ #
469
+ # @param parent [::String]
470
+ # Required. The parent for the instances are in the form of `projects/*/patchJobs/*`.
471
+ # @param page_size [::Integer]
472
+ # The maximum number of instance details records to return. Default is 100.
473
+ # @param page_token [::String]
474
+ # A pagination token returned from a previous call
475
+ # that indicates where this listing should continue from.
476
+ # @param filter [::String]
477
+ # A filter expression that filters results listed in the response. This
478
+ # field supports filtering results by instance zone, name, state, or
479
+ # `failure_reason`.
480
+ #
481
+ # @yield [response, operation] Access the result along with the RPC operation
482
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::PatchJobInstanceDetails>]
483
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
484
+ #
485
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::PatchJobInstanceDetails>]
486
+ #
487
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
488
+ #
489
+ def list_patch_job_instance_details request, options = nil
490
+ raise ::ArgumentError, "request must be provided" if request.nil?
491
+
492
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListPatchJobInstanceDetailsRequest
493
+
494
+ # Converts hash and nil to an options object
495
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
496
+
497
+ # Customize the options with defaults
498
+ metadata = @config.rpcs.list_patch_job_instance_details.metadata.to_h
499
+
500
+ # Set x-goog-api-client and x-goog-user-project headers
501
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
502
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
503
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
504
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
505
+
506
+ header_params = {
507
+ "parent" => request.parent
508
+ }
509
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
510
+ metadata[:"x-goog-request-params"] ||= request_params_header
511
+
512
+ options.apply_defaults timeout: @config.rpcs.list_patch_job_instance_details.timeout,
513
+ metadata: metadata,
514
+ retry_policy: @config.rpcs.list_patch_job_instance_details.retry_policy
515
+ options.apply_defaults metadata: @config.metadata,
516
+ retry_policy: @config.retry_policy
517
+
518
+ @os_config_service_stub.call_rpc :list_patch_job_instance_details, request, options: options do |response, operation|
519
+ response = ::Gapic::PagedEnumerable.new @os_config_service_stub, :list_patch_job_instance_details, request, response, operation, options
520
+ yield response, operation if block_given?
521
+ return response
522
+ end
523
+ rescue ::GRPC::BadStatus => e
524
+ raise ::Google::Cloud::Error.from_error(e)
525
+ end
526
+
527
+ ##
528
+ # Create an OS Config patch deployment.
529
+ #
530
+ # @overload create_patch_deployment(request, options = nil)
531
+ # Pass arguments to `create_patch_deployment` via a request object, either of type
532
+ # {::Google::Cloud::OsConfig::V1::CreatePatchDeploymentRequest} or an equivalent Hash.
533
+ #
534
+ # @param request [::Google::Cloud::OsConfig::V1::CreatePatchDeploymentRequest, ::Hash]
535
+ # A request object representing the call parameters. Required. To specify no
536
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
537
+ # @param options [::Gapic::CallOptions, ::Hash]
538
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
539
+ #
540
+ # @overload create_patch_deployment(parent: nil, patch_deployment_id: nil, patch_deployment: nil)
541
+ # Pass arguments to `create_patch_deployment` via keyword arguments. Note that at
542
+ # least one keyword argument is required. To specify no parameters, or to keep all
543
+ # the default parameter values, pass an empty Hash as a request object (see above).
544
+ #
545
+ # @param parent [::String]
546
+ # Required. The project to apply this patch deployment to in the form `projects/*`.
547
+ # @param patch_deployment_id [::String]
548
+ # Required. A name for the patch deployment in the project. When creating a name
549
+ # the following rules apply:
550
+ # * Must contain only lowercase letters, numbers, and hyphens.
551
+ # * Must start with a letter.
552
+ # * Must be between 1-63 characters.
553
+ # * Must end with a number or a letter.
554
+ # * Must be unique within the project.
555
+ # @param patch_deployment [::Google::Cloud::OsConfig::V1::PatchDeployment, ::Hash]
556
+ # Required. The patch deployment to create.
557
+ #
558
+ # @yield [response, operation] Access the result along with the RPC operation
559
+ # @yieldparam response [::Google::Cloud::OsConfig::V1::PatchDeployment]
560
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
561
+ #
562
+ # @return [::Google::Cloud::OsConfig::V1::PatchDeployment]
563
+ #
564
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
565
+ #
566
+ def create_patch_deployment request, options = nil
567
+ raise ::ArgumentError, "request must be provided" if request.nil?
568
+
569
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::CreatePatchDeploymentRequest
570
+
571
+ # Converts hash and nil to an options object
572
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
573
+
574
+ # Customize the options with defaults
575
+ metadata = @config.rpcs.create_patch_deployment.metadata.to_h
576
+
577
+ # Set x-goog-api-client and x-goog-user-project headers
578
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
579
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
580
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
581
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
582
+
583
+ header_params = {
584
+ "parent" => request.parent
585
+ }
586
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
587
+ metadata[:"x-goog-request-params"] ||= request_params_header
588
+
589
+ options.apply_defaults timeout: @config.rpcs.create_patch_deployment.timeout,
590
+ metadata: metadata,
591
+ retry_policy: @config.rpcs.create_patch_deployment.retry_policy
592
+ options.apply_defaults metadata: @config.metadata,
593
+ retry_policy: @config.retry_policy
594
+
595
+ @os_config_service_stub.call_rpc :create_patch_deployment, request, options: options do |response, operation|
596
+ yield response, operation if block_given?
597
+ return response
598
+ end
599
+ rescue ::GRPC::BadStatus => e
600
+ raise ::Google::Cloud::Error.from_error(e)
601
+ end
602
+
603
+ ##
604
+ # Get an OS Config patch deployment.
605
+ #
606
+ # @overload get_patch_deployment(request, options = nil)
607
+ # Pass arguments to `get_patch_deployment` via a request object, either of type
608
+ # {::Google::Cloud::OsConfig::V1::GetPatchDeploymentRequest} or an equivalent Hash.
609
+ #
610
+ # @param request [::Google::Cloud::OsConfig::V1::GetPatchDeploymentRequest, ::Hash]
611
+ # A request object representing the call parameters. Required. To specify no
612
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
613
+ # @param options [::Gapic::CallOptions, ::Hash]
614
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
615
+ #
616
+ # @overload get_patch_deployment(name: nil)
617
+ # Pass arguments to `get_patch_deployment` via keyword arguments. Note that at
618
+ # least one keyword argument is required. To specify no parameters, or to keep all
619
+ # the default parameter values, pass an empty Hash as a request object (see above).
620
+ #
621
+ # @param name [::String]
622
+ # Required. The resource name of the patch deployment in the form
623
+ # `projects/*/patchDeployments/*`.
624
+ #
625
+ # @yield [response, operation] Access the result along with the RPC operation
626
+ # @yieldparam response [::Google::Cloud::OsConfig::V1::PatchDeployment]
627
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
628
+ #
629
+ # @return [::Google::Cloud::OsConfig::V1::PatchDeployment]
630
+ #
631
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
632
+ #
633
+ def get_patch_deployment request, options = nil
634
+ raise ::ArgumentError, "request must be provided" if request.nil?
635
+
636
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetPatchDeploymentRequest
637
+
638
+ # Converts hash and nil to an options object
639
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
640
+
641
+ # Customize the options with defaults
642
+ metadata = @config.rpcs.get_patch_deployment.metadata.to_h
643
+
644
+ # Set x-goog-api-client and x-goog-user-project headers
645
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
646
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
647
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
648
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
649
+
650
+ header_params = {
651
+ "name" => request.name
652
+ }
653
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
654
+ metadata[:"x-goog-request-params"] ||= request_params_header
655
+
656
+ options.apply_defaults timeout: @config.rpcs.get_patch_deployment.timeout,
657
+ metadata: metadata,
658
+ retry_policy: @config.rpcs.get_patch_deployment.retry_policy
659
+ options.apply_defaults metadata: @config.metadata,
660
+ retry_policy: @config.retry_policy
661
+
662
+ @os_config_service_stub.call_rpc :get_patch_deployment, request, options: options do |response, operation|
663
+ yield response, operation if block_given?
664
+ return response
665
+ end
666
+ rescue ::GRPC::BadStatus => e
667
+ raise ::Google::Cloud::Error.from_error(e)
668
+ end
669
+
670
+ ##
671
+ # Get a page of OS Config patch deployments.
672
+ #
673
+ # @overload list_patch_deployments(request, options = nil)
674
+ # Pass arguments to `list_patch_deployments` via a request object, either of type
675
+ # {::Google::Cloud::OsConfig::V1::ListPatchDeploymentsRequest} or an equivalent Hash.
676
+ #
677
+ # @param request [::Google::Cloud::OsConfig::V1::ListPatchDeploymentsRequest, ::Hash]
678
+ # A request object representing the call parameters. Required. To specify no
679
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
680
+ # @param options [::Gapic::CallOptions, ::Hash]
681
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
682
+ #
683
+ # @overload list_patch_deployments(parent: nil, page_size: nil, page_token: nil)
684
+ # Pass arguments to `list_patch_deployments` via keyword arguments. Note that at
685
+ # least one keyword argument is required. To specify no parameters, or to keep all
686
+ # the default parameter values, pass an empty Hash as a request object (see above).
687
+ #
688
+ # @param parent [::String]
689
+ # Required. The resource name of the parent in the form `projects/*`.
690
+ # @param page_size [::Integer]
691
+ # Optional. The maximum number of patch deployments to return. Default is 100.
692
+ # @param page_token [::String]
693
+ # Optional. A pagination token returned from a previous call to ListPatchDeployments
694
+ # that indicates where this listing should continue from.
695
+ #
696
+ # @yield [response, operation] Access the result along with the RPC operation
697
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::PatchDeployment>]
698
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
699
+ #
700
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::PatchDeployment>]
701
+ #
702
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
703
+ #
704
+ def list_patch_deployments request, options = nil
705
+ raise ::ArgumentError, "request must be provided" if request.nil?
706
+
707
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListPatchDeploymentsRequest
708
+
709
+ # Converts hash and nil to an options object
710
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
711
+
712
+ # Customize the options with defaults
713
+ metadata = @config.rpcs.list_patch_deployments.metadata.to_h
714
+
715
+ # Set x-goog-api-client and x-goog-user-project headers
716
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
717
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
718
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
719
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
720
+
721
+ header_params = {
722
+ "parent" => request.parent
723
+ }
724
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
725
+ metadata[:"x-goog-request-params"] ||= request_params_header
726
+
727
+ options.apply_defaults timeout: @config.rpcs.list_patch_deployments.timeout,
728
+ metadata: metadata,
729
+ retry_policy: @config.rpcs.list_patch_deployments.retry_policy
730
+ options.apply_defaults metadata: @config.metadata,
731
+ retry_policy: @config.retry_policy
732
+
733
+ @os_config_service_stub.call_rpc :list_patch_deployments, request, options: options do |response, operation|
734
+ response = ::Gapic::PagedEnumerable.new @os_config_service_stub, :list_patch_deployments, request, response, operation, options
735
+ yield response, operation if block_given?
736
+ return response
737
+ end
738
+ rescue ::GRPC::BadStatus => e
739
+ raise ::Google::Cloud::Error.from_error(e)
740
+ end
741
+
742
+ ##
743
+ # Delete an OS Config patch deployment.
744
+ #
745
+ # @overload delete_patch_deployment(request, options = nil)
746
+ # Pass arguments to `delete_patch_deployment` via a request object, either of type
747
+ # {::Google::Cloud::OsConfig::V1::DeletePatchDeploymentRequest} or an equivalent Hash.
748
+ #
749
+ # @param request [::Google::Cloud::OsConfig::V1::DeletePatchDeploymentRequest, ::Hash]
750
+ # A request object representing the call parameters. Required. To specify no
751
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
752
+ # @param options [::Gapic::CallOptions, ::Hash]
753
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
754
+ #
755
+ # @overload delete_patch_deployment(name: nil)
756
+ # Pass arguments to `delete_patch_deployment` via keyword arguments. Note that at
757
+ # least one keyword argument is required. To specify no parameters, or to keep all
758
+ # the default parameter values, pass an empty Hash as a request object (see above).
759
+ #
760
+ # @param name [::String]
761
+ # Required. The resource name of the patch deployment in the form
762
+ # `projects/*/patchDeployments/*`.
763
+ #
764
+ # @yield [response, operation] Access the result along with the RPC operation
765
+ # @yieldparam response [::Google::Protobuf::Empty]
766
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
767
+ #
768
+ # @return [::Google::Protobuf::Empty]
769
+ #
770
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
771
+ #
772
+ def delete_patch_deployment request, options = nil
773
+ raise ::ArgumentError, "request must be provided" if request.nil?
774
+
775
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::DeletePatchDeploymentRequest
776
+
777
+ # Converts hash and nil to an options object
778
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
779
+
780
+ # Customize the options with defaults
781
+ metadata = @config.rpcs.delete_patch_deployment.metadata.to_h
782
+
783
+ # Set x-goog-api-client and x-goog-user-project headers
784
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
785
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
786
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
787
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
788
+
789
+ header_params = {
790
+ "name" => request.name
791
+ }
792
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
793
+ metadata[:"x-goog-request-params"] ||= request_params_header
794
+
795
+ options.apply_defaults timeout: @config.rpcs.delete_patch_deployment.timeout,
796
+ metadata: metadata,
797
+ retry_policy: @config.rpcs.delete_patch_deployment.retry_policy
798
+ options.apply_defaults metadata: @config.metadata,
799
+ retry_policy: @config.retry_policy
800
+
801
+ @os_config_service_stub.call_rpc :delete_patch_deployment, request, options: options do |response, operation|
802
+ yield response, operation if block_given?
803
+ return response
804
+ end
805
+ rescue ::GRPC::BadStatus => e
806
+ raise ::Google::Cloud::Error.from_error(e)
807
+ end
808
+
809
+ ##
810
+ # Configuration class for the OsConfigService API.
811
+ #
812
+ # This class represents the configuration for OsConfigService,
813
+ # providing control over timeouts, retry behavior, logging, transport
814
+ # parameters, and other low-level controls. Certain parameters can also be
815
+ # applied individually to specific RPCs. See
816
+ # {::Google::Cloud::OsConfig::V1::OsConfigService::Client::Configuration::Rpcs}
817
+ # for a list of RPCs that can be configured independently.
818
+ #
819
+ # Configuration can be applied globally to all clients, or to a single client
820
+ # on construction.
821
+ #
822
+ # # Examples
823
+ #
824
+ # To modify the global config, setting the timeout for execute_patch_job
825
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
826
+ #
827
+ # ::Google::Cloud::OsConfig::V1::OsConfigService::Client.configure do |config|
828
+ # config.timeout = 10.0
829
+ # config.rpcs.execute_patch_job.timeout = 20.0
830
+ # end
831
+ #
832
+ # To apply the above configuration only to a new client:
833
+ #
834
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new do |config|
835
+ # config.timeout = 10.0
836
+ # config.rpcs.execute_patch_job.timeout = 20.0
837
+ # end
838
+ #
839
+ # @!attribute [rw] endpoint
840
+ # The hostname or hostname:port of the service endpoint.
841
+ # Defaults to `"osconfig.googleapis.com"`.
842
+ # @return [::String]
843
+ # @!attribute [rw] credentials
844
+ # Credentials to send with calls. You may provide any of the following types:
845
+ # * (`String`) The path to a service account key file in JSON format
846
+ # * (`Hash`) A service account key as a Hash
847
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
848
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
849
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
850
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
851
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
852
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
853
+ # * (`nil`) indicating no credentials
854
+ # @return [::Object]
855
+ # @!attribute [rw] scope
856
+ # The OAuth scopes
857
+ # @return [::Array<::String>]
858
+ # @!attribute [rw] lib_name
859
+ # The library name as recorded in instrumentation and logging
860
+ # @return [::String]
861
+ # @!attribute [rw] lib_version
862
+ # The library version as recorded in instrumentation and logging
863
+ # @return [::String]
864
+ # @!attribute [rw] channel_args
865
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
866
+ # `GRPC::Core::Channel` object is provided as the credential.
867
+ # @return [::Hash]
868
+ # @!attribute [rw] interceptors
869
+ # An array of interceptors that are run before calls are executed.
870
+ # @return [::Array<::GRPC::ClientInterceptor>]
871
+ # @!attribute [rw] timeout
872
+ # The call timeout in seconds.
873
+ # @return [::Numeric]
874
+ # @!attribute [rw] metadata
875
+ # Additional gRPC headers to be sent with the call.
876
+ # @return [::Hash{::Symbol=>::String}]
877
+ # @!attribute [rw] retry_policy
878
+ # The retry policy. The value is a hash with the following keys:
879
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
880
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
881
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
882
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
883
+ # trigger a retry.
884
+ # @return [::Hash]
885
+ # @!attribute [rw] quota_project
886
+ # A separate project against which to charge quota.
887
+ # @return [::String]
888
+ #
889
+ class Configuration
890
+ extend ::Gapic::Config
891
+
892
+ config_attr :endpoint, "osconfig.googleapis.com", ::String
893
+ config_attr :credentials, nil do |value|
894
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
895
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
896
+ allowed.any? { |klass| klass === value }
897
+ end
898
+ config_attr :scope, nil, ::String, ::Array, nil
899
+ config_attr :lib_name, nil, ::String, nil
900
+ config_attr :lib_version, nil, ::String, nil
901
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
902
+ config_attr :interceptors, nil, ::Array, nil
903
+ config_attr :timeout, nil, ::Numeric, nil
904
+ config_attr :metadata, nil, ::Hash, nil
905
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
906
+ config_attr :quota_project, nil, ::String, nil
907
+
908
+ # @private
909
+ def initialize parent_config = nil
910
+ @parent_config = parent_config unless parent_config.nil?
911
+
912
+ yield self if block_given?
913
+ end
914
+
915
+ ##
916
+ # Configurations for individual RPCs
917
+ # @return [Rpcs]
918
+ #
919
+ def rpcs
920
+ @rpcs ||= begin
921
+ parent_rpcs = nil
922
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
923
+ Rpcs.new parent_rpcs
924
+ end
925
+ end
926
+
927
+ ##
928
+ # Configuration RPC class for the OsConfigService API.
929
+ #
930
+ # Includes fields providing the configuration for each RPC in this service.
931
+ # Each configuration object is of type `Gapic::Config::Method` and includes
932
+ # the following configuration fields:
933
+ #
934
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
935
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
936
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
937
+ # include the following keys:
938
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
939
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
940
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
941
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
942
+ # trigger a retry.
943
+ #
944
+ class Rpcs
945
+ ##
946
+ # RPC-specific configuration for `execute_patch_job`
947
+ # @return [::Gapic::Config::Method]
948
+ #
949
+ attr_reader :execute_patch_job
950
+ ##
951
+ # RPC-specific configuration for `get_patch_job`
952
+ # @return [::Gapic::Config::Method]
953
+ #
954
+ attr_reader :get_patch_job
955
+ ##
956
+ # RPC-specific configuration for `cancel_patch_job`
957
+ # @return [::Gapic::Config::Method]
958
+ #
959
+ attr_reader :cancel_patch_job
960
+ ##
961
+ # RPC-specific configuration for `list_patch_jobs`
962
+ # @return [::Gapic::Config::Method]
963
+ #
964
+ attr_reader :list_patch_jobs
965
+ ##
966
+ # RPC-specific configuration for `list_patch_job_instance_details`
967
+ # @return [::Gapic::Config::Method]
968
+ #
969
+ attr_reader :list_patch_job_instance_details
970
+ ##
971
+ # RPC-specific configuration for `create_patch_deployment`
972
+ # @return [::Gapic::Config::Method]
973
+ #
974
+ attr_reader :create_patch_deployment
975
+ ##
976
+ # RPC-specific configuration for `get_patch_deployment`
977
+ # @return [::Gapic::Config::Method]
978
+ #
979
+ attr_reader :get_patch_deployment
980
+ ##
981
+ # RPC-specific configuration for `list_patch_deployments`
982
+ # @return [::Gapic::Config::Method]
983
+ #
984
+ attr_reader :list_patch_deployments
985
+ ##
986
+ # RPC-specific configuration for `delete_patch_deployment`
987
+ # @return [::Gapic::Config::Method]
988
+ #
989
+ attr_reader :delete_patch_deployment
990
+
991
+ # @private
992
+ def initialize parent_rpcs = nil
993
+ execute_patch_job_config = parent_rpcs&.execute_patch_job if parent_rpcs&.respond_to? :execute_patch_job
994
+ @execute_patch_job = ::Gapic::Config::Method.new execute_patch_job_config
995
+ get_patch_job_config = parent_rpcs&.get_patch_job if parent_rpcs&.respond_to? :get_patch_job
996
+ @get_patch_job = ::Gapic::Config::Method.new get_patch_job_config
997
+ cancel_patch_job_config = parent_rpcs&.cancel_patch_job if parent_rpcs&.respond_to? :cancel_patch_job
998
+ @cancel_patch_job = ::Gapic::Config::Method.new cancel_patch_job_config
999
+ list_patch_jobs_config = parent_rpcs&.list_patch_jobs if parent_rpcs&.respond_to? :list_patch_jobs
1000
+ @list_patch_jobs = ::Gapic::Config::Method.new list_patch_jobs_config
1001
+ list_patch_job_instance_details_config = parent_rpcs&.list_patch_job_instance_details if parent_rpcs&.respond_to? :list_patch_job_instance_details
1002
+ @list_patch_job_instance_details = ::Gapic::Config::Method.new list_patch_job_instance_details_config
1003
+ create_patch_deployment_config = parent_rpcs&.create_patch_deployment if parent_rpcs&.respond_to? :create_patch_deployment
1004
+ @create_patch_deployment = ::Gapic::Config::Method.new create_patch_deployment_config
1005
+ get_patch_deployment_config = parent_rpcs&.get_patch_deployment if parent_rpcs&.respond_to? :get_patch_deployment
1006
+ @get_patch_deployment = ::Gapic::Config::Method.new get_patch_deployment_config
1007
+ list_patch_deployments_config = parent_rpcs&.list_patch_deployments if parent_rpcs&.respond_to? :list_patch_deployments
1008
+ @list_patch_deployments = ::Gapic::Config::Method.new list_patch_deployments_config
1009
+ delete_patch_deployment_config = parent_rpcs&.delete_patch_deployment if parent_rpcs&.respond_to? :delete_patch_deployment
1010
+ @delete_patch_deployment = ::Gapic::Config::Method.new delete_patch_deployment_config
1011
+
1012
+ yield self if block_given?
1013
+ end
1014
+ end
1015
+ end
1016
+ end
1017
+ end
1018
+ end
1019
+ end
1020
+ end
1021
+ end