Class: OCI::DataSafe::Models::DatabaseViewAccessEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_safe/models/database_view_access_entry.rb

Overview

A DatabaseViewAccessEntry object is a resource corresponding to a row in view authorization report. It's a subresource of Security Policy Report resource and is always associated with a SecurityPolicyReport.

Constant Summary collapse

ACCESS_TYPE_ENUM =
[
  ACCESS_TYPE_SELECT = 'SELECT'.freeze,
  ACCESS_TYPE_UPDATE = 'UPDATE'.freeze,
  ACCESS_TYPE_INSERT = 'INSERT'.freeze,
  ACCESS_TYPE_DELETE = 'DELETE'.freeze,
  ACCESS_TYPE_OWNER = 'OWNER'.freeze,
  ACCESS_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PRIVILEGE_ENUM =
[
  PRIVILEGE_SELECT = 'SELECT'.freeze,
  PRIVILEGE_UPDATE = 'UPDATE'.freeze,
  PRIVILEGE_INSERT = 'INSERT'.freeze,
  PRIVILEGE_DELETE = 'DELETE'.freeze,
  PRIVILEGE_READ = 'READ'.freeze,
  PRIVILEGE_OWNER = 'OWNER'.freeze,
  PRIVILEGE_INDEX = 'INDEX'.freeze,
  PRIVILEGE_SELECT_ANY_TABLE = 'SELECT_ANY_TABLE'.freeze,
  PRIVILEGE_UPDATE_ANY_TABLE = 'UPDATE_ANY_TABLE'.freeze,
  PRIVILEGE_INSERT_ANY_TABLE = 'INSERT_ANY_TABLE'.freeze,
  PRIVILEGE_DELETE_ANY_TABLE = 'DELETE_ANY_TABLE'.freeze,
  PRIVILEGE_READ_ANY_TABLE = 'READ_ANY_TABLE'.freeze,
  PRIVILEGE_CREATE_ANY_INDEX = 'CREATE_ANY_INDEX'.freeze,
  PRIVILEGE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
PRIVILEGE_GRANTABLE_ENUM =
[
  PRIVILEGE_GRANTABLE_ADMIN_OPTION = 'ADMIN_OPTION'.freeze,
  PRIVILEGE_GRANTABLE_GRANT_OPTION = 'GRANT_OPTION'.freeze,
  PRIVILEGE_GRANTABLE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DatabaseViewAccessEntry

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 215

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

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

  self.access_type = attributes[:'accessType'] if attributes[:'accessType']

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

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

  self.table_schema = attributes[:'tableSchema'] if attributes[:'tableSchema']

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

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

  self.table_name = attributes[:'tableName'] if attributes[:'tableName']

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

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

  self.privilege_type = attributes[:'privilegeType'] if attributes[:'privilegeType']

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

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

  self.target_id = attributes[:'targetId'] if attributes[:'targetId']

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

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

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

  self.privilege_grantable = attributes[:'privilegeGrantable'] if attributes[:'privilegeGrantable']

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

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

  self.grant_from_role = attributes[:'grantFromRole'] if attributes[:'grantFromRole']

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

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

  self.view_schema = attributes[:'viewSchema'] if attributes[:'viewSchema']

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

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

  self.view_name = attributes[:'viewName'] if attributes[:'viewName']

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

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

  self.view_text = attributes[:'viewText'] if attributes[:'viewText']

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

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

  self.column_name = attributes[:'columnName'] if attributes[:'columnName']

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

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

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

  self.is_access_constrained_by_database_vault = attributes[:'isAccessConstrainedByDatabaseVault'] unless attributes[:'isAccessConstrainedByDatabaseVault'].nil?

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

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

  self.is_access_constrained_by_virtual_private_database = attributes[:'isAccessConstrainedByVirtualPrivateDatabase'] unless attributes[:'isAccessConstrainedByVirtualPrivateDatabase'].nil?

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

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

  self.is_access_constrained_by_redaction = attributes[:'isAccessConstrainedByRedaction'] unless attributes[:'isAccessConstrainedByRedaction'].nil?

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

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

  self.is_access_constrained_by_real_application_security = attributes[:'isAccessConstrainedByRealApplicationSecurity'] unless attributes[:'isAccessConstrainedByRealApplicationSecurity'].nil?

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

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

  self.is_access_constrained_by_sql_firewall = attributes[:'isAccessConstrainedBySqlFirewall'] unless attributes[:'isAccessConstrainedBySqlFirewall'].nil?

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

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

Instance Attribute Details

#access_typeString

The type of the access the user has on the table, there can be one or more from SELECT, UPDATE, INSERT or DELETE.

Returns:

  • (String)


57
58
59
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 57

def access_type
  @access_type
end

#column_nameString

If there are column level privileges on a table or view.

Returns:

  • (String)


107
108
109
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 107

def column_name
  @column_name
end

#grant_from_roleString

This can be empty in case of direct grant, in case of indirect grant, this attribute displays the name of the role which is granted to the user though which the user has access to the table.

Returns:

  • (String)


91
92
93
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 91

def grant_from_role
  @grant_from_role
end

#granteeString

[Required] Grantee is the user who can access the table or view

Returns:

  • (String)


52
53
54
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 52

def grantee
  @grantee
end

#grantorString

The user who granted the privilege.

Returns:

  • (String)


111
112
113
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 111

def grantor
  @grantor
end

#is_access_constrained_by_database_vaultBOOLEAN

Indicates whether the table access is constrained via Oracle Database Vault.

Returns:

  • (BOOLEAN)


115
116
117
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 115

def is_access_constrained_by_database_vault
  @is_access_constrained_by_database_vault
end

#is_access_constrained_by_real_application_securityBOOLEAN

Indicates whether the view access is constrained via Real Application Security.

Returns:

  • (BOOLEAN)


127
128
129
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 127

def is_access_constrained_by_real_application_security
  @is_access_constrained_by_real_application_security
end

#is_access_constrained_by_redactionBOOLEAN

Indicates whether the view access is constrained via Oracle Data Redaction.

Returns:

  • (BOOLEAN)


123
124
125
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 123

def is_access_constrained_by_redaction
  @is_access_constrained_by_redaction
end

#is_access_constrained_by_sql_firewallBOOLEAN

Indicates whether the view access is constrained via Oracle Database SQL Firewall.

Returns:

  • (BOOLEAN)


131
132
133
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 131

def is_access_constrained_by_sql_firewall
  @is_access_constrained_by_sql_firewall
end

#is_access_constrained_by_virtual_private_databaseBOOLEAN

Indicates whether the view access is constrained via Virtual Private Database.

Returns:

  • (BOOLEAN)


119
120
121
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 119

def is_access_constrained_by_virtual_private_database
  @is_access_constrained_by_virtual_private_database
end

#keyString

[Required] The unique key that identifies the table access report. It is numeric and unique within a security policy report.

Returns:

  • (String)


48
49
50
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 48

def key
  @key
end

#privilegeString

The name of the privilege.

Returns:

  • (String)


79
80
81
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 79

def privilege
  @privilege
end

#privilege_grantableString

Indicates whether the grantee can grant this privilege to other users. Privileges can be granted to a user or role with GRANT_OPTION or ADMIN_OPTION

Returns:

  • (String)


85
86
87
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 85

def privilege_grantable
  @privilege_grantable
end

#privilege_typeString

Type of the privilege user has, this includes System Privilege, Schema Privilege, Object Privilege, Column Privilege, Owner or Schema Privilege on a schema.

Returns:

  • (String)


71
72
73
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 71

def privilege_type
  @privilege_type
end

#table_nameString

The name of the database table the user has access to.

Returns:

  • (String)


65
66
67
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 65

def table_name
  @table_name
end

#table_schemaString

The name of the schema the table belongs to.

Returns:

  • (String)


61
62
63
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 61

def table_schema
  @table_schema
end

#target_idString

The OCID of the of the target database.

Returns:

  • (String)


75
76
77
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 75

def target_id
  @target_id
end

#view_nameString

The name of the view.

Returns:

  • (String)


99
100
101
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 99

def view_name
  @view_name
end

#view_schemaString

The name of the schema.

Returns:

  • (String)


95
96
97
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 95

def view_schema
  @view_schema
end

#view_textString

Definition of the view.

Returns:

  • (String)


103
104
105
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 103

def view_text
  @view_text
end

Class Method Details

.attribute_mapObject

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



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 134

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'grantee': :'grantee',
    'access_type': :'accessType',
    'table_schema': :'tableSchema',
    'table_name': :'tableName',
    'privilege_type': :'privilegeType',
    'target_id': :'targetId',
    'privilege': :'privilege',
    'privilege_grantable': :'privilegeGrantable',
    'grant_from_role': :'grantFromRole',
    'view_schema': :'viewSchema',
    'view_name': :'viewName',
    'view_text': :'viewText',
    'column_name': :'columnName',
    'grantor': :'grantor',
    'is_access_constrained_by_database_vault': :'isAccessConstrainedByDatabaseVault',
    'is_access_constrained_by_virtual_private_database': :'isAccessConstrainedByVirtualPrivateDatabase',
    'is_access_constrained_by_redaction': :'isAccessConstrainedByRedaction',
    'is_access_constrained_by_real_application_security': :'isAccessConstrainedByRealApplicationSecurity',
    'is_access_constrained_by_sql_firewall': :'isAccessConstrainedBySqlFirewall'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 162

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'grantee': :'String',
    'access_type': :'String',
    'table_schema': :'String',
    'table_name': :'String',
    'privilege_type': :'String',
    'target_id': :'String',
    'privilege': :'String',
    'privilege_grantable': :'String',
    'grant_from_role': :'String',
    'view_schema': :'String',
    'view_name': :'String',
    'view_text': :'String',
    'column_name': :'String',
    'grantor': :'String',
    'is_access_constrained_by_database_vault': :'BOOLEAN',
    'is_access_constrained_by_virtual_private_database': :'BOOLEAN',
    'is_access_constrained_by_redaction': :'BOOLEAN',
    'is_access_constrained_by_real_application_security': :'BOOLEAN',
    'is_access_constrained_by_sql_firewall': :'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



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 372

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

  self.class == other.class &&
    key == other.key &&
    grantee == other.grantee &&
    access_type == other.access_type &&
    table_schema == other.table_schema &&
    table_name == other.table_name &&
    privilege_type == other.privilege_type &&
    target_id == other.target_id &&
    privilege == other.privilege &&
    privilege_grantable == other.privilege_grantable &&
    grant_from_role == other.grant_from_role &&
    view_schema == other.view_schema &&
    view_name == other.view_name &&
    view_text == other.view_text &&
    column_name == other.column_name &&
    grantor == other.grantor &&
    is_access_constrained_by_database_vault == other.is_access_constrained_by_database_vault &&
    is_access_constrained_by_virtual_private_database == other.is_access_constrained_by_virtual_private_database &&
    is_access_constrained_by_redaction == other.is_access_constrained_by_redaction &&
    is_access_constrained_by_real_application_security == other.is_access_constrained_by_real_application_security &&
    is_access_constrained_by_sql_firewall == other.is_access_constrained_by_sql_firewall
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



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 421

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


401
402
403
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 401

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



410
411
412
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 410

def hash
  [key, grantee, access_type, table_schema, table_name, privilege_type, target_id, privilege, privilege_grantable, grant_from_role, view_schema, view_name, view_text, column_name, grantor, is_access_constrained_by_database_vault, is_access_constrained_by_virtual_private_database, is_access_constrained_by_redaction, is_access_constrained_by_real_application_security, is_access_constrained_by_sql_firewall].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



454
455
456
457
458
459
460
461
462
463
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 454

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



448
449
450
# File 'lib/oci/data_safe/models/database_view_access_entry.rb', line 448

def to_s
  to_hash.to_s
end