Class: NewStoreApi::SignatureAtV1Dto
- Defined in:
- lib/new_store_api/models/signature_at_v1_dto.rb
Overview
SignatureAtV1Dto Model.
Instance Attribute Summary collapse
-
#cashbox_id ⇒ String
Cashbox ID.
-
#cashbox_name ⇒ String
Cashbox name.
-
#environment ⇒ FiscalEnvironmentEnum
Cashbox name.
-
#portal_receipt_url ⇒ String
Receipt URL in fiskaltrust Portal.
-
#queue_id ⇒ String
Queue ID.
-
#queue_item_id ⇒ String
Queue item ID.
-
#queue_row ⇒ Integer
Queue row.
-
#receipt_id ⇒ String
Receipt ID to be printed on receipt.
-
#receipt_moment ⇒ DateTime
Receipt moment.
-
#signature_items ⇒ Array[SignatureItemAtV1Dto]
List of signature items to be printed on receipt.
-
#state ⇒ FtAtStateEnum
List of signature items to be printed on receipt.
-
#state_data ⇒ Object
Additional state data (JSON string).
-
#terminal_id ⇒ String
Terminal/associate ID.
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(cashbox_id = nil, cashbox_name = nil, environment = nil, portal_receipt_url = nil, queue_id = nil, queue_item_id = nil, queue_row = nil, receipt_id = nil, receipt_moment = nil, signature_items = nil, state = nil, state_data = nil, terminal_id = nil) ⇒ SignatureAtV1Dto
constructor
A new instance of SignatureAtV1Dto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_receipt_moment ⇒ Object
-
#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(cashbox_id = nil, cashbox_name = nil, environment = nil, portal_receipt_url = nil, queue_id = nil, queue_item_id = nil, queue_row = nil, receipt_id = nil, receipt_moment = nil, signature_items = nil, state = nil, state_data = nil, terminal_id = nil) ⇒ SignatureAtV1Dto
Returns a new instance of SignatureAtV1Dto.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 94 def initialize(cashbox_id = nil, cashbox_name = nil, environment = nil, portal_receipt_url = nil, queue_id = nil, queue_item_id = nil, queue_row = nil, receipt_id = nil, receipt_moment = nil, signature_items = nil, state = nil, state_data = nil, terminal_id = nil) @cashbox_id = cashbox_id @cashbox_name = cashbox_name @environment = environment @portal_receipt_url = portal_receipt_url @queue_id = queue_id @queue_item_id = queue_item_id @queue_row = queue_row @receipt_id = receipt_id @receipt_moment = receipt_moment @signature_items = signature_items @state = state @state_data = state_data @terminal_id = terminal_id end |
Instance Attribute Details
#cashbox_id ⇒ String
Cashbox ID.
15 16 17 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 15 def cashbox_id @cashbox_id end |
#cashbox_name ⇒ String
Cashbox name.
19 20 21 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 19 def cashbox_name @cashbox_name end |
#environment ⇒ FiscalEnvironmentEnum
Cashbox name.
23 24 25 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 23 def environment @environment end |
#portal_receipt_url ⇒ String
Receipt URL in fiskaltrust Portal.
27 28 29 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 27 def portal_receipt_url @portal_receipt_url end |
#queue_id ⇒ String
Queue ID.
31 32 33 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 31 def queue_id @queue_id end |
#queue_item_id ⇒ String
Queue item ID.
35 36 37 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 35 def queue_item_id @queue_item_id end |
#queue_row ⇒ Integer
Queue row.
39 40 41 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 39 def queue_row @queue_row end |
#receipt_id ⇒ String
Receipt ID to be printed on receipt.
43 44 45 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 43 def receipt_id @receipt_id end |
#receipt_moment ⇒ DateTime
Receipt moment.
47 48 49 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 47 def receipt_moment @receipt_moment end |
#signature_items ⇒ Array[SignatureItemAtV1Dto]
List of signature items to be printed on receipt.
51 52 53 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 51 def signature_items @signature_items end |
#state ⇒ FtAtStateEnum
List of signature items to be printed on receipt.
55 56 57 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 55 def state @state end |
#state_data ⇒ Object
Additional state data (JSON string).
59 60 61 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 59 def state_data @state_data end |
#terminal_id ⇒ String
Terminal/associate ID.
63 64 65 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 63 def terminal_id @terminal_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 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 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 115 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. cashbox_id = hash.key?('cashbox_id') ? hash['cashbox_id'] : nil cashbox_name = hash.key?('cashbox_name') ? hash['cashbox_name'] : nil environment = hash.key?('environment') ? hash['environment'] : nil portal_receipt_url = hash.key?('portal_receipt_url') ? hash['portal_receipt_url'] : nil queue_id = hash.key?('queue_id') ? hash['queue_id'] : nil queue_item_id = hash.key?('queue_item_id') ? hash['queue_item_id'] : nil queue_row = hash.key?('queue_row') ? hash['queue_row'] : nil receipt_id = hash.key?('receipt_id') ? hash['receipt_id'] : nil receipt_moment = if hash.key?('receipt_moment') (DateTimeHelper.from_rfc3339(hash['receipt_moment']) if hash['receipt_moment']) end # Parameter is an array, so we need to iterate through it signature_items = nil unless hash['signature_items'].nil? signature_items = [] hash['signature_items'].each do |structure| signature_items << (SignatureItemAtV1Dto.from_hash(structure) if structure) end end signature_items = nil unless hash.key?('signature_items') state = hash.key?('state') ? hash['state'] : nil state_data = hash.key?('state_data') ? hash['state_data'] : nil terminal_id = hash.key?('terminal_id') ? hash['terminal_id'] : nil # Create object from extracted values. SignatureAtV1Dto.new(cashbox_id, cashbox_name, environment, portal_receipt_url, queue_id, queue_item_id, queue_row, receipt_id, receipt_moment, signature_items, state, state_data, terminal_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 66 def self.names @_hash = {} if @_hash.nil? @_hash['cashbox_id'] = 'cashbox_id' @_hash['cashbox_name'] = 'cashbox_name' @_hash['environment'] = 'environment' @_hash['portal_receipt_url'] = 'portal_receipt_url' @_hash['queue_id'] = 'queue_id' @_hash['queue_item_id'] = 'queue_item_id' @_hash['queue_row'] = 'queue_row' @_hash['receipt_id'] = 'receipt_id' @_hash['receipt_moment'] = 'receipt_moment' @_hash['signature_items'] = 'signature_items' @_hash['state'] = 'state' @_hash['state_data'] = 'state_data' @_hash['terminal_id'] = 'terminal_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
90 91 92 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 90 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
85 86 87 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 85 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 167 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.cashbox_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.cashbox_name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.environment, ->(val) { FiscalEnvironmentEnum.validate(val) }) and APIHelper.valid_type?(value.portal_receipt_url, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.queue_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.queue_item_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.queue_row, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.receipt_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.receipt_moment, ->(val) { val.instance_of? DateTime }) and APIHelper.valid_type?(value.signature_items, ->(val) { SignatureItemAtV1Dto.validate(val) }, is_model_hash: true, is_inner_model_hash: true) and APIHelper.valid_type?(value.state, ->(val) { FtAtStateEnum.validate(val) }) and APIHelper.valid_type?(value.state_data, ->(val) { val.instance_of? Object }) and APIHelper.valid_type?(value.terminal_id, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['cashbox_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['cashbox_name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['environment'], ->(val) { FiscalEnvironmentEnum.validate(val) }) and APIHelper.valid_type?(value['portal_receipt_url'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['queue_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['queue_item_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['queue_row'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['receipt_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['receipt_moment'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['signature_items'], ->(val) { SignatureItemAtV1Dto.validate(val) }, is_model_hash: true, is_inner_model_hash: true) and APIHelper.valid_type?(value['state'], ->(val) { FtAtStateEnum.validate(val) }) and APIHelper.valid_type?(value['state_data'], ->(val) { val.instance_of? Object }) and APIHelper.valid_type?(value['terminal_id'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
246 247 248 249 250 251 252 253 254 255 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 246 def inspect class_name = self.class.name.split('::').last "<#{class_name} cashbox_id: #{@cashbox_id.inspect}, cashbox_name: #{@cashbox_name.inspect},"\ " environment: #{@environment.inspect}, portal_receipt_url: #{@portal_receipt_url.inspect},"\ " queue_id: #{@queue_id.inspect}, queue_item_id: #{@queue_item_id.inspect}, queue_row:"\ " #{@queue_row.inspect}, receipt_id: #{@receipt_id.inspect}, receipt_moment:"\ " #{@receipt_moment.inspect}, signature_items: #{@signature_items.inspect}, state:"\ " #{@state.inspect}, state_data: #{@state_data.inspect}, terminal_id:"\ " #{@terminal_id.inspect}>" end |
#to_custom_receipt_moment ⇒ Object
161 162 163 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 161 def to_custom_receipt_moment DateTimeHelper.to_rfc3339(receipt_moment) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
236 237 238 239 240 241 242 243 |
# File 'lib/new_store_api/models/signature_at_v1_dto.rb', line 236 def to_s class_name = self.class.name.split('::').last "<#{class_name} cashbox_id: #{@cashbox_id}, cashbox_name: #{@cashbox_name}, environment:"\ " #{@environment}, portal_receipt_url: #{@portal_receipt_url}, queue_id: #{@queue_id},"\ " queue_item_id: #{@queue_item_id}, queue_row: #{@queue_row}, receipt_id: #{@receipt_id},"\ " receipt_moment: #{@receipt_moment}, signature_items: #{@signature_items}, state:"\ " #{@state}, state_data: #{@state_data}, terminal_id: #{@terminal_id}>" end |