oci 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/oci/audit/models/audit_event.rb +34 -4
- data/lib/oci/file_storage/file_storage.rb +2 -0
- data/lib/oci/file_storage/file_storage_client.rb +60 -0
- data/lib/oci/file_storage/file_storage_client_composite_operations.rb +40 -0
- data/lib/oci/file_storage/models/client_options.rb +284 -0
- data/lib/oci/file_storage/models/create_export_details.rb +37 -1
- data/lib/oci/file_storage/models/create_snapshot_details.rb +1 -1
- data/lib/oci/file_storage/models/export.rb +43 -1
- data/lib/oci/file_storage/models/export_set.rb +1 -1
- data/lib/oci/file_storage/models/update_export_details.rb +155 -0
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +37 -1
- data/lib/oci/load_balancer/models/load_balancer.rb +37 -1
- data/lib/oci/load_balancer/models/update_load_balancer_details.rb +41 -5
- data/lib/oci/regions.rb +2 -0
- data/lib/oci/version.rb +1 -1
- metadata +44 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dce598b5266d9674ebe6ea0e70e422671331b47
|
4
|
+
data.tar.gz: e8dd3e1ad2d99f2ea990f4b93878692d02a3aa32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b50db7913ddcb46fd07972392ddee5ef2fe8d9faa3e84f56411d25151c32163661f169b8beb1502676c14da5a415cb8afdc2e1bcda7f25ac12e60c5b6029d106
|
7
|
+
data.tar.gz: 2969c2b133de7b2d9563f5293386f282f4a38de21d1d47cdeef4a2045096d3cabcc392c6965413f7d655d127dc1be9ec62f162ba6fdae1fad187d7720b344086
|
data/README.md
CHANGED
@@ -14,6 +14,12 @@ module OCI
|
|
14
14
|
# @return [String]
|
15
15
|
attr_accessor :compartment_id
|
16
16
|
|
17
|
+
# The name of the compartment. This value is the friendly name associated with compartmentId.
|
18
|
+
# This value can change, but the service logs the value that appeared at the time of the audit event.
|
19
|
+
#
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :compartment_name
|
22
|
+
|
17
23
|
# The GUID of the event.
|
18
24
|
# @return [String]
|
19
25
|
attr_accessor :event_id
|
@@ -88,12 +94,17 @@ module OCI
|
|
88
94
|
# @return [Hash<String, Object>]
|
89
95
|
attr_accessor :response_payload
|
90
96
|
|
97
|
+
# The name of the user or service. This value is the friendly name associated with principalId.
|
98
|
+
# @return [String]
|
99
|
+
attr_accessor :user_name
|
100
|
+
|
91
101
|
# Attribute mapping from ruby-style variable name to JSON key.
|
92
102
|
def self.attribute_map
|
93
103
|
{
|
94
104
|
# rubocop:disable Style/SymbolLiteral
|
95
105
|
'tenant_id': :'tenantId',
|
96
106
|
'compartment_id': :'compartmentId',
|
107
|
+
'compartment_name': :'compartmentName',
|
97
108
|
'event_id': :'eventId',
|
98
109
|
'event_name': :'eventName',
|
99
110
|
'event_source': :'eventSource',
|
@@ -111,7 +122,8 @@ module OCI
|
|
111
122
|
'response_headers': :'responseHeaders',
|
112
123
|
'response_status': :'responseStatus',
|
113
124
|
'response_time': :'responseTime',
|
114
|
-
'response_payload': :'responsePayload'
|
125
|
+
'response_payload': :'responsePayload',
|
126
|
+
'user_name': :'userName'
|
115
127
|
# rubocop:enable Style/SymbolLiteral
|
116
128
|
}
|
117
129
|
end
|
@@ -122,6 +134,7 @@ module OCI
|
|
122
134
|
# rubocop:disable Style/SymbolLiteral
|
123
135
|
'tenant_id': :'String',
|
124
136
|
'compartment_id': :'String',
|
137
|
+
'compartment_name': :'String',
|
125
138
|
'event_id': :'String',
|
126
139
|
'event_name': :'String',
|
127
140
|
'event_source': :'String',
|
@@ -139,7 +152,8 @@ module OCI
|
|
139
152
|
'response_headers': :'Hash<String, Array<String>>',
|
140
153
|
'response_status': :'String',
|
141
154
|
'response_time': :'DateTime',
|
142
|
-
'response_payload': :'Hash<String, Object>'
|
155
|
+
'response_payload': :'Hash<String, Object>',
|
156
|
+
'user_name': :'String'
|
143
157
|
# rubocop:enable Style/SymbolLiteral
|
144
158
|
}
|
145
159
|
end
|
@@ -152,6 +166,7 @@ module OCI
|
|
152
166
|
# @param [Hash] attributes Model attributes in the form of hash
|
153
167
|
# @option attributes [String] :tenant_id The value to assign to the {#tenant_id} property
|
154
168
|
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
169
|
+
# @option attributes [String] :compartment_name The value to assign to the {#compartment_name} property
|
155
170
|
# @option attributes [String] :event_id The value to assign to the {#event_id} property
|
156
171
|
# @option attributes [String] :event_name The value to assign to the {#event_name} property
|
157
172
|
# @option attributes [String] :event_source The value to assign to the {#event_source} property
|
@@ -170,6 +185,7 @@ module OCI
|
|
170
185
|
# @option attributes [String] :response_status The value to assign to the {#response_status} property
|
171
186
|
# @option attributes [DateTime] :response_time The value to assign to the {#response_time} property
|
172
187
|
# @option attributes [Hash<String, Object>] :response_payload The value to assign to the {#response_payload} property
|
188
|
+
# @option attributes [String] :user_name The value to assign to the {#user_name} property
|
173
189
|
def initialize(attributes = {})
|
174
190
|
return unless attributes.is_a?(Hash)
|
175
191
|
|
@@ -188,6 +204,12 @@ module OCI
|
|
188
204
|
|
189
205
|
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
190
206
|
|
207
|
+
self.compartment_name = attributes[:'compartmentName'] if attributes[:'compartmentName']
|
208
|
+
|
209
|
+
raise 'You cannot provide both :compartmentName and :compartment_name' if attributes.key?(:'compartmentName') && attributes.key?(:'compartment_name')
|
210
|
+
|
211
|
+
self.compartment_name = attributes[:'compartment_name'] if attributes[:'compartment_name']
|
212
|
+
|
191
213
|
self.event_id = attributes[:'eventId'] if attributes[:'eventId']
|
192
214
|
|
193
215
|
raise 'You cannot provide both :eventId and :event_id' if attributes.key?(:'eventId') && attributes.key?(:'event_id')
|
@@ -295,6 +317,12 @@ module OCI
|
|
295
317
|
raise 'You cannot provide both :responsePayload and :response_payload' if attributes.key?(:'responsePayload') && attributes.key?(:'response_payload')
|
296
318
|
|
297
319
|
self.response_payload = attributes[:'response_payload'] if attributes[:'response_payload']
|
320
|
+
|
321
|
+
self.user_name = attributes[:'userName'] if attributes[:'userName']
|
322
|
+
|
323
|
+
raise 'You cannot provide both :userName and :user_name' if attributes.key?(:'userName') && attributes.key?(:'user_name')
|
324
|
+
|
325
|
+
self.user_name = attributes[:'user_name'] if attributes[:'user_name']
|
298
326
|
end
|
299
327
|
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
300
328
|
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
@@ -309,6 +337,7 @@ module OCI
|
|
309
337
|
self.class == other.class &&
|
310
338
|
tenant_id == other.tenant_id &&
|
311
339
|
compartment_id == other.compartment_id &&
|
340
|
+
compartment_name == other.compartment_name &&
|
312
341
|
event_id == other.event_id &&
|
313
342
|
event_name == other.event_name &&
|
314
343
|
event_source == other.event_source &&
|
@@ -326,7 +355,8 @@ module OCI
|
|
326
355
|
response_headers == other.response_headers &&
|
327
356
|
response_status == other.response_status &&
|
328
357
|
response_time == other.response_time &&
|
329
|
-
response_payload == other.response_payload
|
358
|
+
response_payload == other.response_payload &&
|
359
|
+
user_name == other.user_name
|
330
360
|
end
|
331
361
|
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
332
362
|
|
@@ -342,7 +372,7 @@ module OCI
|
|
342
372
|
# Calculates hash code according to all attributes.
|
343
373
|
# @return [Fixnum] Hash code
|
344
374
|
def hash
|
345
|
-
[tenant_id, compartment_id, event_id, event_name, event_source, event_type, event_time, principal_id, credential_id, request_action, request_id, request_agent, request_headers, request_origin, request_parameters, request_resource, response_headers, response_status, response_time, response_payload].hash
|
375
|
+
[tenant_id, compartment_id, compartment_name, event_id, event_name, event_source, event_type, event_time, principal_id, credential_id, request_action, request_id, request_agent, request_headers, request_origin, request_parameters, request_resource, response_headers, response_status, response_time, response_payload, user_name].hash
|
346
376
|
end
|
347
377
|
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
348
378
|
|
@@ -10,6 +10,7 @@ module OCI
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# Require models
|
13
|
+
require 'oci/file_storage/models/client_options'
|
13
14
|
require 'oci/file_storage/models/create_export_details'
|
14
15
|
require 'oci/file_storage/models/create_file_system_details'
|
15
16
|
require 'oci/file_storage/models/create_mount_target_details'
|
@@ -24,6 +25,7 @@ require 'oci/file_storage/models/mount_target'
|
|
24
25
|
require 'oci/file_storage/models/mount_target_summary'
|
25
26
|
require 'oci/file_storage/models/snapshot'
|
26
27
|
require 'oci/file_storage/models/snapshot_summary'
|
28
|
+
require 'oci/file_storage/models/update_export_details'
|
27
29
|
require 'oci/file_storage/models/update_export_set_details'
|
28
30
|
require 'oci/file_storage/models/update_file_system_details'
|
29
31
|
require 'oci/file_storage/models/update_mount_target_details'
|
@@ -1387,6 +1387,66 @@ module OCI
|
|
1387
1387
|
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
1388
1388
|
|
1389
1389
|
|
1390
|
+
# Updates the specified export's information.
|
1391
|
+
# @param [String] export_id The OCID of the export.
|
1392
|
+
# @param [OCI::FileStorage::Models::UpdateExportDetails] update_export_details Details object for updating an export.
|
1393
|
+
# @param [Hash] opts the optional parameters
|
1394
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
1395
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
1396
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call
|
1397
|
+
# for a resource, set the `if-match` parameter to the value of the
|
1398
|
+
# etag from a previous GET or POST response for that resource.
|
1399
|
+
# The resource will be updated or deleted only if the etag you
|
1400
|
+
# provide matches the resource's current etag value.
|
1401
|
+
#
|
1402
|
+
# @return [Response] A Response object with data of type {OCI::FileStorage::Models::Export Export}
|
1403
|
+
def update_export(export_id, update_export_details, opts = {})
|
1404
|
+
logger.debug 'Calling operation FileStorageClient#update_export.' if logger
|
1405
|
+
|
1406
|
+
raise "Missing the required parameter 'export_id' when calling update_export." if export_id.nil?
|
1407
|
+
raise "Missing the required parameter 'update_export_details' when calling update_export." if update_export_details.nil?
|
1408
|
+
raise "Parameter value for 'export_id' must not be blank" if OCI::Internal::Util.blank_string?(export_id)
|
1409
|
+
|
1410
|
+
path = '/exports/{exportId}'.sub('{exportId}', export_id.to_s)
|
1411
|
+
operation_signing_strategy = :standard
|
1412
|
+
|
1413
|
+
# rubocop:disable Style/NegatedIf
|
1414
|
+
# Query Params
|
1415
|
+
query_params = {}
|
1416
|
+
|
1417
|
+
# Header Params
|
1418
|
+
header_params = {}
|
1419
|
+
header_params['accept'] = 'application/json'
|
1420
|
+
header_params['content-type'] = 'application/json'
|
1421
|
+
header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
|
1422
|
+
# rubocop:enable Style/NegatedIf
|
1423
|
+
|
1424
|
+
post_body = @api_client.object_to_http_body(update_export_details)
|
1425
|
+
|
1426
|
+
# rubocop:disable Metrics/BlockLength
|
1427
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FileStorageClient#update_export') do
|
1428
|
+
@api_client.call_api(
|
1429
|
+
:PUT,
|
1430
|
+
path,
|
1431
|
+
endpoint,
|
1432
|
+
header_params: header_params,
|
1433
|
+
query_params: query_params,
|
1434
|
+
operation_signing_strategy: operation_signing_strategy,
|
1435
|
+
body: post_body,
|
1436
|
+
return_type: 'OCI::FileStorage::Models::Export'
|
1437
|
+
)
|
1438
|
+
end
|
1439
|
+
# rubocop:enable Metrics/BlockLength
|
1440
|
+
end
|
1441
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
1442
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
1443
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
1444
|
+
|
1445
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
1446
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
1447
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
1448
|
+
|
1449
|
+
|
1390
1450
|
# Updates the specified export set's information.
|
1391
1451
|
# @param [String] export_set_id The OCID of the export set.
|
1392
1452
|
# @param [OCI::FileStorage::Models::UpdateExportSetDetails] update_export_set_details Details object for updating an export set.
|
@@ -340,6 +340,46 @@ module OCI
|
|
340
340
|
# rubocop:disable Layout/EmptyLines
|
341
341
|
|
342
342
|
|
343
|
+
# Calls {OCI::FileStorage::FileStorageClient#update_export} and then waits for the {OCI::FileStorage::Models::Export} acted upon
|
344
|
+
# to enter the given state(s).
|
345
|
+
#
|
346
|
+
# @param [String] export_id The OCID of the export.
|
347
|
+
# @param [OCI::FileStorage::Models::UpdateExportDetails] update_export_details Details object for updating an export.
|
348
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Export#lifecycle_state}
|
349
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#update_export}
|
350
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
351
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
352
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
353
|
+
#
|
354
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::FileStorage::Models::Export}
|
355
|
+
def update_export_and_wait_for_state(export_id, update_export_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
356
|
+
operation_result = @service_client.update_export(export_id, update_export_details, base_operation_opts)
|
357
|
+
|
358
|
+
return operation_result if wait_for_states.empty?
|
359
|
+
|
360
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
361
|
+
wait_for_resource_id = operation_result.data.id
|
362
|
+
|
363
|
+
begin
|
364
|
+
waiter_result = @service_client.get_export(wait_for_resource_id).wait_until(
|
365
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
366
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
367
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
368
|
+
)
|
369
|
+
result_to_return = waiter_result
|
370
|
+
|
371
|
+
return result_to_return
|
372
|
+
rescue StandardError
|
373
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
374
|
+
end
|
375
|
+
end
|
376
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
377
|
+
# rubocop:enable Layout/EmptyLines
|
378
|
+
|
379
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
380
|
+
# rubocop:disable Layout/EmptyLines
|
381
|
+
|
382
|
+
|
343
383
|
# Calls {OCI::FileStorage::FileStorageClient#update_export_set} and then waits for the {OCI::FileStorage::Models::ExportSet} acted upon
|
344
384
|
# to enter the given state(s).
|
345
385
|
#
|
@@ -0,0 +1,284 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# NFS export options applied to a specified set of
|
9
|
+
# clients. Only governs access through the associated
|
10
|
+
# export. Access to the same file system through a different
|
11
|
+
# export (on the same or different mount target) will be governed
|
12
|
+
# by that export's export options.
|
13
|
+
#
|
14
|
+
class FileStorage::Models::ClientOptions # rubocop:disable Metrics/LineLength
|
15
|
+
ACCESS_ENUM = [
|
16
|
+
ACCESS_READ_WRITE = 'READ_WRITE'.freeze,
|
17
|
+
ACCESS_READ_ONLY = 'READ_ONLY'.freeze,
|
18
|
+
ACCESS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
IDENTITY_SQUASH_ENUM = [
|
22
|
+
IDENTITY_SQUASH_NONE = 'NONE'.freeze,
|
23
|
+
IDENTITY_SQUASH_ROOT = 'ROOT'.freeze,
|
24
|
+
IDENTITY_SQUASH_ALL = 'ALL'.freeze,
|
25
|
+
IDENTITY_SQUASH_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
26
|
+
].freeze
|
27
|
+
|
28
|
+
# **[Required]** Clients these options should apply to. Must be a either
|
29
|
+
# single IPv4 address or single IPv4 CIDR block.
|
30
|
+
#
|
31
|
+
# **Note:** Access will also be limited by any applicable VCN
|
32
|
+
# security rules and the ability to route IP packets to the
|
33
|
+
# mount target. Mount targets do not have Internet-routable IP addresses.
|
34
|
+
#
|
35
|
+
# @return [String]
|
36
|
+
attr_accessor :source
|
37
|
+
|
38
|
+
# If `true`, clients accessing the file system through this
|
39
|
+
# export must connect from a privileged source port. If
|
40
|
+
# unspecified, defaults to `true`.
|
41
|
+
#
|
42
|
+
# @return [BOOLEAN]
|
43
|
+
attr_accessor :require_privileged_source_port
|
44
|
+
|
45
|
+
# Type of access to grant clients using the file system
|
46
|
+
# through this export. If unspecified defaults to `READ_ONLY`.
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
attr_reader :access
|
50
|
+
|
51
|
+
# Used when clients accessing the file system through this export
|
52
|
+
# have their UID and GID remapped to 'anonymousUid' and
|
53
|
+
# 'anonymousGid'. If `ALL`, all users and groups are remapped;
|
54
|
+
# if `ROOT`, only the root user and group (UID/GID 0) are
|
55
|
+
# remapped; if `NONE`, no remapping is done. If unspecified,
|
56
|
+
# defaults to `ROOT`.
|
57
|
+
#
|
58
|
+
# @return [String]
|
59
|
+
attr_reader :identity_squash
|
60
|
+
|
61
|
+
# UID value to remap to when squashing a client UID (see
|
62
|
+
# identitySquash for more details.) If unspecified, defaults
|
63
|
+
# to `65534`.
|
64
|
+
#
|
65
|
+
# @return [Integer]
|
66
|
+
attr_accessor :anonymous_uid
|
67
|
+
|
68
|
+
# GID value to remap to when squashing a client GID (see
|
69
|
+
# identitySquash for more details.) If unspecified defaults
|
70
|
+
# to `65534`.
|
71
|
+
#
|
72
|
+
# @return [Integer]
|
73
|
+
attr_accessor :anonymous_gid
|
74
|
+
|
75
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
76
|
+
def self.attribute_map
|
77
|
+
{
|
78
|
+
# rubocop:disable Style/SymbolLiteral
|
79
|
+
'source': :'source',
|
80
|
+
'require_privileged_source_port': :'requirePrivilegedSourcePort',
|
81
|
+
'access': :'access',
|
82
|
+
'identity_squash': :'identitySquash',
|
83
|
+
'anonymous_uid': :'anonymousUid',
|
84
|
+
'anonymous_gid': :'anonymousGid'
|
85
|
+
# rubocop:enable Style/SymbolLiteral
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# Attribute type mapping.
|
90
|
+
def self.swagger_types
|
91
|
+
{
|
92
|
+
# rubocop:disable Style/SymbolLiteral
|
93
|
+
'source': :'String',
|
94
|
+
'require_privileged_source_port': :'BOOLEAN',
|
95
|
+
'access': :'String',
|
96
|
+
'identity_squash': :'String',
|
97
|
+
'anonymous_uid': :'Integer',
|
98
|
+
'anonymous_gid': :'Integer'
|
99
|
+
# rubocop:enable Style/SymbolLiteral
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
104
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
105
|
+
|
106
|
+
|
107
|
+
# Initializes the object
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @option attributes [String] :source The value to assign to the {#source} property
|
110
|
+
# @option attributes [BOOLEAN] :require_privileged_source_port The value to assign to the {#require_privileged_source_port} property
|
111
|
+
# @option attributes [String] :access The value to assign to the {#access} property
|
112
|
+
# @option attributes [String] :identity_squash The value to assign to the {#identity_squash} property
|
113
|
+
# @option attributes [Integer] :anonymous_uid The value to assign to the {#anonymous_uid} property
|
114
|
+
# @option attributes [Integer] :anonymous_gid The value to assign to the {#anonymous_gid} property
|
115
|
+
def initialize(attributes = {})
|
116
|
+
return unless attributes.is_a?(Hash)
|
117
|
+
|
118
|
+
# convert string to symbol for hash key
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
120
|
+
|
121
|
+
self.source = attributes[:'source'] if attributes[:'source']
|
122
|
+
|
123
|
+
self.require_privileged_source_port = attributes[:'requirePrivilegedSourcePort'] unless attributes[:'requirePrivilegedSourcePort'].nil?
|
124
|
+
|
125
|
+
raise 'You cannot provide both :requirePrivilegedSourcePort and :require_privileged_source_port' if attributes.key?(:'requirePrivilegedSourcePort') && attributes.key?(:'require_privileged_source_port')
|
126
|
+
|
127
|
+
self.require_privileged_source_port = attributes[:'require_privileged_source_port'] unless attributes[:'require_privileged_source_port'].nil?
|
128
|
+
|
129
|
+
self.access = attributes[:'access'] if attributes[:'access']
|
130
|
+
|
131
|
+
self.identity_squash = attributes[:'identitySquash'] if attributes[:'identitySquash']
|
132
|
+
|
133
|
+
raise 'You cannot provide both :identitySquash and :identity_squash' if attributes.key?(:'identitySquash') && attributes.key?(:'identity_squash')
|
134
|
+
|
135
|
+
self.identity_squash = attributes[:'identity_squash'] if attributes[:'identity_squash']
|
136
|
+
|
137
|
+
self.anonymous_uid = attributes[:'anonymousUid'] if attributes[:'anonymousUid']
|
138
|
+
|
139
|
+
raise 'You cannot provide both :anonymousUid and :anonymous_uid' if attributes.key?(:'anonymousUid') && attributes.key?(:'anonymous_uid')
|
140
|
+
|
141
|
+
self.anonymous_uid = attributes[:'anonymous_uid'] if attributes[:'anonymous_uid']
|
142
|
+
|
143
|
+
self.anonymous_gid = attributes[:'anonymousGid'] if attributes[:'anonymousGid']
|
144
|
+
|
145
|
+
raise 'You cannot provide both :anonymousGid and :anonymous_gid' if attributes.key?(:'anonymousGid') && attributes.key?(:'anonymous_gid')
|
146
|
+
|
147
|
+
self.anonymous_gid = attributes[:'anonymous_gid'] if attributes[:'anonymous_gid']
|
148
|
+
end
|
149
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
150
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
151
|
+
|
152
|
+
# Custom attribute writer method checking allowed values (enum).
|
153
|
+
# @param [Object] access Object to be assigned
|
154
|
+
def access=(access)
|
155
|
+
# rubocop:disable Style/ConditionalAssignment
|
156
|
+
if access && !ACCESS_ENUM.include?(access)
|
157
|
+
# rubocop: disable Metrics/LineLength
|
158
|
+
OCI.logger.debug("Unknown value for 'access' [" + access + "]. Mapping to 'ACCESS_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
159
|
+
# rubocop: enable Metrics/LineLength
|
160
|
+
@access = ACCESS_UNKNOWN_ENUM_VALUE
|
161
|
+
else
|
162
|
+
@access = access
|
163
|
+
end
|
164
|
+
# rubocop:enable Style/ConditionalAssignment
|
165
|
+
end
|
166
|
+
|
167
|
+
# Custom attribute writer method checking allowed values (enum).
|
168
|
+
# @param [Object] identity_squash Object to be assigned
|
169
|
+
def identity_squash=(identity_squash)
|
170
|
+
# rubocop:disable Style/ConditionalAssignment
|
171
|
+
if identity_squash && !IDENTITY_SQUASH_ENUM.include?(identity_squash)
|
172
|
+
# rubocop: disable Metrics/LineLength
|
173
|
+
OCI.logger.debug("Unknown value for 'identity_squash' [" + identity_squash + "]. Mapping to 'IDENTITY_SQUASH_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
174
|
+
# rubocop: enable Metrics/LineLength
|
175
|
+
@identity_squash = IDENTITY_SQUASH_UNKNOWN_ENUM_VALUE
|
176
|
+
else
|
177
|
+
@identity_squash = identity_squash
|
178
|
+
end
|
179
|
+
# rubocop:enable Style/ConditionalAssignment
|
180
|
+
end
|
181
|
+
|
182
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
183
|
+
|
184
|
+
|
185
|
+
# Checks equality by comparing each attribute.
|
186
|
+
# @param [Object] other the other object to be compared
|
187
|
+
def ==(other)
|
188
|
+
return true if equal?(other)
|
189
|
+
self.class == other.class &&
|
190
|
+
source == other.source &&
|
191
|
+
require_privileged_source_port == other.require_privileged_source_port &&
|
192
|
+
access == other.access &&
|
193
|
+
identity_squash == other.identity_squash &&
|
194
|
+
anonymous_uid == other.anonymous_uid &&
|
195
|
+
anonymous_gid == other.anonymous_gid
|
196
|
+
end
|
197
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
198
|
+
|
199
|
+
# @see the `==` method
|
200
|
+
# @param [Object] other the other object to be compared
|
201
|
+
def eql?(other)
|
202
|
+
self == other
|
203
|
+
end
|
204
|
+
|
205
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
206
|
+
|
207
|
+
|
208
|
+
# Calculates hash code according to all attributes.
|
209
|
+
# @return [Fixnum] Hash code
|
210
|
+
def hash
|
211
|
+
[source, require_privileged_source_port, access, identity_squash, anonymous_uid, anonymous_gid].hash
|
212
|
+
end
|
213
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
214
|
+
|
215
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
216
|
+
|
217
|
+
|
218
|
+
# Builds the object from hash
|
219
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
220
|
+
# @return [Object] Returns the model itself
|
221
|
+
def build_from_hash(attributes)
|
222
|
+
return nil unless attributes.is_a?(Hash)
|
223
|
+
self.class.swagger_types.each_pair do |key, type|
|
224
|
+
if type =~ /^Array<(.*)>/i
|
225
|
+
# check to ensure the input is an array given that the the attribute
|
226
|
+
# is documented as an array but the input is not
|
227
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
228
|
+
public_method("#{key}=").call(
|
229
|
+
attributes[self.class.attribute_map[key]]
|
230
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
231
|
+
)
|
232
|
+
end
|
233
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
234
|
+
public_method("#{key}=").call(
|
235
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
236
|
+
)
|
237
|
+
end
|
238
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
239
|
+
end
|
240
|
+
|
241
|
+
self
|
242
|
+
end
|
243
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
244
|
+
|
245
|
+
# Returns the string representation of the object
|
246
|
+
# @return [String] String presentation of the object
|
247
|
+
def to_s
|
248
|
+
to_hash.to_s
|
249
|
+
end
|
250
|
+
|
251
|
+
# Returns the object in the form of hash
|
252
|
+
# @return [Hash] Returns the object in the form of hash
|
253
|
+
def to_hash
|
254
|
+
hash = {}
|
255
|
+
self.class.attribute_map.each_pair do |attr, param|
|
256
|
+
value = public_method(attr).call
|
257
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
258
|
+
hash[param] = _to_hash(value)
|
259
|
+
end
|
260
|
+
hash
|
261
|
+
end
|
262
|
+
|
263
|
+
private
|
264
|
+
|
265
|
+
# Outputs non-array value in the form of hash
|
266
|
+
# For object, use to_hash. Otherwise, just return the value
|
267
|
+
# @param [Object] value Any valid value
|
268
|
+
# @return [Hash] Returns the value in the form of hash
|
269
|
+
def _to_hash(value)
|
270
|
+
if value.is_a?(Array)
|
271
|
+
value.compact.map { |v| _to_hash(v) }
|
272
|
+
elsif value.is_a?(Hash)
|
273
|
+
{}.tap do |hash|
|
274
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
275
|
+
end
|
276
|
+
elsif value.respond_to? :to_hash
|
277
|
+
value.to_hash
|
278
|
+
else
|
279
|
+
value
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
end
|
284
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|