Class: NewStoreApi::RegistrationRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::RegistrationRequest
- Defined in:
- lib/new_store_api/models/registration_request.rb
Overview
RegistrationRequest Model.
Instance Attribute Summary collapse
-
#app_name ⇒ String
Identifier of the app name who recently used the device.
-
#app_os ⇒ String
Identifier of the app os who recently used the device.
-
#device_id ⇒ String
Registration or device id.
-
#store_id ⇒ String
Identifier of the store id who recently used the device.
-
#user_id ⇒ String
Identifier of the user who recently used the device.
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(app_name = nil, app_os = nil, device_id = nil, store_id = SKIP, user_id = SKIP) ⇒ RegistrationRequest
constructor
A new instance of RegistrationRequest.
-
#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(app_name = nil, app_os = nil, device_id = nil, store_id = SKIP, user_id = SKIP) ⇒ RegistrationRequest
Returns a new instance of RegistrationRequest.
56 57 58 59 60 61 62 63 |
# File 'lib/new_store_api/models/registration_request.rb', line 56 def initialize(app_name = nil, app_os = nil, device_id = nil, store_id = SKIP, user_id = SKIP) @app_name = app_name @app_os = app_os @device_id = device_id @store_id = store_id unless store_id == SKIP @user_id = user_id unless user_id == SKIP end |
Instance Attribute Details
#app_name ⇒ String
Identifier of the app name who recently used the device
14 15 16 |
# File 'lib/new_store_api/models/registration_request.rb', line 14 def app_name @app_name end |
#app_os ⇒ String
Identifier of the app os who recently used the device
18 19 20 |
# File 'lib/new_store_api/models/registration_request.rb', line 18 def app_os @app_os end |
#device_id ⇒ String
Registration or device id.
22 23 24 |
# File 'lib/new_store_api/models/registration_request.rb', line 22 def device_id @device_id end |
#store_id ⇒ String
Identifier of the store id who recently used the device
26 27 28 |
# File 'lib/new_store_api/models/registration_request.rb', line 26 def store_id @store_id end |
#user_id ⇒ String
Identifier of the user who recently used the device.
30 31 32 |
# File 'lib/new_store_api/models/registration_request.rb', line 30 def user_id @user_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/new_store_api/models/registration_request.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. app_name = hash.key?('app_name') ? hash['app_name'] : nil app_os = hash.key?('app_os') ? hash['app_os'] : nil device_id = hash.key?('device_id') ? hash['device_id'] : nil store_id = hash.key?('store_id') ? hash['store_id'] : SKIP user_id = hash.key?('user_id') ? hash['user_id'] : SKIP # Create object from extracted values. RegistrationRequest.new(app_name, app_os, device_id, store_id, user_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/new_store_api/models/registration_request.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['app_name'] = 'app_name' @_hash['app_os'] = 'app_os' @_hash['device_id'] = 'device_id' @_hash['store_id'] = 'store_id' @_hash['user_id'] = 'user_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/new_store_api/models/registration_request.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 |
# File 'lib/new_store_api/models/registration_request.rb', line 44 def self.optionals %w[ store_id user_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
92 93 94 95 96 |
# File 'lib/new_store_api/models/registration_request.rb', line 92 def inspect class_name = self.class.name.split('::').last "<#{class_name} app_name: #{@app_name.inspect}, app_os: #{@app_os.inspect}, device_id:"\ " #{@device_id.inspect}, store_id: #{@store_id.inspect}, user_id: #{@user_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
85 86 87 88 89 |
# File 'lib/new_store_api/models/registration_request.rb', line 85 def to_s class_name = self.class.name.split('::').last "<#{class_name} app_name: #{@app_name}, app_os: #{@app_os}, device_id: #{@device_id},"\ " store_id: #{@store_id}, user_id: #{@user_id}>" end |