Class: LinodeOpenapiClient::PutProfile200Response

Inherits:
Object
  • Object
show all
Defined in:
lib/linode_openapi_client/models/put_profile200_response.rb

Overview

A Profile represents your User in our system. This is where you can change information about your User. This information is available to any OAuth Client regardless of requested scopes, and can be used to populate User information in third-party applications.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PutProfile200Response

Initializes the object

Parameters:

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

    Model attributes in the form of hash



132
133
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
160
161
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
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 132

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::PutProfile200Response` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `LinodeOpenapiClient::PutProfile200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'uid')
    self.uid = attributes[:'uid']
  end

  if attributes.key?(:'authorized_keys')
    if (value = attributes[:'authorized_keys']).is_a?(Array)
      self.authorized_keys = value
    end
  end

  if attributes.key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.key?(:'restricted')
    self.restricted = attributes[:'restricted']
  end

  if attributes.key?(:'email_notifications')
    self.email_notifications = attributes[:'email_notifications']
  end

  if attributes.key?(:'ip_whitelist_enabled')
    self.ip_whitelist_enabled = attributes[:'ip_whitelist_enabled']
  end

  if attributes.key?(:'lish_auth_method')
    self.lish_auth_method = attributes[:'lish_auth_method']
  end

  if attributes.key?(:'timezone')
    self.timezone = attributes[:'timezone']
  end

  if attributes.key?(:'authentication_type')
    self.authentication_type = attributes[:'authentication_type']
  end

  if attributes.key?(:'two_factor_auth')
    self.two_factor_auth = attributes[:'two_factor_auth']
  end

  if attributes.key?(:'referrals')
    self.referrals = attributes[:'referrals']
  end

  if attributes.key?(:'verified_phone_number')
    self.verified_phone_number = attributes[:'verified_phone_number']
  end

  if attributes.key?(:'username')
    self.username = attributes[:'username']
  end
end

Instance Attribute Details

#authentication_typeObject

Read-only This account’s Cloud Manager authentication type. Authentication types are chosen through Cloud Manager and authorized when logging into your account. These authentication types are either the user’s password (in conjunction with their username), or the name of their identity provider such as GitHub. For example, if a user: - Has never used Third-Party Authentication, their authentication type will be ‘password`. - Is using Third-Party Authentication, their authentication type will be the name of their Identity Provider (eg. `github`). - Has used Third-Party Authentication and has since revoked it, their authentication type will be `password`. __Note__. This functionality may not yet be available in Cloud Manager. See the [Cloud Manager Changelog](www.linode.com/docs/products/tools/cloud-manager/release-notes/) for the latest updates.



44
45
46
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 44

def authentication_type
  @authentication_type
end

#authorized_keysObject

The list of SSH Keys authorized to use Lish for your User. This value is ignored if ‘lish_auth_method` is `disabled`.



23
24
25
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 23

def authorized_keys
  @authorized_keys
end

#emailObject

Your email address. This address will be used for communication with Linode as necessary.



26
27
28
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 26

def email
  @email
end

#email_notificationsObject

If true, you will receive email notifications about account activity. If false, you may still receive business-critical communications through email.



32
33
34
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 32

def email_notifications
  @email_notifications
end

#ip_whitelist_enabledObject

If true, logins for your User will only be allowed from whitelisted IPs. This setting is currently deprecated, and cannot be enabled. If you disable this setting, you will not be able to re-enable it.



35
36
37
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 35

def ip_whitelist_enabled
  @ip_whitelist_enabled
end

#lish_auth_methodObject

