Class: OCI::DataSafe::Models::EnableConditions
- Inherits:
-
Object
- Object
- OCI::DataSafe::Models::EnableConditions
- 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
-
#entity_names ⇒ Array<String>
List of users or roles that the policy must be enabled for.
-
#entity_selection ⇒ String
[Required] The entity include or exclude selection.
-
#entity_type ⇒ String
[Required] The entity type that the policy must be enabled for.
-
#operation_status ⇒ String
[Required] The operation status that the policy must be enabled for.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ EnableConditions
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ EnableConditions
Initializes the object
81 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 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 81 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_names ⇒ Array<String>
List of users or roles that the policy must be enabled for.
45 46 47 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 45 def entity_names @entity_names end |
#entity_selection ⇒ String
[Required] The entity include or exclude selection.
33 34 35 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 33 def entity_selection @entity_selection end |
#entity_type ⇒ String
[Required] The entity type that the policy must be enabled for.
37 38 39 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 37 def entity_type @entity_type end |
#operation_status ⇒ String
[Required] The operation status that the policy must be enabled for.
41 42 43 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 41 def operation_status @operation_status end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 48 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_types ⇒ Object
Attribute type mapping.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 60 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.
158 159 160 161 162 163 164 165 166 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 158 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
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 191 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
171 172 173 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 171 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
180 181 182 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 180 def hash [entity_selection, entity_type, operation_status, entity_names].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
224 225 226 227 228 229 230 231 232 233 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 224 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_s ⇒ String
Returns the string representation of the object
218 219 220 |
# File 'lib/oci/data_safe/models/enable_conditions.rb', line 218 def to_s to_hash.to_s end |