Class: OCI::DataSafe::Models::EnableConditions

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

Overview

The details of the audit policy provisioning conditions.

Constant Summary collapse

ENTITY_SELECTION_ENUM =
[
  ENTITY_SELECTION_INCLUDE = 'INCLUDE'.freeze,
  ENTITY_SELECTION_EXCLUDE = 'EXCLUDE'.freeze,
  ENTITY_SELECTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ENTITY_TYPE_ENUM =
[
  ENTITY_TYPE_USER = 'USER'.freeze,
  ENTITY_TYPE_ROLE = 'ROLE'.freeze,
  ENTITY_TYPE_ALL_USERS = 'ALL_USERS'.freeze,
  ENTITY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OPERATION_STATUS_ENUM =
[
  OPERATION_STATUS_SUCCESS = 'SUCCESS'.freeze,
  OPERATION_STATUS_FAILURE = 'FAILURE'.freeze,
  OPERATION_STATUS_BOTH = 'BOTH'.freeze,
  OPERATION_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EnableConditions

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :entity_selection (String)

    The value to assign to the #entity_selection property

  • :entity_type (String)

    The value to assign to the #entity_type property

  • :operation_status (String)

    The value to assign to the #operation_status property

  • :entity_names (Array<String>)

    The value to assign to the #entity_names property



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 82

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.entity_selection = attributes[:'entitySelection'] if attributes[:'entitySelection']

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

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

  self.entity_type = attributes[:'entityType'] if attributes[:'entityType']

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

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

  self.operation_status = attributes[:'operationStatus'] if attributes[:'operationStatus']

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

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

  self.entity_names = attributes[:'entityNames'] if attributes[:'entityNames']

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

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

Instance Attribute Details

#entity_namesArray<String>

List of users or roles that the policy must be enabled for.

Returns:

  • (Array<String>)


46
47
48
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 46

def entity_names
  @entity_names
end

#entity_selectionString

[Required] The entity include or exclude selection.

Returns:

  • (String)


34
35
36
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 34

def entity_selection
  @entity_selection
end

#entity_typeString

[Required] The entity type that the policy must be enabled for.

Returns:

  • (String)


38
39
40
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 38

def entity_type
  @entity_type
end

#operation_statusString

[Required] The operation status that the policy must be enabled for.

Returns:

  • (String)


42
43
44
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 42

def operation_status
  @operation_status
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_selection': :'entitySelection',
    'entity_type': :'entityType',
    'operation_status': :'operationStatus',
    'entity_names': :'entityNames'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 61

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'entity_selection': :'String',
    'entity_type': :'String',
    'operation_status': :'String',
    'entity_names': :'Array<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



159
160
161
162
163
164
165
166
167
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 159

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

  self.class == other.class &&
    entity_selection == other.entity_selection &&
    entity_type == other.entity_type &&
    operation_status == other.operation_status &&
    entity_names == other.entity_names
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



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 192

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


172
173
174
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 172

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



181
182
183
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 181

def hash
  [entity_selection, entity_type, operation_status, entity_names].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



225
226
227
228
229
230
231
232
233
234
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 225

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



219
220
221
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 219

def to_s
  to_hash.to_s
end