google-cloud-gke_connect-gateway-v1beta1 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +3 -3
  4. data/lib/google/cloud/gke_connect/gateway/v1beta1/gateway_control/client.rb +450 -0
  5. data/lib/google/cloud/gke_connect/gateway/v1beta1/{gateway_service → gateway_control}/credentials.rb +3 -3
  6. data/lib/google/cloud/gke_connect/gateway/v1beta1/gateway_control/rest/client.rb +417 -0
  7. data/lib/google/cloud/gke_connect/gateway/v1beta1/gateway_control/rest/service_stub.rb +130 -0
  8. data/lib/google/cloud/gke_connect/gateway/v1beta1/gateway_control/rest.rb +53 -0
  9. data/lib/google/cloud/gke_connect/gateway/v1beta1/{gateway_service.rb → gateway_control.rb} +15 -13
  10. data/lib/google/cloud/gke_connect/gateway/v1beta1/rest.rb +39 -0
  11. data/lib/google/cloud/gke_connect/gateway/v1beta1/version.rb +1 -1
  12. data/lib/google/cloud/gke_connect/gateway/v1beta1.rb +7 -2
  13. data/lib/google/cloud/gkeconnect/gateway/v1beta1/control_pb.rb +50 -0
  14. data/lib/google/cloud/gkeconnect/gateway/v1beta1/control_services_pb.rb +48 -0
  15. data/proto_docs/google/api/client.rb +18 -10
  16. data/proto_docs/google/api/field_behavior.rb +85 -0
  17. data/proto_docs/google/api/resource.rb +7 -2
  18. data/proto_docs/google/cloud/gkeconnect/gateway/v1beta1/control.rb +84 -0
  19. metadata +13 -9
  20. data/lib/google/cloud/gke_connect/gateway/v1beta1/gateway_service/client.rb +0 -778
  21. data/lib/google/cloud/gkeconnect/gateway/v1beta1/gateway_pb.rb +0 -47
  22. data/lib/google/cloud/gkeconnect/gateway/v1beta1/gateway_services_pb.rb +0 -59
  23. data/proto_docs/google/api/httpbody.rb +0 -80
  24. data/proto_docs/google/protobuf/any.rb +0 -145
