Class: OCI::IdentityDomains::Models::AppGrants

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

Overview

Grants assigned to the app

Constant Summary collapse

GRANTEE_TYPE_ENUM =
[
  GRANTEE_TYPE_USER = 'User'.freeze,
  GRANTEE_TYPE_GROUP = 'Group'.freeze,
  GRANTEE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
GRANT_MECHANISM_ENUM =
[
  GRANT_MECHANISM_IMPORT_APPROLE_MEMBERS = 'IMPORT_APPROLE_MEMBERS'.freeze,
  GRANT_MECHANISM_ADMINISTRATOR_TO_USER = 'ADMINISTRATOR_TO_USER'.freeze,
  GRANT_MECHANISM_ADMINISTRATOR_TO_GROUP = 'ADMINISTRATOR_TO_GROUP'.freeze,
  GRANT_MECHANISM_SERVICE_MANAGER_TO_USER = 'SERVICE_MANAGER_TO_USER'.freeze,
  GRANT_MECHANISM_ADMINISTRATOR_TO_APP = 'ADMINISTRATOR_TO_APP'.freeze,
  GRANT_MECHANISM_SERVICE_MANAGER_TO_APP = 'SERVICE_MANAGER_TO_APP'.freeze,
  GRANT_MECHANISM_OPC_INFRA_TO_APP = 'OPC_INFRA_TO_APP'.freeze,
  GRANT_MECHANISM_GROUP_MEMBERSHIP = 'GROUP_MEMBERSHIP'.freeze,
  GRANT_MECHANISM_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AppGrants

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

  • :grantee_id (String)

    The value to assign to the #grantee_id property

  • :grantee_type (String)

    The value to assign to the #grantee_type property

  • :grant_mechanism (String)

    The value to assign to the #grant_mechanism property



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/oci/identity_domains/models/app_grants.rb', line 140

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

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

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

  self.grantee_type = attributes[:'granteeType'] if attributes[:'granteeType']

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

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

  self.grant_mechanism = attributes[:'grantMechanism'] if attributes[:'grantMechanism']

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

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

Instance Attribute Details

#grant_mechanismString

Each value of grantMechanism indicates how (or by what component) some App (or App-Entitlement) was granted. A customer or the UI should use only grantMechanism values that start with 'ADMINISTRATOR': - 'ADMINISTRATOR_TO_USER' is for a direct grant to a specific User. - 'ADMINISTRATOR_TO_GROUP' is for a grant to a specific Group, which results in indirect grants to Users who are members of that Group. - 'ADMINISTRATOR_TO_APP' is for a grant to a specific App. The grantee (client) App gains access to the granted (server) App.

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

Returns:

  • (String)


101
102
103
# File 'lib/oci/identity_domains/models/app_grants.rb', line 101

def grant_mechanism
  @grant_mechanism
end

#grantee_idString

Grantee identifier

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

Returns:

  • (String)


69
70
71
# File 'lib/oci/identity_domains/models/app_grants.rb', line 69

def grantee_id
  @grantee_id
end

#grantee_typeString

Grantee resource type. Allowed values are User and Group.

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

Returns:

  • (String)


83
84
85
# File 'lib/oci/identity_domains/models/app_grants.rb', line 83

def grantee_type
  @grantee_type
end

#refString

Grant URI

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

Returns:

  • (String)


55
56
57
# File 'lib/oci/identity_domains/models/app_grants.rb', line 55

def ref
  @ref
end

#valueString

Grant identifier

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

Returns:

  • (String)


42
43
44
# File 'lib/oci/identity_domains/models/app_grants.rb', line 42

def value
  @value
end

Class Method Details

.attribute_mapObject

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



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/oci/identity_domains/models/app_grants.rb', line 104

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'value',
    'ref': :'$ref',
    'grantee_id': :'granteeId',
    'grantee_type': :'granteeType',
    'grant_mechanism': :'grantMechanism'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/identity_domains/models/app_grants.rb', line 117

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'value': :'String',
    'ref': :'String',
    'grantee_id': :'String',
    'grantee_type': :'String',
    'grant_mechanism': :'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



202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/identity_domains/models/app_grants.rb', line 202

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

  self.class == other.class &&
    value == other.value &&
    ref == other.ref &&
    grantee_id == other.grantee_id &&
    grantee_type == other.grantee_type &&
    grant_mechanism == other.grant_mechanism
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



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/identity_domains/models/app_grants.rb', line 236

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


216
217
218
# File 'lib/oci/identity_domains/models/app_grants.rb', line 216

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



225
226
227
# File 'lib/oci/identity_domains/models/app_grants.rb', line 225

def hash
  [value, ref, grantee_id, grantee_type, grant_mechanism].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/identity_domains/models/app_grants.rb', line 269

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



263
264
265
# File 'lib/oci/identity_domains/models/app_grants.rb', line 263

def to_s
  to_hash.to_s
end