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