Class: OCI::IdentityDomains::Models::Schema

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

Overview

SCIM schema

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Schema

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/oci/identity_domains/models/schema.rb', line 196

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

  self.idcs_maps_to_same_target_attribute_name_as = attributes[:'idcsMapsToSameTargetAttributeNameAs'] if attributes[:'idcsMapsToSameTargetAttributeNameAs']

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

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

  self.external_id = attributes[:'externalId'] if attributes[:'externalId']

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

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

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

  self.idcs_resource_types = attributes[:'idcsResourceTypes'] if attributes[:'idcsResourceTypes']

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

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

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

  self.idcs_mappable = attributes[:'idcsMappable'] unless attributes[:'idcsMappable'].nil?

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

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

  self.idcs_attribute_cacheable = attributes[:'idcsAttributeCacheable'] unless attributes[:'idcsAttributeCacheable'].nil?

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

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

  self.idcs_override_common_attribute = attributes[:'idcsOverrideCommonAttribute'] unless attributes[:'idcsOverrideCommonAttribute'].nil?

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

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

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

Instance Attribute Details

#attributesArray<OCI::IdentityDomains::Models::SchemaAttributes>

A complex type that specifies the set of Resource attributes

SCIM++ Properties: - idcsCompositeKey: [] - multiValued: true - mutability: readWrite - required: false - returned: default - type: complex



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

def attributes
  @attributes
end

#descriptionString

Schema's human-readable description

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

Returns:

  • (String)


91
92
93
# File 'lib/oci/identity_domains/models/schema.rb', line 91

def description
  @description
end

#external_idString

An identifier for the Resource as defined by the Service Consumer. The externalId may simplify identification of the Resource between Service Consumer and Service Provider by allowing the Consumer to refer to the Resource with its own identifier, obviating the need to store a local mapping between the local identifier of the Resource and the identifier used by the Service Provider. Each Resource MAY include a non-empty externalId value. The value of the externalId attribute is always issued by the Service Consumer and can never be specified by the Service Provider. The Service Provider MUST always interpret the externalId as scoped to the Service Consumer's tenant.

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

Returns:

  • (String)


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

def external_id
  @external_id
end

#idcs_attribute_cacheableBOOLEAN

Specifies whether the attribute is cacheable. True by default for all attributes. If attribute with idcsAttributeCachable = false, is present \“attributesToGet\” while executing GET/SEARCH on cacheable resource, Cache is missed and data is fetched from Data Provider.

Added In: 17.3.4

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

Returns:

  • (BOOLEAN)


117
118
119
# File 'lib/oci/identity_domains/models/schema.rb', line 117

def idcs_attribute_cacheable
  @idcs_attribute_cacheable
end

#idcs_mappableBOOLEAN

[Required] Specifies if the attributes in this schema can be used for mapping with external identity sources such as AD or LDAP

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

Returns:

  • (BOOLEAN)


104
105
106
# File 'lib/oci/identity_domains/models/schema.rb', line 104

def idcs_mappable
  @idcs_mappable
end

#idcs_maps_to_same_target_attribute_name_asString

Contains the canonical name of the other attribute sharing the same idcsTargetAttributeName

Added In: 2209122038

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

Returns:

  • (String)


39
40
41
# File 'lib/oci/identity_domains/models/schema.rb', line 39

def idcs_maps_to_same_target_attribute_name_as
  @idcs_maps_to_same_target_attribute_name_as
end

#idcs_override_common_attributeBOOLEAN

Specifies whether the dataprovider mapping from resource schema should override from common schema with the same name.

Added In: 2102181953

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

Returns:

  • (BOOLEAN)


130
131
132
# File 'lib/oci/identity_domains/models/schema.rb', line 130

def idcs_override_common_attribute
  @idcs_override_common_attribute
end

#idcs_resource_typesArray<String>

Resource types defs this resource refers to

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

Returns:

  • (Array<String>)


78
79
80
# File 'lib/oci/identity_domains/models/schema.rb', line 78

def idcs_resource_types
  @idcs_resource_types
end

#nameString

Schema's human-readable name

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

Returns:

  • (String)


65
66
67
# File 'lib/oci/identity_domains/models/schema.rb', line 65

def name
  @name
end

#schemasArray<String>

[Required] REQUIRED. The schemas attribute is an array of Strings which allows introspection of the supported schema version for a SCIM representation as well any schema extensions supported by that representation. Each String value must be a unique URI. This specification defines URIs for User, Group, and a standard \“enterprise\” extension. All representations of SCIM schema MUST include a non-zero value array with value(s) of the URIs supported by that representation. Duplicate values MUST NOT be included. Value order is not specified and MUST not impact behavior.

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

Returns:

  • (Array<String>)


23
24
25
# File 'lib/oci/identity_domains/models/schema.rb', line 23

def schemas
  @schemas
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
158
159
160
# File 'lib/oci/identity_domains/models/schema.rb', line 145

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'schemas': :'schemas',
    'idcs_maps_to_same_target_attribute_name_as': :'idcsMapsToSameTargetAttributeNameAs',
    'external_id': :'externalId',
    'name': :'name',
    'idcs_resource_types': :'idcsResourceTypes',
    'description': :'description',
    'idcs_mappable': :'idcsMappable',
    'idcs_attribute_cacheable': :'idcsAttributeCacheable',
    'idcs_override_common_attribute': :'idcsOverrideCommonAttribute',
    'attributes': :'attributes'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/oci/identity_domains/models/schema.rb', line 163

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'schemas': :'Array<String>',
    'idcs_maps_to_same_target_attribute_name_as': :'String',
    'external_id': :'String',
    'name': :'String',
    'idcs_resource_types': :'Array<String>',
    'description': :'String',
    'idcs_mappable': :'BOOLEAN',
    'idcs_attribute_cacheable': :'BOOLEAN',
    'idcs_override_common_attribute': :'BOOLEAN',
    'attributes': :'Array<OCI::IdentityDomains::Models::SchemaAttributes>'
    # 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



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/identity_domains/models/schema.rb', line 254

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

  self.class == other.class &&
    schemas == other.schemas &&
    idcs_maps_to_same_target_attribute_name_as == other.idcs_maps_to_same_target_attribute_name_as &&
    external_id == other.external_id &&
    name == other.name &&
    idcs_resource_types == other.idcs_resource_types &&
    description == other.description &&
    idcs_mappable == other.idcs_mappable &&
    idcs_attribute_cacheable == other.idcs_attribute_cacheable &&
    idcs_override_common_attribute == other.idcs_override_common_attribute &&
    attributes == other.attributes
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



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/oci/identity_domains/models/schema.rb', line 293

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


273
274
275
# File 'lib/oci/identity_domains/models/schema.rb', line 273

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



282
283
284
# File 'lib/oci/identity_domains/models/schema.rb', line 282

def hash
  [schemas, idcs_maps_to_same_target_attribute_name_as, external_id, name, idcs_resource_types, description, idcs_mappable, idcs_attribute_cacheable, idcs_override_common_attribute, attributes].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



326
327
328
329
330
331
332
333
334
335
# File 'lib/oci/identity_domains/models/schema.rb', line 326

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



320
321
322
# File 'lib/oci/identity_domains/models/schema.rb', line 320

def to_s
  to_hash.to_s
end