Class: OCI::Database::Models::SaasAdminUserConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/saas_admin_user_configuration.rb

Overview

SaaS administrative user configuration.

Constant Summary collapse

ACCESS_TYPE_ENUM =
[
  ACCESS_TYPE_READ_ONLY = 'READ_ONLY'.freeze,
  ACCESS_TYPE_READ_WRITE = 'READ_WRITE'.freeze,
  ACCESS_TYPE_ADMIN = 'ADMIN'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SaasAdminUserConfiguration

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :password (String)

    The value to assign to the #password property

  • :secret_id (String)

    The value to assign to the #secret_id property

  • :secret_version_number (Integer)

    The value to assign to the #secret_version_number property

  • :duration (Integer)

    The value to assign to the #duration property

  • :is_enabled (BOOLEAN)

    The value to assign to the #is_enabled property

  • :access_type (String)

    The value to assign to the #access_type property

  • :time_saas_admin_user_enabled (DateTime)

    The value to assign to the #time_saas_admin_user_enabled property



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 88

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

  self.secret_id = attributes[:'secretId'] if attributes[:'secretId']

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

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

  self.secret_version_number = attributes[:'secretVersionNumber'] if attributes[:'secretVersionNumber']

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

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

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

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

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

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

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

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

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

Instance Attribute Details

#access_typeString

The access type for the SaaS administrative user. If no access type is specified, the READ_ONLY access type is used.

Returns:

  • (String)


39
40
41
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 39

def access_type
  @access_type
end

#durationInteger

How long, in hours, the SaaS administrative user will stay enabled. If no duration is specified, the default value 1 will be used.

Returns:

  • (Integer)


31
32
33
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 31

def duration
  @duration
end

#is_enabledBOOLEAN

Indicates if the SaaS administrative user is enabled for the Autonomous Database.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 35

def is_enabled
  @is_enabled
end

#passwordString

A strong password for SaaS administrative user. The password must be a minimum of nine (9) characters and contain a minimum of two (2) uppercase, two (2) lowercase, two (2) numbers, and two (2) special characters from _ (underscore), # (hashtag), or - (dash).

Returns:

  • (String)


19
20
21
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 19

def password
  @password
end

#secret_idString

The OCID of the Oracle Cloud Infrastructure secret.

Returns:

  • (String)


23
24
25
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 23

def secret_id
  @secret_id
end

#secret_version_numberInteger

The version of the vault secret. If no version is specified, the latest version will be used.

Returns:

  • (Integer)


27
28
29
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 27

def secret_version_number
  @secret_version_number
end

#time_saas_admin_user_enabledDateTime

The date and time the SaaS administrative user was enabled at, for the Autonomous Database.

Returns:

  • (DateTime)


43
44
45
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 43

def time_saas_admin_user_enabled
  @time_saas_admin_user_enabled
end

Class Method Details

.attribute_mapObject

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



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 46

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'password': :'password',
    'secret_id': :'secretId',
    'secret_version_number': :'secretVersionNumber',
    'duration': :'duration',
    'is_enabled': :'isEnabled',
    'access_type': :'accessType',
    'time_saas_admin_user_enabled': :'timeSaasAdminUserEnabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 61

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'password': :'String',
    'secret_id': :'String',
    'secret_version_number': :'Integer',
    'duration': :'Integer',
    'is_enabled': :'BOOLEAN',
    'access_type': :'String',
    'time_saas_admin_user_enabled': :'DateTime'
    # 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



144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 144

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

  self.class == other.class &&
    password == other.password &&
    secret_id == other.secret_id &&
    secret_version_number == other.secret_version_number &&
    duration == other.duration &&
    is_enabled == other.is_enabled &&
    access_type == other.access_type &&
    time_saas_admin_user_enabled == other.time_saas_admin_user_enabled
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



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 180

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


160
161
162
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 160

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



169
170
171
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 169

def hash
  [password, secret_id, secret_version_number, duration, is_enabled, access_type, time_saas_admin_user_enabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



207
208
209
# File 'lib/oci/database/models/saas_admin_user_configuration.rb', line 207

def to_s
  to_hash.to_s
end