Class: OCI::IdentityDomains::Models::MeGroups

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

Overview

A list of groups that the user belongs to, either thorough direct membership, nested groups, or dynamically calculated

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_DIRECT = 'direct'.freeze,
  TYPE_INDIRECT = 'indirect'.freeze,
  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 = {}) ⇒ MeGroups

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

  • :ocid (String)

    The value to assign to the #ocid property

  • :ref (String)

    The value to assign to the #ref property

  • :display (String)

    The value to assign to the #display property

  • :non_unique_display (String)

    The value to assign to the #non_unique_display property

  • :external_id (String)

    The value to assign to the #external_id property

  • :type (String)

    The value to assign to the #type property

  • :membership_ocid (String)

    The value to assign to the #membership_ocid property

  • :date_added (String)

    The value to assign to the #date_added property



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

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

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

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

  self.non_unique_display = attributes[:'nonUniqueDisplay'] if attributes[:'nonUniqueDisplay']

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

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

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

  self.membership_ocid = attributes[:'membershipOcid'] if attributes[:'membershipOcid']

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

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

  self.date_added = attributes[:'dateAdded'] if attributes[:'dateAdded']

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

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

Instance Attribute Details

#date_addedString

Date when the member is Added to the group

Added In: 2105200541

SCIM++ Properties: - multiValued: false - mutability: readOnly - required: false - returned: default - type: dateTime - uniqueness: none

Returns:

  • (String)


144
145
146
# File 'lib/oci/identity_domains/models/me_groups.rb', line 144

def date_added
  @date_added
end

#displayString

A human readable name, primarily used for display purposes. READ-ONLY.

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

Returns:

  • (String)


72
73
74
# File 'lib/oci/identity_domains/models/me_groups.rb', line 72

def display
  @display
end

#external_idString

An identifier for the Resource as defined by the Service Consumer. READ-ONLY.

Added In: 2011192329

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

Returns:

  • (String)


102
103
104
# File 'lib/oci/identity_domains/models/me_groups.rb', line 102

def external_id
  @external_id
end

#membership_ocidString

The membership OCID.

Added In: 2103141444

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

Returns:

  • (String)


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

def membership_ocid
  @membership_ocid
end

#non_unique_displayString

A human readable name for Group as defined by the Service Consumer. READ-ONLY.

Added In: 2011192329

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

Returns:

  • (String)


87
88
89
# File 'lib/oci/identity_domains/models/me_groups.rb', line 87

def non_unique_display
  @non_unique_display
end

#ocidString

The OCID of the User's group.

Added In: 2102181953

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

Returns:

  • (String)


46
47
48
# File 'lib/oci/identity_domains/models/me_groups.rb', line 46

def ocid
  @ocid
end

#refString

The URI of the corresponding Group resource to which the user belongs

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

Returns:

  • (String)


59
60
61
# File 'lib/oci/identity_domains/models/me_groups.rb', line 59

def ref
  @ref
end

#typeString

A label indicating the attribute's function; e.g., 'direct' or 'indirect'.

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

Returns:

  • (String)


115
116
117
# File 'lib/oci/identity_domains/models/me_groups.rb', line 115

def type
  @type
end

#valueString

[Required] The identifier of the User's group.

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

Returns:

  • (String)


30
31
32
# File 'lib/oci/identity_domains/models/me_groups.rb', line 30

def value
  @value
end

Class Method Details

.attribute_mapObject

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



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/identity_domains/models/me_groups.rb', line 147

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'value',
    'ocid': :'ocid',
    'ref': :'$ref',
    'display': :'display',
    'non_unique_display': :'nonUniqueDisplay',
    'external_id': :'externalId',
    'type': :'type',
    'membership_ocid': :'membershipOcid',
    'date_added': :'dateAdded'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'String',
    'ocid': :'String',
    'ref': :'String',
    'display': :'String',
    'non_unique_display': :'String',
    'external_id': :'String',
    'type': :'String',
    'membership_ocid': :'String',
    'date_added': :'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



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

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

  self.class == other.class &&
    value == other.value &&
    ocid == other.ocid &&
    ref == other.ref &&
    display == other.display &&
    non_unique_display == other.non_unique_display &&
    external_id == other.external_id &&
    type == other.type &&
    membership_ocid == other.membership_ocid &&
    date_added == other.date_added
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



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

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


274
275
276
# File 'lib/oci/identity_domains/models/me_groups.rb', line 274

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



283
284
285
# File 'lib/oci/identity_domains/models/me_groups.rb', line 283

def hash
  [value, ocid, ref, display, non_unique_display, external_id, type, membership_ocid, date_added].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



321
322
323
# File 'lib/oci/identity_domains/models/me_groups.rb', line 321

def to_s
  to_hash.to_s
end