Class: LinodeOpenapiClient::GetProfile200Response
- Inherits:
-
Object
- Object
- LinodeOpenapiClient::GetProfile200Response
- Defined in:
- lib/linode_openapi_client/models/get_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
-
#authentication_type ⇒ Object
Read-only This account’s Cloud Manager authentication type.
-
#authorized_keys ⇒ Object
The list of SSH Keys authorized to use Lish for your User.
-
#email ⇒ Object
Your email address.
-
#email_notifications ⇒ Object
If true, you will receive email notifications about account activity.
-
#ip_whitelist_enabled ⇒ Object
If true, logins for your User will only be allowed from whitelisted IPs.
-
#lish_auth_method ⇒ Object
The authentication methods that are allowed when connecting to [the Linode Shell (Lish)](www.linode.com/docs/guides/lish/).
-
#referrals ⇒ Object
Returns the value of attribute referrals.
-
#restricted ⇒ Object
If true, your User has restrictions on what can be accessed on your Account.
-
#timezone ⇒ Object
The timezone you prefer to see times in.
-
#two_factor_auth ⇒ Object
If true, logins from untrusted computers will require Two Factor Authentication.
-
#uid ⇒ Object
Read-only Your unique ID in our system.
-
#username ⇒ Object
Read-only Your username, used for logging in to our system.
-
#verified_phone_number ⇒ Object
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.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GetProfile200Response
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ GetProfile200Response
Initializes the object
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/get_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::GetProfile200Response` 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::GetProfile200Response`. 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?(:'timezone') self.timezone = attributes[:'timezone'] end if attributes.key?(:'lish_auth_method') self.lish_auth_method = attributes[:'lish_auth_method'] end if attributes.key?(:'uid') self.uid = attributes[:'uid'] end if attributes.key?(:'authorized_keys') if (value = attributes[:'authorized_keys']).is_a?(Array) self. = value end end if attributes.key?(:'ip_whitelist_enabled') self.ip_whitelist_enabled = attributes[:'ip_whitelist_enabled'] 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?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'referrals') self.referrals = attributes[:'referrals'] end if attributes.key?(:'username') self.username = attributes[:'username'] end if attributes.key?(:'verified_phone_number') self.verified_phone_number = attributes[:'verified_phone_number'] end if attributes.key?(:'two_factor_auth') self.two_factor_auth = attributes[:'two_factor_auth'] end if attributes.key?(:'authentication_type') self.authentication_type = attributes[:'authentication_type'] end end |
Instance Attribute Details
#authentication_type ⇒ Object
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.
55 56 57 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 55 def authentication_type @authentication_type end |
#authorized_keys ⇒ Object
The list of SSH Keys authorized to use Lish for your User. This value is ignored if ‘lish_auth_method` is `disabled`.
29 30 31 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 29 def @authorized_keys end |
#email ⇒ Object
Your email address. This address will be used for communication with Linode as necessary.
41 42 43 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 41 def email @email end |
#email_notifications ⇒ Object
If true, you will receive email notifications about account activity. If false, you may still receive business-critical communications through email.
38 39 40 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 38 def email_notifications @email_notifications end |
#ip_whitelist_enabled ⇒ Object
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.
32 33 34 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 32 def ip_whitelist_enabled @ip_whitelist_enabled end |
#lish_auth_method ⇒ Object
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.
23 24 25 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 23 def lish_auth_method @lish_auth_method end |
#referrals ⇒ Object
Returns the value of attribute referrals.
43 44 45 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 43 def referrals @referrals end |
#restricted ⇒ Object
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).
35 36 37 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 35 def restricted @restricted end |
#timezone ⇒ Object
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.
20 21 22 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 20 def timezone @timezone end |
#two_factor_auth ⇒ Object
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.
52 53 54 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 52 def two_factor_auth @two_factor_auth end |
#uid ⇒ Object
Read-only Your unique ID in our system. This value will never change, and can safely be used to identify your User.
26 27 28 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 26 def uid @uid end |
#username ⇒ Object
Read-only Your username, used for logging in to our system.
46 47 48 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 46 def username @username end |
#verified_phone_number ⇒ Object
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.
49 50 51 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 49 def verified_phone_number @verified_phone_number end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
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/get_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_attributes ⇒ Object
Returns all the JSON keys this model knows about
99 100 101 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 99 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
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/get_profile200_response.rb', line 80 def self.attribute_map { :'timezone' => :'timezone', :'lish_auth_method' => :'lish_auth_method', :'uid' => :'uid', :'authorized_keys' => :'authorized_keys', :'ip_whitelist_enabled' => :'ip_whitelist_enabled', :'restricted' => :'restricted', :'email_notifications' => :'email_notifications', :'email' => :'email', :'referrals' => :'referrals', :'username' => :'username', :'verified_phone_number' => :'verified_phone_number', :'two_factor_auth' => :'two_factor_auth', :'authentication_type' => :'authentication_type' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
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/get_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_nullable ⇒ Object
List of attributes with nullable: true
123 124 125 126 127 128 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 123 def self.openapi_nullable Set.new([ :'authorized_keys', :'verified_phone_number', ]) end |
.openapi_types ⇒ Object
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/get_profile200_response.rb', line 104 def self.openapi_types { :'timezone' => :'String', :'lish_auth_method' => :'String', :'uid' => :'Integer', :'authorized_keys' => :'Array<String>', :'ip_whitelist_enabled' => :'Boolean', :'restricted' => :'Boolean', :'email_notifications' => :'Boolean', :'email' => :'String', :'referrals' => :'GetProfile200ResponseReferrals', :'username' => :'String', :'verified_phone_number' => :'String', :'two_factor_auth' => :'Boolean', :'authentication_type' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 241 def ==(o) return true if self.equal?(o) self.class == o.class && timezone == o.timezone && lish_auth_method == o.lish_auth_method && uid == o.uid && == o. && ip_whitelist_enabled == o.ip_whitelist_enabled && restricted == o.restricted && email_notifications == o.email_notifications && email == o.email && referrals == o.referrals && username == o.username && verified_phone_number == o.verified_phone_number && two_factor_auth == o.two_factor_auth && authentication_type == o.authentication_type end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/linode_openapi_client/models/get_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
261 262 263 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 261 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
267 268 269 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 267 def hash [timezone, lish_auth_method, uid, , ip_whitelist_enabled, restricted, email_notifications, email, referrals, username, verified_phone_number, two_factor_auth, authentication_type].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
202 203 204 205 206 |
# File 'lib/linode_openapi_client/models/get_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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
345 346 347 |
# File 'lib/linode_openapi_client/models/get_profile200_response.rb', line 345 def to_body to_hash end |
#to_hash ⇒ 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/get_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_s ⇒ String
Returns the string representation of the object
339 340 341 |
# File 'lib/linode_openapi_client/models/get_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
210 211 212 213 214 215 216 217 |
# File 'lib/linode_openapi_client/models/get_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 |