Class: OCI::DataSafe::Models::AuditConditions

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

Overview

Represents audit policies with corresponding audit provisioning conditions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AuditConditions

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 62

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.is_priv_users_managed_by_data_safe = attributes[:'isPrivUsersManagedByDataSafe'] unless attributes[:'isPrivUsersManagedByDataSafe'].nil?

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

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

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

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

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

  self.enable_conditions = attributes[:'enableConditions'] if attributes[:'enableConditions']

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

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

Instance Attribute Details

#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)


14
15
16
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 14

def audit_policy_name
  @audit_policy_name
end

#enable_conditionsArray<OCI::DataSafe::Models::EnableConditions>

Indicates the users/roles in the target database for which the audit policy is enforced, and the success/failure event condition to generate the audit event..



26
27
28
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 26

def enable_conditions
  @enable_conditions
end

#is_data_safe_service_account_auditedBOOLEAN

[Required] Indicates whether the Data Safe user activity on the target database will be audited by the policy.

Returns:

  • (BOOLEAN)


22
23
24
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 22

def 
  @is_data_safe_service_account_audited
end

#is_priv_users_managed_by_data_safeBOOLEAN

[Required] Indicates whether the privileged user list is managed by Data Safe.

Returns:

  • (BOOLEAN)


18
19
20
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 18

def is_priv_users_managed_by_data_safe
  @is_priv_users_managed_by_data_safe
end

Class Method Details

.attribute_mapObject

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



29
30
31
32
33
34
35
36
37
38
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 29

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'audit_policy_name': :'auditPolicyName',
    'is_priv_users_managed_by_data_safe': :'isPrivUsersManagedByDataSafe',
    'is_data_safe_service_account_audited': :'isDataSafeServiceAccountAudited',
    'enable_conditions': :'enableConditions'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



41
42
43
44
45
46
47
48
49
50
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 41

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'audit_policy_name': :'String',
    'is_priv_users_managed_by_data_safe': :'BOOLEAN',
    'is_data_safe_service_account_audited': :'BOOLEAN',
    'enable_conditions': :'Array<OCI::DataSafe::Models::EnableConditions>'
    # 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



100
101
102
103
104
105
106
107
108
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 100

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

  self.class == other.class &&
    audit_policy_name == other.audit_policy_name &&
    is_priv_users_managed_by_data_safe == other.is_priv_users_managed_by_data_safe &&
     == other. &&
    enable_conditions == other.enable_conditions
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



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 133

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


113
114
115
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 113

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



122
123
124
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 122

def hash
  [audit_policy_name, is_priv_users_managed_by_data_safe, , enable_conditions].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



166
167
168
169
170
171
172
173
174
175
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 166

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



160
161
162
# File 'lib/oci/data_safe/models/audit_conditions.rb', line 160

def to_s
  to_hash.to_s
end