Class: OCI::IdentityDomains::Models::AppGrantedAppRoles

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

Overview

A list of AppRoles that are granted to this App (and that are defined by other Apps). Within the Oracle Public Cloud infrastructure, this allows AppID-based association. Such an association allows this App to act as a consumer and thus to access resources of another App that acts as a producer.

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 = {}) ⇒ AppGrantedAppRoles

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

  • :type (String)

    The value to assign to the #type property

  • :display (String)

    The value to assign to the #display property

  • :app_id (String)

    The value to assign to the #app_id property

  • :app_name (String)

    The value to assign to the #app_name property

  • :admin_role (BOOLEAN)

    The value to assign to the #admin_role property

  • :legacy_group_name (String)

    The value to assign to the #legacy_group_name property

  • :read_only (BOOLEAN)

    The value to assign to the #read_only property



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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 190

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

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

  self.app_id = attributes[:'appId'] if attributes[:'appId']

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

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

  self.app_name = attributes[:'appName'] if attributes[:'appName']

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

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

  self.admin_role = attributes[:'adminRole'] unless attributes[:'adminRole'].nil?

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

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

  self.legacy_group_name = attributes[:'legacyGroupName'] if attributes[:'legacyGroupName']

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

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

  self.read_only = attributes[:'readOnly'] unless attributes[:'readOnly'].nil?

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

  self.read_only = attributes[:'read_only'] unless attributes[:'read_only'].nil?
end

Instance Attribute Details

#admin_roleBOOLEAN

If true, then this granted AppRole confers administrative privileges within the App that defines it. Otherwise, the granted AppRole confers only functional privileges.

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

Returns:

  • (BOOLEAN)


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

def admin_role
  @admin_role
end

#app_idString

The id of the App that defines this AppRole, which is granted to this App. The App that defines the AppRole acts as the producer; the App to which the AppRole is granted acts as a consumer.

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

Returns:

  • (String)


85
86
87
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 85

def app_id
  @app_id
end

#app_nameString

The name of the App that defines this AppRole, which is granted to this App. The App that defines the AppRole acts as the producer; the App to which the AppRole is granted acts as a consumer.

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

Returns:

  • (String)


98
99
100
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 98

def app_name
  @app_name
end

#displayString

The display-name of an AppRole that is granted to this App.

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

Returns:

  • (String)


71
72
73
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 71

def display
  @display
end

#legacy_group_nameString

The name of the legacy group associated with this AppRole.

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

Returns:

  • (String)


124
125
126
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 124

def legacy_group_name
  @legacy_group_name
end

#read_onlyBOOLEAN

If true, indicates that this value must be protected.

Added In: 18.2.2

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

Returns:

  • (BOOLEAN)


139
140
141
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 139

def read_only
  @read_only
end

#refString

The URI of an AppRole that is granted to this App.

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

Returns:

  • (String)


44
45
46
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 44

def ref
  @ref
end

#typeString

A label that indicates whether this AppRole was granted directly to the App (or indirectly through a Group). For an App, the value of this attribute will always be 'direct' (because an App cannot be a member of a Group).

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

Returns:

  • (String)


57
58
59
# File 'lib/oci/identity_domains/models/app_granted_app_roles.rb', line 57

def type
  @type
end

#valueString

[Required] The id of an AppRole that is granted to this App.

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

Returns:

  • (String)


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

def value
  @value
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'value',
    'ref': :'$ref',
    'type': :'type',
    'display': :'display',
    'app_id': :'appId',
    'app_name': :'appName',
    'admin_role': :'adminRole',
    'legacy_group_name': :'legacyGroupName',
    'read_only': :'readOnly'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'String',
    'ref': :'String',
    'type': :'String',
    'display': :'String',
    'app_id': :'String',
    'app_name': :'String',
    'admin_role': :'BOOLEAN',
    'legacy_group_name': :'String',
    'read_only': :'BOOLEAN'
    # 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



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

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

  self.class == other.class &&
    value == other.value &&
    ref == other.ref &&
    type == other.type &&
    display == other.display &&
    app_id == other.app_id &&
    app_name == other.app_name &&
    admin_role == other.admin_role &&
    legacy_group_name == other.legacy_group_name &&
    read_only == other.read_only
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/app_granted_app_roles.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/app_granted_app_roles.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/app_granted_app_roles.rb', line 282

def hash
  [value, ref, type, display, app_id, app_name, admin_role, legacy_group_name, read_only].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/app_granted_app_roles.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/app_granted_app_roles.rb', line 320

def to_s
  to_hash.to_s
end