Class: ShellDataReportingApIs::PricedTransSummaryResponseTransactionsSummaryItems

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb

Overview

PricedTransSummaryResponseTransactionsSummaryItems Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(product_id = SKIP, product_code = SKIP, product_name = SKIP, product_group_id = SKIP, product_group_name = SKIP, site_group_id = SKIP, site_group_name = SKIP, total_fuel_quantity = SKIP, total_net_amount = SKIP, total_gross_amount = SKIP, invoice_currency_code = SKIP, invoice_currency_symbol = SKIP, customer_retail_value_total_net = SKIP, customer_retail_value_total_gross = SKIP) ⇒ PricedTransSummaryResponseTransactionsSummaryItems

Returns a new instance of PricedTransSummaryResponseTransactionsSummaryItems.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 159

def initialize(product_id = SKIP, product_code = SKIP, product_name = SKIP,
               product_group_id = SKIP, product_group_name = SKIP,
               site_group_id = SKIP, site_group_name = SKIP,
               total_fuel_quantity = SKIP, total_net_amount = SKIP,
               total_gross_amount = SKIP, invoice_currency_code = SKIP,
               invoice_currency_symbol = SKIP,
               customer_retail_value_total_net = SKIP,
               customer_retail_value_total_gross = SKIP)
  @product_id = product_id unless product_id == SKIP
  @product_code = product_code unless product_code == SKIP
  @product_name = product_name unless product_name == SKIP
  @product_group_id = product_group_id unless product_group_id == SKIP
  @product_group_name = product_group_name unless product_group_name == SKIP
  @site_group_id = site_group_id unless site_group_id == SKIP
  @site_group_name = site_group_name unless site_group_name == SKIP
  @total_fuel_quantity = total_fuel_quantity unless total_fuel_quantity == SKIP
  @total_net_amount = total_net_amount unless total_net_amount == SKIP
  @total_gross_amount = total_gross_amount unless total_gross_amount == SKIP
  @invoice_currency_code = invoice_currency_code unless invoice_currency_code == SKIP
  @invoice_currency_symbol = invoice_currency_symbol unless invoice_currency_symbol == SKIP
  unless customer_retail_value_total_net == SKIP
    @customer_retail_value_total_net =
      customer_retail_value_total_net
  end
  unless customer_retail_value_total_gross == SKIP
    @customer_retail_value_total_gross =
      customer_retail_value_total_gross
  end
end

Instance Attribute Details

#customer_retail_value_total_grossFloat

Sum of the retail gross price

Returns:

  • (Float)


95
96
97
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 95

def customer_retail_value_total_gross
  @customer_retail_value_total_gross
end

#customer_retail_value_total_netFloat

Sum of the retail net price

Returns:

  • (Float)


91
92
93
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 91

def customer_retail_value_total_net
  @customer_retail_value_total_net
end

#invoice_currency_codeString

ISO currency code Example: GBP

Returns:

  • (String)


82
83
84
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 82

def invoice_currency_code
  @invoice_currency_code
end

#invoice_currency_symbolString

Currency symbol of the Invoice Currency Code Example: £, $

Returns:

  • (String)


87
88
89
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 87

def invoice_currency_symbol
  @invoice_currency_symbol
end

#product_codeString

Product Code Examples: 10 TMF Charges 11 Tunnel/Bridges 12 Motorway toll 13 Ferries

Returns:

  • (String)


23
24
25
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 23

def product_code
  @product_code
end

#product_group_idInteger

Product Group Id Example: 1 Parent Product Group 2 All Fuels 3 Motor gasoline 4 2 stroke 5 Autogas 6 CNG

Returns:

  • (Integer)


43
44
45
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 43

def product_group_id
  @product_group_id
end

#product_group_nameString

Product Group Name Example: 1 Parent Product Group 2 All Fuels 3 Motor gasoline 4 2 stroke 5 Autogas 6 CNG 7 Automotive Gas Oil

Returns:

  • (String)


55
56
57
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 55

def product_group_name
  @product_group_name
end

#product_idInteger

Product Id

Returns:

  • (Integer)


14
15
16
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 14

def product_id
  @product_id
end

#product_nameString

Product Name Examples: Unleaded - High octane Unleaded - Medium octane Unleaded - Low octane Unleaded Environmental

Returns:

  • (String)


32
33
34
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 32

def product_name
  @product_name
end

#site_group_idInteger

Site Group Id Example: 202

Returns:

  • (Integer)


60
61
62
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 60

def site_group_id
  @site_group_id
end

#site_group_nameString

Site Group Name Example: CZ 9100 ECONOMY NETWORK

Returns:

  • (String)


