Class: OCI::IdentityDomains::Models::SettingsTenantCustomClaims

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

Overview

Custom claims associated with the specific tenant

Constant Summary collapse

MODE_ENUM =
[
  MODE_ALWAYS = 'always'.freeze,
  MODE_REQUEST = 'request'.freeze,
  MODE_NEVER = 'never'.freeze,
  MODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
TOKEN_TYPE_ENUM =
[
  TOKEN_TYPE_AT = 'AT'.freeze,
  TOKEN_TYPE_IT = 'IT'.freeze,
  TOKEN_TYPE_BOTH = 'BOTH'.freeze,
  TOKEN_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SettingsTenantCustomClaims

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :value (String)

    The value to assign to the #value property

  • :mode (String)

    The value to assign to the #mode property

  • :expression (BOOLEAN)

    The value to assign to the #expression property

  • :all_scopes (BOOLEAN)

    The value to assign to the #all_scopes property

  • :token_type (String)

    The value to assign to the #token_type property

  • :scopes (Array<String>)

    The value to assign to the #scopes property



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 167

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

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

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

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

  self.all_scopes = attributes[:'allScopes'] unless attributes[:'allScopes'].nil?

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

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

  self.token_type = attributes[:'tokenType'] if attributes[:'tokenType']

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

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

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

Instance Attribute Details

#all_scopesBOOLEAN

[Required] Indicates if the custom claim is associated with all scopes

Added In: 18.4.2

SCIM++ Properties: - multiValued: false - mutability: readWrite - required: true - returned: default - type: boolean - uniqueness: none

Returns:

  • (BOOLEAN)


94
95
96
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 94

def all_scopes
  @all_scopes
end

#expressionBOOLEAN

[Required] Indicates if the custom claim is an expression

Added In: 18.4.2

SCIM++ Properties: - multiValued: false - mutability: readWrite - required: true - returned: default - type: boolean - uniqueness: none

Returns:

  • (BOOLEAN)


80
81
82
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 80

def expression
  @expression
end

#modeString

[Required] Indicates under what scenario the custom claim will be return

Added In: 18.4.2

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

Returns:

  • (String)


66
67
68
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 66

def mode
  @mode
end

#nameString

[Required] Custom claim name

Added In: 18.4.2

SCIM++ Properties: - multiValued: false - mutability: readWrite - required: true - returned: default - type: string - uniqueness: server

Returns:

  • (String)


38
39
40
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 38

def name
  @name
end

#scopesArray<String>

Scopes associated with a specific custom claim

Added In: 18.4.2

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

Returns:

  • (Array<String>)


122
123
124
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 122

def scopes
  @scopes
end

#token_typeString

[Required] Indicates what type of token the custom claim will be embedded

Added In: 18.4.2

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

Returns:

  • (String)


108
109
110
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 108

def token_type
  @token_type
end

#valueString

[Required] Custom claim value

Added In: 18.4.2

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

Returns:

  • (String)


52
53
54
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 52

def value
  @value
end

Class Method Details

.attribute_mapObject

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



125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 125

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'value': :'value',
    'mode': :'mode',
    'expression': :'expression',
    'all_scopes': :'allScopes',
    'token_type': :'tokenType',
    'scopes': :'scopes'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 140

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'value': :'String',
    'mode': :'String',
    'expression': :'BOOLEAN',
    'all_scopes': :'BOOLEAN',
    'token_type': :'String',
    'scopes': :'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



229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 229

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

  self.class == other.class &&
    name == other.name &&
    value == other.value &&
    mode == other.mode &&
    expression == other.expression &&
    all_scopes == other.all_scopes &&
    token_type == other.token_type &&
    scopes == other.scopes
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



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 265

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


245
246
247
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 245

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



254
255
256
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 254

def hash
  [name, value, mode, expression, all_scopes, token_type, scopes].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



298
299
300
301
302
303
304
305
306
307
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 298

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



292
293
294
# File 'lib/oci/identity_domains/models/settings_tenant_custom_claims.rb', line 292

def to_s
  to_hash.to_s
end