Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::SuccessfulOperation42

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb

Overview

SuccessfulOperation42 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(customer_email_id = nil, customer_order_id = nil, order_date = nil, order_lines = nil, purchase_order_id = nil, shipping_info = nil, buyer_id = nil, mart = nil, is_guest = nil, order_type = nil, payment_types = nil, order_summary = nil, pickup_persons = nil, ship_node = nil) ⇒ SuccessfulOperation42

Returns a new instance of SuccessfulOperation42.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 99

def initialize(customer_email_id = nil, customer_order_id = nil,
               order_date = nil, order_lines = nil, purchase_order_id = nil,
               shipping_info = nil, buyer_id = nil, mart = nil,
               is_guest = nil, order_type = nil, payment_types = nil,
               order_summary = nil, pickup_persons = nil, ship_node = nil)
  @customer_email_id = customer_email_id
  @customer_order_id = customer_order_id
  @order_date = order_date
  @order_lines = order_lines
  @purchase_order_id = purchase_order_id
  @shipping_info = shipping_info
  @buyer_id = buyer_id
  @mart = mart
  @is_guest = is_guest
  @order_type = order_type
  @payment_types = payment_types
  @order_summary = order_summary
  @pickup_persons = pickup_persons
  @ship_node = ship_node
end

Instance Attribute Details

#buyer_idString

TODO: Write general description for this method

Returns:

  • (String)


39
40
41
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 39

def buyer_id
  @buyer_id
end

#customer_email_idString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 15

def customer_email_id
  @customer_email_id
end

#customer_order_idString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 19

def customer_order_id
  @customer_order_id
end

#is_guestString

TODO: Write general description for this method

Returns:

  • (String)


47
48
49
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 47

def is_guest
  @is_guest
end

#martString

TODO: Write general description for this method

Returns:

  • (String)


43
44
45
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 43

def mart
  @mart
end

#order_dateString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 23

def order_date
  @order_date
end

#order_linesOrderLines1

TODO: Write general description for this method

Returns:



27
28
29
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 27

def order_lines
  @order_lines
end

#order_summaryOrderSummary

TODO: Write general description for this method

Returns:



59
60
61
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 59

def order_summary
  @order_summary
end

#order_typeString

TODO: Write general description for this method

Returns:

  • (String)


51
52
53
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 51

def order_type
  @order_type
end

#payment_typesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


55
56
57
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 55

def payment_types
  @payment_types
end

#pickup_personsArray[PickupPerson]

TODO: Write general description for this method

Returns:



63
64
65
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 63

def pickup_persons
  @pickup_persons
end

#purchase_order_idString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 31

def purchase_order_id
  @purchase_order_id
end

#ship_nodeShippingTemplate

TODO: Write general description for this method

Returns:



67
68
69
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 67

def ship_node
  @ship_node
end

#shipping_infoShippingInfo

TODO: Write general description for this method

Returns:



35
36
37
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 35

def shipping_info
  @shipping_info
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
160
161
162
163
164
165
166
167
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 121

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer_email_id =
    hash.key?('customerEmailId') ? hash['customerEmailId'] : nil
  customer_order_id =
    hash.key?('customerOrderId') ? hash['customerOrderId'] : nil
  order_date = hash.key?('orderDate') ? hash['orderDate'] : nil
  order_lines = OrderLines1.from_hash(hash['orderLines']) if hash['orderLines']
  purchase_order_id =
    hash.key?('purchaseOrderId') ? hash['purchaseOrderId'] : nil
  shipping_info = ShippingInfo.from_hash(hash['shippingInfo']) if hash['shippingInfo']
  buyer_id = hash.key?('buyerId') ? hash['buyerId'] : nil
  mart = hash.key?('mart') ? hash['mart'] : nil
  is_guest = hash.key?('isGuest') ? hash['isGuest'] : nil
  order_type = hash.key?('orderType') ? hash['orderType'] : nil
  payment_types = hash.key?('paymentTypes') ? hash['paymentTypes'] : nil
  order_summary = OrderSummary.from_hash(hash['orderSummary']) if hash['orderSummary']
  # Parameter is an array, so we need to iterate through it
  pickup_persons = nil
  unless hash['pickupPersons'].nil?
    pickup_persons = []
    hash['pickupPersons'].each do |structure|
      pickup_persons << (PickupPerson.from_hash(structure) if structure)
    end
  end

  pickup_persons = nil unless hash.key?('pickupPersons')
  ship_node = ShippingTemplate.from_hash(hash['shipNode']) if hash['shipNode']

  # Create object from extracted values.
  SuccessfulOperation42.new(customer_email_id,
                            customer_order_id,
                            order_date,
                            order_lines,
                            purchase_order_id,
                            shipping_info,
                            buyer_id,
                            mart,
                            is_guest,
                            order_type,
                            payment_types,
                            order_summary,
                            pickup_persons,
                            ship_node)
end

.namesObject

A mapping from model property names to API property names.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 70

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer_email_id'] = 'customerEmailId'
  @_hash['customer_order_id'] = 'customerOrderId'
  @_hash['order_date'] = 'orderDate'
  @_hash['order_lines'] = 'orderLines'
  @_hash['purchase_order_id'] = 'purchaseOrderId'
  @_hash['shipping_info'] = 'shippingInfo'
  @_hash['buyer_id'] = 'buyerId'
  @_hash['mart'] = 'mart'
  @_hash['is_guest'] = 'isGuest'
  @_hash['order_type'] = 'orderType'
  @_hash['payment_types'] = 'paymentTypes'
  @_hash['order_summary'] = 'orderSummary'
  @_hash['pickup_persons'] = 'pickupPersons'
  @_hash['ship_node'] = 'shipNode'
  @_hash
end

.nullablesObject

An array for nullable fields



95
96
97
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 95

def self.nullables
  []
end

.optionalsObject

An array for optional fields



90
91
92
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 90

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



181
182
183
184
185
186
187
188
189
190
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 181

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} customer_email_id: #{@customer_email_id.inspect}, customer_order_id:"\
  " #{@customer_order_id.inspect}, order_date: #{@order_date.inspect}, order_lines:"\
  " #{@order_lines.inspect}, purchase_order_id: #{@purchase_order_id.inspect}, shipping_info:"\
  " #{@shipping_info.inspect}, buyer_id: #{@buyer_id.inspect}, mart: #{@mart.inspect},"\
  " is_guest: #{@is_guest.inspect}, order_type: #{@order_type.inspect}, payment_types:"\
  " #{@payment_types.inspect}, order_summary: #{@order_summary.inspect}, pickup_persons:"\
  " #{@pickup_persons.inspect}, ship_node: #{@ship_node.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



170
171
172
173
174
175
176
177
178
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/successful_operation42.rb', line 170

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} customer_email_id: #{@customer_email_id}, customer_order_id:"\
  " #{@customer_order_id}, order_date: #{@order_date}, order_lines: #{@order_lines},"\
  " purchase_order_id: #{@purchase_order_id}, shipping_info: #{@shipping_info}, buyer_id:"\
  " #{@buyer_id}, mart: #{@mart}, is_guest: #{@is_guest}, order_type: #{@order_type},"\
  " payment_types: #{@payment_types}, order_summary: #{@order_summary}, pickup_persons:"\
  " #{@pickup_persons}, ship_node: #{@ship_node}>"
end