The authentication methods that are allowed when connecting to [the Linode Shell (Lish)](www.linode.com/docs/guides/lish/). - ‘keys_only` is the most secure if you intend to use Lish. - `disabled` is recommended if you do not intend to use Lish at all. - If this account’s Cloud Manager authentication type is set to a Third-Party Authentication method, ‘password_keys` cannot be used as your Lish authentication method. To view this account’s Cloud Manager ‘authentication_type` field, send a request to the [Get a profile](techdocs.akamai.com/linode-api/reference/get-profile) operation.



38
39
40
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 38

def lish_auth_method
  @lish_auth_method
end

#referralsObject

Returns the value of attribute referrals.



49
50
51
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 49

def referrals
  @referrals
end

#restrictedObject

If true, your User has restrictions on what can be accessed on your Account. To get details on what entities/actions you can access/perform, run [List grants](techdocs.akamai.com/linode-api/reference/get-profile-grants).



29
30
31
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 29

def restricted
  @restricted
end

#timezoneObject

The timezone you prefer to see times in. This is not used by the API directly. It is provided for the benefit of clients such as the Linode Cloud Manager and other clients built on the API. All times returned by the API are in UTC.



41
42
43
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 41

def timezone
  @timezone
end

#two_factor_authObject

If true, logins from untrusted computers will require Two Factor Authentication. Run [Create a two factor secret](techdocs.akamai.com/linode-api/reference/post-tfa-enable) to enable Two Factor Authentication.



47
48
49
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 47

def two_factor_auth
  @two_factor_auth
end

#uidObject

Read-only Your unique ID in our system. This value will never change, and can safely be used to identify your User.



20
21
22
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 20

def uid
  @uid
end

#usernameObject

Read-only Your username, used for logging in to our system.



55
56
57
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 55

def username
  @username
end

#verified_phone_numberObject

Read-only The phone number verified for this Profile with the [Verify a phone number](techdocs.akamai.com/linode-api/reference/post-profile-phone-number-verify) operation. ‘null` if this Profile has no verified phone number.



52
53
54
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 52

def verified_phone_number
  @verified_phone_number
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 298

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = LinodeOpenapiClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



99
100
101
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 99

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 80

def self.attribute_map
  {
    :'uid' => :'uid',
    :'authorized_keys' => :'authorized_keys',
    :'email' => :'email',
    :'restricted' => :'restricted',
    :'email_notifications' => :'email_notifications',
    :'ip_whitelist_enabled' => :'ip_whitelist_enabled',
    :'lish_auth_method' => :'lish_auth_method',
    :'timezone' => :'timezone',
    :'authentication_type' => :'authentication_type',
    :'two_factor_auth' => :'two_factor_auth',
    :'referrals' => :'referrals',
    :'verified_phone_number' => :'verified_phone_number',
    :'username' => :'username'
  }
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



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 274

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



123
124
125
126
127
128
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 123

def self.openapi_nullable
  Set.new([
    :'authorized_keys',
    :'verified_phone_number',
  ])
end

.openapi_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 104

def self.openapi_types
  {
    :'uid' => :'Integer',
    :'authorized_keys' => :'Array<String>',
    :'email' => :'String',
    :'restricted' => :'Boolean',
    :'email_notifications' => :'Boolean',
    :'ip_whitelist_enabled' => :'Boolean',
    :'lish_auth_method' => :'String',
    :'timezone' => :'String',
    :'authentication_type' => :'String',
    :'two_factor_auth' => :'Boolean',
    :'referrals' => :'PutProfile200ResponseReferrals',
    :'verified_phone_number' => :'String',
    :'username' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 241

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      uid == o.uid &&
      authorized_keys == o.authorized_keys &&
      email == o.email &&
      restricted == o.restricted &&
      email_notifications == o.email_notifications &&
      ip_whitelist_enabled == o.ip_whitelist_enabled &&
      lish_auth_method == o.lish_auth_method &&
      timezone == o.timezone &&
      authentication_type == o.authentication_type &&
      two_factor_auth == o.two_factor_auth &&
      referrals == o.referrals &&
      verified_phone_number == o.verified_phone_number &&
      username == o.username
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 369

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


261
262
263
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 261

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



267
268
269
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 267

def hash
  [uid, authorized_keys, email, restricted, email_notifications, ip_whitelist_enabled, lish_auth_method, timezone, authentication_type, two_factor_auth, referrals, verified_phone_number, username].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



202
203
204
205
206
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 202

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



345
346
347
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 345

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 351

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



339
340
341
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 339

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



210
211
212
213
214
215
216
217
# File 'lib/linode_openapi_client/models/put_profile200_response.rb', line 210

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  lish_auth_method_validator = EnumAttributeValidator.new('String', ["password_keys", "keys_only", "disabled"])
  return false unless lish_auth_method_validator.valid?(@lish_auth_method)
  authentication_type_validator = EnumAttributeValidator.new('String', ["password", "github"])
  return false unless authentication_type_validator.valid?(@authentication_type)
  true
end