Class: OCI::DataSafe::Models::UserSummary

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

Overview

The summary of information about the database user. It includes details such as user type, account status, last login time, user creation time, authentication type, user profile, and time and date of the last password change. It also contains the user category derived from these user details, as well as granted privileges.

Constant Summary collapse

USER_CATEGORY_ENUM =
[
  USER_CATEGORY_CRITICAL = 'CRITICAL'.freeze,
  USER_CATEGORY_HIGH = 'HIGH'.freeze,
  USER_CATEGORY_MEDIUM = 'MEDIUM'.freeze,
  USER_CATEGORY_LOW = 'LOW'.freeze,
  USER_CATEGORY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ACCOUNT_STATUS_ENUM =
[
  ACCOUNT_STATUS_OPEN = 'OPEN'.freeze,
  ACCOUNT_STATUS_LOCKED = 'LOCKED'.freeze,
  ACCOUNT_STATUS_EXPIRED = 'EXPIRED'.freeze,
  ACCOUNT_STATUS_EXPIRED_AND_LOCKED = 'EXPIRED_AND_LOCKED'.freeze,
  ACCOUNT_STATUS_NONE = 'NONE'.freeze,
  ACCOUNT_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
AUTHENTICATION_TYPE_ENUM =
[
  AUTHENTICATION_TYPE_PASSWORD = 'PASSWORD'.freeze,
  AUTHENTICATION_TYPE_NONE = 'NONE'.freeze,
  AUTHENTICATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
USER_TYPES_ENUM =
[
  USER_TYPES_ADMIN_PRIVILEGED = 'ADMIN_PRIVILEGED'.freeze,
  USER_TYPES_APPLICATION = 'APPLICATION'.freeze,
  USER_TYPES_PRIVILEGED = 'PRIVILEGED'.freeze,
  USER_TYPES_SCHEMA = 'SCHEMA'.freeze,
  USER_TYPES_NON_PRIVILEGED = 'NON_PRIVILEGED'.freeze,
  USER_TYPES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ADMIN_ROLES_ENUM =
[
  ADMIN_ROLES_PDB_DBA = 'PDB_DBA'.freeze,
  ADMIN_ROLES_DBA = 'DBA'.freeze,
  ADMIN_ROLES_DV_ADMIN = 'DV_ADMIN'.freeze,
  ADMIN_ROLES_AUDIT_ADMIN = 'AUDIT_ADMIN'.freeze,
  ADMIN_ROLES_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :user_name (String)

    The value to assign to the #user_name property

  • :user_category (String)

    The value to assign to the #user_category property

  • :account_status (String)

    The value to assign to the #account_status property

  • :target_id (String)

    The value to assign to the #target_id property

  • :time_last_login (DateTime)

    The value to assign to the #time_last_login property

  • :time_user_created (DateTime)

    The value to assign to the #time_user_created property

  • :authentication_type (String)

    The value to assign to the #authentication_type property

  • :user_profile (String)

    The value to assign to the #user_profile property

  • :time_password_changed (DateTime)

    The value to assign to the #time_password_changed property

  • :user_types (Array<String>)

    The value to assign to the #user_types property

  • :admin_roles (Array<String>)

    The value to assign to the #admin_roles property



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
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
# File 'lib/oci/data_safe/models/user_summary.rb', line 168

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

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

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

  self.user_category = attributes[:'userCategory'] if attributes[:'userCategory']

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

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

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

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

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

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

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

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

  self.time_user_created = attributes[:'timeUserCreated'] if attributes[:'timeUserCreated']

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

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

  self.authentication_type = attributes[:'authenticationType'] if attributes[:'authenticationType']

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

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

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

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

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

  self.time_password_changed = attributes[:'timePasswordChanged'] if attributes[:'timePasswordChanged']

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

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

  self.user_types = attributes[:'userTypes'] if attributes[:'userTypes']

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

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

  self.admin_roles = attributes[:'adminRoles'] if attributes[:'adminRoles']

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

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

Instance Attribute Details

#account_statusString

The status of the user account.

Returns:

  • (String)


69
70
71
# File 'lib/oci/data_safe/models/user_summary.rb', line 69

def 
  @account_status
end

#admin_rolesArray<String>

The admin roles granted to the user.

Returns:

  • (Array<String>)


108
109
110
# File 'lib/oci/data_safe/models/user_summary.rb', line 108

def admin_roles
  @admin_roles
end

#authentication_typeString

The user authentication method.

Returns:

  • (String)


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

def authentication_type
  @authentication_type
end

#keyString

[Required] The unique user key. This is a system-generated identifier. Use ListUsers to get the user key for a user.

Returns:

  • (String)


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

def key
  @key
end

#target_idString

[Required] The OCID of the target database.

Returns:

  • (String)


73
74
75
# File 'lib/oci/data_safe/models/user_summary.rb', line 73

def target_id
  @target_id
end

#time_last_loginDateTime

The date and time the user last logged in, in the format defined by RFC3339.

Returns:

  • (DateTime)


77
78
79
# File 'lib/oci/data_safe/models/user_summary.rb', line 77

def 
  @time_last_login
end

#time_password_changedDateTime

The date and time the user password was last changed, in the format defined by RFC3339.

Returns:

  • (DateTime)


93
94
95
# File 'lib/oci/data_safe/models/user_summary.rb', line 93

def time_password_changed
  @time_password_changed
end

#time_user_createdDateTime

The date and time the user was created in the database, in the format defined by RFC3339.

Returns:

  • (DateTime)


81
82
83
# File 'lib/oci/data_safe/models/user_summary.rb', line 81

def time_user_created
  @time_user_created
end

#user_categoryString

The user category based on the privileges and other details of the user.

Returns:

  • (String)


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

def user_category
  @user_category
end

#user_nameString

[Required] The database user name.

Returns:

  • (String)


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

def user_name
  @user_name
end

#user_profileString

The user profile name.

Returns:

  • (String)


89
90
91
# File 'lib/oci/data_safe/models/user_summary.rb', line 89

def 
  @user_profile
end

#user_typesArray<String>

The user type, which can be a combination of the following:

'Admin Privileged': The user has administrative privileges. 'Application': The user is an Oracle E-Business Suite Applications (EBS) or Fusion Applications (FA) user. 'Privileged': The user is a privileged user. 'Schema': The user is EXPIRED & LOCKED / EXPIRED / LOCKED, or a schema-only account (authentication type is NONE). 'Non-privileged': The user is a non-privileged user.

Returns:

  • (Array<String>)


104
105
106
# File 'lib/oci/data_safe/models/user_summary.rb', line 104

def user_types
  @user_types
end

Class Method Details

.attribute_mapObject

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



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/oci/data_safe/models/user_summary.rb', line 111

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'key',
    'user_name': :'userName',
    'user_category': :'userCategory',
    'account_status': :'accountStatus',
    'target_id': :'targetId',
    'time_last_login': :'timeLastLogin',
    'time_user_created': :'timeUserCreated',
    'authentication_type': :'authenticationType',
    'user_profile': :'userProfile',
    'time_password_changed': :'timePasswordChanged',
    'user_types': :'userTypes',
    'admin_roles': :'adminRoles'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/oci/data_safe/models/user_summary.rb', line 131

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key': :'String',
    'user_name': :'String',
    'user_category': :'String',
    'account_status': :'String',
    'target_id': :'String',
    'time_last_login': :'DateTime',
    'time_user_created': :'DateTime',
    'authentication_type': :'String',
    'user_profile': :'String',
    'time_password_changed': :'DateTime',
    'user_types': :'Array<String>',
    'admin_roles': :'Array<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



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/oci/data_safe/models/user_summary.rb', line 329

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

  self.class == other.class &&
    key == other.key &&
    user_name == other.user_name &&
    user_category == other.user_category &&
     == other. &&
    target_id == other.target_id &&
     == other. &&
    time_user_created == other.time_user_created &&
    authentication_type == other.authentication_type &&
     == other. &&
    time_password_changed == other.time_password_changed &&
    user_types == other.user_types &&
    admin_roles == other.admin_roles
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



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

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


350
351
352
# File 'lib/oci/data_safe/models/user_summary.rb', line 350

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



359
360
361
# File 'lib/oci/data_safe/models/user_summary.rb', line 359

def hash
  [key, user_name, user_category, , target_id, , time_user_created, authentication_type, , time_password_changed, user_types, admin_roles].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



403
404
405
406
407
408
409
410
411
412
# File 'lib/oci/data_safe/models/user_summary.rb', line 403

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



397
398
399
# File 'lib/oci/data_safe/models/user_summary.rb', line 397

def to_s
  to_hash.to_s
end