Class: NewStoreApi::GetReturnReceiptRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::GetReturnReceiptRequest
- Defined in:
- lib/new_store_api/models/get_return_receipt_request.rb
Overview
request payload to get a return receipt document
Instance Attribute Summary collapse
-
#order_id ⇒ String
Identifier for the corresponding sales_order.
-
#print_type ⇒ String
Type of the receipt printing operation (document_printed, document_emailed).
-
#refund_id ⇒ String
The identifier of the refund related to this return receipt.
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(order_id = nil, refund_id = nil, print_type = SKIP) ⇒ GetReturnReceiptRequest
constructor
A new instance of GetReturnReceiptRequest.
-
#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(order_id = nil, refund_id = nil, print_type = SKIP) ⇒ GetReturnReceiptRequest
Returns a new instance of GetReturnReceiptRequest.
46 47 48 49 50 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 46 def initialize(order_id = nil, refund_id = nil, print_type = SKIP) @order_id = order_id @print_type = print_type unless print_type == SKIP @refund_id = refund_id end |
Instance Attribute Details
#order_id ⇒ String
Identifier for the corresponding sales_order
14 15 16 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 14 def order_id @order_id end |
#print_type ⇒ String
Type of the receipt printing operation (document_printed, document_emailed).
19 20 21 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 19 def print_type @print_type end |
#refund_id ⇒ String
The identifier of the refund related to this return receipt.
23 24 25 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 23 def refund_id @refund_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 53 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. order_id = hash.key?('order_id') ? hash['order_id'] : nil refund_id = hash.key?('refund_id') ? hash['refund_id'] : nil print_type = hash.key?('print_type') ? hash['print_type'] : SKIP # Create object from extracted values. GetReturnReceiptRequest.new(order_id, refund_id, print_type) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['order_id'] = 'order_id' @_hash['print_type'] = 'print_type' @_hash['refund_id'] = 'refund_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 35 def self.optionals %w[ print_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
75 76 77 78 79 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 75 def inspect class_name = self.class.name.split('::').last "<#{class_name} order_id: #{@order_id.inspect}, print_type: #{@print_type.inspect},"\ " refund_id: #{@refund_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
68 69 70 71 72 |
# File 'lib/new_store_api/models/get_return_receipt_request.rb', line 68 def to_s class_name = self.class.name.split('::').last "<#{class_name} order_id: #{@order_id}, print_type: #{@print_type}, refund_id:"\ " #{@refund_id}>" end |