Class: OCI::IdentityDomains::Models::UserExtRiskScores

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/identity_domains/models/user_ext_risk_scores.rb

Overview

The risk score pertaining to the user.

Added In: 18.1.6

SCIM++ Properties: - caseExact: false - idcsCompositeKey: [value] - multiValued: true - mutability: readWrite - required: false - returned: request - type: complex - uniqueness: none

Constant Summary collapse

RISK_LEVEL_ENUM =
[
  RISK_LEVEL_LOW = 'LOW'.freeze,
  RISK_LEVEL_MEDIUM = 'MEDIUM'.freeze,
  RISK_LEVEL_HIGH = 'HIGH'.freeze,
  RISK_LEVEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserExtRiskScores

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :value (String)

    The value to assign to the #value property

  • :ref (String)

    The value to assign to the #ref property

  • :source (String)

    The value to assign to the #source property

  • :status (String)

    The value to assign to the #status property

  • :score (Integer)

    The value to assign to the #score property

  • :risk_level (String)

    The value to assign to the #risk_level property

  • :last_update_timestamp (String)

    The value to assign to the #last_update_timestamp property



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
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 187

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

  self.ref = attributes[:'$ref'] if attributes[:'$ref']

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

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

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

  self.risk_level = attributes[:'riskLevel'] if attributes[:'riskLevel']

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

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

  self.last_update_timestamp = attributes[:'lastUpdateTimestamp'] if attributes[:'lastUpdateTimestamp']

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

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

Instance Attribute Details

#last_update_timestampString

[Required] Last update timestamp for the risk score

Added In: 18.1.6

SCIM++ Properties: - caseExact: false - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: always - type: dateTime - uniqueness: none

Returns:

  • (String)


142
143
144
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 142

def last_update_timestamp
  @last_update_timestamp
end

#refString

Risk Provider Profile URI: URI that corresponds to risk source identifier.

Added In: 18.1.6

SCIM++ Properties: - caseExact: true - idcsSearchable: false - multiValued: false - mutability: readOnly - required: false - returned: always - type: reference - uniqueness: none

Returns:

  • (String)


61
62
63
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 61

def ref
  @ref
end

#risk_levelString

[Required] Risk Level

Added In: 18.1.6

SCIM++ Properties: - idcsSearchable: true - multiValued: false - mutability: readWrite - required: true - returned: always - type: string - uniqueness: none

Returns:

  • (String)


126
127
128
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 126

def risk_level
  @risk_level
end

#scoreInteger

[Required] Risk Score value

Added In: 18.1.6

SCIM++ Properties: - caseExact: false - idcsSearchable: true - multiValued: false - mutability: readWrite - required: true - returned: always - type: integer - uniqueness: none - idcsMaxValue: 100 - idcsMinValue: 0

Returns:

  • (Integer)


111
112
113
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 111

def score
  @score
end

#sourceString

Risk Provider Profile Source

Added In: 18.1.6

SCIM++ Properties: - caseExact: false - idcsSearchable: true - multiValued: false - mutability: readOnly - required: false - returned: always - type: string - uniqueness: none

Returns:

  • (String)


77
78
79
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 77

def source
  @source
end

#statusString

Risk Provider Profile status

Added In: 18.1.6

SCIM++ Properties: - caseExact: false - idcsSearchable: true - multiValued: false - mutability: readOnly - required: false - returned: always - type: string - uniqueness: none

Returns:

  • (String)


93
94
95
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 93

def status
  @status
end

#valueString

[Required] Risk Provider Profile: Identifier for the provider service from which the risk score was received.

Added In: 18.1.6

SCIM++ Properties: - caseExact: true - idcsSearchable: true - multiValued: false - mutability: readWrite - required: true - returned: always - type: string - uniqueness: none

Returns:

  • (String)


45
46
47
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 45

def value
  @value
end

Class Method Details

.attribute_mapObject

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



145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 145

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'value',
    'ref': :'$ref',
    'source': :'source',
    'status': :'status',
    'score': :'score',
    'risk_level': :'riskLevel',
    'last_update_timestamp': :'lastUpdateTimestamp'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 160

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'String',
    'ref': :'String',
    'source': :'String',
    'status': :'String',
    'score': :'Integer',
    'risk_level': :'String',
    'last_update_timestamp': :'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



236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 236

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

  self.class == other.class &&
    value == other.value &&
    ref == other.ref &&
    source == other.source &&
    status == other.status &&
    score == other.score &&
    risk_level == other.risk_level &&
    last_update_timestamp == other.last_update_timestamp
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



272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 272

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


252
253
254
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 252

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



261
262
263
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 261

def hash
  [value, ref, source, status, score, risk_level, last_update_timestamp].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



305
306
307
308
309
310
311
312
313
314
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 305

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



299
300
301
# File 'lib/oci/identity_domains/models/user_ext_risk_scores.rb', line 299

def to_s
  to_hash.to_s
end