Class: NewStoreApi::SalesOrderSerialNumbersRequestItemEpc
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::SalesOrderSerialNumbersRequestItemEpc
- Defined in:
- lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb
Overview
The epc which should be assigned to the specified order line item.
Instance Attribute Summary collapse
-
#code ⇒ String
The epc code.
-
#external_id ⇒ String
The external identifier for the epc.
-
#serial_number ⇒ String
The serial number associated with the epc.
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(code = nil, external_id = nil, serial_number = nil) ⇒ SalesOrderSerialNumbersRequestItemEpc
constructor
A new instance of SalesOrderSerialNumbersRequestItemEpc.
-
#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(code = nil, external_id = nil, serial_number = nil) ⇒ SalesOrderSerialNumbersRequestItemEpc
Returns a new instance of SalesOrderSerialNumbersRequestItemEpc.
43 44 45 46 47 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 43 def initialize(code = nil, external_id = nil, serial_number = nil) @code = code @external_id = external_id @serial_number = serial_number end |
Instance Attribute Details
#code ⇒ String
The epc code.
14 15 16 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 14 def code @code end |
#external_id ⇒ String
The external identifier for the epc.
18 19 20 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 18 def external_id @external_id end |
#serial_number ⇒ String
The serial number associated with the epc.
22 23 24 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 22 def serial_number @serial_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 50 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('code') ? hash['code'] : nil external_id = hash.key?('external_id') ? hash['external_id'] : nil serial_number = hash.key?('serial_number') ? hash['serial_number'] : nil # Create object from extracted values. SalesOrderSerialNumbersRequestItemEpc.new(code, external_id, serial_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['external_id'] = 'external_id' @_hash['serial_number'] = 'serial_number' @_hash end |
.nullables ⇒ Object
An array for nullable fields
39 40 41 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 39 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 34 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
72 73 74 75 76 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 72 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, external_id: #{@external_id.inspect},"\ " serial_number: #{@serial_number.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
65 66 67 68 69 |
# File 'lib/new_store_api/models/sales_order_serial_numbers_request_item_epc.rb', line 65 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, external_id: #{@external_id}, serial_number:"\ " #{@serial_number}>" end |