Class: NewStoreApi::PosnetOnlineCommandLogV1Dto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::PosnetOnlineCommandLogV1Dto
- Defined in:
- lib/new_store_api/models/posnet_online_command_log_v1_dto.rb
Overview
PosnetOnlineCommandLogV1Dto Model.
Instance Attribute Summary collapse
-
#command_id ⇒ String
Id of the command.
-
#error ⇒ String
Error (if any).
-
#error_code ⇒ String
Error code for a failed command execution result.
-
#error_state ⇒ String
Error state (if any).
-
#request ⇒ String
Request frame to the command.
-
#response ⇒ String
Response frame to the command.
-
#success ⇒ TrueClass | FalseClass
Success state of the command.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(command_id = nil, error = SKIP, error_code = SKIP, error_state = SKIP, request = SKIP, response = SKIP, success = SKIP) ⇒ PosnetOnlineCommandLogV1Dto
constructor
A new instance of PosnetOnlineCommandLogV1Dto.
-
#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(command_id = nil, error = SKIP, error_code = SKIP, error_state = SKIP, request = SKIP, response = SKIP, success = SKIP) ⇒ PosnetOnlineCommandLogV1Dto
Returns a new instance of PosnetOnlineCommandLogV1Dto.
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 70 def initialize(command_id = nil, error = SKIP, error_code = SKIP, error_state = SKIP, request = SKIP, response = SKIP, success = SKIP) @command_id = command_id @error = error unless error == SKIP @error_code = error_code unless error_code == SKIP @error_state = error_state unless error_state == SKIP @request = request unless request == SKIP @response = response unless response == SKIP @success = success unless success == SKIP end |
Instance Attribute Details
#command_id ⇒ String
Id of the command.
14 15 16 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 14 def command_id @command_id end |
#error ⇒ String
Error (if any).
18 19 20 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 18 def error @error end |
#error_code ⇒ String
Error code for a failed command execution result.
22 23 24 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 22 def error_code @error_code end |
#error_state ⇒ String
Error state (if any).
26 27 28 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 26 def error_state @error_state end |
#request ⇒ String
Request frame to the command.
30 31 32 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 30 def request @request end |
#response ⇒ String
Response frame to the command.
34 35 36 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 34 def response @response end |
#success ⇒ TrueClass | FalseClass
Success state of the command.
38 39 40 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 38 def success @success end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. command_id = hash.key?('command_id') ? hash['command_id'] : nil error = hash.key?('error') ? hash['error'] : SKIP error_code = hash.key?('error_code') ? hash['error_code'] : SKIP error_state = hash.key?('error_state') ? hash['error_state'] : SKIP request = hash.key?('request') ? hash['request'] : SKIP response = hash.key?('response') ? hash['response'] : SKIP success = hash.key?('success') ? hash['success'] : SKIP # Create object from extracted values. PosnetOnlineCommandLogV1Dto.new(command_id, error, error_code, error_state, request, response, success) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['command_id'] = 'command_id' @_hash['error'] = 'error' @_hash['error_code'] = 'error_code' @_hash['error_state'] = 'error_state' @_hash['request'] = 'request' @_hash['response'] = 'response' @_hash['success'] = 'success' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 54 def self.optionals %w[ error error_code error_state request response success ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 107 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.command_id, ->(val) { val.instance_of? String }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['command_id'], ->(val) { val.instance_of? String }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
128 129 130 131 132 133 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 128 def inspect class_name = self.class.name.split('::').last "<#{class_name} command_id: #{@command_id.inspect}, error: #{@error.inspect}, error_code:"\ " #{@error_code.inspect}, error_state: #{@error_state.inspect}, request:"\ " #{@request.inspect}, response: #{@response.inspect}, success: #{@success.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
120 121 122 123 124 125 |
# File 'lib/new_store_api/models/posnet_online_command_log_v1_dto.rb', line 120 def to_s class_name = self.class.name.split('::').last "<#{class_name} command_id: #{@command_id}, error: #{@error}, error_code: #{@error_code},"\ " error_state: #{@error_state}, request: #{@request}, response: #{@response}, success:"\ " #{@success}>" end |