google-cloud-gke_hub-v1beta1 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 2021 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/gke_hub/v1beta1"
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/gke_hub/v1beta1/gke_hub_membership_service"
20
+ require "google/cloud/gke_hub/v1beta1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module GkeHub
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/gke_hub/v1beta1"
29
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
30
+ #
31
+ module V1beta1
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb"
38
+ require "google/cloud/gke_hub/v1beta1/_helpers" if ::File.file? helper_path
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/gke_hub/v1beta1/version"
24
+
25
+ require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service/credentials"
26
+ require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service/paths"
27
+ require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service/operations"
28
+ require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module GkeHub
33
+ module V1beta1
34
+ ##
35
+ # GKE Hub CRUD API for the Membership resource.
36
+ # The Membership service is currently only available in the global location.
37
+ #
38
+ # To load this service and instantiate a client:
39
+ #
40
+ # require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service"
41
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
42
+ #
43
+ module GkeHubMembershipService
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "gke_hub_membership_service", "helpers.rb"
51
+ require "google/cloud/gke_hub/v1beta1/gke_hub_membership_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,1011 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/gkehub/v1beta1/membership_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module GkeHub
25
+ module V1beta1
26
+ module GkeHubMembershipService
27
+ ##
28
+ # Client for the GkeHubMembershipService service.
29
+ #
30
+ # GKE Hub CRUD API for the Membership resource.
31
+ # The Membership service is currently only available in the global location.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :gke_hub_membership_service_stub
38
+
39
+ ##
40
+ # Configure the GkeHubMembershipService Client class.
41
+ #
42
+ # See {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # ## Example
46
+ #
47
+ # To modify the configuration for all GkeHubMembershipService clients:
48
+ #
49
+ # ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::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", "GkeHub", "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.timeout = 60.0
70
+ default_config.retry_policy = {
71
+ initial_delay: 1.0,
72
+ max_delay: 10.0,
73
+ multiplier: 1.3,
74
+ retry_codes: [14]
75
+ }
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the GkeHubMembershipService Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # Create a new GkeHubMembershipService client object.
105
+ #
106
+ # ## Examples
107
+ #
108
+ # To create a new GkeHubMembershipService client with the default
109
+ # configuration:
110
+ #
111
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new
112
+ #
113
+ # To create a new GkeHubMembershipService client with a custom
114
+ # configuration:
115
+ #
116
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
119
+ #
120
+ # @yield [config] Configure the GkeHubMembershipService client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ def initialize
124
+ # These require statements are intentionally placed here to initialize
125
+ # the gRPC module only when it's required.
126
+ # See https://github.com/googleapis/toolkit/issues/446
127
+ require "gapic/grpc"
128
+ require "google/cloud/gkehub/v1beta1/membership_services_pb"
129
+
130
+ # Create the configuration object
131
+ @config = Configuration.new Client.configure
132
+
133
+ # Yield the configuration if needed
134
+ yield @config if block_given?
135
+
136
+ # Create credentials
137
+ credentials = @config.credentials
138
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
139
+ # but only if the default endpoint does not have a region prefix.
140
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
141
+ @config.endpoint == Client.configure.endpoint &&
142
+ !@config.endpoint.split(".").first.include?("-")
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+ @quota_project_id = @config.quota_project
149
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
150
+
151
+ @operations_client = Operations.new do |config|
152
+ config.credentials = credentials
153
+ config.endpoint = @config.endpoint
154
+ end
155
+
156
+ @gke_hub_membership_service_stub = ::Gapic::ServiceStub.new(
157
+ ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Stub,
158
+ credentials: credentials,
159
+ endpoint: @config.endpoint,
160
+ channel_args: @config.channel_args,
161
+ interceptors: @config.interceptors
162
+ )
163
+ end
164
+
165
+ ##
166
+ # Get the associated client for long-running operations.
167
+ #
168
+ # @return [::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Operations]
169
+ #
170
+ attr_reader :operations_client
171
+
172
+ # Service calls
173
+
174
+ ##
175
+ # Lists Memberships in a given project and location.
176
+ #
177
+ # @overload list_memberships(request, options = nil)
178
+ # Pass arguments to `list_memberships` via a request object, either of type
179
+ # {::Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest} or an equivalent Hash.
180
+ #
181
+ # @param request [::Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest, ::Hash]
182
+ # A request object representing the call parameters. Required. To specify no
183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
184
+ # @param options [::Gapic::CallOptions, ::Hash]
185
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
186
+ #
187
+ # @overload list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
188
+ # Pass arguments to `list_memberships` via keyword arguments. Note that at
189
+ # least one keyword argument is required. To specify no parameters, or to keep all
190
+ # the default parameter values, pass an empty Hash as a request object (see above).
191
+ #
192
+ # @param parent [::String]
193
+ # Required. The parent (project and location) where the Memberships will be listed.
194
+ # Specified in the format `projects/*/locations/*`.
195
+ # @param page_size [::Integer]
196
+ # Optional. When requesting a 'page' of resources, `page_size` specifies number of
197
+ # resources to return. If unspecified or set to 0, all resources will
198
+ # be returned.
199
+ # @param page_token [::String]
200
+ # Optional. Token returned by previous call to `ListMemberships` which
201
+ # specifies the position in the list from where to continue listing the
202
+ # resources.
203
+ # @param filter [::String]
204
+ # Optional. Lists Memberships that match the filter expression, following the syntax
205
+ # outlined in https://google.aip.dev/160.
206
+ #
207
+ # Examples:
208
+ #
209
+ # - Name is `bar` in project `foo-proj` and location `global`:
210
+ #
211
+ # name = "projects/foo-proj/locations/global/membership/bar"
212
+ #
213
+ # - Memberships that have a label called `foo`:
214
+ #
215
+ # labels.foo:*
216
+ #
217
+ # - Memberships that have a label called `foo` whose value is `bar`:
218
+ #
219
+ # labels.foo = bar
220
+ #
221
+ # - Memberships in the CREATING state:
222
+ #
223
+ # state = CREATING
224
+ # @param order_by [::String]
225
+ # Optional. One or more fields to compare and use to sort the output.
226
+ # See https://google.aip.dev/132#ordering.
227
+ #
228
+ # @yield [response, operation] Access the result along with the RPC operation
229
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1beta1::Membership>]
230
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
231
+ #
232
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GkeHub::V1beta1::Membership>]
233
+ #
234
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
235
+ #
236
+ def list_memberships request, options = nil
237
+ raise ::ArgumentError, "request must be provided" if request.nil?
238
+
239
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest
240
+
241
+ # Converts hash and nil to an options object
242
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
243
+
244
+ # Customize the options with defaults
245
+ metadata = @config.rpcs.list_memberships.metadata.to_h
246
+
247
+ # Set x-goog-api-client and x-goog-user-project headers
248
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
249
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
250
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
251
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
252
+
253
+ header_params = {
254
+ "parent" => request.parent
255
+ }
256
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
257
+ metadata[:"x-goog-request-params"] ||= request_params_header
258
+
259
+ options.apply_defaults timeout: @config.rpcs.list_memberships.timeout,
260
+ metadata: metadata,
261
+ retry_policy: @config.rpcs.list_memberships.retry_policy
262
+ options.apply_defaults metadata: @config.metadata,
263
+ retry_policy: @config.retry_policy
264
+
265
+ @gke_hub_membership_service_stub.call_rpc :list_memberships, request, options: options do |response, operation|
266
+ response = ::Gapic::PagedEnumerable.new @gke_hub_membership_service_stub, :list_memberships, request, response, operation, options
267
+ yield response, operation if block_given?
268
+ return response
269
+ end
270
+ rescue ::GRPC::BadStatus => e
271
+ raise ::Google::Cloud::Error.from_error(e)
272
+ end
273
+
274
+ ##
275
+ # Gets the details of a Membership.
276
+ #
277
+ # @overload get_membership(request, options = nil)
278
+ # Pass arguments to `get_membership` via a request object, either of type
279
+ # {::Google::Cloud::GkeHub::V1beta1::GetMembershipRequest} or an equivalent Hash.
280
+ #
281
+ # @param request [::Google::Cloud::GkeHub::V1beta1::GetMembershipRequest, ::Hash]
282
+ # A request object representing the call parameters. Required. To specify no
283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
284
+ # @param options [::Gapic::CallOptions, ::Hash]
285
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
286
+ #
287
+ # @overload get_membership(name: nil)
288
+ # Pass arguments to `get_membership` via keyword arguments. Note that at
289
+ # least one keyword argument is required. To specify no parameters, or to keep all
290
+ # the default parameter values, pass an empty Hash as a request object (see above).
291
+ #
292
+ # @param name [::String]
293
+ # Required. The Membership resource name in the format
294
+ # `projects/*/locations/*/memberships/*`.
295
+ #
296
+ # @yield [response, operation] Access the result along with the RPC operation
297
+ # @yieldparam response [::Google::Cloud::GkeHub::V1beta1::Membership]
298
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
299
+ #
300
+ # @return [::Google::Cloud::GkeHub::V1beta1::Membership]
301
+ #
302
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
303
+ #
304
+ def get_membership request, options = nil
305
+ raise ::ArgumentError, "request must be provided" if request.nil?
306
+
307
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::GetMembershipRequest
308
+
309
+ # Converts hash and nil to an options object
310
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
311
+
312
+ # Customize the options with defaults
313
+ metadata = @config.rpcs.get_membership.metadata.to_h
314
+
315
+ # Set x-goog-api-client and x-goog-user-project headers
316
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
317
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
318
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
319
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
320
+
321
+ header_params = {
322
+ "name" => request.name
323
+ }
324
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
325
+ metadata[:"x-goog-request-params"] ||= request_params_header
326
+
327
+ options.apply_defaults timeout: @config.rpcs.get_membership.timeout,
328
+ metadata: metadata,
329
+ retry_policy: @config.rpcs.get_membership.retry_policy
330
+ options.apply_defaults metadata: @config.metadata,
331
+ retry_policy: @config.retry_policy
332
+
333
+ @gke_hub_membership_service_stub.call_rpc :get_membership, request, options: options do |response, operation|
334
+ yield response, operation if block_given?
335
+ return response
336
+ end
337
+ rescue ::GRPC::BadStatus => e
338
+ raise ::Google::Cloud::Error.from_error(e)
339
+ end
340
+
341
+ ##
342
+ # Adds a new Membership.
343
+ #
344
+ # @overload create_membership(request, options = nil)
345
+ # Pass arguments to `create_membership` via a request object, either of type
346
+ # {::Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest} or an equivalent Hash.
347
+ #
348
+ # @param request [::Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest, ::Hash]
349
+ # A request object representing the call parameters. Required. To specify no
350
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
351
+ # @param options [::Gapic::CallOptions, ::Hash]
352
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
353
+ #
354
+ # @overload create_membership(parent: nil, membership_id: nil, resource: nil)
355
+ # Pass arguments to `create_membership` via keyword arguments. Note that at
356
+ # least one keyword argument is required. To specify no parameters, or to keep all
357
+ # the default parameter values, pass an empty Hash as a request object (see above).
358
+ #
359
+ # @param parent [::String]
360
+ # Required. The parent (project and location) where the Memberships will be created.
361
+ # Specified in the format `projects/*/locations/*`.
362
+ # @param membership_id [::String]
363
+ # Required. Client chosen ID for the membership. `membership_id` must be a valid RFC
364
+ # 1123 compliant DNS label:
365
+ #
366
+ # 1. At most 63 characters in length
367
+ # 2. It must consist of lower case alphanumeric characters or `-`
368
+ # 3. It must start and end with an alphanumeric character
369
+ #
370
+ # Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
371
+ # with a maximum length of 63 characters.
372
+ # @param resource [::Google::Cloud::GkeHub::V1beta1::Membership, ::Hash]
373
+ # Required. The membership to create.
374
+ #
375
+ # @yield [response, operation] Access the result along with the RPC operation
376
+ # @yieldparam response [::Gapic::Operation]
377
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
378
+ #
379
+ # @return [::Gapic::Operation]
380
+ #
381
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
382
+ #
383
+ def create_membership request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.create_membership.metadata.to_h
393
+
394
+ # Set x-goog-api-client and x-goog-user-project headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
398
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
399
+
400
+ header_params = {
401
+ "parent" => request.parent
402
+ }
403
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
404
+ metadata[:"x-goog-request-params"] ||= request_params_header
405
+
406
+ options.apply_defaults timeout: @config.rpcs.create_membership.timeout,
407
+ metadata: metadata,
408
+ retry_policy: @config.rpcs.create_membership.retry_policy
409
+ options.apply_defaults metadata: @config.metadata,
410
+ retry_policy: @config.retry_policy
411
+
412
+ @gke_hub_membership_service_stub.call_rpc :create_membership, request, options: options do |response, operation|
413
+ response = ::Gapic::Operation.new response, @operations_client, options: options
414
+ yield response, operation if block_given?
415
+ return response
416
+ end
417
+ rescue ::GRPC::BadStatus => e
418
+ raise ::Google::Cloud::Error.from_error(e)
419
+ end
420
+
421
+ ##
422
+ # Removes a Membership.
423
+ #
424
+ # @overload delete_membership(request, options = nil)
425
+ # Pass arguments to `delete_membership` via a request object, either of type
426
+ # {::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest} or an equivalent Hash.
427
+ #
428
+ # @param request [::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest, ::Hash]
429
+ # A request object representing the call parameters. Required. To specify no
430
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
431
+ # @param options [::Gapic::CallOptions, ::Hash]
432
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
433
+ #
434
+ # @overload delete_membership(name: nil)
435
+ # Pass arguments to `delete_membership` via keyword arguments. Note that at
436
+ # least one keyword argument is required. To specify no parameters, or to keep all
437
+ # the default parameter values, pass an empty Hash as a request object (see above).
438
+ #
439
+ # @param name [::String]
440
+ # Required. The Membership resource name in the format
441
+ # `projects/*/locations/*/memberships/*`.
442
+ #
443
+ # @yield [response, operation] Access the result along with the RPC operation
444
+ # @yieldparam response [::Gapic::Operation]
445
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
446
+ #
447
+ # @return [::Gapic::Operation]
448
+ #
449
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
450
+ #
451
+ def delete_membership request, options = nil
452
+ raise ::ArgumentError, "request must be provided" if request.nil?
453
+
454
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest
455
+
456
+ # Converts hash and nil to an options object
457
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
458
+
459
+ # Customize the options with defaults
460
+ metadata = @config.rpcs.delete_membership.metadata.to_h
461
+
462
+ # Set x-goog-api-client and x-goog-user-project headers
463
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
464
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
465
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
466
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
+
468
+ header_params = {
469
+ "name" => request.name
470
+ }
471
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
472
+ metadata[:"x-goog-request-params"] ||= request_params_header
473
+
474
+ options.apply_defaults timeout: @config.rpcs.delete_membership.timeout,
475
+ metadata: metadata,
476
+ retry_policy: @config.rpcs.delete_membership.retry_policy
477
+ options.apply_defaults metadata: @config.metadata,
478
+ retry_policy: @config.retry_policy
479
+
480
+ @gke_hub_membership_service_stub.call_rpc :delete_membership, request, options: options do |response, operation|
481
+ response = ::Gapic::Operation.new response, @operations_client, options: options
482
+ yield response, operation if block_given?
483
+ return response
484
+ end
485
+ rescue ::GRPC::BadStatus => e
486
+ raise ::Google::Cloud::Error.from_error(e)
487
+ end
488
+
489
+ ##
490
+ # Updates an existing Membership.
491
+ #
492
+ # @overload update_membership(request, options = nil)
493
+ # Pass arguments to `update_membership` via a request object, either of type
494
+ # {::Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest} or an equivalent Hash.
495
+ #
496
+ # @param request [::Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest, ::Hash]
497
+ # A request object representing the call parameters. Required. To specify no
498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
499
+ # @param options [::Gapic::CallOptions, ::Hash]
500
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
501
+ #
502
+ # @overload update_membership(name: nil, update_mask: nil, resource: nil)
503
+ # Pass arguments to `update_membership` via keyword arguments. Note that at
504
+ # least one keyword argument is required. To specify no parameters, or to keep all
505
+ # the default parameter values, pass an empty Hash as a request object (see above).
506
+ #
507
+ # @param name [::String]
508
+ # Required. The membership resource name in the format:
509
+ # `projects/[project_id]/locations/global/memberships/[membership_id]`
510
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
511
+ # Required. Mask of fields to update. At least one field path must be specified in this
512
+ # mask.
513
+ # @param resource [::Google::Cloud::GkeHub::V1beta1::Membership, ::Hash]
514
+ # Required. Only fields specified in update_mask are updated.
515
+ # If you specify a field in the update_mask but don't specify its value here
516
+ # that field will be deleted.
517
+ # If you are updating a map field, set the value of a key to null or empty
518
+ # string to delete the key from the map. It's not possible to update a key's
519
+ # value to the empty string.
520
+ #
521
+ # @yield [response, operation] Access the result along with the RPC operation
522
+ # @yieldparam response [::Gapic::Operation]
523
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
524
+ #
525
+ # @return [::Gapic::Operation]
526
+ #
527
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
528
+ #
529
+ def update_membership request, options = nil
530
+ raise ::ArgumentError, "request must be provided" if request.nil?
531
+
532
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest
533
+
534
+ # Converts hash and nil to an options object
535
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
536
+
537
+ # Customize the options with defaults
538
+ metadata = @config.rpcs.update_membership.metadata.to_h
539
+
540
+ # Set x-goog-api-client and x-goog-user-project headers
541
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
542
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
543
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
544
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
+
546
+ header_params = {
547
+ "name" => request.name
548
+ }
549
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
550
+ metadata[:"x-goog-request-params"] ||= request_params_header
551
+
552
+ options.apply_defaults timeout: @config.rpcs.update_membership.timeout,
553
+ metadata: metadata,
554
+ retry_policy: @config.rpcs.update_membership.retry_policy
555
+ options.apply_defaults metadata: @config.metadata,
556
+ retry_policy: @config.retry_policy
557
+
558
+ @gke_hub_membership_service_stub.call_rpc :update_membership, request, options: options do |response, operation|
559
+ response = ::Gapic::Operation.new response, @operations_client, options: options
560
+ yield response, operation if block_given?
561
+ return response
562
+ end
563
+ rescue ::GRPC::BadStatus => e
564
+ raise ::Google::Cloud::Error.from_error(e)
565
+ end
566
+
567
+ ##
568
+ # Generates the manifest for deployment of the GKE connect agent.
569
+ #
570
+ # @overload generate_connect_manifest(request, options = nil)
571
+ # Pass arguments to `generate_connect_manifest` via a request object, either of type
572
+ # {::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest} or an equivalent Hash.
573
+ #
574
+ # @param request [::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest, ::Hash]
575
+ # A request object representing the call parameters. Required. To specify no
576
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
577
+ # @param options [::Gapic::CallOptions, ::Hash]
578
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
579
+ #
580
+ # @overload generate_connect_manifest(name: nil, connect_agent: nil, version: nil, is_upgrade: nil, registry: nil, image_pull_secret_content: nil)
581
+ # Pass arguments to `generate_connect_manifest` via keyword arguments. Note that at
582
+ # least one keyword argument is required. To specify no parameters, or to keep all
583
+ # the default parameter values, pass an empty Hash as a request object (see above).
584
+ #
585
+ # @param name [::String]
586
+ # Required. The Membership resource name the Agent will associate with, in the format
587
+ # `projects/*/locations/*/memberships/*`.
588
+ # @param connect_agent [::Google::Cloud::GkeHub::V1beta1::ConnectAgent, ::Hash]
589
+ # Optional. The connect agent to generate manifest for.
590
+ # @param version [::String]
591
+ # Optional. The Connect agent version to use. Defaults to the most current version.
592
+ # @param is_upgrade [::Boolean]
593
+ # Optional. If true, generate the resources for upgrade only. Some resources
594
+ # generated only for installation (e.g. secrets) will be excluded.
595
+ # @param registry [::String]
596
+ # Optional. The registry to fetch the connect agent image from. Defaults to
597
+ # gcr.io/gkeconnect.
598
+ # @param image_pull_secret_content [::String]
599
+ # Optional. The image pull secret content for the registry, if not public.
600
+ #
601
+ # @yield [response, operation] Access the result along with the RPC operation
602
+ # @yieldparam response [::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse]
603
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
604
+ #
605
+ # @return [::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse]
606
+ #
607
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
608
+ #
609
+ def generate_connect_manifest request, options = nil
610
+ raise ::ArgumentError, "request must be provided" if request.nil?
611
+
612
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest
613
+
614
+ # Converts hash and nil to an options object
615
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
616
+
617
+ # Customize the options with defaults
618
+ metadata = @config.rpcs.generate_connect_manifest.metadata.to_h
619
+
620
+ # Set x-goog-api-client and x-goog-user-project headers
621
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
622
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
623
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
624
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
625
+
626
+ header_params = {
627
+ "name" => request.name
628
+ }
629
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
630
+ metadata[:"x-goog-request-params"] ||= request_params_header
631
+
632
+ options.apply_defaults timeout: @config.rpcs.generate_connect_manifest.timeout,
633
+ metadata: metadata,
634
+ retry_policy: @config.rpcs.generate_connect_manifest.retry_policy
635
+ options.apply_defaults metadata: @config.metadata,
636
+ retry_policy: @config.retry_policy
637
+
638
+ @gke_hub_membership_service_stub.call_rpc :generate_connect_manifest, request, options: options do |response, operation|
639
+ yield response, operation if block_given?
640
+ return response
641
+ end
642
+ rescue ::GRPC::BadStatus => e
643
+ raise ::Google::Cloud::Error.from_error(e)
644
+ end
645
+
646
+ ##
647
+ # ValidateExclusivity validates the state of exclusivity in the cluster.
648
+ # The validation does not depend on an existing Hub membership resource.
649
+ #
650
+ # @overload validate_exclusivity(request, options = nil)
651
+ # Pass arguments to `validate_exclusivity` via a request object, either of type
652
+ # {::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest} or an equivalent Hash.
653
+ #
654
+ # @param request [::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest, ::Hash]
655
+ # A request object representing the call parameters. Required. To specify no
656
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
657
+ # @param options [::Gapic::CallOptions, ::Hash]
658
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
659
+ #
660
+ # @overload validate_exclusivity(parent: nil, cr_manifest: nil, intended_membership: nil)
661
+ # Pass arguments to `validate_exclusivity` via keyword arguments. Note that at
662
+ # least one keyword argument is required. To specify no parameters, or to keep all
663
+ # the default parameter values, pass an empty Hash as a request object (see above).
664
+ #
665
+ # @param parent [::String]
666
+ # Required. The parent (project and location) where the Memberships will be created.
667
+ # Specified in the format `projects/*/locations/*`.
668
+ # @param cr_manifest [::String]
669
+ # Optional. The YAML of the membership CR in the cluster. Empty if the membership
670
+ # CR does not exist.
671
+ # @param intended_membership [::String]
672
+ # Required. The intended membership name under the `parent`. This method only does
673
+ # validation in anticipation of a CreateMembership call with the same name.
674
+ #
675
+ # @yield [response, operation] Access the result along with the RPC operation
676
+ # @yieldparam response [::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse]
677
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
678
+ #
679
+ # @return [::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse]
680
+ #
681
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
682
+ #
683
+ def validate_exclusivity request, options = nil
684
+ raise ::ArgumentError, "request must be provided" if request.nil?
685
+
686
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest
687
+
688
+ # Converts hash and nil to an options object
689
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
690
+
691
+ # Customize the options with defaults
692
+ metadata = @config.rpcs.validate_exclusivity.metadata.to_h
693
+
694
+ # Set x-goog-api-client and x-goog-user-project headers
695
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
696
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
697
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
698
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
699
+
700
+ header_params = {
701
+ "parent" => request.parent
702
+ }
703
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
704
+ metadata[:"x-goog-request-params"] ||= request_params_header
705
+
706
+ options.apply_defaults timeout: @config.rpcs.validate_exclusivity.timeout,
707
+ metadata: metadata,
708
+ retry_policy: @config.rpcs.validate_exclusivity.retry_policy
709
+ options.apply_defaults metadata: @config.metadata,
710
+ retry_policy: @config.retry_policy
711
+
712
+ @gke_hub_membership_service_stub.call_rpc :validate_exclusivity, request, options: options do |response, operation|
713
+ yield response, operation if block_given?
714
+ return response
715
+ end
716
+ rescue ::GRPC::BadStatus => e
717
+ raise ::Google::Cloud::Error.from_error(e)
718
+ end
719
+
720
+ ##
721
+ # GenerateExclusivityManifest generates the manifests to update the
722
+ # exclusivity artifacts in the cluster if needed.
723
+ #
724
+ # Exclusivity artifacts include the Membership custom resource definition
725
+ # (CRD) and the singleton Membership custom resource (CR). Combined with
726
+ # ValidateExclusivity, exclusivity artifacts guarantee that a Kubernetes
727
+ # cluster is only registered to a single GKE Hub.
728
+ #
729
+ # The Membership CRD is versioned, and may require conversion when the GKE
730
+ # Hub API server begins serving a newer version of the CRD and
731
+ # corresponding CR. The response will be the converted CRD and CR if there
732
+ # are any differences between the versions.
733
+ #
734
+ # @overload generate_exclusivity_manifest(request, options = nil)
735
+ # Pass arguments to `generate_exclusivity_manifest` via a request object, either of type
736
+ # {::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest} or an equivalent Hash.
737
+ #
738
+ # @param request [::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest, ::Hash]
739
+ # A request object representing the call parameters. Required. To specify no
740
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
741
+ # @param options [::Gapic::CallOptions, ::Hash]
742
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
743
+ #
744
+ # @overload generate_exclusivity_manifest(name: nil, crd_manifest: nil, cr_manifest: nil)
745
+ # Pass arguments to `generate_exclusivity_manifest` via keyword arguments. Note that at
746
+ # least one keyword argument is required. To specify no parameters, or to keep all
747
+ # the default parameter values, pass an empty Hash as a request object (see above).
748
+ #
749
+ # @param name [::String]
750
+ # Required. The Membership resource name in the format
751
+ # `projects/*/locations/*/memberships/*`.
752
+ # @param crd_manifest [::String]
753
+ # Optional. The YAML manifest of the membership CRD retrieved by
754
+ # `kubectl get customresourcedefinitions membership`.
755
+ # Leave empty if the resource does not exist.
756
+ # @param cr_manifest [::String]
757
+ # Optional. The YAML manifest of the membership CR retrieved by
758
+ # `kubectl get memberships membership`.
759
+ # Leave empty if the resource does not exist.
760
+ #
761
+ # @yield [response, operation] Access the result along with the RPC operation
762
+ # @yieldparam response [::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse]
763
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
764
+ #
765
+ # @return [::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse]
766
+ #
767
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
768
+ #
769
+ def generate_exclusivity_manifest request, options = nil
770
+ raise ::ArgumentError, "request must be provided" if request.nil?
771
+
772
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest
773
+
774
+ # Converts hash and nil to an options object
775
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
776
+
777
+ # Customize the options with defaults
778
+ metadata = @config.rpcs.generate_exclusivity_manifest.metadata.to_h
779
+
780
+ # Set x-goog-api-client and x-goog-user-project headers
781
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
782
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
783
+ gapic_version: ::Google::Cloud::GkeHub::V1beta1::VERSION
784
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
+
786
+ header_params = {
787
+ "name" => request.name
788
+ }
789
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
790
+ metadata[:"x-goog-request-params"] ||= request_params_header
791
+
792
+ options.apply_defaults timeout: @config.rpcs.generate_exclusivity_manifest.timeout,
793
+ metadata: metadata,
794
+ retry_policy: @config.rpcs.generate_exclusivity_manifest.retry_policy
795
+ options.apply_defaults metadata: @config.metadata,
796
+ retry_policy: @config.retry_policy
797
+
798
+ @gke_hub_membership_service_stub.call_rpc :generate_exclusivity_manifest, request, options: options do |response, operation|
799
+ yield response, operation if block_given?
800
+ return response
801
+ end
802
+ rescue ::GRPC::BadStatus => e
803
+ raise ::Google::Cloud::Error.from_error(e)
804
+ end
805
+
806
+ ##
807
+ # Configuration class for the GkeHubMembershipService API.
808
+ #
809
+ # This class represents the configuration for GkeHubMembershipService,
810
+ # providing control over timeouts, retry behavior, logging, transport
811
+ # parameters, and other low-level controls. Certain parameters can also be
812
+ # applied individually to specific RPCs. See
813
+ # {::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client::Configuration::Rpcs}
814
+ # for a list of RPCs that can be configured independently.
815
+ #
816
+ # Configuration can be applied globally to all clients, or to a single client
817
+ # on construction.
818
+ #
819
+ # # Examples
820
+ #
821
+ # To modify the global config, setting the timeout for list_memberships
822
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
823
+ #
824
+ # ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.configure do |config|
825
+ # config.timeout = 10.0
826
+ # config.rpcs.list_memberships.timeout = 20.0
827
+ # end
828
+ #
829
+ # To apply the above configuration only to a new client:
830
+ #
831
+ # client = ::Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new do |config|
832
+ # config.timeout = 10.0
833
+ # config.rpcs.list_memberships.timeout = 20.0
834
+ # end
835
+ #
836
+ # @!attribute [rw] endpoint
837
+ # The hostname or hostname:port of the service endpoint.
838
+ # Defaults to `"gkehub.googleapis.com"`.
839
+ # @return [::String]
840
+ # @!attribute [rw] credentials
841
+ # Credentials to send with calls. You may provide any of the following types:
842
+ # * (`String`) The path to a service account key file in JSON format
843
+ # * (`Hash`) A service account key as a Hash
844
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
845
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
846
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
847
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
848
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
849
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
850
+ # * (`nil`) indicating no credentials
851
+ # @return [::Object]
852
+ # @!attribute [rw] scope
853
+ # The OAuth scopes
854
+ # @return [::Array<::String>]
855
+ # @!attribute [rw] lib_name
856
+ # The library name as recorded in instrumentation and logging
857
+ # @return [::String]
858
+ # @!attribute [rw] lib_version
859
+ # The library version as recorded in instrumentation and logging
860
+ # @return [::String]
861
+ # @!attribute [rw] channel_args
862
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
863
+ # `GRPC::Core::Channel` object is provided as the credential.
864
+ # @return [::Hash]
865
+ # @!attribute [rw] interceptors
866
+ # An array of interceptors that are run before calls are executed.
867
+ # @return [::Array<::GRPC::ClientInterceptor>]
868
+ # @!attribute [rw] timeout
869
+ # The call timeout in seconds.
870
+ # @return [::Numeric]
871
+ # @!attribute [rw] metadata
872
+ # Additional gRPC headers to be sent with the call.
873
+ # @return [::Hash{::Symbol=>::String}]
874
+ # @!attribute [rw] retry_policy
875
+ # The retry policy. The value is a hash with the following keys:
876
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
877
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
878
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
879
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
880
+ # trigger a retry.
881
+ # @return [::Hash]
882
+ # @!attribute [rw] quota_project
883
+ # A separate project against which to charge quota.
884
+ # @return [::String]
885
+ #
886
+ class Configuration
887
+ extend ::Gapic::Config
888
+
889
+ config_attr :endpoint, "gkehub.googleapis.com", ::String
890
+ config_attr :credentials, nil do |value|
891
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
892
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
893
+ allowed.any? { |klass| klass === value }
894
+ end
895
+ config_attr :scope, nil, ::String, ::Array, nil
896
+ config_attr :lib_name, nil, ::String, nil
897
+ config_attr :lib_version, nil, ::String, nil
898
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
899
+ config_attr :interceptors, nil, ::Array, nil
900
+ config_attr :timeout, nil, ::Numeric, nil
901
+ config_attr :metadata, nil, ::Hash, nil
902
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
903
+ config_attr :quota_project, nil, ::String, nil
904
+
905
+ # @private
906
+ def initialize parent_config = nil
907
+ @parent_config = parent_config unless parent_config.nil?
908
+
909
+ yield self if block_given?
910
+ end
911
+
912
+ ##
913
+ # Configurations for individual RPCs
914
+ # @return [Rpcs]
915
+ #
916
+ def rpcs
917
+ @rpcs ||= begin
918
+ parent_rpcs = nil
919
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
920
+ Rpcs.new parent_rpcs
921
+ end
922
+ end
923
+
924
+ ##
925
+ # Configuration RPC class for the GkeHubMembershipService API.
926
+ #
927
+ # Includes fields providing the configuration for each RPC in this service.
928
+ # Each configuration object is of type `Gapic::Config::Method` and includes
929
+ # the following configuration fields:
930
+ #
931
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
932
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
933
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
934
+ # include the following keys:
935
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
936
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
937
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
938
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
939
+ # trigger a retry.
940
+ #
941
+ class Rpcs
942
+ ##
943
+ # RPC-specific configuration for `list_memberships`
944
+ # @return [::Gapic::Config::Method]
945
+ #
946
+ attr_reader :list_memberships
947
+ ##
948
+ # RPC-specific configuration for `get_membership`
949
+ # @return [::Gapic::Config::Method]
950
+ #
951
+ attr_reader :get_membership
952
+ ##
953
+ # RPC-specific configuration for `create_membership`
954
+ # @return [::Gapic::Config::Method]
955
+ #
956
+ attr_reader :create_membership
957
+ ##
958
+ # RPC-specific configuration for `delete_membership`
959
+ # @return [::Gapic::Config::Method]
960
+ #
961
+ attr_reader :delete_membership
962
+ ##
963
+ # RPC-specific configuration for `update_membership`
964
+ # @return [::Gapic::Config::Method]
965
+ #
966
+ attr_reader :update_membership
967
+ ##
968
+ # RPC-specific configuration for `generate_connect_manifest`
969
+ # @return [::Gapic::Config::Method]
970
+ #
971
+ attr_reader :generate_connect_manifest
972
+ ##
973
+ # RPC-specific configuration for `validate_exclusivity`
974
+ # @return [::Gapic::Config::Method]
975
+ #
976
+ attr_reader :validate_exclusivity
977
+ ##
978
+ # RPC-specific configuration for `generate_exclusivity_manifest`
979
+ # @return [::Gapic::Config::Method]
980
+ #
981
+ attr_reader :generate_exclusivity_manifest
982
+
983
+ # @private
984
+ def initialize parent_rpcs = nil
985
+ list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships
986
+ @list_memberships = ::Gapic::Config::Method.new list_memberships_config
987
+ get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership
988
+ @get_membership = ::Gapic::Config::Method.new get_membership_config
989
+ create_membership_config = parent_rpcs.create_membership if parent_rpcs.respond_to? :create_membership
990
+ @create_membership = ::Gapic::Config::Method.new create_membership_config
991
+ delete_membership_config = parent_rpcs.delete_membership if parent_rpcs.respond_to? :delete_membership
992
+ @delete_membership = ::Gapic::Config::Method.new delete_membership_config
993
+ update_membership_config = parent_rpcs.update_membership if parent_rpcs.respond_to? :update_membership
994
+ @update_membership = ::Gapic::Config::Method.new update_membership_config
995
+ generate_connect_manifest_config = parent_rpcs.generate_connect_manifest if parent_rpcs.respond_to? :generate_connect_manifest
996
+ @generate_connect_manifest = ::Gapic::Config::Method.new generate_connect_manifest_config
997
+ validate_exclusivity_config = parent_rpcs.validate_exclusivity if parent_rpcs.respond_to? :validate_exclusivity
998
+ @validate_exclusivity = ::Gapic::Config::Method.new validate_exclusivity_config
999
+ generate_exclusivity_manifest_config = parent_rpcs.generate_exclusivity_manifest if parent_rpcs.respond_to? :generate_exclusivity_manifest
1000
+ @generate_exclusivity_manifest = ::Gapic::Config::Method.new generate_exclusivity_manifest_config
1001
+
1002
+ yield self if block_given?
1003
+ end
1004
+ end
1005
+ end
1006
+ end
1007
+ end
1008
+ end
1009
+ end
1010
+ end
1011
+ end