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