Class: OCI::DatabaseManagement::Models::ObjectPrivilegeSummary

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

Overview

Summary of objectPrivileges.

Constant Summary collapse

HIERARCHY_ENUM =
[
  HIERARCHY_YES = 'YES'.freeze,
  HIERARCHY_NO = 'NO'.freeze,
  HIERARCHY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
GRANT_OPTION_ENUM =
[
  GRANT_OPTION_YES = 'YES'.freeze,
  GRANT_OPTION_NO = 'NO'.freeze,
  GRANT_OPTION_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 = {}) ⇒ ObjectPrivilegeSummary

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

  • :schema_type (String)

    The value to assign to the #schema_type property

  • :owner (String)

    The value to assign to the #owner property

  • :grantor (String)

    The value to assign to the #grantor property

  • :hierarchy (String)

    The value to assign to the #hierarchy property

  • :object (String)

    The value to assign to the #object property

  • :grant_option (String)

    The value to assign to the #grant_option property

  • :common (String)

    The value to assign to the #common property

  • :inherited (String)

    The value to assign to the #inherited property



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 123

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

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

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

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

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

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

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

  self.grant_option = attributes[:'grantOption'] if attributes[:'grantOption']

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

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

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

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

Instance Attribute Details

#commonString

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

Returns:

  • (String)


68
69
70
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 68

def common
  @common
end

#grant_optionString

Indicates whether the privilege was granted with the GRANT OPTION (YES) or not (NO)

Returns:

  • (String)


61
62
63
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 61

def grant_option
  @grant_option
end

#grantorString

The name of the user who performed the grant

Returns:

  • (String)


49
50
51
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 49

def grantor
  @grantor
end

#hierarchyString

Indicates whether the privilege was granted with the HIERARCHY OPTION (YES) or not (NO)

Returns:

  • (String)


53
54
55
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 53

def hierarchy
  @hierarchy
end

#inheritedString

Indicates whether the role grant was inherited from another container (YES) or not (NO)

Returns:

  • (String)


72
73
74
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 72

def inherited
  @inherited
end

#nameString

The name of the privilege on the object.

Returns:

  • (String)


37
38
39
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 37

def name
  @name
end

#objectString

The name of the object. The object can be any object, including tables, packages, indexes, sequences, and so on.

Returns:

  • (String)


57
58
59
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 57

def object
  @object
end

#ownerString

The owner of the object.

Returns:

  • (String)


45
46
47
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 45

def owner
  @owner
end

#schema_typeString

The type of the object.

Returns:

  • (String)


41
42
43
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 41

def schema_type
  @schema_type
end

Class Method Details

.attribute_mapObject

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



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 75

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'schema_type': :'schemaType',
    'owner': :'owner',
    'grantor': :'grantor',
    'hierarchy': :'hierarchy',
    'object': :'object',
    'grant_option': :'grantOption',
    'common': :'common',
    'inherited': :'inherited'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 92

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'schema_type': :'String',
    'owner': :'String',
    'grantor': :'String',
    'hierarchy': :'String',
    'object': :'String',
    'grant_option': :'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



215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 215

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

  self.class == other.class &&
    name == other.name &&
    schema_type == other.schema_type &&
    owner == other.owner &&
    grantor == other.grantor &&
    hierarchy == other.hierarchy &&
    object == other.object &&
    grant_option == other.grant_option &&
    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



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 253

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


233
234
235
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 233

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



242
243
244
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 242

def hash
  [name, schema_type, owner, grantor, hierarchy, object, grant_option, common, inherited].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



286
287
288
289
290
291
292
293
294
295
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 286

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



280
281
282
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 280

def to_s
  to_hash.to_s
end