Class: NewStoreApi::ShippingOptionAudit
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::ShippingOptionAudit
- Defined in:
- lib/new_store_api/models/shipping_option_audit.rb
Overview
ShippingOptionAudit Model.
Instance Attribute Summary collapse
-
#external_order_id ⇒ String
an external order ID if Sales Order UUID is not created yet.
-
#sales_order_uuid ⇒ UUID | String
the Sales Order UUID for which to generate the option.
-
#search_key ⇒ String
if none of the above match your use case, you can use this field.
-
#transfer_order_id ⇒ String
the Transfer Order ID for which to generate the option.
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(external_order_id = SKIP, sales_order_uuid = SKIP, search_key = SKIP, transfer_order_id = SKIP) ⇒ ShippingOptionAudit
constructor
A new instance of ShippingOptionAudit.
-
#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(external_order_id = SKIP, sales_order_uuid = SKIP, search_key = SKIP, transfer_order_id = SKIP) ⇒ ShippingOptionAudit
Returns a new instance of ShippingOptionAudit.
58 59 60 61 62 63 64 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 58 def initialize(external_order_id = SKIP, sales_order_uuid = SKIP, search_key = SKIP, transfer_order_id = SKIP) @external_order_id = external_order_id unless external_order_id == SKIP @sales_order_uuid = sales_order_uuid unless sales_order_uuid == SKIP @search_key = search_key unless search_key == SKIP @transfer_order_id = transfer_order_id unless transfer_order_id == SKIP end |
Instance Attribute Details
#external_order_id ⇒ String
an external order ID if Sales Order UUID is not created yet
14 15 16 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 14 def external_order_id @external_order_id end |
#sales_order_uuid ⇒ UUID | String
the Sales Order UUID for which to generate the option
18 19 20 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 18 def sales_order_uuid @sales_order_uuid end |
#search_key ⇒ String
if none of the above match your use case, you can use this field
22 23 24 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 22 def search_key @search_key end |
#transfer_order_id ⇒ String
the Transfer Order ID for which to generate the option
26 27 28 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 26 def transfer_order_id @transfer_order_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. external_order_id = hash.key?('external_order_id') ? hash['external_order_id'] : SKIP sales_order_uuid = hash.key?('sales_order_uuid') ? hash['sales_order_uuid'] : SKIP search_key = hash.key?('search_key') ? hash['search_key'] : SKIP transfer_order_id = hash.key?('transfer_order_id') ? hash['transfer_order_id'] : SKIP # Create object from extracted values. ShippingOptionAudit.new(external_order_id, sales_order_uuid, search_key, transfer_order_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['external_order_id'] = 'external_order_id' @_hash['sales_order_uuid'] = 'sales_order_uuid' @_hash['search_key'] = 'search_key' @_hash['transfer_order_id'] = 'transfer_order_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 52 53 54 55 56 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 49 def self.nullables %w[ external_order_id sales_order_uuid search_key transfer_order_id ] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 39 def self.optionals %w[ external_order_id sales_order_uuid search_key transfer_order_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
95 96 97 98 99 100 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 95 def inspect class_name = self.class.name.split('::').last "<#{class_name} external_order_id: #{@external_order_id.inspect}, sales_order_uuid:"\ " #{@sales_order_uuid.inspect}, search_key: #{@search_key.inspect}, transfer_order_id:"\ " #{@transfer_order_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
87 88 89 90 91 92 |
# File 'lib/new_store_api/models/shipping_option_audit.rb', line 87 def to_s class_name = self.class.name.split('::').last "<#{class_name} external_order_id: #{@external_order_id}, sales_order_uuid:"\ " #{@sales_order_uuid}, search_key: #{@search_key}, transfer_order_id:"\ " #{@transfer_order_id}>" end |