Class: OCI::IdentityDomains::Models::ExtensionPosixUser

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/identity_domains/models/extension_posix_user.rb

Overview

POSIX User extension

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ExtensionPosixUser

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :uid_number (Integer)

    The value to assign to the #uid_number property

  • :gid_number (Integer)

    The value to assign to the #gid_number property

  • :gecos (String)

    The value to assign to the #gecos property

  • :home_directory (String)

    The value to assign to the #home_directory property

  • :login_shell (String)

    The value to assign to the #login_shell property



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 113

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

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

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

  self.gid_number = attributes[:'gidNumber'] if attributes[:'gidNumber']

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

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

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

  self.home_directory = attributes[:'homeDirectory'] if attributes[:'homeDirectory']

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

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

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

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

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

Instance Attribute Details

#gecosString

General information about the POSIX account such as their real name and phone number

SCIM++ Properties: - caseExact: false - multiValued: false - mutability: readWrite - required: false - returned: request - type: string - uniqueness: none

Returns:

  • (String)


48
49
50
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 48

def gecos
  @gecos
end

#gid_numberInteger

Primary Group identifier of the POSIX user

SCIM++ Properties: - idcsSearchable: true - multiValued: false - mutability: readWrite - required: false - returned: request - type: integer - uniqueness: none

Returns:

  • (Integer)


35
36
37
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 35

def gid_number
  @gid_number
end

#home_directoryString

The absolute path to the home directory of the POSIX account

SCIM++ Properties: - caseExact: true - multiValued: false - mutability: readWrite - required: false - returned: request - type: string - uniqueness: none

Returns:

  • (String)


61
62
63
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 61

def home_directory
  @home_directory
end

#login_shellString

The path to the login shell of the POSIX account

SCIM++ Properties: - caseExact: true - multiValued: false - mutability: readWrite - required: false - returned: request - type: string - uniqueness: none

Returns:

  • (String)


74
75
76
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 74

def 
  @login_shell
end

#uid_numberInteger

Integer uniquely identifying a user in a POSIX administrative domain

SCIM++ Properties: - idcsSearchable: true - multiValued: false - mutability: readWrite - required: false - returned: request - type: integer - uniqueness: server

Returns:

  • (Integer)


22
23
24
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 22

def uid_number
  @uid_number
end

Class Method Details

.attribute_mapObject

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



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 77

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'uid_number': :'uidNumber',
    'gid_number': :'gidNumber',
    'gecos': :'gecos',
    'home_directory': :'homeDirectory',
    'login_shell': :'loginShell'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'uid_number': :'Integer',
    'gid_number': :'Integer',
    'gecos': :'String',
    'home_directory': :'String',
    'login_shell': :'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



153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 153

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

  self.class == other.class &&
    uid_number == other.uid_number &&
    gid_number == other.gid_number &&
    gecos == other.gecos &&
    home_directory == other.home_directory &&
     == other.
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



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 187

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


167
168
169
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 167

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



176
177
178
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 176

def hash
  [uid_number, gid_number, gecos, home_directory, ].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



220
221
222
223
224
225
226
227
228
229
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 220

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



214
215
216
# File 'lib/oci/identity_domains/models/extension_posix_user.rb', line 214

def to_s
  to_hash.to_s
end