data-and-reporting-sdk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +104 -0
- data/lib/shell_data_reporting_ap_is/api_helper.rb +10 -0
- data/lib/shell_data_reporting_ap_is/client.rb +84 -0
- data/lib/shell_data_reporting_ap_is/configuration.rb +110 -0
- data/lib/shell_data_reporting_ap_is/controllers/base_controller.rb +66 -0
- data/lib/shell_data_reporting_ap_is/controllers/customer_controller.rb +478 -0
- data/lib/shell_data_reporting_ap_is/controllers/invoice_controller.rb +470 -0
- data/lib/shell_data_reporting_ap_is/controllers/o_auth_authorization_controller.rb +42 -0
- data/lib/shell_data_reporting_ap_is/controllers/transaction_controller.rb +878 -0
- data/lib/shell_data_reporting_ap_is/exceptions/api_exception.rb +10 -0
- data/lib/shell_data_reporting_ap_is/exceptions/default_error_exception.rb +32 -0
- data/lib/shell_data_reporting_ap_is/exceptions/error_object_exception.rb +54 -0
- data/lib/shell_data_reporting_ap_is/exceptions/error_user_access_error1_exception.rb +32 -0
- data/lib/shell_data_reporting_ap_is/exceptions/o_auth_provider_exception.rb +48 -0
- data/lib/shell_data_reporting_ap_is/http/auth/basic_auth.rb +50 -0
- data/lib/shell_data_reporting_ap_is/http/auth/bearer_token.rb +89 -0
- data/lib/shell_data_reporting_ap_is/http/http_call_back.rb +10 -0
- data/lib/shell_data_reporting_ap_is/http/http_method_enum.rb +10 -0
- data/lib/shell_data_reporting_ap_is/http/http_request.rb +10 -0
- data/lib/shell_data_reporting_ap_is/http/http_response.rb +10 -0
- data/lib/shell_data_reporting_ap_is/models/account_access.rb +128 -0
- data/lib/shell_data_reporting_ap_is/models/account_request.rb +252 -0
- data/lib/shell_data_reporting_ap_is/models/account_response.rb +111 -0
- data/lib/shell_data_reporting_ap_is/models/account_response_accounts_items.rb +750 -0
- data/lib/shell_data_reporting_ap_is/models/accounts.rb +65 -0
- data/lib/shell_data_reporting_ap_is/models/address.rb +174 -0
- data/lib/shell_data_reporting_ap_is/models/associated_account.rb +98 -0
- data/lib/shell_data_reporting_ap_is/models/audit_request.rb +256 -0
- data/lib/shell_data_reporting_ap_is/models/audit_response.rb +111 -0
- data/lib/shell_data_reporting_ap_is/models/audit_response_audits_items.rb +450 -0
- data/lib/shell_data_reporting_ap_is/models/bank_account.rb +192 -0
- data/lib/shell_data_reporting_ap_is/models/base_model.rb +62 -0
- data/lib/shell_data_reporting_ap_is/models/bonus_configuration.rb +419 -0
- data/lib/shell_data_reporting_ap_is/models/bonus_history.rb +444 -0
- data/lib/shell_data_reporting_ap_is/models/card_day_time_restrictions.rb +159 -0
- data/lib/shell_data_reporting_ap_is/models/card_exceptions.rb +268 -0
- data/lib/shell_data_reporting_ap_is/models/card_group_request.rb +178 -0
- data/lib/shell_data_reporting_ap_is/models/card_group_response.rb +109 -0
- data/lib/shell_data_reporting_ap_is/models/card_group_response_card_groups_items.rb +301 -0
- data/lib/shell_data_reporting_ap_is/models/card_type_request.rb +145 -0
- data/lib/shell_data_reporting_ap_is/models/card_type_response.rb +79 -0
- data/lib/shell_data_reporting_ap_is/models/card_type_response_customer_card_types_items.rb +470 -0
- data/lib/shell_data_reporting_ap_is/models/card_type_response_error.rb +60 -0
- data/lib/shell_data_reporting_ap_is/models/card_usage_restrictions.rb +281 -0
- data/lib/shell_data_reporting_ap_is/models/card_usage_summary_request.rb +159 -0
- data/lib/shell_data_reporting_ap_is/models/card_usage_summary_response.rb +79 -0
- data/lib/shell_data_reporting_ap_is/models/col_co_access.rb +88 -0
- data/lib/shell_data_reporting_ap_is/models/current_volume.rb +99 -0
- data/lib/shell_data_reporting_ap_is/models/customer_contract.rb +63 -0
- data/lib/shell_data_reporting_ap_is/models/customer_detail_request.rb +123 -0
- data/lib/shell_data_reporting_ap_is/models/customer_detail_response.rb +437 -0
- data/lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb +200 -0
- data/lib/shell_data_reporting_ap_is/models/customer_price_list_response.rb +82 -0
- data/lib/shell_data_reporting_ap_is/models/default_error_fault.rb +60 -0
- data/lib/shell_data_reporting_ap_is/models/default_error_fault_detail.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/delivery_addresses.rb +258 -0
- data/lib/shell_data_reporting_ap_is/models/eid_access.rb +75 -0
- data/lib/shell_data_reporting_ap_is/models/eid_document.rb +166 -0
- data/lib/shell_data_reporting_ap_is/models/eid_document_response.rb +140 -0
- data/lib/shell_data_reporting_ap_is/models/eid_download_req.rb +86 -0
- data/lib/shell_data_reporting_ap_is/models/eid_download_request.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/eid_search_req.rb +160 -0
- data/lib/shell_data_reporting_ap_is/models/eid_search_request.rb +70 -0
- data/lib/shell_data_reporting_ap_is/models/error_details.rb +81 -0
- data/lib/shell_data_reporting_ap_is/models/error_status.rb +60 -0
- data/lib/shell_data_reporting_ap_is/models/error_user_access.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/error_user_access_error.rb +60 -0
- data/lib/shell_data_reporting_ap_is/models/exception_product.rb +65 -0
- data/lib/shell_data_reporting_ap_is/models/exception_site_location.rb +63 -0
- data/lib/shell_data_reporting_ap_is/models/fee_item.rb +977 -0
- data/lib/shell_data_reporting_ap_is/models/fee_item_summary_all_of0.rb +194 -0
- data/lib/shell_data_reporting_ap_is/models/fee_rule_location.rb +153 -0
- data/lib/shell_data_reporting_ap_is/models/fee_rule_product.rb +98 -0
- data/lib/shell_data_reporting_ap_is/models/fee_rule_tier.rb +74 -0
- data/lib/shell_data_reporting_ap_is/models/fee_summary_response.rb +85 -0
- data/lib/shell_data_reporting_ap_is/models/fees_fee_rule_tiers.rb +124 -0
- data/lib/shell_data_reporting_ap_is/models/finance_currency.rb +98 -0
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_card.rb +73 -0
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb +267 -0
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_request.rb +197 -0
- data/lib/shell_data_reporting_ap_is/models/fuel_consumption_response.rb +79 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_data.rb +62 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_request.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_request_filters.rb +146 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_dates_response_data.rb +80 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_distribution_method.rb +99 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_download_req.rb +99 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_download_request.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_search_additional_document.rb +80 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_search_details.rb +913 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_search_request.rb +91 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_search_request_filters.rb +344 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_search_response.rb +127 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_summary_details.rb +129 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_summary_request.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_summary_request_filters.rb +345 -0
- data/lib/shell_data_reporting_ap_is/models/invoice_summary_response.rb +79 -0
- data/lib/shell_data_reporting_ap_is/models/invoices_summaries.rb +221 -0
- data/lib/shell_data_reporting_ap_is/models/last_statement_of_account.rb +421 -0
- data/lib/shell_data_reporting_ap_is/models/logged_in_user_request.rb +107 -0
- data/lib/shell_data_reporting_ap_is/models/logged_in_user_response.rb +394 -0
- data/lib/shell_data_reporting_ap_is/models/monthly_invoice_trend.rb +112 -0
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request.rb +360 -0
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_request_accounts_items.rb +84 -0
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_response.rb +110 -0
- data/lib/shell_data_reporting_ap_is/models/multi_priced_transaction_response_transactions_items.rb +1724 -0
- data/lib/shell_data_reporting_ap_is/models/o_auth_provider_error_enum.rb +45 -0
- data/lib/shell_data_reporting_ap_is/models/o_auth_token.rb +100 -0
- data/lib/shell_data_reporting_ap_is/models/past_statement_of_accounts.rb +502 -0
- data/lib/shell_data_reporting_ap_is/models/payer_access.rb +147 -0
- data/lib/shell_data_reporting_ap_is/models/payer_details.rb +1412 -0
- data/lib/shell_data_reporting_ap_is/models/payer_request.rb +126 -0
- data/lib/shell_data_reporting_ap_is/models/payer_response.rb +115 -0
- data/lib/shell_data_reporting_ap_is/models/payers.rb +109 -0
- data/lib/shell_data_reporting_ap_is/models/payments_since_last_soa.rb +322 -0
- data/lib/shell_data_reporting_ap_is/models/pin_advice_types.rb +80 -0
- data/lib/shell_data_reporting_ap_is/models/price_list.rb +485 -0
- data/lib/shell_data_reporting_ap_is/models/price_trans_summary_request.rb +477 -0
- data/lib/shell_data_reporting_ap_is/models/price_transaction_request.rb +572 -0
- data/lib/shell_data_reporting_ap_is/models/priced_request_data.rb +485 -0
- data/lib/shell_data_reporting_ap_is/models/priced_response_data.rb +2132 -0
- data/lib/shell_data_reporting_ap_is/models/priced_trans_summary_response.rb +79 -0
- data/lib/shell_data_reporting_ap_is/models/priced_trans_summary_response_transactions_summary_items.rb +242 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_items_location_items.rb +67 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_invoice_status_enum.rb +27 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_period_enum.rb +27 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_req_v2_sort_order_enum.rb +37 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_request_v2.rb +72 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_resp_v2_refund_flag_enum.rb +23 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_response.rb +59 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_response_transactions_items.rb +1719 -0
- data/lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb +110 -0
- data/lib/shell_data_reporting_ap_is/models/pricing_current_volume.rb +115 -0
- data/lib/shell_data_reporting_ap_is/models/pricing_history.rb +105 -0
- data/lib/shell_data_reporting_ap_is/models/purchase_categories.rb +114 -0
- data/lib/shell_data_reporting_ap_is/models/recent_transaction_req.rb +217 -0
- data/lib/shell_data_reporting_ap_is/models/recent_transaction_request.rb +66 -0
- data/lib/shell_data_reporting_ap_is/models/recent_transactions.rb +918 -0
- data/lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb +110 -0
- data/lib/shell_data_reporting_ap_is/models/role.rb +102 -0
- data/lib/shell_data_reporting_ap_is/models/search_doc_req.rb +269 -0
- data/lib/shell_data_reporting_ap_is/models/search_documents_invoice.rb +204 -0
- data/lib/shell_data_reporting_ap_is/models/search_documents_request.rb +70 -0
- data/lib/shell_data_reporting_ap_is/models/search_documents_response.rb +122 -0
- data/lib/shell_data_reporting_ap_is/models/search_soa_req.rb +197 -0
- data/lib/shell_data_reporting_ap_is/models/search_statement_of_account.rb +220 -0
- data/lib/shell_data_reporting_ap_is/models/search_statement_of_account_request.rb +70 -0
- data/lib/shell_data_reporting_ap_is/models/search_statement_of_account_response.rb +120 -0
- data/lib/shell_data_reporting_ap_is/models/site_location.rb +67 -0
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_request.rb +50 -0
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_request_filters.rb +197 -0
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb +138 -0
- data/lib/shell_data_reporting_ap_is/models/statement_of_account_response.rb +80 -0
- data/lib/shell_data_reporting_ap_is/models/tier.rb +167 -0
- data/lib/shell_data_reporting_ap_is/models/transaction_exceptions.rb +1267 -0
- data/lib/shell_data_reporting_ap_is/models/transaction_exceptions_request.rb +267 -0
- data/lib/shell_data_reporting_ap_is/models/transaction_exceptions_response.rb +100 -0
- data/lib/shell_data_reporting_ap_is/models/transaction_fees_request.rb +348 -0
- data/lib/shell_data_reporting_ap_is/models/transaction_fees_response.rb +111 -0
- data/lib/shell_data_reporting_ap_is/models/update_odometer.rb +62 -0
- data/lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb +67 -0
- data/lib/shell_data_reporting_ap_is/models/update_odometer_request.rb +146 -0
- data/lib/shell_data_reporting_ap_is/models/update_odometer_response.rb +93 -0
- data/lib/shell_data_reporting_ap_is/models/usage_summary.rb +202 -0
- data/lib/shell_data_reporting_ap_is/models/volume_based_bonus_request.rb +118 -0
- data/lib/shell_data_reporting_ap_is/models/volume_based_bonus_response.rb +120 -0
- data/lib/shell_data_reporting_ap_is/models/volume_based_pricing_request.rb +103 -0
- data/lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb +120 -0
- data/lib/shell_data_reporting_ap_is/utilities/date_time_helper.rb +11 -0
- data/lib/shell_data_reporting_ap_is/utilities/file_wrapper.rb +16 -0
- data/lib/shell_data_reporting_ap_is.rb +229 -0
- data/test/controllers/controller_test_base.rb +34 -0
- data/test/controllers/test_invoice_controller.rb +398 -0
- data/test/controllers/test_transaction_controller.rb +235 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +302 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
# shell_data_reporting_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellDataReportingApIs
|
7
|
+
# PINAdviceTypes Model.
|
8
|
+
class PINAdviceTypes < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Id of of PIN advice type.
|
13
|
+
# Possible Values:
|
14
|
+
# 1. Paper
|
15
|
+
# 2. Email
|
16
|
+
# 3. SMS
|
17
|
+
# 4. None
|
18
|
+
# @return [Integer]
|
19
|
+
attr_accessor :pin_advice_type_id
|
20
|
+
|
21
|
+
# Whether the PIN advice type is available for card ordering
|
22
|
+
# @return [TrueClass | FalseClass]
|
23
|
+
attr_accessor :is_card_order_option
|
24
|
+
|
25
|
+
# Whether the PIN advice type is available for PIN Reminder
|
26
|
+
# @return [TrueClass | FalseClass]
|
27
|
+
attr_accessor :is_pin_reminder_option
|
28
|
+
|
29
|
+
# A mapping from model property names to API property names.
|
30
|
+
def self.names
|
31
|
+
@_hash = {} if @_hash.nil?
|
32
|
+
@_hash['pin_advice_type_id'] = 'PINAdviceTypeID'
|
33
|
+
@_hash['is_card_order_option'] = 'IsCardOrderOption'
|
34
|
+
@_hash['is_pin_reminder_option'] = 'IsPINReminderOption'
|
35
|
+
@_hash
|
36
|
+
end
|
37
|
+
|
38
|
+
# An array for optional fields
|
39
|
+
def self.optionals
|
40
|
+
%w[
|
41
|
+
pin_advice_type_id
|
42
|
+
is_card_order_option
|
43
|
+
is_pin_reminder_option
|
44
|
+
]
|
45
|
+
end
|
46
|
+
|
47
|
+
# An array for nullable fields
|
48
|
+
def self.nullables
|
49
|
+
%w[
|
50
|
+
pin_advice_type_id
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
54
|
+
def initialize(pin_advice_type_id = SKIP,
|
55
|
+
is_card_order_option = SKIP,
|
56
|
+
is_pin_reminder_option = SKIP)
|
57
|
+
@pin_advice_type_id = pin_advice_type_id unless pin_advice_type_id == SKIP
|
58
|
+
@is_card_order_option = is_card_order_option unless is_card_order_option == SKIP
|
59
|
+
@is_pin_reminder_option = is_pin_reminder_option unless is_pin_reminder_option == SKIP
|
60
|
+
end
|
61
|
+
|
62
|
+
# Creates an instance of the object from a hash.
|
63
|
+
def self.from_hash(hash)
|
64
|
+
return nil unless hash
|
65
|
+
|
66
|
+
# Extract variables from the hash.
|
67
|
+
pin_advice_type_id =
|
68
|
+
hash.key?('PINAdviceTypeID') ? hash['PINAdviceTypeID'] : SKIP
|
69
|
+
is_card_order_option =
|
70
|
+
hash.key?('IsCardOrderOption') ? hash['IsCardOrderOption'] : SKIP
|
71
|
+
is_pin_reminder_option =
|
72
|
+
hash.key?('IsPINReminderOption') ? hash['IsPINReminderOption'] : SKIP
|
73
|
+
|
74
|
+
# Create object from extracted values.
|
75
|
+
PINAdviceTypes.new(pin_advice_type_id,
|
76
|
+
is_card_order_option,
|
77
|
+
is_pin_reminder_option)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,485 @@
|
|
1
|
+
# shell_data_reporting_ap_is
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellDataReportingApIs
|
7
|
+
# PriceList Model.
|
8
|
+
class PriceList < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# Date on which the price is applicable.
|
13
|
+
# Format: yyyyMMdd
|
14
|
+
# E.g.: 20180131
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :date
|
17
|
+
|
18
|
+
# Day on which the price is applicable.
|
19
|
+
# E.g.: Sunday, Monday etc.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :day
|
22
|
+
|
23
|
+
# Price list type.
|
24
|
+
# E.g., List, Shell Standard International List
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :type
|
27
|
+
|
28
|
+
# Price list ID
|
29
|
+
# @return [Integer]
|
30
|
+
attr_accessor :price_list_id
|
31
|
+
|
32
|
+
# Price list description
|
33
|
+
# E.g., UK Fuels CRT Reseller List Price
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :price_list_description
|
36
|
+
|
37
|
+
# Price Rule Id
|
38
|
+
# @return [Integer]
|
39
|
+
attr_accessor :price_rule_id
|
40
|
+
|
41
|
+
# Price Rule Name
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :price_rule_name
|
44
|
+
|
45
|
+
# DelCo Id
|
46
|
+
# @return [Integer]
|
47
|
+
attr_accessor :del_co_id
|
48
|
+
|
49
|
+
# Country ISO Code
|
50
|
+
# E.g., UK, NL, etc.,
|
51
|
+
# @return [String]
|
52
|
+
attr_accessor :country_code
|
53
|
+
|
54
|
+
# Country
|
55
|
+
# E.g., United Kingdom, Netherlands etc
|
56
|
+
# @return [String]
|
57
|
+
attr_accessor :country
|
58
|
+
|
59
|
+
# Product Group Id
|
60
|
+
# @return [Integer]
|
61
|
+
attr_accessor :product_group_id
|
62
|
+
|
63
|
+
# Product Group name
|
64
|
+
# @return [String]
|
65
|
+
attr_accessor :product_group_name
|
66
|
+
|
67
|
+
# Client Product Code
|
68
|
+
# @return [String]
|
69
|
+
attr_accessor :product_code
|
70
|
+
|
71
|
+
# Product Id
|
72
|
+
# @return [Integer]
|
73
|
+
attr_accessor :product_id
|
74
|
+
|
75
|
+
# Product name in English
|
76
|
+
# @return [String]
|
77
|
+
attr_accessor :product_name
|
78
|
+
|
79
|
+
# Price per unit
|
80
|
+
# @return [Float]
|
81
|
+
attr_accessor :price_per_unit
|
82
|
+
|
83
|
+
# Currency Code.
|
84
|
+
# Format : 3 digit ISO code
|
85
|
+
# @return [String]
|
86
|
+
attr_accessor :currency_code
|
87
|
+
|
88
|
+
# Currency Symbol
|
89
|
+
# Example: £
|
90
|
+
# @return [String]
|
91
|
+
attr_accessor :currency_symbol
|
92
|
+
|
93
|
+
# Price Type
|
94
|
+
# Possible Values are:
|
95
|
+
# • Country– Price rule defined at country whereas Price Rule DelcoId same
|
96
|
+
# as ColcoId.
|
97
|
+
# • TPNDelcoPrice – Price rule defined in the TPN whereas Price Rule DelcoId
|
98
|
+
# is different from ColcoId.
|
99
|
+
# • NetworkPrice – Price rule defined at Fuel Network level.
|
100
|
+
# • Other – Price rule defined at either Site or SiteGroup level.
|
101
|
+
# @return [String]
|
102
|
+
attr_accessor :price_type
|
103
|
+
|
104
|
+
# Site-Group ID
|
105
|
+
# E.g.: 100007
|
106
|
+
# @return [Integer]
|
107
|
+
attr_accessor :site_group_id
|
108
|
+
|
109
|
+
# Site-Group name
|
110
|
+
# @return [String]
|
111
|
+
attr_accessor :site_group_name
|
112
|
+
|
113
|
+
# Site Code
|
114
|
+
# @return [Integer]
|
115
|
+
attr_accessor :site_code
|
116
|
+
|
117
|
+
# Site ID
|
118
|
+
# @return [Integer]
|
119
|
+
attr_accessor :site_id
|
120
|
+
|
121
|
+
# Site Name
|
122
|
+
# @return [String]
|
123
|
+
attr_accessor :site_name
|
124
|
+
|
125
|
+
# Fuel Network ID
|
126
|
+
# @return [Integer]
|
127
|
+
attr_accessor :fuel_network_id
|
128
|
+
|
129
|
+
# Network Name
|
130
|
+
# @return [String]
|
131
|
+
attr_accessor :network_name
|
132
|
+
|
133
|
+
# PriceRuleDelcoId
|
134
|
+
# @return [Integer]
|
135
|
+
attr_accessor :price_rule_delco_id
|
136
|
+
|
137
|
+
# Company Name of the price rule DelCo.
|
138
|
+
# E.g.:
|
139
|
+
# • Pilipinas Shell Petroleum Corp
|
140
|
+
# • Shell U.K. Oil Products Limited
|
141
|
+
# • G & V SERVICE STATIONS NV
|
142
|
+
# @return [String]
|
143
|
+
attr_accessor :price_rule_delco_name
|
144
|
+
|
145
|
+
# PriceRuleCountry
|
146
|
+
# E.g.: United Kingdom
|
147
|
+
# @return [String]
|
148
|
+
attr_accessor :price_rule_country
|
149
|
+
|
150
|
+
# ISO Code of PriceRuleCountry
|
151
|
+
# E.g.: UK, NL, etc.,
|
152
|
+
# @return [String]
|
153
|
+
attr_accessor :price_rule_country_code
|
154
|
+
|
155
|
+
# PriceRuleBasisId
|
156
|
+
# @return [Integer]
|
157
|
+
attr_accessor :price_rule_basis_id
|
158
|
+
|
159
|
+
# Discount value
|
160
|
+
# @return [Float]
|
161
|
+
attr_accessor :discount_value
|
162
|
+
|
163
|
+
# Price per unit after discount
|
164
|
+
# @return [Float]
|
165
|
+
attr_accessor :price_per_unit_after_discount
|
166
|
+
|
167
|
+
# VAT Percentage
|
168
|
+
# @return [Float]
|
169
|
+
attr_accessor :vat_percentage
|
170
|
+
|
171
|
+
# PriceRuleCategoryId
|
172
|
+
# @return [Integer]
|
173
|
+
attr_accessor :price_rule_category_id
|
174
|
+
|
175
|
+
# PriceRuleCategoryId
|
176
|
+
# @return [Array[Tier]]
|
177
|
+
attr_accessor :tiers
|
178
|
+
|
179
|
+
# A mapping from model property names to API property names.
|
180
|
+
def self.names
|
181
|
+
@_hash = {} if @_hash.nil?
|
182
|
+
@_hash['date'] = 'Date'
|
183
|
+
@_hash['day'] = 'Day'
|
184
|
+
@_hash['type'] = 'Type'
|
185
|
+
@_hash['price_list_id'] = 'PriceListId'
|
186
|
+
@_hash['price_list_description'] = 'PriceListDescription'
|
187
|
+
@_hash['price_rule_id'] = 'PriceRuleId'
|
188
|
+
@_hash['price_rule_name'] = 'PriceRuleName'
|
189
|
+
@_hash['del_co_id'] = 'DelCoId'
|
190
|
+
@_hash['country_code'] = 'CountryCode'
|
191
|
+
@_hash['country'] = 'Country'
|
192
|
+
@_hash['product_group_id'] = 'ProductGroupId'
|
193
|
+
@_hash['product_group_name'] = 'ProductGroupName'
|
194
|
+
@_hash['product_code'] = 'ProductCode'
|
195
|
+
@_hash['product_id'] = 'ProductId'
|
196
|
+
@_hash['product_name'] = 'ProductName'
|
197
|
+
@_hash['price_per_unit'] = 'PricePerUnit'
|
198
|
+
@_hash['currency_code'] = 'CurrencyCode'
|
199
|
+
@_hash['currency_symbol'] = 'CurrencySymbol'
|
200
|
+
@_hash['price_type'] = 'PriceType'
|
201
|
+
@_hash['site_group_id'] = 'SiteGroupId'
|
202
|
+
@_hash['site_group_name'] = 'SiteGroupName'
|
203
|
+
@_hash['site_code'] = 'SiteCode'
|
204
|
+
@_hash['site_id'] = 'SiteId'
|
205
|
+
@_hash['site_name'] = 'SiteName'
|
206
|
+
@_hash['fuel_network_id'] = 'FuelNetworkId'
|
207
|
+
@_hash['network_name'] = 'NetworkName'
|
208
|
+
@_hash['price_rule_delco_id'] = 'PriceRuleDelcoId'
|
209
|
+
@_hash['price_rule_delco_name'] = 'PriceRuleDelcoName'
|
210
|
+
@_hash['price_rule_country'] = 'PriceRuleCountry'
|
211
|
+
@_hash['price_rule_country_code'] = 'PriceRuleCountryCode'
|
212
|
+
@_hash['price_rule_basis_id'] = 'PriceRuleBasisId'
|
213
|
+
@_hash['discount_value'] = 'DiscountValue'
|
214
|
+
@_hash['price_per_unit_after_discount'] = 'PricePerUnitAfterDiscount'
|
215
|
+
@_hash['vat_percentage'] = 'VATPercentage'
|
216
|
+
@_hash['price_rule_category_id'] = 'PriceRuleCategoryId'
|
217
|
+
@_hash['tiers'] = 'Tiers'
|
218
|
+
@_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# An array for optional fields
|
222
|
+
def self.optionals
|
223
|
+
%w[
|
224
|
+
date
|
225
|
+
day
|
226
|
+
type
|
227
|
+
price_list_id
|
228
|
+
price_list_description
|
229
|
+
price_rule_id
|
230
|
+
price_rule_name
|
231
|
+
del_co_id
|
232
|
+
country_code
|
233
|
+
country
|
234
|
+
product_group_id
|
235
|
+
product_group_name
|
236
|
+
product_code
|
237
|
+
product_id
|
238
|
+
product_name
|
239
|
+
price_per_unit
|
240
|
+
currency_code
|
241
|
+
currency_symbol
|
242
|
+
price_type
|
243
|
+
site_group_id
|
244
|
+
site_group_name
|
245
|
+
site_code
|
246
|
+
site_id
|
247
|
+
site_name
|
248
|
+
fuel_network_id
|
249
|
+
network_name
|
250
|
+
price_rule_delco_id
|
251
|
+
price_rule_delco_name
|
252
|
+
price_rule_country
|
253
|
+
price_rule_country_code
|
254
|
+
price_rule_basis_id
|
255
|
+
discount_value
|
256
|
+
price_per_unit_after_discount
|
257
|
+
vat_percentage
|
258
|
+
price_rule_category_id
|
259
|
+
tiers
|
260
|
+
]
|
261
|
+
end
|
262
|
+
|
263
|
+
# An array for nullable fields
|
264
|
+
def self.nullables
|
265
|
+
%w[
|
266
|
+
date
|
267
|
+
day
|
268
|
+
type
|
269
|
+
price_list_id
|
270
|
+
price_list_description
|
271
|
+
price_rule_id
|
272
|
+
price_rule_name
|
273
|
+
del_co_id
|
274
|
+
country_code
|
275
|
+
country
|
276
|
+
product_group_id
|
277
|
+
product_group_name
|
278
|
+
product_code
|
279
|
+
product_id
|
280
|
+
product_name
|
281
|
+
price_per_unit
|
282
|
+
currency_code
|
283
|
+
currency_symbol
|
284
|
+
price_type
|
285
|
+
site_group_id
|
286
|
+
site_group_name
|
287
|
+
site_code
|
288
|
+
site_id
|
289
|
+
site_name
|
290
|
+
fuel_network_id
|
291
|
+
network_name
|
292
|
+
price_rule_delco_id
|
293
|
+
price_rule_delco_name
|
294
|
+
price_rule_country
|
295
|
+
price_rule_country_code
|
296
|
+
price_rule_basis_id
|
297
|
+
discount_value
|
298
|
+
price_per_unit_after_discount
|
299
|
+
vat_percentage
|
300
|
+
price_rule_category_id
|
301
|
+
]
|
302
|
+
end
|
303
|
+
|
304
|
+
def initialize(date = SKIP,
|
305
|
+
day = SKIP,
|
306
|
+
type = SKIP,
|
307
|
+
price_list_id = SKIP,
|
308
|
+
price_list_description = SKIP,
|
309
|
+
price_rule_id = SKIP,
|
310
|
+
price_rule_name = SKIP,
|
311
|
+
del_co_id = SKIP,
|
312
|
+
country_code = SKIP,
|
313
|
+
country = SKIP,
|
314
|
+
product_group_id = SKIP,
|
315
|
+
product_group_name = SKIP,
|
316
|
+
product_code = SKIP,
|
317
|
+
product_id = SKIP,
|
318
|
+
product_name = SKIP,
|
319
|
+
price_per_unit = SKIP,
|
320
|
+
currency_code = SKIP,
|
321
|
+
currency_symbol = SKIP,
|
322
|
+
price_type = SKIP,
|
323
|
+
site_group_id = SKIP,
|
324
|
+
site_group_name = SKIP,
|
325
|
+
site_code = SKIP,
|
326
|
+
site_id = SKIP,
|
327
|
+
site_name = SKIP,
|
328
|
+
fuel_network_id = SKIP,
|
329
|
+
network_name = SKIP,
|
330
|
+
price_rule_delco_id = SKIP,
|
331
|
+
price_rule_delco_name = SKIP,
|
332
|
+
price_rule_country = SKIP,
|
333
|
+
price_rule_country_code = SKIP,
|
334
|
+
price_rule_basis_id = SKIP,
|
335
|
+
discount_value = SKIP,
|
336
|
+
price_per_unit_after_discount = SKIP,
|
337
|
+
vat_percentage = SKIP,
|
338
|
+
price_rule_category_id = SKIP,
|
339
|
+
tiers = SKIP)
|
340
|
+
@date = date unless date == SKIP
|
341
|
+
@day = day unless day == SKIP
|
342
|
+
@type = type unless type == SKIP
|
343
|
+
@price_list_id = price_list_id unless price_list_id == SKIP
|
344
|
+
@price_list_description = price_list_description unless price_list_description == SKIP
|
345
|
+
@price_rule_id = price_rule_id unless price_rule_id == SKIP
|
346
|
+
@price_rule_name = price_rule_name unless price_rule_name == SKIP
|
347
|
+
@del_co_id = del_co_id unless del_co_id == SKIP
|
348
|
+
@country_code = country_code unless country_code == SKIP
|
349
|
+
@country = country unless country == SKIP
|
350
|
+
@product_group_id = product_group_id unless product_group_id == SKIP
|
351
|
+
@product_group_name = product_group_name unless product_group_name == SKIP
|
352
|
+
@product_code = product_code unless product_code == SKIP
|
353
|
+
@product_id = product_id unless product_id == SKIP
|
354
|
+
@product_name = product_name unless product_name == SKIP
|
355
|
+
@price_per_unit = price_per_unit unless price_per_unit == SKIP
|
356
|
+
@currency_code = currency_code unless currency_code == SKIP
|
357
|
+
@currency_symbol = currency_symbol unless currency_symbol == SKIP
|
358
|
+
@price_type = price_type unless price_type == SKIP
|
359
|
+
@site_group_id = site_group_id unless site_group_id == SKIP
|
360
|
+
@site_group_name = site_group_name unless site_group_name == SKIP
|
361
|
+
@site_code = site_code unless site_code == SKIP
|
362
|
+
@site_id = site_id unless site_id == SKIP
|
363
|
+
@site_name = site_name unless site_name == SKIP
|
364
|
+
@fuel_network_id = fuel_network_id unless fuel_network_id == SKIP
|
365
|
+
@network_name = network_name unless network_name == SKIP
|
366
|
+
@price_rule_delco_id = price_rule_delco_id unless price_rule_delco_id == SKIP
|
367
|
+
@price_rule_delco_name = price_rule_delco_name unless price_rule_delco_name == SKIP
|
368
|
+
@price_rule_country = price_rule_country unless price_rule_country == SKIP
|
369
|
+
@price_rule_country_code = price_rule_country_code unless price_rule_country_code == SKIP
|
370
|
+
@price_rule_basis_id = price_rule_basis_id unless price_rule_basis_id == SKIP
|
371
|
+
@discount_value = discount_value unless discount_value == SKIP
|
372
|
+
unless price_per_unit_after_discount == SKIP
|
373
|
+
@price_per_unit_after_discount =
|
374
|
+
price_per_unit_after_discount
|
375
|
+
end
|
376
|
+
@vat_percentage = vat_percentage unless vat_percentage == SKIP
|
377
|
+
@price_rule_category_id = price_rule_category_id unless price_rule_category_id == SKIP
|
378
|
+
@tiers = tiers unless tiers == SKIP
|
379
|
+
end
|
380
|
+
|
381
|
+
# Creates an instance of the object from a hash.
|
382
|
+
def self.from_hash(hash)
|
383
|
+
return nil unless hash
|
384
|
+
|
385
|
+
# Extract variables from the hash.
|
386
|
+
date = hash.key?('Date') ? hash['Date'] : SKIP
|
387
|
+
day = hash.key?('Day') ? hash['Day'] : SKIP
|
388
|
+
type = hash.key?('Type') ? hash['Type'] : SKIP
|
389
|
+
price_list_id = hash.key?('PriceListId') ? hash['PriceListId'] : SKIP
|
390
|
+
price_list_description =
|
391
|
+
hash.key?('PriceListDescription') ? hash['PriceListDescription'] : SKIP
|
392
|
+
price_rule_id = hash.key?('PriceRuleId') ? hash['PriceRuleId'] : SKIP
|
393
|
+
price_rule_name =
|
394
|
+
hash.key?('PriceRuleName') ? hash['PriceRuleName'] : SKIP
|
395
|
+
del_co_id = hash.key?('DelCoId') ? hash['DelCoId'] : SKIP
|
396
|
+
country_code = hash.key?('CountryCode') ? hash['CountryCode'] : SKIP
|
397
|
+
country = hash.key?('Country') ? hash['Country'] : SKIP
|
398
|
+
product_group_id =
|
399
|
+
hash.key?('ProductGroupId') ? hash['ProductGroupId'] : SKIP
|
400
|
+
product_group_name =
|
401
|
+
hash.key?('ProductGroupName') ? hash['ProductGroupName'] : SKIP
|
402
|
+
product_code = hash.key?('ProductCode') ? hash['ProductCode'] : SKIP
|
403
|
+
product_id = hash.key?('ProductId') ? hash['ProductId'] : SKIP
|
404
|
+
product_name = hash.key?('ProductName') ? hash['ProductName'] : SKIP
|
405
|
+
price_per_unit = hash.key?('PricePerUnit') ? hash['PricePerUnit'] : SKIP
|
406
|
+
currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
|
407
|
+
currency_symbol =
|
408
|
+
hash.key?('CurrencySymbol') ? hash['CurrencySymbol'] : SKIP
|
409
|
+
price_type = hash.key?('PriceType') ? hash['PriceType'] : SKIP
|
410
|
+
site_group_id = hash.key?('SiteGroupId') ? hash['SiteGroupId'] : SKIP
|
411
|
+
site_group_name =
|
412
|
+
hash.key?('SiteGroupName') ? hash['SiteGroupName'] : SKIP
|
413
|
+
site_code = hash.key?('SiteCode') ? hash['SiteCode'] : SKIP
|
414
|
+
site_id = hash.key?('SiteId') ? hash['SiteId'] : SKIP
|
415
|
+
site_name = hash.key?('SiteName') ? hash['SiteName'] : SKIP
|
416
|
+
fuel_network_id =
|
417
|
+
hash.key?('FuelNetworkId') ? hash['FuelNetworkId'] : SKIP
|
418
|
+
network_name = hash.key?('NetworkName') ? hash['NetworkName'] : SKIP
|
419
|
+
price_rule_delco_id =
|
420
|
+
hash.key?('PriceRuleDelcoId') ? hash['PriceRuleDelcoId'] : SKIP
|
421
|
+
price_rule_delco_name =
|
422
|
+
hash.key?('PriceRuleDelcoName') ? hash['PriceRuleDelcoName'] : SKIP
|
423
|
+
price_rule_country =
|
424
|
+
hash.key?('PriceRuleCountry') ? hash['PriceRuleCountry'] : SKIP
|
425
|
+
price_rule_country_code =
|
426
|
+
hash.key?('PriceRuleCountryCode') ? hash['PriceRuleCountryCode'] : SKIP
|
427
|
+
price_rule_basis_id =
|
428
|
+
hash.key?('PriceRuleBasisId') ? hash['PriceRuleBasisId'] : SKIP
|
429
|
+
discount_value = hash.key?('DiscountValue') ? hash['DiscountValue'] : SKIP
|
430
|
+
price_per_unit_after_discount =
|
431
|
+
hash.key?('PricePerUnitAfterDiscount') ? hash['PricePerUnitAfterDiscount'] : SKIP
|
432
|
+
vat_percentage = hash.key?('VATPercentage') ? hash['VATPercentage'] : SKIP
|
433
|
+
price_rule_category_id =
|
434
|
+
hash.key?('PriceRuleCategoryId') ? hash['PriceRuleCategoryId'] : SKIP
|
435
|
+
# Parameter is an array, so we need to iterate through it
|
436
|
+
tiers = nil
|
437
|
+
unless hash['Tiers'].nil?
|
438
|
+
tiers = []
|
439
|
+
hash['Tiers'].each do |structure|
|
440
|
+
tiers << (Tier.from_hash(structure) if structure)
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
tiers = SKIP unless hash.key?('Tiers')
|
445
|
+
|
446
|
+
# Create object from extracted values.
|
447
|
+
PriceList.new(date,
|
448
|
+
day,
|
449
|
+
type,
|
450
|
+
price_list_id,
|
451
|
+
price_list_description,
|
452
|
+
price_rule_id,
|
453
|
+
price_rule_name,
|
454
|
+
del_co_id,
|
455
|
+
country_code,
|
456
|
+
country,
|
457
|
+
product_group_id,
|
458
|
+
product_group_name,
|
459
|
+
product_code,
|
460
|
+
product_id,
|
461
|
+
product_name,
|
462
|
+
price_per_unit,
|
463
|
+
currency_code,
|
464
|
+
currency_symbol,
|
465
|
+
price_type,
|
466
|
+
site_group_id,
|
467
|
+
site_group_name,
|
468
|
+
site_code,
|
469
|
+
site_id,
|
470
|
+
site_name,
|
471
|
+
fuel_network_id,
|
472
|
+
network_name,
|
473
|
+
price_rule_delco_id,
|
474
|
+
price_rule_delco_name,
|
475
|
+
price_rule_country,
|
476
|
+
price_rule_country_code,
|
477
|
+
price_rule_basis_id,
|
478
|
+
discount_value,
|
479
|
+
price_per_unit_after_discount,
|
480
|
+
vat_percentage,
|
481
|
+
price_rule_category_id,
|
482
|
+
tiers)
|
483
|
+
end
|
484
|
+
end
|
485
|
+
end
|