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

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

Overview

A summary of object privileges.

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



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
155
# File 'lib/oci/database_management/models/object_privilege_summary.rb', line 124

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 object privilege 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)


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

def common
  @common
end

#grant_optionString

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

Returns:

  • (String)


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

def grant_option
  @grant_option
end

#grantorString

The name of the user who granted the object privilege.

Returns:

  • (String)


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

def grantor
  @grantor
end

#hierarchyString

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

Returns:

  • (String)


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

def hierarchy
  @hierarchy
end

#inheritedString

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

Returns:

  • (String)


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

def inherited
  @inherited
end

#nameString

The name of the privilege on the object.

Returns:

  • (String)


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

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)


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

def object
  @object
end

#ownerString

The owner of the object.

Returns:

  • (String)


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

def owner
  @owner
end

#schema_typeString

The type of object.

Returns:

  • (String)


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

def schema_type
  @schema_type
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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

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



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

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



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

def to_s
  to_hash.to_s
end