Class: NewStoreApi::GetUserinfoResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::GetUserinfoResponse
- Defined in:
- lib/new_store_api/models/get_userinfo_response.rb
Overview
Returns user information including permissions.
Instance Attribute Summary collapse
-
#associate_id ⇒ String
External identifier for the NewStore plattform.
-
#email ⇒ String
Email address of the user.
-
#first_name ⇒ String
First name of the user.
-
#id ⇒ String
Identifier of the user.
-
#last_name ⇒ String
Last name of the user.
-
#permissions ⇒ Array[Permission]
Last name of the user.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(associate_id = SKIP, email = SKIP, first_name = SKIP, id = SKIP, last_name = SKIP, permissions = SKIP) ⇒ GetUserinfoResponse
constructor
A new instance of GetUserinfoResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(associate_id = SKIP, email = SKIP, first_name = SKIP, id = SKIP, last_name = SKIP, permissions = SKIP) ⇒ GetUserinfoResponse
Returns a new instance of GetUserinfoResponse.
66 67 68 69 70 71 72 73 74 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 66 def initialize(associate_id = SKIP, email = SKIP, first_name = SKIP, id = SKIP, last_name = SKIP, = SKIP) @associate_id = associate_id unless associate_id == SKIP @email = email unless email == SKIP @first_name = first_name unless first_name == SKIP @id = id unless id == SKIP @last_name = last_name unless last_name == SKIP @permissions = unless == SKIP end |
Instance Attribute Details
#associate_id ⇒ String
External identifier for the NewStore plattform. Formerly known as "newstore_id".
15 16 17 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 15 def associate_id @associate_id end |
#email ⇒ String
Email address of the user.
19 20 21 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 19 def email @email end |
#first_name ⇒ String
First name of the user.
23 24 25 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 23 def first_name @first_name end |
#id ⇒ String
Identifier of the user.
27 28 29 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 27 def id @id end |
#last_name ⇒ String
Last name of the user.
31 32 33 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 31 def last_name @last_name end |
#permissions ⇒ Array[Permission]
Last name of the user.
35 36 37 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 35 def @permissions end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. associate_id = hash.key?('associate_id') ? hash['associate_id'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP first_name = hash.key?('first_name') ? hash['first_name'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP last_name = hash.key?('last_name') ? hash['last_name'] : SKIP # Parameter is an array, so we need to iterate through it = nil unless hash['permissions'].nil? = [] hash['permissions'].each do |structure| << (Permission.from_hash(structure) if structure) end end = SKIP unless hash.key?('permissions') # Create object from extracted values. GetUserinfoResponse.new(associate_id, email, first_name, id, last_name, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['associate_id'] = 'associate_id' @_hash['email'] = 'email' @_hash['first_name'] = 'first_name' @_hash['id'] = 'id' @_hash['last_name'] = 'last_name' @_hash['permissions'] = 'permissions' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 50 def self.optionals %w[ associate_id email first_name id last_name permissions ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} associate_id: #{@associate_id.inspect}, email: #{@email.inspect},"\ " first_name: #{@first_name.inspect}, id: #{@id.inspect}, last_name: #{@last_name.inspect},"\ " permissions: #{@permissions.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 |
# File 'lib/new_store_api/models/get_userinfo_response.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} associate_id: #{@associate_id}, email: #{@email}, first_name:"\ " #{@first_name}, id: #{@id}, last_name: #{@last_name}, permissions: #{@permissions}>" end |