Class: OCI::DataSafe::Models::ProvisionAuditConditions

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/provision_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 = {}) ⇒ ProvisionAuditConditions

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
92
93
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 64

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

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

  self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].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 available for provisioning from Data Safe. 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/provision_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 will be enforced, and the success/failure event condition to generate the audit event.



28
29
30
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 28

def enable_conditions
  @enable_conditions
end

#is_enabledBOOLEAN

[Required] Indicates whether the policy has to be enabled or disabled in the target database. Set this to true if you want the audit policy to be enabled in the target database. If the seeded audit policy is not already created in the database, the provisioning creates and enables them. If this is set to false, the policy will be disabled in the target database.

Returns:

  • (BOOLEAN)


23
24
25
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 23

def is_enabled
  @is_enabled
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/provision_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.



31
32
33
34
35
36
37
38
39
40
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 31

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

.swagger_typesObject

Attribute type mapping.



43
44
45
46
47
48
49
50
51
52
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 43

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'audit_policy_name': :'String',
    'is_priv_users_managed_by_data_safe': :'BOOLEAN',
    'is_enabled': :'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



102
103
104
105
106
107
108
109
110
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 102

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 &&
    is_enabled == other.is_enabled &&
    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



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

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


115
116
117
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 115

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



124
125
126
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 124

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



168
169
170
171
172
173
174
175
176
177
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 168

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



162
163
164
# File 'lib/oci/data_safe/models/provision_audit_conditions.rb', line 162

def to_s
  to_hash.to_s
end