google-cloud-network_security-v1beta1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +167 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google/cloud/network_security/v1beta1/network_security/client.rb +1517 -0
  7. data/lib/google/cloud/network_security/v1beta1/network_security/credentials.rb +47 -0
  8. data/lib/google/cloud/network_security/v1beta1/network_security/operations.rb +664 -0
  9. data/lib/google/cloud/network_security/v1beta1/network_security/paths.rb +107 -0
  10. data/lib/google/cloud/network_security/v1beta1/network_security.rb +48 -0
  11. data/lib/google/cloud/network_security/v1beta1/version.rb +28 -0
  12. data/lib/google/cloud/network_security/v1beta1.rb +38 -0
  13. data/lib/google/cloud/networksecurity/v1beta1/authorization_policy_pb.rb +93 -0
  14. data/lib/google/cloud/networksecurity/v1beta1/client_tls_policy_pb.rb +65 -0
  15. data/lib/google/cloud/networksecurity/v1beta1/common_pb.rb +31 -0
  16. data/lib/google/cloud/networksecurity/v1beta1/network_security_pb.rb +24 -0
  17. data/lib/google/cloud/networksecurity/v1beta1/network_security_services_pb.rb +72 -0
  18. data/lib/google/cloud/networksecurity/v1beta1/server_tls_policy_pb.rb +69 -0
  19. data/lib/google/cloud/networksecurity/v1beta1/tls_pb.rb +42 -0
  20. data/lib/google-cloud-network_security-v1beta1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/field_behavior.rb +71 -0
  23. data/proto_docs/google/api/resource.rb +283 -0
  24. data/proto_docs/google/cloud/networksecurity/v1beta1/authorization_policy.rb +252 -0
  25. data/proto_docs/google/cloud/networksecurity/v1beta1/client_tls_policy.rb +160 -0
  26. data/proto_docs/google/cloud/networksecurity/v1beta1/common.rb +56 -0
  27. data/proto_docs/google/cloud/networksecurity/v1beta1/server_tls_policy.rb +176 -0
  28. data/proto_docs/google/cloud/networksecurity/v1beta1/tls.rb +82 -0
  29. data/proto_docs/google/longrunning/operations.rb +164 -0
  30. data/proto_docs/google/protobuf/any.rb +141 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +36 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  35. data/proto_docs/google/rpc/status.rb +46 -0
  36. metadata +225 -0
