Class: OCI::DatabaseManagement::Models::RoleSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/role_summary.rb

Overview

A summary of each role.

Constant Summary collapse

ADMIN_OPTION_ENUM =
[
  ADMIN_OPTION_YES = 'YES'.freeze,
  ADMIN_OPTION_NO = 'NO'.freeze,
  ADMIN_OPTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DELEGATE_OPTION_ENUM =
[
  DELEGATE_OPTION_YES = 'YES'.freeze,
  DELEGATE_OPTION_NO = 'NO'.freeze,
  DELEGATE_OPTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
DEFAULT_ROLE_ENUM =
[
  DEFAULT_ROLE_YES = 'YES'.freeze,
  DEFAULT_ROLE_NO = 'NO'.freeze,
  DEFAULT_ROLE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
COMMON_ENUM =
[
  COMMON_YES = 'YES'.freeze,
  COMMON_NO = 'NO'.freeze,
  COMMON_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
INHERITED_ENUM =
[
  INHERITED_YES = 'YES'.freeze,
  INHERITED_NO = 'NO'.freeze,
  INHERITED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RoleSummary

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

  • :admin_option (String)

    The value to assign to the #admin_option property

  • :delegate_option (String)

    The value to assign to the #delegate_option property

  • :default_role (String)

    The value to assign to the #default_role property

  • :common (String)

    The value to assign to the #common property

  • :inherited (String)

    The value to assign to the #inherited property



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/oci/database_management/models/role_summary.rb', line 109

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

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

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

  self.delegate_option = attributes[:'delegateOption'] if attributes[:'delegateOption']

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

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

  self.default_role = attributes[:'defaultRole'] if attributes[:'defaultRole']

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

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

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

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

Instance Attribute Details

#admin_optionString

Indicates whether the role is granted with the ADMIN OPTION (YES) or not (NO).

Returns:

  • (String)


48
49
50
# File 'lib/oci/database_management/models/role_summary.rb', line 48

def admin_option
  @admin_option
end

#commonString

Indicates how the role was granted. Possible values: YES if the role is granted commonly (CONTAINER=ALL is used) NO if the role is granted locally (CONTAINER=ALL is not used)

Returns:

  • (String)


63
64
65
# File 'lib/oci/database_management/models/role_summary.rb', line 63

def common
  @common
end

#default_roleString

Indicates whether the role is designated as a DEFAULT ROLE for the user (YES) or not (NO).

Returns:

  • (String)


56
57
58
# File 'lib/oci/database_management/models/role_summary.rb', line 56

def default_role
  @default_role
end

#delegate_optionString

Indicates whether the role is granted with the DELEGATE OPTION (YES) or not (NO).

Returns:

  • (String)


52
53
54
# File 'lib/oci/database_management/models/role_summary.rb', line 52

def delegate_option
  @delegate_option
end

#inheritedString

Indicates whether the granted role is inherited from another container (YES) or not (NO).

Returns:

  • (String)


67
68
69
# File 'lib/oci/database_management/models/role_summary.rb', line 67

def inherited
  @inherited
end

#nameString

The name of the role granted to the user.

Returns:

  • (String)


44
45
46
# File 'lib/oci/database_management/models/role_summary.rb', line 44

def name
  @name
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/database_management/models/role_summary.rb', line 70

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'admin_option': :'adminOption',
    'delegate_option': :'delegateOption',
    'default_role': :'defaultRole',
    'common': :'common',
    'inherited': :'inherited'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/oci/database_management/models/role_summary.rb', line 84

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'admin_option': :'String',
    'delegate_option': :'String',
    'default_role': :'String',
    'common': :'String',
    'inherited': :'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



212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/database_management/models/role_summary.rb', line 212

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

  self.class == other.class &&
    name == other.name &&
    admin_option == other.admin_option &&
    delegate_option == other.delegate_option &&
    default_role == other.default_role &&
    common == other.common &&
    inherited == other.inherited
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



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/database_management/models/role_summary.rb', line 247

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


227
228
229
# File 'lib/oci/database_management/models/role_summary.rb', line 227

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



236
237
238
# File 'lib/oci/database_management/models/role_summary.rb', line 236

def hash
  [name, admin_option, delegate_option, default_role, common, inherited].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



280
281
282
283
284
285
286
287
288
289
# File 'lib/oci/database_management/models/role_summary.rb', line 280

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



274
275
276
# File 'lib/oci/database_management/models/role_summary.rb', line 274

def to_s
  to_hash.to_s
end