65
66
67
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 65

def site_group_name
  @site_group_name
end

#total_fuel_quantityInteger

Total Fuel Quantity

Returns:

  • (Integer)


69
70
71
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 69

def total_fuel_quantity
  @total_fuel_quantity
end

#total_gross_amountInteger

Total Gross amount in invoice currency

Returns:

  • (Integer)


77
78
79
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 77

def total_gross_amount
  @total_gross_amount
end

#total_net_amountInteger

Total Net amount in invoice currency

Returns:

  • (Integer)


73
74
75
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 73

def total_net_amount
  @total_net_amount
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 190

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  product_id = hash.key?('ProductId') ? hash['ProductId'] : SKIP
  product_code = hash.key?('ProductCode') ? hash['ProductCode'] : SKIP
  product_name = hash.key?('ProductName') ? hash['ProductName'] : SKIP
  product_group_id =
    hash.key?('ProductGroupId') ? hash['ProductGroupId'] : SKIP
  product_group_name =
    hash.key?('ProductGroupName') ? hash['ProductGroupName'] : SKIP
  site_group_id = hash.key?('SiteGroupId') ? hash['SiteGroupId'] : SKIP
  site_group_name =
    hash.key?('SiteGroupName') ? hash['SiteGroupName'] : SKIP
  total_fuel_quantity =
    hash.key?('TotalFuelQuantity') ? hash['TotalFuelQuantity'] : SKIP
  total_net_amount =
    hash.key?('TotalNetAmount') ? hash['TotalNetAmount'] : SKIP
  total_gross_amount =
    hash.key?('TotalGrossAmount') ? hash['TotalGrossAmount'] : SKIP
  invoice_currency_code =
    hash.key?('InvoiceCurrencyCode') ? hash['InvoiceCurrencyCode'] : SKIP
  invoice_currency_symbol =
    hash.key?('InvoiceCurrencySymbol') ? hash['InvoiceCurrencySymbol'] : SKIP
  customer_retail_value_total_net =
    hash.key?('CustomerRetailValueTotalNet') ? hash['CustomerRetailValueTotalNet'] : SKIP
  customer_retail_value_total_gross =
    hash.key?('CustomerRetailValueTotalGross') ? hash['CustomerRetailValueTotalGross'] : SKIP

  # Create object from extracted values.
  PricedTransSummaryResponseTransactionsSummaryItems.new(product_id,
                                                         product_code,
                                                         product_name,
                                                         product_group_id,
                                                         product_group_name,
                                                         site_group_id,
                                                         site_group_name,
                                                         total_fuel_quantity,
                                                         total_net_amount,
                                                         total_gross_amount,
                                                         invoice_currency_code,
                                                         invoice_currency_symbol,
                                                         customer_retail_value_total_net,
                                                         customer_retail_value_total_gross)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['product_id'] = 'ProductId'
  @_hash['product_code'] = 'ProductCode'
  @_hash['product_name'] = 'ProductName'
  @_hash['product_group_id'] = 'ProductGroupId'
  @_hash['product_group_name'] = 'ProductGroupName'
  @_hash['site_group_id'] = 'SiteGroupId'
  @_hash['site_group_name'] = 'SiteGroupName'
  @_hash['total_fuel_quantity'] = 'TotalFuelQuantity'
  @_hash['total_net_amount'] = 'TotalNetAmount'
  @_hash['total_gross_amount'] = 'TotalGrossAmount'
  @_hash['invoice_currency_code'] = 'InvoiceCurrencyCode'
  @_hash['invoice_currency_symbol'] = 'InvoiceCurrencySymbol'
  @_hash['customer_retail_value_total_net'] =
    'CustomerRetailValueTotalNet'
  @_hash['customer_retail_value_total_gross'] =
    'CustomerRetailValueTotalGross'
  @_hash
end

.nullablesObject

An array for nullable fields



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 140

def self.nullables
  %w[
    product_id
    product_code
    product_name
    product_group_id
    product_group_name
    site_group_id
    site_group_name
    total_fuel_quantity
    total_net_amount
    total_gross_amount
    invoice_currency_code
    invoice_currency_symbol
    customer_retail_value_total_net
    customer_retail_value_total_gross
  ]
end

.optionalsObject

An array for optional fields



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb', line 120

def self.optionals
  %w[
    product_id
    product_code
    product_name
    product_group_id
    product_group_name
    site_group_id
    site_group_name
    total_fuel_quantity
    total_net_amount
    total_gross_amount
    invoice_currency_code
    invoice_currency_symbol
    customer_retail_value_total_net
    customer_retail_value_total_gross
  ]
end