@@ -0,0 +1,1517 @@
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/networksecurity/v1beta1/network_security_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module NetworkSecurity
25
+ module V1beta1
26
+ module NetworkSecurity
27
+ ##
28
+ # Client for the NetworkSecurity service.
29
+ #
30
+ class Client
31
+ include Paths
32
+
33
+ # @private
34
+ attr_reader :network_security_stub
35
+
36
+ ##
37
+ # Configure the NetworkSecurity Client class.
38
+ #
39
+ # See {::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client::Configuration}
40
+ # for a description of the configuration fields.
41
+ #
42
+ # @example
43
+ #
44
+ # # Modify the configuration for all NetworkSecurity clients
45
+ # ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.configure do |config|
46
+ # config.timeout = 10.0
47
+ # end
48
+ #
49
+ # @yield [config] Configure the Client client.
50
+ # @yieldparam config [Client::Configuration]
51
+ #
52
+ # @return [Client::Configuration]
53
+ #
54
+ def self.configure
55
+ @configure ||= begin
56
+ namespace = ["Google", "Cloud", "NetworkSecurity", "V1beta1"]
57
+ parent_config = while namespace.any?
58
+ parent_name = namespace.join "::"
59
+ parent_const = const_get parent_name
60
+ break parent_const.configure if parent_const.respond_to? :configure
61
+ namespace.pop
62
+ end
63
+ default_config = Client::Configuration.new parent_config
64
+
65
+ default_config.timeout = 60.0
66
+
67
+ default_config
68
+ end
69
+ yield @configure if block_given?
70
+ @configure
71
+ end
72
+
73
+ ##
74
+ # Configure the NetworkSecurity Client instance.
75
+ #
76
+ # The configuration is set to the derived mode, meaning that values can be changed,
77
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
78
+ # should be made on {Client.configure}.
79
+ #
80
+ # See {::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client::Configuration}
81
+ # for a description of the configuration fields.
82
+ #
83
+ # @yield [config] Configure the Client client.
84
+ # @yieldparam config [Client::Configuration]
85
+ #
86
+ # @return [Client::Configuration]
87
+ #
88
+ def configure
89
+ yield @config if block_given?
90
+ @config
91
+ end
92
+
93
+ ##
94
+ # Create a new NetworkSecurity client object.
95
+ #
96
+ # @example
97
+ #
98
+ # # Create a client using the default configuration
99
+ # client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new
100
+ #
101
+ # # Create a client using a custom configuration
102
+ # client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config|
103
+ # config.timeout = 10.0
104
+ # end
105
+ #
106
+ # @yield [config] Configure the NetworkSecurity client.
107
+ # @yieldparam config [Client::Configuration]
108
+ #
109
+ def initialize
110
+ # These require statements are intentionally placed here to initialize
111
+ # the gRPC module only when it's required.
112
+ # See https://github.com/googleapis/toolkit/issues/446
113
+ require "gapic/grpc"
114
+ require "google/cloud/networksecurity/v1beta1/network_security_services_pb"
115
+
116
+ # Create the configuration object
117
+ @config = Configuration.new Client.configure
118
+
119
+ # Yield the configuration if needed
120
+ yield @config if block_given?
121
+
122
+ # Create credentials
123
+ credentials = @config.credentials
124
+ # Use self-signed JWT if the endpoint is unchanged from default,
125
+ # but only if the default endpoint does not have a region prefix.
126
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
127
+ !@config.endpoint.split(".").first.include?("-")
128
+ credentials ||= Credentials.default scope: @config.scope,
129
+ enable_self_signed_jwt: enable_self_signed_jwt
130
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
131
+ credentials = Credentials.new credentials, scope: @config.scope
132
+ end
133
+ @quota_project_id = @config.quota_project
134
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
135
+
136
+ @operations_client = Operations.new do |config|
137
+ config.credentials = credentials
138
+ config.endpoint = @config.endpoint
139
+ end
140
+
141
+ @network_security_stub = ::Gapic::ServiceStub.new(
142
+ ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Stub,
143
+ credentials: credentials,
144
+ endpoint: @config.endpoint,
145
+ channel_args: @config.channel_args,
146
+ interceptors: @config.interceptors
147
+ )
148
+ end
149
+
150
+ ##
151
+ # Get the associated client for long-running operations.
152
+ #
153
+ # @return [::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Operations]
154
+ #
155
+ attr_reader :operations_client
156
+
157
+ # Service calls
158
+
159
+ ##
160
+ # Lists AuthorizationPolicies in a given project and location.
161
+ #
162
+ # @overload list_authorization_policies(request, options = nil)
163
+ # Pass arguments to `list_authorization_policies` via a request object, either of type
164
+ # {::Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest} or an equivalent Hash.
165
+ #
166
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest, ::Hash]
167
+ # A request object representing the call parameters. Required. To specify no
168
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
169
+ # @param options [::Gapic::CallOptions, ::Hash]
170
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
171
+ #
172
+ # @overload list_authorization_policies(parent: nil, page_size: nil, page_token: nil)
173
+ # Pass arguments to `list_authorization_policies` via keyword arguments. Note that at
174
+ # least one keyword argument is required. To specify no parameters, or to keep all
175
+ # the default parameter values, pass an empty Hash as a request object (see above).
176
+ #
177
+ # @param parent [::String]
178
+ # Required. The project and location from which the AuthorizationPolicies
179
+ # should be listed, specified in the format
180
+ # `projects/{project}/locations/{location}`.
181
+ # @param page_size [::Integer]
182
+ # Maximum number of AuthorizationPolicies to return per call.
183
+ # @param page_token [::String]
184
+ # The value returned by the last
185
+ # `ListAuthorizationPoliciesResponse` Indicates that this is a
186
+ # continuation of a prior `ListAuthorizationPolicies` call, and
187
+ # that the system should return the next page of data.
188
+ #
189
+ # @yield [response, operation] Access the result along with the RPC operation
190
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy>]
191
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
192
+ #
193
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy>]
194
+ #
195
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
196
+ #
197
+ def list_authorization_policies request, options = nil
198
+ raise ::ArgumentError, "request must be provided" if request.nil?
199
+
200
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest
201
+
202
+ # Converts hash and nil to an options object
203
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
204
+
205
+ # Customize the options with defaults
206
+ metadata = @config.rpcs.list_authorization_policies.metadata.to_h
207
+
208
+ # Set x-goog-api-client and x-goog-user-project headers
209
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
210
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
211
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
212
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
213
+
214
+ header_params = {
215
+ "parent" => request.parent
216
+ }
217
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
218
+ metadata[:"x-goog-request-params"] ||= request_params_header
219
+
220
+ options.apply_defaults timeout: @config.rpcs.list_authorization_policies.timeout,
221
+ metadata: metadata,
222
+ retry_policy: @config.rpcs.list_authorization_policies.retry_policy
223
+
224
+ options.apply_defaults timeout: @config.timeout,
225
+ metadata: @config.metadata,
226
+ retry_policy: @config.retry_policy
227
+
228
+ @network_security_stub.call_rpc :list_authorization_policies, request, options: options do |response, operation|
229
+ response = ::Gapic::PagedEnumerable.new @network_security_stub, :list_authorization_policies, request, response, operation, options
230
+ yield response, operation if block_given?
231
+ return response
232
+ end
233
+ rescue ::GRPC::BadStatus => e
234
+ raise ::Google::Cloud::Error.from_error(e)
235
+ end
236
+
237
+ ##
238
+ # Gets details of a single AuthorizationPolicy.
239
+ #
240
+ # @overload get_authorization_policy(request, options = nil)
241
+ # Pass arguments to `get_authorization_policy` via a request object, either of type
242
+ # {::Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest} or an equivalent Hash.
243
+ #
244
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest, ::Hash]
245
+ # A request object representing the call parameters. Required. To specify no
246
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
247
+ # @param options [::Gapic::CallOptions, ::Hash]
248
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
249
+ #
250
+ # @overload get_authorization_policy(name: nil)
251
+ # Pass arguments to `get_authorization_policy` via keyword arguments. Note that at
252
+ # least one keyword argument is required. To specify no parameters, or to keep all
253
+ # the default parameter values, pass an empty Hash as a request object (see above).
254
+ #
255
+ # @param name [::String]
256
+ # Required. A name of the AuthorizationPolicy to get. Must be in the format
257
+ # `projects/{project}/locations/{location}/authorizationPolicies/*`.
258
+ #
259
+ # @yield [response, operation] Access the result along with the RPC operation
260
+ # @yieldparam response [::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy]
261
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
262
+ #
263
+ # @return [::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy]
264
+ #
265
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
266
+ #
267
+ def get_authorization_policy request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ metadata = @config.rpcs.get_authorization_policy.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
282
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
283
+
284
+ header_params = {
285
+ "name" => request.name
286
+ }
287
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
288
+ metadata[:"x-goog-request-params"] ||= request_params_header
289
+
290
+ options.apply_defaults timeout: @config.rpcs.get_authorization_policy.timeout,
291
+ metadata: metadata,
292
+ retry_policy: @config.rpcs.get_authorization_policy.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @network_security_stub.call_rpc :get_authorization_policy, request, options: options do |response, operation|
299
+ yield response, operation if block_given?
300
+ return response
301
+ end
302
+ rescue ::GRPC::BadStatus => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Creates a new AuthorizationPolicy in a given project and location.
308
+ #
309
+ # @overload create_authorization_policy(request, options = nil)
310
+ # Pass arguments to `create_authorization_policy` via a request object, either of type
311
+ # {::Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
318
+ #
319
+ # @overload create_authorization_policy(parent: nil, authorization_policy_id: nil, authorization_policy: nil)
320
+ # Pass arguments to `create_authorization_policy` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param parent [::String]
325
+ # Required. The parent resource of the AuthorizationPolicy. Must be in the
326
+ # format `projects/{project}/locations/{location}`.
327
+ # @param authorization_policy_id [::String]
328
+ # Required. Short name of the AuthorizationPolicy resource to be created.
329
+ # This value should be 1-63 characters long, containing only
330
+ # letters, numbers, hyphens, and underscores, and should not start
331
+ # with a number. E.g. "authz_policy".
332
+ # @param authorization_policy [::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy, ::Hash]
333
+ # Required. AuthorizationPolicy resource to be created.
334
+ #
335
+ # @yield [response, operation] Access the result along with the RPC operation
336
+ # @yieldparam response [::Gapic::Operation]
337
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
338
+ #
339
+ # @return [::Gapic::Operation]
340
+ #
341
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
342
+ #
343
+ def create_authorization_policy request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ metadata = @config.rpcs.create_authorization_policy.metadata.to_h
353
+
354
+ # Set x-goog-api-client and x-goog-user-project headers
355
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
358
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
+
360
+ header_params = {
361
+ "parent" => request.parent
362
+ }
363
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
+ metadata[:"x-goog-request-params"] ||= request_params_header
365
+
366
+ options.apply_defaults timeout: @config.rpcs.create_authorization_policy.timeout,
367
+ metadata: metadata,
368
+ retry_policy: @config.rpcs.create_authorization_policy.retry_policy
369
+
370
+ options.apply_defaults timeout: @config.timeout,
371
+ metadata: @config.metadata,
372
+ retry_policy: @config.retry_policy
373
+
374
+ @network_security_stub.call_rpc :create_authorization_policy, request, options: options do |response, operation|
375
+ response = ::Gapic::Operation.new response, @operations_client, options: options
376
+ yield response, operation if block_given?
377
+ return response
378
+ end
379
+ rescue ::GRPC::BadStatus => e
380
+ raise ::Google::Cloud::Error.from_error(e)
381
+ end
382
+
383
+ ##
384
+ # Updates the parameters of a single AuthorizationPolicy.
385
+ #
386
+ # @overload update_authorization_policy(request, options = nil)
387
+ # Pass arguments to `update_authorization_policy` via a request object, either of type
388
+ # {::Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest} or an equivalent Hash.
389
+ #
390
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest, ::Hash]
391
+ # A request object representing the call parameters. Required. To specify no
392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
393
+ # @param options [::Gapic::CallOptions, ::Hash]
394
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
395
+ #
396
+ # @overload update_authorization_policy(update_mask: nil, authorization_policy: nil)
397
+ # Pass arguments to `update_authorization_policy` via keyword arguments. Note that at
398
+ # least one keyword argument is required. To specify no parameters, or to keep all
399
+ # the default parameter values, pass an empty Hash as a request object (see above).
400
+ #
401
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
402
+ # Optional. Field mask is used to specify the fields to be overwritten in the
403
+ # AuthorizationPolicy resource by the update.
404
+ # The fields specified in the update_mask are relative to the resource, not
405
+ # the full request. A field will be overwritten if it is in the mask. If the
406
+ # user does not provide a mask then all fields will be overwritten.
407
+ # @param authorization_policy [::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy, ::Hash]
408
+ # Required. Updated AuthorizationPolicy resource.
409
+ #
410
+ # @yield [response, operation] Access the result along with the RPC operation
411
+ # @yieldparam response [::Gapic::Operation]
412
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
413
+ #
414
+ # @return [::Gapic::Operation]
415
+ #
416
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
417
+ #
418
+ def update_authorization_policy request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ metadata = @config.rpcs.update_authorization_policy.metadata.to_h
428
+
429
+ # Set x-goog-api-client and x-goog-user-project headers
430
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
433
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
434
+
435
+ header_params = {
436
+ "authorization_policy.name" => request.authorization_policy.name
437
+ }
438
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
439
+ metadata[:"x-goog-request-params"] ||= request_params_header
440
+
441
+ options.apply_defaults timeout: @config.rpcs.update_authorization_policy.timeout,
442
+ metadata: metadata,
443
+ retry_policy: @config.rpcs.update_authorization_policy.retry_policy
444
+
445
+ options.apply_defaults timeout: @config.timeout,
446
+ metadata: @config.metadata,
447
+ retry_policy: @config.retry_policy
448
+
449
+ @network_security_stub.call_rpc :update_authorization_policy, request, options: options do |response, operation|
450
+ response = ::Gapic::Operation.new response, @operations_client, options: options
451
+ yield response, operation if block_given?
452
+ return response
453
+ end
454
+ rescue ::GRPC::BadStatus => e
455
+ raise ::Google::Cloud::Error.from_error(e)
456
+ end
457
+
458
+ ##
459
+ # Deletes a single AuthorizationPolicy.
460
+ #
461
+ # @overload delete_authorization_policy(request, options = nil)
462
+ # Pass arguments to `delete_authorization_policy` via a request object, either of type
463
+ # {::Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest} or an equivalent Hash.
464
+ #
465
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest, ::Hash]
466
+ # A request object representing the call parameters. Required. To specify no
467
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
468
+ # @param options [::Gapic::CallOptions, ::Hash]
469
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
470
+ #
471
+ # @overload delete_authorization_policy(name: nil)
472
+ # Pass arguments to `delete_authorization_policy` via keyword arguments. Note that at
473
+ # least one keyword argument is required. To specify no parameters, or to keep all
474
+ # the default parameter values, pass an empty Hash as a request object (see above).
475
+ #
476
+ # @param name [::String]
477
+ # Required. A name of the AuthorizationPolicy to delete. Must be in the format
478
+ # `projects/{project}/locations/{location}/authorizationPolicies/*`.
479
+ #
480
+ # @yield [response, operation] Access the result along with the RPC operation
481
+ # @yieldparam response [::Gapic::Operation]
482
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
483
+ #
484
+ # @return [::Gapic::Operation]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
487
+ #
488
+ def delete_authorization_policy request, options = nil
489
+ raise ::ArgumentError, "request must be provided" if request.nil?
490
+
491
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest
492
+
493
+ # Converts hash and nil to an options object
494
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
495
+
496
+ # Customize the options with defaults
497
+ metadata = @config.rpcs.delete_authorization_policy.metadata.to_h
498
+
499
+ # Set x-goog-api-client and x-goog-user-project headers
500
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
501
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
502
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
503
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
504
+
505
+ header_params = {
506
+ "name" => request.name
507
+ }
508
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
509
+ metadata[:"x-goog-request-params"] ||= request_params_header
510
+
511
+ options.apply_defaults timeout: @config.rpcs.delete_authorization_policy.timeout,
512
+ metadata: metadata,
513
+ retry_policy: @config.rpcs.delete_authorization_policy.retry_policy
514
+
515
+ options.apply_defaults timeout: @config.timeout,
516
+ metadata: @config.metadata,
517
+ retry_policy: @config.retry_policy
518
+
519
+ @network_security_stub.call_rpc :delete_authorization_policy, request, options: options do |response, operation|
520
+ response = ::Gapic::Operation.new response, @operations_client, options: options
521
+ yield response, operation if block_given?
522
+ return response
523
+ end
524
+ rescue ::GRPC::BadStatus => e
525
+ raise ::Google::Cloud::Error.from_error(e)
526
+ end
527
+
528
+ ##
529
+ # Lists ServerTlsPolicies in a given project and location.
530
+ #
531
+ # @overload list_server_tls_policies(request, options = nil)
532
+ # Pass arguments to `list_server_tls_policies` via a request object, either of type
533
+ # {::Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest} or an equivalent Hash.
534
+ #
535
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest, ::Hash]
536
+ # A request object representing the call parameters. Required. To specify no
537
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
538
+ # @param options [::Gapic::CallOptions, ::Hash]
539
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
540
+ #
541
+ # @overload list_server_tls_policies(parent: nil, page_size: nil, page_token: nil)
542
+ # Pass arguments to `list_server_tls_policies` via keyword arguments. Note that at
543
+ # least one keyword argument is required. To specify no parameters, or to keep all
544
+ # the default parameter values, pass an empty Hash as a request object (see above).
545
+ #
546
+ # @param parent [::String]
547
+ # Required. The project and location from which the ServerTlsPolicies should
548
+ # be listed, specified in the format `projects/*/locations/{location}`.
549
+ # @param page_size [::Integer]
550
+ # Maximum number of ServerTlsPolicies to return per call.
551
+ # @param page_token [::String]
552
+ # The value returned by the last `ListServerTlsPoliciesResponse`
553
+ # Indicates that this is a continuation of a prior
554
+ # `ListServerTlsPolicies` call, and that the system
555
+ # should return the next page of data.
556
+ #
557
+ # @yield [response, operation] Access the result along with the RPC operation
558
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy>]
559
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
560
+ #
561
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy>]
562
+ #
563
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
564
+ #
565
+ def list_server_tls_policies request, options = nil
566
+ raise ::ArgumentError, "request must be provided" if request.nil?
567
+
568
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest
569
+
570
+ # Converts hash and nil to an options object
571
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
572
+
573
+ # Customize the options with defaults
574
+ metadata = @config.rpcs.list_server_tls_policies.metadata.to_h
575
+
576
+ # Set x-goog-api-client and x-goog-user-project headers
577
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
578
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
579
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
580
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
581
+
582
+ header_params = {
583
+ "parent" => request.parent
584
+ }
585
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
586
+ metadata[:"x-goog-request-params"] ||= request_params_header
587
+
588
+ options.apply_defaults timeout: @config.rpcs.list_server_tls_policies.timeout,
589
+ metadata: metadata,
590
+ retry_policy: @config.rpcs.list_server_tls_policies.retry_policy
591
+
592
+ options.apply_defaults timeout: @config.timeout,
593
+ metadata: @config.metadata,
594
+ retry_policy: @config.retry_policy
595
+
596
+ @network_security_stub.call_rpc :list_server_tls_policies, request, options: options do |response, operation|
597
+ response = ::Gapic::PagedEnumerable.new @network_security_stub, :list_server_tls_policies, request, response, operation, options
598
+ yield response, operation if block_given?
599
+ return response
600
+ end
601
+ rescue ::GRPC::BadStatus => e
602
+ raise ::Google::Cloud::Error.from_error(e)
603
+ end
604
+
605
+ ##
606
+ # Gets details of a single ServerTlsPolicy.
607
+ #
608
+ # @overload get_server_tls_policy(request, options = nil)
609
+ # Pass arguments to `get_server_tls_policy` via a request object, either of type
610
+ # {::Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest} or an equivalent Hash.
611
+ #
612
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest, ::Hash]
613
+ # A request object representing the call parameters. Required. To specify no
614
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
615
+ # @param options [::Gapic::CallOptions, ::Hash]
616
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
617
+ #
618
+ # @overload get_server_tls_policy(name: nil)
619
+ # Pass arguments to `get_server_tls_policy` via keyword arguments. Note that at
620
+ # least one keyword argument is required. To specify no parameters, or to keep all
621
+ # the default parameter values, pass an empty Hash as a request object (see above).
622
+ #
623
+ # @param name [::String]
624
+ # Required. A name of the ServerTlsPolicy to get. Must be in the format
625
+ # `projects/*/locations/{location}/serverTlsPolicies/*`.
626
+ #
627
+ # @yield [response, operation] Access the result along with the RPC operation
628
+ # @yieldparam response [::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy]
629
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
630
+ #
631
+ # @return [::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy]
632
+ #
633
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
634
+ #
635
+ def get_server_tls_policy request, options = nil
636
+ raise ::ArgumentError, "request must be provided" if request.nil?
637
+
638
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest
639
+
640
+ # Converts hash and nil to an options object
641
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
642
+
643
+ # Customize the options with defaults
644
+ metadata = @config.rpcs.get_server_tls_policy.metadata.to_h
645
+
646
+ # Set x-goog-api-client and x-goog-user-project headers
647
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
648
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
649
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
650
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
651
+
652
+ header_params = {
653
+ "name" => request.name
654
+ }
655
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
656
+ metadata[:"x-goog-request-params"] ||= request_params_header
657
+
658
+ options.apply_defaults timeout: @config.rpcs.get_server_tls_policy.timeout,
659
+ metadata: metadata,
660
+ retry_policy: @config.rpcs.get_server_tls_policy.retry_policy
661
+
662
+ options.apply_defaults timeout: @config.timeout,
663
+ metadata: @config.metadata,
664
+ retry_policy: @config.retry_policy
665
+
666
+ @network_security_stub.call_rpc :get_server_tls_policy, request, options: options do |response, operation|
667
+ yield response, operation if block_given?
668
+ return response
669
+ end
670
+ rescue ::GRPC::BadStatus => e
671
+ raise ::Google::Cloud::Error.from_error(e)
672
+ end
673
+
674
+ ##
675
+ # Creates a new ServerTlsPolicy in a given project and location.
676
+ #
677
+ # @overload create_server_tls_policy(request, options = nil)
678
+ # Pass arguments to `create_server_tls_policy` via a request object, either of type
679
+ # {::Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest} or an equivalent Hash.
680
+ #
681
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest, ::Hash]
682
+ # A request object representing the call parameters. Required. To specify no
683
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
684
+ # @param options [::Gapic::CallOptions, ::Hash]
685
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
686
+ #
687
+ # @overload create_server_tls_policy(parent: nil, server_tls_policy_id: nil, server_tls_policy: nil)
688
+ # Pass arguments to `create_server_tls_policy` via keyword arguments. Note that at
689
+ # least one keyword argument is required. To specify no parameters, or to keep all
690
+ # the default parameter values, pass an empty Hash as a request object (see above).
691
+ #
692
+ # @param parent [::String]
693
+ # Required. The parent resource of the ServerTlsPolicy. Must be in
694
+ # the format `projects/*/locations/{location}`.
695
+ # @param server_tls_policy_id [::String]
696
+ # Required. Short name of the ServerTlsPolicy resource to be created. This value should
697
+ # be 1-63 characters long, containing only letters, numbers, hyphens, and
698
+ # underscores, and should not start with a number. E.g. "server_mtls_policy".
699
+ # @param server_tls_policy [::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy, ::Hash]
700
+ # Required. ServerTlsPolicy resource to be created.
701
+ #
702
+ # @yield [response, operation] Access the result along with the RPC operation
703
+ # @yieldparam response [::Gapic::Operation]
704
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
705
+ #
706
+ # @return [::Gapic::Operation]
707
+ #
708
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
709
+ #
710
+ def create_server_tls_policy request, options = nil
711
+ raise ::ArgumentError, "request must be provided" if request.nil?
712
+
713
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest
714
+
715
+ # Converts hash and nil to an options object
716
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
717
+
718
+ # Customize the options with defaults
719
+ metadata = @config.rpcs.create_server_tls_policy.metadata.to_h
720
+
721
+ # Set x-goog-api-client and x-goog-user-project headers
722
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
723
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
724
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
725
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
726
+
727
+ header_params = {
728
+ "parent" => request.parent
729
+ }
730
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
731
+ metadata[:"x-goog-request-params"] ||= request_params_header
732
+
733
+ options.apply_defaults timeout: @config.rpcs.create_server_tls_policy.timeout,
734
+ metadata: metadata,
735
+ retry_policy: @config.rpcs.create_server_tls_policy.retry_policy
736
+
737
+ options.apply_defaults timeout: @config.timeout,
738
+ metadata: @config.metadata,
739
+ retry_policy: @config.retry_policy
740
+
741
+ @network_security_stub.call_rpc :create_server_tls_policy, request, options: options do |response, operation|
742
+ response = ::Gapic::Operation.new response, @operations_client, options: options
743
+ yield response, operation if block_given?
744
+ return response
745
+ end
746
+ rescue ::GRPC::BadStatus => e
747
+ raise ::Google::Cloud::Error.from_error(e)
748
+ end
749
+
750
+ ##
751
+ # Updates the parameters of a single ServerTlsPolicy.
752
+ #
753
+ # @overload update_server_tls_policy(request, options = nil)
754
+ # Pass arguments to `update_server_tls_policy` via a request object, either of type
755
+ # {::Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest} or an equivalent Hash.
756
+ #
757
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest, ::Hash]
758
+ # A request object representing the call parameters. Required. To specify no
759
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
760
+ # @param options [::Gapic::CallOptions, ::Hash]
761
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
762
+ #
763
+ # @overload update_server_tls_policy(update_mask: nil, server_tls_policy: nil)
764
+ # Pass arguments to `update_server_tls_policy` via keyword arguments. Note that at
765
+ # least one keyword argument is required. To specify no parameters, or to keep all
766
+ # the default parameter values, pass an empty Hash as a request object (see above).
767
+ #
768
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
769
+ # Optional. Field mask is used to specify the fields to be overwritten in the
770
+ # ServerTlsPolicy resource by the update. The fields
771
+ # specified in the update_mask are relative to the resource, not
772
+ # the full request. A field will be overwritten if it is in the
773
+ # mask. If the user does not provide a mask then all fields will be
774
+ # overwritten.
775
+ # @param server_tls_policy [::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy, ::Hash]
776
+ # Required. Updated ServerTlsPolicy resource.
777
+ #
778
+ # @yield [response, operation] Access the result along with the RPC operation
779
+ # @yieldparam response [::Gapic::Operation]
780
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
781
+ #
782
+ # @return [::Gapic::Operation]
783
+ #
784
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
785
+ #
786
+ def update_server_tls_policy request, options = nil
787
+ raise ::ArgumentError, "request must be provided" if request.nil?
788
+
789
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest
790
+
791
+ # Converts hash and nil to an options object
792
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
793
+
794
+ # Customize the options with defaults
795
+ metadata = @config.rpcs.update_server_tls_policy.metadata.to_h
796
+
797
+ # Set x-goog-api-client and x-goog-user-project headers
798
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
799
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
800
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
801
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
802
+
803
+ header_params = {
804
+ "server_tls_policy.name" => request.server_tls_policy.name
805
+ }
806
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
807
+ metadata[:"x-goog-request-params"] ||= request_params_header
808
+
809
+ options.apply_defaults timeout: @config.rpcs.update_server_tls_policy.timeout,
810
+ metadata: metadata,
811
+ retry_policy: @config.rpcs.update_server_tls_policy.retry_policy
812
+
813
+ options.apply_defaults timeout: @config.timeout,
814
+ metadata: @config.metadata,
815
+ retry_policy: @config.retry_policy
816
+
817
+ @network_security_stub.call_rpc :update_server_tls_policy, request, options: options do |response, operation|
818
+ response = ::Gapic::Operation.new response, @operations_client, options: options
819
+ yield response, operation if block_given?
820
+ return response
821
+ end
822
+ rescue ::GRPC::BadStatus => e
823
+ raise ::Google::Cloud::Error.from_error(e)
824
+ end
825
+
826
+ ##
827
+ # Deletes a single ServerTlsPolicy.
828
+ #
829
+ # @overload delete_server_tls_policy(request, options = nil)
830
+ # Pass arguments to `delete_server_tls_policy` via a request object, either of type
831
+ # {::Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest} or an equivalent Hash.
832
+ #
833
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest, ::Hash]
834
+ # A request object representing the call parameters. Required. To specify no
835
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
836
+ # @param options [::Gapic::CallOptions, ::Hash]
837
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
838
+ #
839
+ # @overload delete_server_tls_policy(name: nil)
840
+ # Pass arguments to `delete_server_tls_policy` via keyword arguments. Note that at
841
+ # least one keyword argument is required. To specify no parameters, or to keep all
842
+ # the default parameter values, pass an empty Hash as a request object (see above).
843
+ #
844
+ # @param name [::String]
845
+ # Required. A name of the ServerTlsPolicy to delete. Must be in
846
+ # the format `projects/*/locations/{location}/serverTlsPolicies/*`.
847
+ #
848
+ # @yield [response, operation] Access the result along with the RPC operation
849
+ # @yieldparam response [::Gapic::Operation]
850
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
851
+ #
852
+ # @return [::Gapic::Operation]
853
+ #
854
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
855
+ #
856
+ def delete_server_tls_policy request, options = nil
857
+ raise ::ArgumentError, "request must be provided" if request.nil?
858
+
859
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest
860
+
861
+ # Converts hash and nil to an options object
862
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
863
+
864
+ # Customize the options with defaults
865
+ metadata = @config.rpcs.delete_server_tls_policy.metadata.to_h
866
+
867
+ # Set x-goog-api-client and x-goog-user-project headers
868
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
869
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
870
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
871
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
+
873
+ header_params = {
874
+ "name" => request.name
875
+ }
876
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
877
+ metadata[:"x-goog-request-params"] ||= request_params_header
878
+
879
+ options.apply_defaults timeout: @config.rpcs.delete_server_tls_policy.timeout,
880
+ metadata: metadata,
881
+ retry_policy: @config.rpcs.delete_server_tls_policy.retry_policy
882
+
883
+ options.apply_defaults timeout: @config.timeout,
884
+ metadata: @config.metadata,
885
+ retry_policy: @config.retry_policy
886
+
887
+ @network_security_stub.call_rpc :delete_server_tls_policy, request, options: options do |response, operation|
888
+ response = ::Gapic::Operation.new response, @operations_client, options: options
889
+ yield response, operation if block_given?
890
+ return response
891
+ end
892
+ rescue ::GRPC::BadStatus => e
893
+ raise ::Google::Cloud::Error.from_error(e)
894
+ end
895
+
896
+ ##
897
+ # Lists ClientTlsPolicies in a given project and location.
898
+ #
899
+ # @overload list_client_tls_policies(request, options = nil)
900
+ # Pass arguments to `list_client_tls_policies` via a request object, either of type
901
+ # {::Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest} or an equivalent Hash.
902
+ #
903
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest, ::Hash]
904
+ # A request object representing the call parameters. Required. To specify no
905
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
906
+ # @param options [::Gapic::CallOptions, ::Hash]
907
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
908
+ #
909
+ # @overload list_client_tls_policies(parent: nil, page_size: nil, page_token: nil)
910
+ # Pass arguments to `list_client_tls_policies` via keyword arguments. Note that at
911
+ # least one keyword argument is required. To specify no parameters, or to keep all
912
+ # the default parameter values, pass an empty Hash as a request object (see above).
913
+ #
914
+ # @param parent [::String]
915
+ # Required. The project and location from which the ClientTlsPolicies should
916
+ # be listed, specified in the format `projects/*/locations/{location}`.
917
+ # @param page_size [::Integer]
918
+ # Maximum number of ClientTlsPolicies to return per call.
919
+ # @param page_token [::String]
920
+ # The value returned by the last `ListClientTlsPoliciesResponse`
921
+ # Indicates that this is a continuation of a prior
922
+ # `ListClientTlsPolicies` call, and that the system
923
+ # should return the next page of data.
924
+ #
925
+ # @yield [response, operation] Access the result along with the RPC operation
926
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy>]
927
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
928
+ #
929
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy>]
930
+ #
931
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
932
+ #
933
+ def list_client_tls_policies request, options = nil
934
+ raise ::ArgumentError, "request must be provided" if request.nil?
935
+
936
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest
937
+
938
+ # Converts hash and nil to an options object
939
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
940
+
941
+ # Customize the options with defaults
942
+ metadata = @config.rpcs.list_client_tls_policies.metadata.to_h
943
+
944
+ # Set x-goog-api-client and x-goog-user-project headers
945
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
946
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
947
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
948
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
949
+
950
+ header_params = {
951
+ "parent" => request.parent
952
+ }
953
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
954
+ metadata[:"x-goog-request-params"] ||= request_params_header
955
+
956
+ options.apply_defaults timeout: @config.rpcs.list_client_tls_policies.timeout,
957
+ metadata: metadata,
958
+ retry_policy: @config.rpcs.list_client_tls_policies.retry_policy
959
+
960
+ options.apply_defaults timeout: @config.timeout,
961
+ metadata: @config.metadata,
962
+ retry_policy: @config.retry_policy
963
+
964
+ @network_security_stub.call_rpc :list_client_tls_policies, request, options: options do |response, operation|
965
+ response = ::Gapic::PagedEnumerable.new @network_security_stub, :list_client_tls_policies, request, response, operation, options
966
+ yield response, operation if block_given?
967
+ return response
968
+ end
969
+ rescue ::GRPC::BadStatus => e
970
+ raise ::Google::Cloud::Error.from_error(e)
971
+ end
972
+
973
+ ##
974
+ # Gets details of a single ClientTlsPolicy.
975
+ #
976
+ # @overload get_client_tls_policy(request, options = nil)
977
+ # Pass arguments to `get_client_tls_policy` via a request object, either of type
978
+ # {::Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest} or an equivalent Hash.
979
+ #
980
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest, ::Hash]
981
+ # A request object representing the call parameters. Required. To specify no
982
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
983
+ # @param options [::Gapic::CallOptions, ::Hash]
984
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
985
+ #
986
+ # @overload get_client_tls_policy(name: nil)
987
+ # Pass arguments to `get_client_tls_policy` via keyword arguments. Note that at
988
+ # least one keyword argument is required. To specify no parameters, or to keep all
989
+ # the default parameter values, pass an empty Hash as a request object (see above).
990
+ #
991
+ # @param name [::String]
992
+ # Required. A name of the ClientTlsPolicy to get. Must be in the format
993
+ # `projects/*/locations/{location}/clientTlsPolicies/*`.
994
+ #
995
+ # @yield [response, operation] Access the result along with the RPC operation
996
+ # @yieldparam response [::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy]
997
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
998
+ #
999
+ # @return [::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy]
1000
+ #
1001
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1002
+ #
1003
+ def get_client_tls_policy request, options = nil
1004
+ raise ::ArgumentError, "request must be provided" if request.nil?
1005
+
1006
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest
1007
+
1008
+ # Converts hash and nil to an options object
1009
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1010
+
1011
+ # Customize the options with defaults
1012
+ metadata = @config.rpcs.get_client_tls_policy.metadata.to_h
1013
+
1014
+ # Set x-goog-api-client and x-goog-user-project headers
1015
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1016
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1017
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
1018
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1019
+
1020
+ header_params = {
1021
+ "name" => request.name
1022
+ }
1023
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1024
+ metadata[:"x-goog-request-params"] ||= request_params_header
1025
+
1026
+ options.apply_defaults timeout: @config.rpcs.get_client_tls_policy.timeout,
1027
+ metadata: metadata,
1028
+ retry_policy: @config.rpcs.get_client_tls_policy.retry_policy
1029
+
1030
+ options.apply_defaults timeout: @config.timeout,
1031
+ metadata: @config.metadata,
1032
+ retry_policy: @config.retry_policy
1033
+
1034
+ @network_security_stub.call_rpc :get_client_tls_policy, request, options: options do |response, operation|
1035
+ yield response, operation if block_given?
1036
+ return response
1037
+ end
1038
+ rescue ::GRPC::BadStatus => e
1039
+ raise ::Google::Cloud::Error.from_error(e)
1040
+ end
1041
+
1042
+ ##
1043
+ # Creates a new ClientTlsPolicy in a given project and location.
1044
+ #
1045
+ # @overload create_client_tls_policy(request, options = nil)
1046
+ # Pass arguments to `create_client_tls_policy` via a request object, either of type
1047
+ # {::Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest} or an equivalent Hash.
1048
+ #
1049
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest, ::Hash]
1050
+ # A request object representing the call parameters. Required. To specify no
1051
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1052
+ # @param options [::Gapic::CallOptions, ::Hash]
1053
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1054
+ #
1055
+ # @overload create_client_tls_policy(parent: nil, client_tls_policy_id: nil, client_tls_policy: nil)
1056
+ # Pass arguments to `create_client_tls_policy` via keyword arguments. Note that at
1057
+ # least one keyword argument is required. To specify no parameters, or to keep all
1058
+ # the default parameter values, pass an empty Hash as a request object (see above).
1059
+ #
1060
+ # @param parent [::String]
1061
+ # Required. The parent resource of the ClientTlsPolicy. Must be in
1062
+ # the format `projects/*/locations/{location}`.
1063
+ # @param client_tls_policy_id [::String]
1064
+ # Required. Short name of the ClientTlsPolicy resource to be created. This value should
1065
+ # be 1-63 characters long, containing only letters, numbers, hyphens, and
1066
+ # underscores, and should not start with a number. E.g. "client_mtls_policy".
1067
+ # @param client_tls_policy [::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy, ::Hash]
1068
+ # Required. ClientTlsPolicy resource to be created.
1069
+ #
1070
+ # @yield [response, operation] Access the result along with the RPC operation
1071
+ # @yieldparam response [::Gapic::Operation]
1072
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1073
+ #
1074
+ # @return [::Gapic::Operation]
1075
+ #
1076
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1077
+ #
1078
+ def create_client_tls_policy request, options = nil
1079
+ raise ::ArgumentError, "request must be provided" if request.nil?
1080
+
1081
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest
1082
+
1083
+ # Converts hash and nil to an options object
1084
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1085
+
1086
+ # Customize the options with defaults
1087
+ metadata = @config.rpcs.create_client_tls_policy.metadata.to_h
1088
+
1089
+ # Set x-goog-api-client and x-goog-user-project headers
1090
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1091
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1092
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
1093
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1094
+
1095
+ header_params = {
1096
+ "parent" => request.parent
1097
+ }
1098
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1099
+ metadata[:"x-goog-request-params"] ||= request_params_header
1100
+
1101
+ options.apply_defaults timeout: @config.rpcs.create_client_tls_policy.timeout,
1102
+ metadata: metadata,
1103
+ retry_policy: @config.rpcs.create_client_tls_policy.retry_policy
1104
+
1105
+ options.apply_defaults timeout: @config.timeout,
1106
+ metadata: @config.metadata,
1107
+ retry_policy: @config.retry_policy
1108
+
1109
+ @network_security_stub.call_rpc :create_client_tls_policy, request, options: options do |response, operation|
1110
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1111
+ yield response, operation if block_given?
1112
+ return response
1113
+ end
1114
+ rescue ::GRPC::BadStatus => e
1115
+ raise ::Google::Cloud::Error.from_error(e)
1116
+ end
1117
+
1118
+ ##
1119
+ # Updates the parameters of a single ClientTlsPolicy.
1120
+ #
1121
+ # @overload update_client_tls_policy(request, options = nil)
1122
+ # Pass arguments to `update_client_tls_policy` via a request object, either of type
1123
+ # {::Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest} or an equivalent Hash.
1124
+ #
1125
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest, ::Hash]
1126
+ # A request object representing the call parameters. Required. To specify no
1127
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1128
+ # @param options [::Gapic::CallOptions, ::Hash]
1129
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1130
+ #
1131
+ # @overload update_client_tls_policy(update_mask: nil, client_tls_policy: nil)
1132
+ # Pass arguments to `update_client_tls_policy` via keyword arguments. Note that at
1133
+ # least one keyword argument is required. To specify no parameters, or to keep all
1134
+ # the default parameter values, pass an empty Hash as a request object (see above).
1135
+ #
1136
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1137
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1138
+ # ClientTlsPolicy resource by the update. The fields
1139
+ # specified in the update_mask are relative to the resource, not
1140
+ # the full request. A field will be overwritten if it is in the
1141
+ # mask. If the user does not provide a mask then all fields will be
1142
+ # overwritten.
1143
+ # @param client_tls_policy [::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy, ::Hash]
1144
+ # Required. Updated ClientTlsPolicy resource.
1145
+ #
1146
+ # @yield [response, operation] Access the result along with the RPC operation
1147
+ # @yieldparam response [::Gapic::Operation]
1148
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1149
+ #
1150
+ # @return [::Gapic::Operation]
1151
+ #
1152
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1153
+ #
1154
+ def update_client_tls_policy request, options = nil
1155
+ raise ::ArgumentError, "request must be provided" if request.nil?
1156
+
1157
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest
1158
+
1159
+ # Converts hash and nil to an options object
1160
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1161
+
1162
+ # Customize the options with defaults
1163
+ metadata = @config.rpcs.update_client_tls_policy.metadata.to_h
1164
+
1165
+ # Set x-goog-api-client and x-goog-user-project headers
1166
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1167
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1168
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
1169
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1170
+
1171
+ header_params = {
1172
+ "client_tls_policy.name" => request.client_tls_policy.name
1173
+ }
1174
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1175
+ metadata[:"x-goog-request-params"] ||= request_params_header
1176
+
1177
+ options.apply_defaults timeout: @config.rpcs.update_client_tls_policy.timeout,
1178
+ metadata: metadata,
1179
+ retry_policy: @config.rpcs.update_client_tls_policy.retry_policy
1180
+
1181
+ options.apply_defaults timeout: @config.timeout,
1182
+ metadata: @config.metadata,
1183
+ retry_policy: @config.retry_policy
1184
+
1185
+ @network_security_stub.call_rpc :update_client_tls_policy, request, options: options do |response, operation|
1186
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1187
+ yield response, operation if block_given?
1188
+ return response
1189
+ end
1190
+ rescue ::GRPC::BadStatus => e
1191
+ raise ::Google::Cloud::Error.from_error(e)
1192
+ end
1193
+
1194
+ ##
1195
+ # Deletes a single ClientTlsPolicy.
1196
+ #
1197
+ # @overload delete_client_tls_policy(request, options = nil)
1198
+ # Pass arguments to `delete_client_tls_policy` via a request object, either of type
1199
+ # {::Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest} or an equivalent Hash.
1200
+ #
1201
+ # @param request [::Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest, ::Hash]
1202
+ # A request object representing the call parameters. Required. To specify no
1203
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1204
+ # @param options [::Gapic::CallOptions, ::Hash]
1205
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1206
+ #
1207
+ # @overload delete_client_tls_policy(name: nil)
1208
+ # Pass arguments to `delete_client_tls_policy` via keyword arguments. Note that at
1209
+ # least one keyword argument is required. To specify no parameters, or to keep all
1210
+ # the default parameter values, pass an empty Hash as a request object (see above).
1211
+ #
1212
+ # @param name [::String]
1213
+ # Required. A name of the ClientTlsPolicy to delete. Must be in
1214
+ # the format `projects/*/locations/{location}/clientTlsPolicies/*`.
1215
+ #
1216
+ # @yield [response, operation] Access the result along with the RPC operation
1217
+ # @yieldparam response [::Gapic::Operation]
1218
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1219
+ #
1220
+ # @return [::Gapic::Operation]
1221
+ #
1222
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1223
+ #
1224
+ def delete_client_tls_policy request, options = nil
1225
+ raise ::ArgumentError, "request must be provided" if request.nil?
1226
+
1227
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest
1228
+
1229
+ # Converts hash and nil to an options object
1230
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1231
+
1232
+ # Customize the options with defaults
1233
+ metadata = @config.rpcs.delete_client_tls_policy.metadata.to_h
1234
+
1235
+ # Set x-goog-api-client and x-goog-user-project headers
1236
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1237
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1238
+ gapic_version: ::Google::Cloud::NetworkSecurity::V1beta1::VERSION
1239
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1240
+
1241
+ header_params = {
1242
+ "name" => request.name
1243
+ }
1244
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1245
+ metadata[:"x-goog-request-params"] ||= request_params_header
1246
+
1247
+ options.apply_defaults timeout: @config.rpcs.delete_client_tls_policy.timeout,
1248
+ metadata: metadata,
1249
+ retry_policy: @config.rpcs.delete_client_tls_policy.retry_policy
1250
+
1251
+ options.apply_defaults timeout: @config.timeout,
1252
+ metadata: @config.metadata,
1253
+ retry_policy: @config.retry_policy
1254
+
1255
+ @network_security_stub.call_rpc :delete_client_tls_policy, request, options: options do |response, operation|
1256
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1257
+ yield response, operation if block_given?
1258
+ return response
1259
+ end
1260
+ rescue ::GRPC::BadStatus => e
1261
+ raise ::Google::Cloud::Error.from_error(e)
1262
+ end
1263
+
1264
+ ##
1265
+ # Configuration class for the NetworkSecurity API.
1266
+ #
1267
+ # This class represents the configuration for NetworkSecurity,
1268
+ # providing control over timeouts, retry behavior, logging, transport
1269
+ # parameters, and other low-level controls. Certain parameters can also be
1270
+ # applied individually to specific RPCs. See
1271
+ # {::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client::Configuration::Rpcs}
1272
+ # for a list of RPCs that can be configured independently.
1273
+ #
1274
+ # Configuration can be applied globally to all clients, or to a single client
1275
+ # on construction.
1276
+ #
1277
+ # @example
1278
+ #
1279
+ # # Modify the global config, setting the timeout for
1280
+ # # list_authorization_policies to 20 seconds,
1281
+ # # and all remaining timeouts to 10 seconds.
1282
+ # ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.configure do |config|
1283
+ # config.timeout = 10.0
1284
+ # config.rpcs.list_authorization_policies.timeout = 20.0
1285
+ # end
1286
+ #
1287
+ # # Apply the above configuration only to a new client.
1288
+ # client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config|
1289
+ # config.timeout = 10.0
1290
+ # config.rpcs.list_authorization_policies.timeout = 20.0
1291
+ # end
1292
+ #
1293
+ # @!attribute [rw] endpoint
1294
+ # The hostname or hostname:port of the service endpoint.
1295
+ # Defaults to `"networksecurity.googleapis.com"`.
1296
+ # @return [::String]
1297
+ # @!attribute [rw] credentials
1298
+ # Credentials to send with calls. You may provide any of the following types:
1299
+ # * (`String`) The path to a service account key file in JSON format
1300
+ # * (`Hash`) A service account key as a Hash
1301
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1302
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1303
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1304
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1305
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1306
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1307
+ # * (`nil`) indicating no credentials
1308
+ # @return [::Object]
1309
+ # @!attribute [rw] scope
1310
+ # The OAuth scopes
1311
+ # @return [::Array<::String>]
1312
+ # @!attribute [rw] lib_name
1313
+ # The library name as recorded in instrumentation and logging
1314
+ # @return [::String]
1315
+ # @!attribute [rw] lib_version
1316
+ # The library version as recorded in instrumentation and logging
1317
+ # @return [::String]
1318
+ # @!attribute [rw] channel_args
1319
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1320
+ # `GRPC::Core::Channel` object is provided as the credential.
1321
+ # @return [::Hash]
1322
+ # @!attribute [rw] interceptors
1323
+ # An array of interceptors that are run before calls are executed.
1324
+ # @return [::Array<::GRPC::ClientInterceptor>]
1325
+ # @!attribute [rw] timeout
1326
+ # The call timeout in seconds.
1327
+ # @return [::Numeric]
1328
+ # @!attribute [rw] metadata
1329
+ # Additional gRPC headers to be sent with the call.
1330
+ # @return [::Hash{::Symbol=>::String}]
1331
+ # @!attribute [rw] retry_policy
1332
+ # The retry policy. The value is a hash with the following keys:
1333
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1334
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1335
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1336
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1337
+ # trigger a retry.
1338
+ # @return [::Hash]
1339
+ # @!attribute [rw] quota_project
1340
+ # A separate project against which to charge quota.
1341
+ # @return [::String]
1342
+ #
1343
+ class Configuration
1344
+ extend ::Gapic::Config
1345
+
1346
+ config_attr :endpoint, "networksecurity.googleapis.com", ::String
1347
+ config_attr :credentials, nil do |value|
1348
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1349
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1350
+ allowed.any? { |klass| klass === value }
1351
+ end
1352
+ config_attr :scope, nil, ::String, ::Array, nil
1353
+ config_attr :lib_name, nil, ::String, nil
1354
+ config_attr :lib_version, nil, ::String, nil
1355
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1356
+ config_attr :interceptors, nil, ::Array, nil
1357
+ config_attr :timeout, nil, ::Numeric, nil
1358
+ config_attr :metadata, nil, ::Hash, nil
1359
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1360
+ config_attr :quota_project, nil, ::String, nil
1361
+
1362
+ # @private
1363
+ def initialize parent_config = nil
1364
+ @parent_config = parent_config unless parent_config.nil?
1365
+
1366
+ yield self if block_given?
1367
+ end
1368
+
1369
+ ##
1370
+ # Configurations for individual RPCs
1371
+ # @return [Rpcs]
1372
+ #
1373
+ def rpcs
1374
+ @rpcs ||= begin
1375
+ parent_rpcs = nil
1376
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1377
+ Rpcs.new parent_rpcs
1378
+ end
1379
+ end
1380
+
1381
+ ##
1382
+ # Configuration RPC class for the NetworkSecurity API.
1383
+ #
1384
+ # Includes fields providing the configuration for each RPC in this service.
1385
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1386
+ # the following configuration fields:
1387
+ #
1388
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1389
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1390
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1391
+ # include the following keys:
1392
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1393
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1394
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1395
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1396
+ # trigger a retry.
1397
+ #
1398
+ class Rpcs
1399
+ ##
1400
+ # RPC-specific configuration for `list_authorization_policies`
1401
+ # @return [::Gapic::Config::Method]
1402
+ #
1403
+ attr_reader :list_authorization_policies
1404
+ ##
1405
+ # RPC-specific configuration for `get_authorization_policy`
1406
+ # @return [::Gapic::Config::Method]
1407
+ #
1408
+ attr_reader :get_authorization_policy
1409
+ ##
1410
+ # RPC-specific configuration for `create_authorization_policy`
1411
+ # @return [::Gapic::Config::Method]
1412
+ #
1413
+ attr_reader :create_authorization_policy
1414
+ ##
1415
+ # RPC-specific configuration for `update_authorization_policy`
1416
+ # @return [::Gapic::Config::Method]
1417
+ #
1418
+ attr_reader :update_authorization_policy
1419
+ ##
1420
+ # RPC-specific configuration for `delete_authorization_policy`
1421
+ # @return [::Gapic::Config::Method]
1422
+ #
1423
+ attr_reader :delete_authorization_policy
1424
+ ##
1425
+ # RPC-specific configuration for `list_server_tls_policies`
1426
+ # @return [::Gapic::Config::Method]
1427
+ #
1428
+ attr_reader :list_server_tls_policies
1429
+ ##
1430
+ # RPC-specific configuration for `get_server_tls_policy`
1431
+ # @return [::Gapic::Config::Method]
1432
+ #
1433
+ attr_reader :get_server_tls_policy
1434
+ ##
1435
+ # RPC-specific configuration for `create_server_tls_policy`
1436
+ # @return [::Gapic::Config::Method]
1437
+ #
1438
+ attr_reader :create_server_tls_policy
1439
+ ##
1440
+ # RPC-specific configuration for `update_server_tls_policy`
1441
+ # @return [::Gapic::Config::Method]
1442
+ #
1443
+ attr_reader :update_server_tls_policy
1444
+ ##
1445
+ # RPC-specific configuration for `delete_server_tls_policy`
1446
+ # @return [::Gapic::Config::Method]
1447
+ #
1448
+ attr_reader :delete_server_tls_policy
1449
+ ##
1450
+ # RPC-specific configuration for `list_client_tls_policies`
1451
+ # @return [::Gapic::Config::Method]
1452
+ #
1453
+ attr_reader :list_client_tls_policies
1454
+ ##
1455
+ # RPC-specific configuration for `get_client_tls_policy`
1456
+ # @return [::Gapic::Config::Method]
1457
+ #
1458
+ attr_reader :get_client_tls_policy
1459
+ ##
1460
+ # RPC-specific configuration for `create_client_tls_policy`
1461
+ # @return [::Gapic::Config::Method]
1462
+ #
1463
+ attr_reader :create_client_tls_policy
1464
+ ##
1465
+ # RPC-specific configuration for `update_client_tls_policy`
1466
+ # @return [::Gapic::Config::Method]
1467
+ #
1468
+ attr_reader :update_client_tls_policy
1469
+ ##
1470
+ # RPC-specific configuration for `delete_client_tls_policy`
1471
+ # @return [::Gapic::Config::Method]
1472
+ #
1473
+ attr_reader :delete_client_tls_policy
1474
+
1475
+ # @private
1476
+ def initialize parent_rpcs = nil
1477
+ list_authorization_policies_config = parent_rpcs.list_authorization_policies if parent_rpcs.respond_to? :list_authorization_policies
1478
+ @list_authorization_policies = ::Gapic::Config::Method.new list_authorization_policies_config
1479
+ get_authorization_policy_config = parent_rpcs.get_authorization_policy if parent_rpcs.respond_to? :get_authorization_policy
1480
+ @get_authorization_policy = ::Gapic::Config::Method.new get_authorization_policy_config
1481
+ create_authorization_policy_config = parent_rpcs.create_authorization_policy if parent_rpcs.respond_to? :create_authorization_policy
1482
+ @create_authorization_policy = ::Gapic::Config::Method.new create_authorization_policy_config
1483
+ update_authorization_policy_config = parent_rpcs.update_authorization_policy if parent_rpcs.respond_to? :update_authorization_policy
1484
+ @update_authorization_policy = ::Gapic::Config::Method.new update_authorization_policy_config
1485
+ delete_authorization_policy_config = parent_rpcs.delete_authorization_policy if parent_rpcs.respond_to? :delete_authorization_policy
1486
+ @delete_authorization_policy = ::Gapic::Config::Method.new delete_authorization_policy_config
1487
+ list_server_tls_policies_config = parent_rpcs.list_server_tls_policies if parent_rpcs.respond_to? :list_server_tls_policies
1488
+ @list_server_tls_policies = ::Gapic::Config::Method.new list_server_tls_policies_config
1489
+ get_server_tls_policy_config = parent_rpcs.get_server_tls_policy if parent_rpcs.respond_to? :get_server_tls_policy
1490
+ @get_server_tls_policy = ::Gapic::Config::Method.new get_server_tls_policy_config
1491
+ create_server_tls_policy_config = parent_rpcs.create_server_tls_policy if parent_rpcs.respond_to? :create_server_tls_policy
1492
+ @create_server_tls_policy = ::Gapic::Config::Method.new create_server_tls_policy_config
1493
+ update_server_tls_policy_config = parent_rpcs.update_server_tls_policy if parent_rpcs.respond_to? :update_server_tls_policy
1494
+ @update_server_tls_policy = ::Gapic::Config::Method.new update_server_tls_policy_config
1495
+ delete_server_tls_policy_config = parent_rpcs.delete_server_tls_policy if parent_rpcs.respond_to? :delete_server_tls_policy
1496
+ @delete_server_tls_policy = ::Gapic::Config::Method.new delete_server_tls_policy_config
1497
+ list_client_tls_policies_config = parent_rpcs.list_client_tls_policies if parent_rpcs.respond_to? :list_client_tls_policies
1498
+ @list_client_tls_policies = ::Gapic::Config::Method.new list_client_tls_policies_config
1499
+ get_client_tls_policy_config = parent_rpcs.get_client_tls_policy if parent_rpcs.respond_to? :get_client_tls_policy
1500
+ @get_client_tls_policy = ::Gapic::Config::Method.new get_client_tls_policy_config
1501
+ create_client_tls_policy_config = parent_rpcs.create_client_tls_policy if parent_rpcs.respond_to? :create_client_tls_policy
1502
+ @create_client_tls_policy = ::Gapic::Config::Method.new create_client_tls_policy_config
1503
+ update_client_tls_policy_config = parent_rpcs.update_client_tls_policy if parent_rpcs.respond_to? :update_client_tls_policy
1504
+ @update_client_tls_policy = ::Gapic::Config::Method.new update_client_tls_policy_config
1505
+ delete_client_tls_policy_config = parent_rpcs.delete_client_tls_policy if parent_rpcs.respond_to? :delete_client_tls_policy
1506
+ @delete_client_tls_policy = ::Gapic::Config::Method.new delete_client_tls_policy_config
1507
+
1508
+ yield self if block_given?
1509
+ end
1510
+ end
1511
+ end
1512
+ end
1513
+ end
1514
+ end
1515
+ end
1516
+ end
1517
+ end