Class: OCI::DataSafe::Models::AuditSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/audit_specification.rb

Overview

Represents an audit policy relevant for the target database.The audit policy could be in any one of the following 3 states in the target database 1) Created and enabled 2) Created but not enabled 3) Not created For more details on relevant audit policies for the target database, refer to documentation.

Constant Summary collapse

AUDIT_POLICY_CATEGORY_ENUM =
[
  AUDIT_POLICY_CATEGORY_BASIC_ACTIVITY = 'BASIC_ACTIVITY'.freeze,
  AUDIT_POLICY_CATEGORY_ADMIN_USER_ACTIVITY = 'ADMIN_USER_ACTIVITY'.freeze,
  AUDIT_POLICY_CATEGORY_USER_ACTIVITY = 'USER_ACTIVITY'.freeze,
  AUDIT_POLICY_CATEGORY_ORACLE_PREDEFINED = 'ORACLE_PREDEFINED'.freeze,
  AUDIT_POLICY_CATEGORY_COMPLIANCE_STANDARD = 'COMPLIANCE_STANDARD'.freeze,
  AUDIT_POLICY_CATEGORY_CUSTOM = 'CUSTOM'.freeze,
  AUDIT_POLICY_CATEGORY_SQL_FIREWALL_AUDITING = 'SQL_FIREWALL_AUDITING'.freeze,
  AUDIT_POLICY_CATEGORY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ENABLE_STATUS_ENUM =
[
  ENABLE_STATUS_ENABLED = 'ENABLED'.freeze,
  ENABLE_STATUS_DISABLED = 'DISABLED'.freeze,
  ENABLE_STATUS_PARTIALLY_ENABLED = 'PARTIALLY_ENABLED'.freeze,
  ENABLE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ENABLED_ENTITIES_ENUM =
[
  ENABLED_ENTITIES_ALL_USERS = 'ALL_USERS'.freeze,
  ENABLED_ENTITIES_INCLUDE_USERS = 'INCLUDE_USERS'.freeze,
  ENABLED_ENTITIES_INCLUDE_ROLES = 'INCLUDE_ROLES'.freeze,
  ENABLED_ENTITIES_EXCLUDE_USERS = 'EXCLUDE_USERS'.freeze,
  ENABLED_ENTITIES_INCLUDE_USERS_ROLES = 'INCLUDE_USERS_ROLES'.freeze,
  ENABLED_ENTITIES_DISABLED = 'DISABLED'.freeze,
  ENABLED_ENTITIES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AuditSpecification

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/data_safe/models/audit_specification.rb', line 145

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.audit_policy_name = attributes[:'auditPolicyName'] if attributes[:'auditPolicyName']

  raise 'You cannot provide both :auditPolicyName and :audit_policy_name' if attributes.key?(:'auditPolicyName') && attributes.key?(:'audit_policy_name')

  self.audit_policy_name = attributes[:'audit_policy_name'] if attributes[:'audit_policy_name']

  self.database_policy_names = attributes[:'databasePolicyNames'] if attributes[:'databasePolicyNames']

  raise 'You cannot provide both :databasePolicyNames and :database_policy_names' if attributes.key?(:'databasePolicyNames') && attributes.key?(:'database_policy_names')

  self.database_policy_names = attributes[:'database_policy_names'] if attributes[:'database_policy_names']

  self.audit_policy_category = attributes[:'auditPolicyCategory'] if attributes[:'auditPolicyCategory']

  raise 'You cannot provide both :auditPolicyCategory and :audit_policy_category' if attributes.key?(:'auditPolicyCategory') && attributes.key?(:'audit_policy_category')

  self.audit_policy_category = attributes[:'audit_policy_category'] if attributes[:'audit_policy_category']

  self.enable_status = attributes[:'enableStatus'] if attributes[:'enableStatus']

  raise 'You cannot provide both :enableStatus and :enable_status' if attributes.key?(:'enableStatus') && attributes.key?(:'enable_status')

  self.enable_status = attributes[:'enable_status'] if attributes[:'enable_status']

  self.partially_enabled_msg = attributes[:'partiallyEnabledMsg'] if attributes[:'partiallyEnabledMsg']

  raise 'You cannot provide both :partiallyEnabledMsg and :partially_enabled_msg' if attributes.key?(:'partiallyEnabledMsg') && attributes.key?(:'partially_enabled_msg')

  self.partially_enabled_msg = attributes[:'partially_enabled_msg'] if attributes[:'partially_enabled_msg']

  self.is_enabled_for_all_users = attributes[:'isEnabledForAllUsers'] unless attributes[:'isEnabledForAllUsers'].nil?

  raise 'You cannot provide both :isEnabledForAllUsers and :is_enabled_for_all_users' if attributes.key?(:'isEnabledForAllUsers') && attributes.key?(:'is_enabled_for_all_users')

  self.is_enabled_for_all_users = attributes[:'is_enabled_for_all_users'] unless attributes[:'is_enabled_for_all_users'].nil?

  self.is_view_only = attributes[:'isViewOnly'] unless attributes[:'isViewOnly'].nil?

  raise 'You cannot provide both :isViewOnly and :is_view_only' if attributes.key?(:'isViewOnly') && attributes.key?(:'is_view_only')

  self.is_view_only = attributes[:'is_view_only'] unless attributes[:'is_view_only'].nil?

  self.is_seeded_in_target = attributes[:'isSeededInTarget'] unless attributes[:'isSeededInTarget'].nil?

  raise 'You cannot provide both :isSeededInTarget and :is_seeded_in_target' if attributes.key?(:'isSeededInTarget') && attributes.key?(:'is_seeded_in_target')

  self.is_seeded_in_target = attributes[:'is_seeded_in_target'] unless attributes[:'is_seeded_in_target'].nil?

  self.is_seeded_in_data_safe = attributes[:'isSeededInDataSafe'] unless attributes[:'isSeededInDataSafe'].nil?

  raise 'You cannot provide both :isSeededInDataSafe and :is_seeded_in_data_safe' if attributes.key?(:'isSeededInDataSafe') && attributes.key?(:'is_seeded_in_data_safe')

  self.is_seeded_in_data_safe = attributes[:'is_seeded_in_data_safe'] unless attributes[:'is_seeded_in_data_safe'].nil?

  self.is_created = attributes[:'isCreated'] unless attributes[:'isCreated'].nil?

  raise 'You cannot provide both :isCreated and :is_created' if attributes.key?(:'isCreated') && attributes.key?(:'is_created')

  self.is_created = attributes[:'is_created'] unless attributes[:'is_created'].nil?

  self.enabled_entities = attributes[:'enabledEntities'] if attributes[:'enabledEntities']

  raise 'You cannot provide both :enabledEntities and :enabled_entities' if attributes.key?(:'enabledEntities') && attributes.key?(:'enabled_entities')

  self.enabled_entities = attributes[:'enabled_entities'] if attributes[:'enabled_entities']
end

Instance Attribute Details

#audit_policy_categoryString

[Required] The category to which the audit policy belongs.

Returns:

  • (String)


56
57
58
# File 'lib/oci/data_safe/models/audit_specification.rb', line 56

def audit_policy_category
  @audit_policy_category
end

#audit_policy_nameString

[Required] Indicates the audit policy name. Refer to the documentation for seeded audit policy names. For custom policies, refer to the user-defined policy name created in the target database.

Returns:

  • (String)


48
49
50
# File 'lib/oci/data_safe/models/audit_specification.rb', line 48

def audit_policy_name
  @audit_policy_name
end

#database_policy_namesArray<String>

[Required] Indicates the names of corresponding database policy ( or policies) in the target database.

Returns:

  • (Array<String>)


52
53
54
# File 'lib/oci/data_safe/models/audit_specification.rb', line 52

def database_policy_names
  @database_policy_names
end

#enable_statusString

[Required] Indicates whether the policy has been enabled, disabled or partially enabled in the target database. The status is PARTIALLY_ENABLED if any of the constituent database audit policies is not enabled.

Returns:

  • (String)


60
61
62
# File 'lib/oci/data_safe/models/audit_specification.rb', line 60

def enable_status
  @enable_status
end

#enabled_entitiesString

[Required] Indicates on whom the audit policy is enabled.

Returns:

  • (String)


88
89
90
# File 'lib/oci/data_safe/models/audit_specification.rb', line 88

def enabled_entities
  @enabled_entities
end

#is_createdBOOLEAN

[Required] Indicates whether the policy is already created on the target database.

Returns:

  • (BOOLEAN)


84
85
86
# File 'lib/oci/data_safe/models/audit_specification.rb', line 84

def is_created
  @is_created
end

#is_enabled_for_all_usersBOOLEAN

[Required] Indicates whether the policy by default is enabled for all users with no flexibility to alter the enablement conditions.

Returns:

  • (BOOLEAN)


68
69
70
# File 'lib/oci/data_safe/models/audit_specification.rb', line 68

def is_enabled_for_all_users
  @is_enabled_for_all_users
end

#is_seeded_in_data_safeBOOLEAN

[Required] Indicates whether the audit policy is one of the seeded policies provided by Oracle Data Safe.

Returns:

  • (BOOLEAN)


80
81
82
# File 'lib/oci/data_safe/models/audit_specification.rb', line 80

def is_seeded_in_data_safe
  @is_seeded_in_data_safe
end

#is_seeded_in_targetBOOLEAN

[Required] Indicates whether the audit policy is one of the predefined policies provided by Oracle Database.

Returns:

  • (BOOLEAN)


76
77
78
# File 'lib/oci/data_safe/models/audit_specification.rb', line 76

def is_seeded_in_target
  @is_seeded_in_target
end

#is_view_onlyBOOLEAN

[Required] Indicates whether the audit policy is available for provisioning/ de-provisioning from Oracle Data Safe, or is only available for displaying the current provisioning status from the target.

Returns:

  • (BOOLEAN)


72
73
74
# File 'lib/oci/data_safe/models/audit_specification.rb', line 72

def is_view_only
  @is_view_only
end

#partially_enabled_msgString

Provides information about the policy that has been only partially enabled.

Returns:

  • (String)


64
65
66
# File 'lib/oci/data_safe/models/audit_specification.rb', line 64

def partially_enabled_msg
  @partially_enabled_msg
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/oci/data_safe/models/audit_specification.rb', line 91

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'audit_policy_name': :'auditPolicyName',
    'database_policy_names': :'databasePolicyNames',
    'audit_policy_category': :'auditPolicyCategory',
    'enable_status': :'enableStatus',
    'partially_enabled_msg': :'partiallyEnabledMsg',
    'is_enabled_for_all_users': :'isEnabledForAllUsers',
    'is_view_only': :'isViewOnly',
    'is_seeded_in_target': :'isSeededInTarget',
    'is_seeded_in_data_safe': :'isSeededInDataSafe',
    'is_created': :'isCreated',
    'enabled_entities': :'enabledEntities'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/oci/data_safe/models/audit_specification.rb', line 110

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'audit_policy_name': :'String',
    'database_policy_names': :'Array<String>',
    'audit_policy_category': :'String',
    'enable_status': :'String',
    'partially_enabled_msg': :'String',
    'is_enabled_for_all_users': :'BOOLEAN',
    'is_view_only': :'BOOLEAN',
    'is_seeded_in_target': :'BOOLEAN',
    'is_seeded_in_data_safe': :'BOOLEAN',
    'is_created': :'BOOLEAN',
    'enabled_entities': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/oci/data_safe/models/audit_specification.rb', line 264

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    audit_policy_name == other.audit_policy_name &&
    database_policy_names == other.database_policy_names &&
    audit_policy_category == other.audit_policy_category &&
    enable_status == other.enable_status &&
    partially_enabled_msg == other.partially_enabled_msg &&
    is_enabled_for_all_users == other.is_enabled_for_all_users &&
    is_view_only == other.is_view_only &&
    is_seeded_in_target == other.is_seeded_in_target &&
    is_seeded_in_data_safe == other.is_seeded_in_data_safe &&
    is_created == other.is_created &&
    enabled_entities == other.enabled_entities
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/oci/data_safe/models/audit_specification.rb', line 304

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


284
285
286
# File 'lib/oci/data_safe/models/audit_specification.rb', line 284

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



293
294
295
# File 'lib/oci/data_safe/models/audit_specification.rb', line 293

def hash
  [audit_policy_name, database_policy_names, audit_policy_category, enable_status, partially_enabled_msg, is_enabled_for_all_users, is_view_only, is_seeded_in_target, is_seeded_in_data_safe, is_created, enabled_entities].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



337
338
339
340
341
342
343
344
345
346
# File 'lib/oci/data_safe/models/audit_specification.rb', line 337

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



331
332
333
# File 'lib/oci/data_safe/models/audit_specification.rb', line 331

def to_s
  to_hash.to_s
end