Class: NewStoreApi::CheckoutFinancialDocumentsExchangeReceiptsRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb

Overview

CheckoutFinancialDocumentsExchangeReceiptsRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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 = SKIP, original_order_id = SKIP, return_id = SKIP) ⇒ CheckoutFinancialDocumentsExchangeReceiptsRequest

Returns a new instance of CheckoutFinancialDocumentsExchangeReceiptsRequest.



47
48
49
50
51
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 47

def initialize(order_id = SKIP, original_order_id = SKIP, return_id = SKIP)
  @order_id = order_id unless order_id == SKIP
  @original_order_id = original_order_id unless original_order_id == SKIP
  @return_id = return_id unless return_id == SKIP
end

Instance Attribute Details

#order_idString

The order_id for which the exchange receipt should be generated.

Returns:

  • (String)


14
15
16
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 14

def order_id
  @order_id
end

#original_order_idString

The original order_id for which the exchange receipt should be generated.

Returns:

  • (String)


18
19
20
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 18

def original_order_id
  @original_order_id
end

#return_idString

The return_id which the exchange receipt should be generated.

Returns:

  • (String)


22
23
24
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 22

def return_id
  @return_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 54

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  order_id = hash.key?('order_id') ? hash['order_id'] : SKIP
  original_order_id =
    hash.key?('original_order_id') ? hash['original_order_id'] : SKIP
  return_id = hash.key?('return_id') ? hash['return_id'] : SKIP

  # Create object from extracted values.
  CheckoutFinancialDocumentsExchangeReceiptsRequest.new(order_id,
                                                        original_order_id,
                                                        return_id)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['order_id'] = 'order_id'
  @_hash['original_order_id'] = 'original_order_id'
  @_hash['return_id'] = 'return_id'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 34

def self.optionals
  %w[
    order_id
    original_order_id
    return_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



77
78
79
80
81
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 77

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} order_id: #{@order_id.inspect}, original_order_id:"\
  " #{@original_order_id.inspect}, return_id: #{@return_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



70
71
72
73
74
# File 'lib/new_store_api/models/checkout_financial_documents_exchange_receipts_request.rb', line 70

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} order_id: #{@order_id}, original_order_id: #{@original_order_id},"\
  " return_id: #{@return_id}>"
end