@@ -1,778 +0,0 @@
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/gkeconnect/gateway/v1beta1/gateway_pb"
21
-
22
- module Google
23
- module Cloud
24
- module GkeConnect
25
- module Gateway
26
- module V1beta1
27
- module GatewayService
28
- ##
29
- # Client for the GatewayService service.
30
- #
31
- # Gateway service is a public API which works as a Kubernetes resource model
32
- # proxy between end users and registered Kubernetes clusters. Each RPC in this
33
- # service matches with an HTTP verb. End user will initiate kubectl commands
34
- # against the Gateway service, and Gateway service will forward user requests
35
- # to clusters.
36
- #
37
- class Client
38
- # @private
39
- DEFAULT_ENDPOINT_TEMPLATE = "connectgateway.$UNIVERSE_DOMAIN$"
40
-
41
- # @private
42
- attr_reader :gateway_service_stub
43
-
44
- ##
45
- # Configure the GatewayService Client class.
46
- #
47
- # See {::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client::Configuration}
48
- # for a description of the configuration fields.
49
- #
50
- # @example
51
- #
52
- # # Modify the configuration for all GatewayService clients
53
- # ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.configure do |config|
54
- # config.timeout = 10.0
55
- # end
56
- #
57
- # @yield [config] Configure the Client client.
58
- # @yieldparam config [Client::Configuration]
59
- #
60
- # @return [Client::Configuration]
61
- #
62
- def self.configure
63
- @configure ||= begin
64
- namespace = ["Google", "Cloud", "GkeConnect", "Gateway", "V1beta1"]
65
- parent_config = while namespace.any?
66
- parent_name = namespace.join "::"
67
- parent_const = const_get parent_name
68
- break parent_const.configure if parent_const.respond_to? :configure
69
- namespace.pop
70
- end
71
- default_config = Client::Configuration.new parent_config
72
-
73
- default_config
74
- end
75
- yield @configure if block_given?
76
- @configure
77
- end
78
-
79
- ##
80
- # Configure the GatewayService Client instance.
81
- #
82
- # The configuration is set to the derived mode, meaning that values can be changed,
83
- # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
- # should be made on {Client.configure}.
85
- #
86
- # See {::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client::Configuration}
87
- # for a description of the configuration fields.
88
- #
89
- # @yield [config] Configure the Client client.
90
- # @yieldparam config [Client::Configuration]
91
- #
92
- # @return [Client::Configuration]
93
- #
94
- def configure
95
- yield @config if block_given?
96
- @config
97
- end
98
-
99
- ##
100
- # The effective universe domain
101
- #
102
- # @return [String]
103
- #
104
- def universe_domain
105
- @gateway_service_stub.universe_domain
106
- end
107
-
108
- ##
109
- # Create a new GatewayService client object.
110
- #
111
- # @example
112
- #
113
- # # Create a client using the default configuration
114
- # client = ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new
115
- #
116
- # # Create a client using a custom configuration
117
- # client = ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new do |config|
118
- # config.timeout = 10.0
119
- # end
120
- #
121
- # @yield [config] Configure the GatewayService client.
122
- # @yieldparam config [Client::Configuration]
123
- #
124
- def initialize
125
- # These require statements are intentionally placed here to initialize
126
- # the gRPC module only when it's required.
127
- # See https://github.com/googleapis/toolkit/issues/446
128
- require "gapic/grpc"
129
- require "google/cloud/gkeconnect/gateway/v1beta1/gateway_services_pb"
130
-
131
- # Create the configuration object
132
- @config = Configuration.new Client.configure
133
-
134
- # Yield the configuration if needed
135
- yield @config if block_given?
136
-
137
- # Create credentials
138
- credentials = @config.credentials
139
- # Use self-signed JWT if the endpoint is unchanged from default,
140
- # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint.nil? ||
142
- (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
- !@config.endpoint.split(".").first.include?("-"))
144
- credentials ||= Credentials.default scope: @config.scope,
145
- enable_self_signed_jwt: enable_self_signed_jwt
146
- if credentials.is_a?(::String) || credentials.is_a?(::Hash)
147
- credentials = Credentials.new credentials, scope: @config.scope
148
- end
149
- @quota_project_id = @config.quota_project
150
- @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
-
152
- @gateway_service_stub = ::Gapic::ServiceStub.new(
153
- ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Stub,
154
- credentials: credentials,
155
- endpoint: @config.endpoint,
156
- endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
- universe_domain: @config.universe_domain,
158
- channel_args: @config.channel_args,
159
- interceptors: @config.interceptors,
160
- channel_pool_config: @config.channel_pool
161
- )
162
- end
163
-
164
- # Service calls
165
-
166
- ##
167
- # GetResource performs an HTTP GET request on the Kubernetes API Server.
168
- #
169
- # @overload get_resource(request, options = nil)
170
- # Pass arguments to `get_resource` via a request object, either of type
171
- # {::Google::Api::HttpBody} or an equivalent Hash.
172
- #
173
- # @param request [::Google::Api::HttpBody, ::Hash]
174
- # A request object representing the call parameters. Required. To specify no
175
- # parameters, or to keep all the default parameter values, pass an empty Hash.
176
- # @param options [::Gapic::CallOptions, ::Hash]
177
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
178
- #
179
- # @overload get_resource(content_type: nil, data: nil, extensions: nil)
180
- # Pass arguments to `get_resource` via keyword arguments. Note that at
181
- # least one keyword argument is required. To specify no parameters, or to keep all
182
- # the default parameter values, pass an empty Hash as a request object (see above).
183
- #
184
- # @param content_type [::String]
185
- # The HTTP Content-Type header value specifying the content type of the body.
186
- # @param data [::String]
187
- # The HTTP request/response body as raw binary.
188
- # @param extensions [::Array<::Google::Protobuf::Any, ::Hash>]
189
- # Application specific response metadata. Must be set in the first response
190
- # for streaming APIs.
191
- #
192
- # @yield [response, operation] Access the result along with the RPC operation
193
- # @yieldparam response [::Google::Api::HttpBody]
194
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
195
- #
196
- # @return [::Google::Api::HttpBody]
197
- #
198
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
199
- #
200
- # @example Basic example
201
- # require "google/cloud/gke_connect/gateway/v1beta1"
202
- #
203
- # # Create a client object. The client can be reused for multiple calls.
204
- # client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new
205
- #
206
- # # Create a request. To set request fields, pass in keyword arguments.
207
- # request = Google::Api::HttpBody.new
208
- #
209
- # # Call the get_resource method.
210
- # result = client.get_resource request
211
- #
212
- # # The returned object is of type Google::Api::HttpBody.
213
- # p result
214
- #
215
- def get_resource request, options = nil
216
- raise ::ArgumentError, "request must be provided" if request.nil?
217
-
218
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Api::HttpBody
219
-
220
- # Converts hash and nil to an options object
221
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
222
-
223
- # Customize the options with defaults
224
- metadata = @config.rpcs.get_resource.metadata.to_h
225
-
226
- # Set x-goog-api-client and x-goog-user-project headers
227
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
228
- lib_name: @config.lib_name, lib_version: @config.lib_version,
229
- gapic_version: ::Google::Cloud::GkeConnect::Gateway::V1beta1::VERSION
230
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
-
232
- options.apply_defaults timeout: @config.rpcs.get_resource.timeout,
233
- metadata: metadata,
234
- retry_policy: @config.rpcs.get_resource.retry_policy
235
-
236
- options.apply_defaults timeout: @config.timeout,
237
- metadata: @config.metadata,
238
- retry_policy: @config.retry_policy
239
-
240
- @gateway_service_stub.call_rpc :get_resource, request, options: options do |response, operation|
241
- yield response, operation if block_given?
242
- return response
243
- end
244
- rescue ::GRPC::BadStatus => e
245
- raise ::Google::Cloud::Error.from_error(e)
246
- end
247
-
248
- ##
249
- # PostResource performs an HTTP POST on the Kubernetes API Server.
250
- #
251
- # @overload post_resource(request, options = nil)
252
- # Pass arguments to `post_resource` via a request object, either of type
253
- # {::Google::Api::HttpBody} or an equivalent Hash.
254
- #
255
- # @param request [::Google::Api::HttpBody, ::Hash]
256
- # A request object representing the call parameters. Required. To specify no
257
- # parameters, or to keep all the default parameter values, pass an empty Hash.
258
- # @param options [::Gapic::CallOptions, ::Hash]
259
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
260
- #
261
- # @overload post_resource(content_type: nil, data: nil, extensions: nil)
262
- # Pass arguments to `post_resource` via keyword arguments. Note that at
263
- # least one keyword argument is required. To specify no parameters, or to keep all
264
- # the default parameter values, pass an empty Hash as a request object (see above).
265
- #
266
- # @param content_type [::String]
267
- # The HTTP Content-Type header value specifying the content type of the body.
268
- # @param data [::String]
269
- # The HTTP request/response body as raw binary.
270
- # @param extensions [::Array<::Google::Protobuf::Any, ::Hash>]
271
- # Application specific response metadata. Must be set in the first response
272
- # for streaming APIs.
273
- #
274
- # @yield [response, operation] Access the result along with the RPC operation
275
- # @yieldparam response [::Google::Api::HttpBody]
276
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
277
- #
278
- # @return [::Google::Api::HttpBody]
279
- #
280
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
281
- #
282
- # @example Basic example
283
- # require "google/cloud/gke_connect/gateway/v1beta1"
284
- #
285
- # # Create a client object. The client can be reused for multiple calls.
286
- # client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new
287
- #
288
- # # Create a request. To set request fields, pass in keyword arguments.
289
- # request = Google::Api::HttpBody.new
290
- #
291
- # # Call the post_resource method.
292
- # result = client.post_resource request
293
- #
294
- # # The returned object is of type Google::Api::HttpBody.
295
- # p result
296
- #
297
- def post_resource request, options = nil
298
- raise ::ArgumentError, "request must be provided" if request.nil?
299
-
300
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Api::HttpBody
301
-
302
- # Converts hash and nil to an options object
303
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
304
-
305
- # Customize the options with defaults
306
- metadata = @config.rpcs.post_resource.metadata.to_h
307
-
308
- # Set x-goog-api-client and x-goog-user-project headers
309
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
310
- lib_name: @config.lib_name, lib_version: @config.lib_version,
311
- gapic_version: ::Google::Cloud::GkeConnect::Gateway::V1beta1::VERSION
312
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
-
314
- options.apply_defaults timeout: @config.rpcs.post_resource.timeout,
315
- metadata: metadata,
316
- retry_policy: @config.rpcs.post_resource.retry_policy
317
-
318
- options.apply_defaults timeout: @config.timeout,
319
- metadata: @config.metadata,
320
- retry_policy: @config.retry_policy
321
-
322
- @gateway_service_stub.call_rpc :post_resource, request, options: options do |response, operation|
323
- yield response, operation if block_given?
324
- return response
325
- end
326
- rescue ::GRPC::BadStatus => e
327
- raise ::Google::Cloud::Error.from_error(e)
328
- end
329
-
330
- ##
331
- # DeleteResource performs an HTTP DELETE on the Kubernetes API Server.
332
- #
333
- # @overload delete_resource(request, options = nil)
334
- # Pass arguments to `delete_resource` via a request object, either of type
335
- # {::Google::Api::HttpBody} or an equivalent Hash.
336
- #
337
- # @param request [::Google::Api::HttpBody, ::Hash]
338
- # A request object representing the call parameters. Required. To specify no
339
- # parameters, or to keep all the default parameter values, pass an empty Hash.
340
- # @param options [::Gapic::CallOptions, ::Hash]
341
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
342
- #
343
- # @overload delete_resource(content_type: nil, data: nil, extensions: nil)
344
- # Pass arguments to `delete_resource` via keyword arguments. Note that at
345
- # least one keyword argument is required. To specify no parameters, or to keep all
346
- # the default parameter values, pass an empty Hash as a request object (see above).
347
- #
348
- # @param content_type [::String]
349
- # The HTTP Content-Type header value specifying the content type of the body.
350
- # @param data [::String]
351
- # The HTTP request/response body as raw binary.
352
- # @param extensions [::Array<::Google::Protobuf::Any, ::Hash>]
353
- # Application specific response metadata. Must be set in the first response
354
- # for streaming APIs.
355
- #
356
- # @yield [response, operation] Access the result along with the RPC operation
357
- # @yieldparam response [::Google::Api::HttpBody]
358
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
359
- #
360
- # @return [::Google::Api::HttpBody]
361
- #
362
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
363
- #
364
- # @example Basic example
365
- # require "google/cloud/gke_connect/gateway/v1beta1"
366
- #
367
- # # Create a client object. The client can be reused for multiple calls.
368
- # client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new
369
- #
370
- # # Create a request. To set request fields, pass in keyword arguments.
371
- # request = Google::Api::HttpBody.new
372
- #
373
- # # Call the delete_resource method.
374
- # result = client.delete_resource request
375
- #
376
- # # The returned object is of type Google::Api::HttpBody.
377
- # p result
378
- #
379
- def delete_resource request, options = nil
380
- raise ::ArgumentError, "request must be provided" if request.nil?
381
-
382
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Api::HttpBody
383
-
384
- # Converts hash and nil to an options object
385
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
386
-
387
- # Customize the options with defaults
388
- metadata = @config.rpcs.delete_resource.metadata.to_h
389
-
390
- # Set x-goog-api-client and x-goog-user-project headers
391
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
392
- lib_name: @config.lib_name, lib_version: @config.lib_version,
393
- gapic_version: ::Google::Cloud::GkeConnect::Gateway::V1beta1::VERSION
394
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
395
-
396
- options.apply_defaults timeout: @config.rpcs.delete_resource.timeout,
397
- metadata: metadata,
398
- retry_policy: @config.rpcs.delete_resource.retry_policy
399
-
400
- options.apply_defaults timeout: @config.timeout,
401
- metadata: @config.metadata,
402
- retry_policy: @config.retry_policy
403
-
404
- @gateway_service_stub.call_rpc :delete_resource, request, options: options do |response, operation|
405
- yield response, operation if block_given?
406
- return response
407
- end
408
- rescue ::GRPC::BadStatus => e
409
- raise ::Google::Cloud::Error.from_error(e)
410
- end
411
-
412
- ##
413
- # PutResource performs an HTTP PUT on the Kubernetes API Server.
414
- #
415
- # @overload put_resource(request, options = nil)
416
- # Pass arguments to `put_resource` via a request object, either of type
417
- # {::Google::Api::HttpBody} or an equivalent Hash.
418
- #
419
- # @param request [::Google::Api::HttpBody, ::Hash]
420
- # A request object representing the call parameters. Required. To specify no
421
- # parameters, or to keep all the default parameter values, pass an empty Hash.
422
- # @param options [::Gapic::CallOptions, ::Hash]
423
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
424
- #
425
- # @overload put_resource(content_type: nil, data: nil, extensions: nil)
426
- # Pass arguments to `put_resource` via keyword arguments. Note that at
427
- # least one keyword argument is required. To specify no parameters, or to keep all
428
- # the default parameter values, pass an empty Hash as a request object (see above).
429
- #
430
- # @param content_type [::String]
431
- # The HTTP Content-Type header value specifying the content type of the body.
432
- # @param data [::String]
433
- # The HTTP request/response body as raw binary.
434
- # @param extensions [::Array<::Google::Protobuf::Any, ::Hash>]
435
- # Application specific response metadata. Must be set in the first response
436
- # for streaming APIs.
437
- #
438
- # @yield [response, operation] Access the result along with the RPC operation
439
- # @yieldparam response [::Google::Api::HttpBody]
440
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
441
- #
442
- # @return [::Google::Api::HttpBody]
443
- #
444
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
445
- #
446
- # @example Basic example
447
- # require "google/cloud/gke_connect/gateway/v1beta1"
448
- #
449
- # # Create a client object. The client can be reused for multiple calls.
450
- # client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new
451
- #
452
- # # Create a request. To set request fields, pass in keyword arguments.
453
- # request = Google::Api::HttpBody.new
454
- #
455
- # # Call the put_resource method.
456
- # result = client.put_resource request
457
- #
458
- # # The returned object is of type Google::Api::HttpBody.
459
- # p result
460
- #
461
- def put_resource request, options = nil
462
- raise ::ArgumentError, "request must be provided" if request.nil?
463
-
464
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Api::HttpBody
465
-
466
- # Converts hash and nil to an options object
467
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
468
-
469
- # Customize the options with defaults
470
- metadata = @config.rpcs.put_resource.metadata.to_h
471
-
472
- # Set x-goog-api-client and x-goog-user-project headers
473
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
474
- lib_name: @config.lib_name, lib_version: @config.lib_version,
475
- gapic_version: ::Google::Cloud::GkeConnect::Gateway::V1beta1::VERSION
476
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
477
-
478
- options.apply_defaults timeout: @config.rpcs.put_resource.timeout,
479
- metadata: metadata,
480
- retry_policy: @config.rpcs.put_resource.retry_policy
481
-
482
- options.apply_defaults timeout: @config.timeout,
483
- metadata: @config.metadata,
484
- retry_policy: @config.retry_policy
485
-
486
- @gateway_service_stub.call_rpc :put_resource, request, options: options do |response, operation|
487
- yield response, operation if block_given?
488
- return response
489
- end
490
- rescue ::GRPC::BadStatus => e
491
- raise ::Google::Cloud::Error.from_error(e)
492
- end
493
-
494
- ##
495
- # PatchResource performs an HTTP PATCH on the Kubernetes API Server.
496
- #
497
- # @overload patch_resource(request, options = nil)
498
- # Pass arguments to `patch_resource` via a request object, either of type
499
- # {::Google::Api::HttpBody} or an equivalent Hash.
500
- #
501
- # @param request [::Google::Api::HttpBody, ::Hash]
502
- # A request object representing the call parameters. Required. To specify no
503
- # parameters, or to keep all the default parameter values, pass an empty Hash.
504
- # @param options [::Gapic::CallOptions, ::Hash]
505
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
506
- #
507
- # @overload patch_resource(content_type: nil, data: nil, extensions: nil)
508
- # Pass arguments to `patch_resource` via keyword arguments. Note that at
509
- # least one keyword argument is required. To specify no parameters, or to keep all
510
- # the default parameter values, pass an empty Hash as a request object (see above).
511
- #
512
- # @param content_type [::String]
513
- # The HTTP Content-Type header value specifying the content type of the body.
514
- # @param data [::String]
515
- # The HTTP request/response body as raw binary.
516
- # @param extensions [::Array<::Google::Protobuf::Any, ::Hash>]
517
- # Application specific response metadata. Must be set in the first response
518
- # for streaming APIs.
519
- #
520
- # @yield [response, operation] Access the result along with the RPC operation
521
- # @yieldparam response [::Google::Api::HttpBody]
522
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
523
- #
524
- # @return [::Google::Api::HttpBody]
525
- #
526
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
527
- #
528
- # @example Basic example
529
- # require "google/cloud/gke_connect/gateway/v1beta1"
530
- #
531
- # # Create a client object. The client can be reused for multiple calls.
532
- # client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new
533
- #
534
- # # Create a request. To set request fields, pass in keyword arguments.
535
- # request = Google::Api::HttpBody.new
536
- #
537
- # # Call the patch_resource method.
538
- # result = client.patch_resource request
539
- #
540
- # # The returned object is of type Google::Api::HttpBody.
541
- # p result
542
- #
543
- def patch_resource request, options = nil
544
- raise ::ArgumentError, "request must be provided" if request.nil?
545
-
546
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Api::HttpBody
547
-
548
- # Converts hash and nil to an options object
549
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
550
-
551
- # Customize the options with defaults
552
- metadata = @config.rpcs.patch_resource.metadata.to_h
553
-
554
- # Set x-goog-api-client and x-goog-user-project headers
555
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
556
- lib_name: @config.lib_name, lib_version: @config.lib_version,
557
- gapic_version: ::Google::Cloud::GkeConnect::Gateway::V1beta1::VERSION
558
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
559
-
560
- options.apply_defaults timeout: @config.rpcs.patch_resource.timeout,
561
- metadata: metadata,
562
- retry_policy: @config.rpcs.patch_resource.retry_policy
563
-
564
- options.apply_defaults timeout: @config.timeout,
565
- metadata: @config.metadata,
566
- retry_policy: @config.retry_policy
567
-
568
- @gateway_service_stub.call_rpc :patch_resource, request, options: options do |response, operation|
569
- yield response, operation if block_given?
570
- return response
571
- end
572
- rescue ::GRPC::BadStatus => e
573
- raise ::Google::Cloud::Error.from_error(e)
574
- end
575
-
576
- ##
577
- # Configuration class for the GatewayService API.
578
- #
579
- # This class represents the configuration for GatewayService,
580
- # providing control over timeouts, retry behavior, logging, transport
581
- # parameters, and other low-level controls. Certain parameters can also be
582
- # applied individually to specific RPCs. See
583
- # {::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client::Configuration::Rpcs}
584
- # for a list of RPCs that can be configured independently.
585
- #
586
- # Configuration can be applied globally to all clients, or to a single client
587
- # on construction.
588
- #
589
- # @example
590
- #
591
- # # Modify the global config, setting the timeout for
592
- # # get_resource to 20 seconds,
593
- # # and all remaining timeouts to 10 seconds.
594
- # ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.configure do |config|
595
- # config.timeout = 10.0
596
- # config.rpcs.get_resource.timeout = 20.0
597
- # end
598
- #
599
- # # Apply the above configuration only to a new client.
600
- # client = ::Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new do |config|
601
- # config.timeout = 10.0
602
- # config.rpcs.get_resource.timeout = 20.0
603
- # end
604
- #
605
- # @!attribute [rw] endpoint
606
- # A custom service endpoint, as a hostname or hostname:port. The default is
607
- # nil, indicating to use the default endpoint in the current universe domain.
608
- # @return [::String,nil]
609
- # @!attribute [rw] credentials
610
- # Credentials to send with calls. You may provide any of the following types:
611
- # * (`String`) The path to a service account key file in JSON format
612
- # * (`Hash`) A service account key as a Hash
613
- # * (`Google::Auth::Credentials`) A googleauth credentials object
614
- # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
615
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
616
- # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
617
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
618
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
619
- # * (`nil`) indicating no credentials
620
- # @return [::Object]
621
- # @!attribute [rw] scope
622
- # The OAuth scopes
623
- # @return [::Array<::String>]
624
- # @!attribute [rw] lib_name
625
- # The library name as recorded in instrumentation and logging
626
- # @return [::String]
627
- # @!attribute [rw] lib_version
628
- # The library version as recorded in instrumentation and logging
629
- # @return [::String]
630
- # @!attribute [rw] channel_args
631
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
632
- # `GRPC::Core::Channel` object is provided as the credential.
633
- # @return [::Hash]
634
- # @!attribute [rw] interceptors
635
- # An array of interceptors that are run before calls are executed.
636
- # @return [::Array<::GRPC::ClientInterceptor>]
637
- # @!attribute [rw] timeout
638
- # The call timeout in seconds.
639
- # @return [::Numeric]
640
- # @!attribute [rw] metadata
641
- # Additional gRPC headers to be sent with the call.
642
- # @return [::Hash{::Symbol=>::String}]
643
- # @!attribute [rw] retry_policy
644
- # The retry policy. The value is a hash with the following keys:
645
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
646
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
647
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
648
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
649
- # trigger a retry.
650
- # @return [::Hash]
651
- # @!attribute [rw] quota_project
652
- # A separate project against which to charge quota.
653
- # @return [::String]
654
- # @!attribute [rw] universe_domain
655
- # The universe domain within which to make requests. This determines the
656
- # default endpoint URL. The default value of nil uses the environment
657
- # universe (usually the default "googleapis.com" universe).
658
- # @return [::String,nil]
659
- #
660
- class Configuration
661
- extend ::Gapic::Config
662
-
663
- # @private
664
- # The endpoint specific to the default "googleapis.com" universe. Deprecated.
665
- DEFAULT_ENDPOINT = "connectgateway.googleapis.com"
666
-
667
- config_attr :endpoint, nil, ::String, nil
668
- config_attr :credentials, nil do |value|
669
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
670
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
671
- allowed.any? { |klass| klass === value }
672
- end
673
- config_attr :scope, nil, ::String, ::Array, nil
674
- config_attr :lib_name, nil, ::String, nil
675
- config_attr :lib_version, nil, ::String, nil
676
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
677
- config_attr :interceptors, nil, ::Array, nil
678
- config_attr :timeout, nil, ::Numeric, nil
679
- config_attr :metadata, nil, ::Hash, nil
680
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
681
- config_attr :quota_project, nil, ::String, nil
682
- config_attr :universe_domain, nil, ::String, nil
683
-
684
- # @private
685
- def initialize parent_config = nil
686
- @parent_config = parent_config unless parent_config.nil?
687
-
688
- yield self if block_given?
689
- end
690
-
691
- ##
692
- # Configurations for individual RPCs
693
- # @return [Rpcs]
694
- #
695
- def rpcs
696
- @rpcs ||= begin
697
- parent_rpcs = nil
698
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
699
- Rpcs.new parent_rpcs
700
- end
701
- end
702
-
703
- ##
704
- # Configuration for the channel pool
705
- # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
706
- #
707
- def channel_pool
708
- @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
709
- end
710
-
711
- ##
712
- # Configuration RPC class for the GatewayService API.
713
- #
714
- # Includes fields providing the configuration for each RPC in this service.
715
- # Each configuration object is of type `Gapic::Config::Method` and includes
716
- # the following configuration fields:
717
- #
718
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
719
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
720
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
721
- # include the following keys:
722
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
723
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
724
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
725
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
726
- # trigger a retry.
727
- #
728
- class Rpcs
729
- ##
730
- # RPC-specific configuration for `get_resource`
731
- # @return [::Gapic::Config::Method]
732
- #
733
- attr_reader :get_resource
734
- ##
735
- # RPC-specific configuration for `post_resource`
736
- # @return [::Gapic::Config::Method]
737
- #
738
- attr_reader :post_resource
739
- ##
740
- # RPC-specific configuration for `delete_resource`
741
- # @return [::Gapic::Config::Method]
742
- #
743
- attr_reader :delete_resource
744
- ##
745
- # RPC-specific configuration for `put_resource`
746
- # @return [::Gapic::Config::Method]
747
- #
748
- attr_reader :put_resource
749
- ##
750
- # RPC-specific configuration for `patch_resource`
751
- # @return [::Gapic::Config::Method]
752
- #
753
- attr_reader :patch_resource
754
-
755
- # @private
756
- def initialize parent_rpcs = nil
757
- get_resource_config = parent_rpcs.get_resource if parent_rpcs.respond_to? :get_resource
758
- @get_resource = ::Gapic::Config::Method.new get_resource_config
759
- post_resource_config = parent_rpcs.post_resource if parent_rpcs.respond_to? :post_resource
760
- @post_resource = ::Gapic::Config::Method.new post_resource_config
761
- delete_resource_config = parent_rpcs.delete_resource if parent_rpcs.respond_to? :delete_resource
762
- @delete_resource = ::Gapic::Config::Method.new delete_resource_config
763
- put_resource_config = parent_rpcs.put_resource if parent_rpcs.respond_to? :put_resource
764
- @put_resource = ::Gapic::Config::Method.new put_resource_config
765
- patch_resource_config = parent_rpcs.patch_resource if parent_rpcs.respond_to? :patch_resource
766
- @patch_resource = ::Gapic::Config::Method.new patch_resource_config
767
-
768
- yield self if block_given?
769
- end
770
- end
771
- end
772
- end
773
- end
774
- end
775
- end
776
- end
777
- end
778
- end