Class: ShellDataReportingApIs::CustomerPriceListRequest

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

Overview

CustomerPriceListRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(from_date = nil, to_date = nil, col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP, account_id = SKIP, account_number = SKIP, customer_specific_list = SKIP, price_list_type = SKIP, del_co_id = SKIP, include_pump_price_discounts = SKIP) ⇒ CustomerPriceListRequest

Returns a new instance of CustomerPriceListRequest.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 135

def initialize(from_date = nil, to_date = nil, col_co_id = SKIP,
               col_co_code = SKIP, payer_id = SKIP, payer_number = SKIP,
                = SKIP,  = SKIP,
               customer_specific_list = SKIP, price_list_type = SKIP,
               del_co_id = SKIP, include_pump_price_discounts = SKIP)
  @col_co_id = col_co_id unless col_co_id == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @payer_id = payer_id unless payer_id == SKIP
  @payer_number = payer_number unless payer_number == SKIP
  @account_id =  unless  == SKIP
  @account_number =  unless  == SKIP
  @customer_specific_list = customer_specific_list unless customer_specific_list == SKIP
  @price_list_type = price_list_type unless price_list_type == SKIP
  @del_co_id = del_co_id unless del_co_id == SKIP
  @from_date = from_date
  @to_date = to_date
  unless include_pump_price_discounts == SKIP
    @include_pump_price_discounts =
      include_pump_price_discounts
  end
end

Instance Attribute Details

#account_idInteger

Account Id of the customer. Optional

Returns:

  • (Integer)


33
34
35
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 33

def 
  @account_id
end

#account_numberString

Account Number of the customer. Optional

Returns:

  • (String)


38
39
40
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 38

def 
  @account_number
end

#col_co_codeInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 18

def col_co_code
  @col_co_code
end

#col_co_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def col_co_id
  @col_co_id
end

#customer_specific_listInteger

Whether customer specific price lists and customer specific discount values set on pump prices are to be returned or not.

Returns:

  • (Integer)


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

def customer_specific_list
  @customer_specific_list
end

#del_co_idInteger

Delivering Company ID Optional.

Returns:

  • (Integer)


57
58
59
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 57

def del_co_id
  @del_co_id
end

#from_dateString

Start date to fetch the price lists, discount values on pump prices and VAT rates. Mandatory Format: yyyyMMdd

Returns:

  • (String)


64
65
66
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 64

def from_date
  @from_date
end

#include_pump_price_discountsTrueClass | FalseClass

True / False. A flag to request the discount information set on pump prices for the customer to be included in the response. Optional Default value: False

Returns:

  • (TrueClass | FalseClass)


81
82
83
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 81

def include_pump_price_discounts
  @include_pump_price_discounts
end

#payer_idInteger

Payer Id of the selected payer. Optional if PayerNumber is passed else Mandatory

Returns:

  • (Integer)


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

def payer_id
  @payer_id
end

#payer_numberString

Payer Number of the selected payer. Optional if PayerId is passed else Mandatory

Returns:

  • (String)


28
29
30
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 28

def payer_number
  @payer_number
end

#price_list_typeInteger

Specifies the type of price lists to be included in the response. Optional – default value is zero. Allowed values: 0 – All 1 – National Only 2 – International Only

Returns:

  • (Integer)


52
53
54
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 52

def price_list_type
  @price_list_type
end

#to_dateString

End date to fetch the price lists, discount values on pump prices and VAT rates. Mandatory and greater than or equal to FromDate. Maximum of 30 (configurable) day’s duration is allowed between ‘From’ and ‘To’ dates. Format: yyyyMMdd

Returns:

  • (String)


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

def to_date
  @to_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



158
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
188
189
190
191
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 158

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  from_date = hash.key?('FromDate') ? hash['FromDate'] : nil
  to_date = hash.key?('ToDate') ? hash['ToDate'] : nil
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  payer_id = hash.key?('PayerId') ? hash['PayerId'] : SKIP
  payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP
  customer_specific_list =
    hash.key?('CustomerSpecificList') ? hash['CustomerSpecificList'] : SKIP
  price_list_type =
    hash.key?('PriceListType') ? hash['PriceListType'] : SKIP
  del_co_id = hash.key?('DelCoId') ? hash['DelCoId'] : SKIP
  include_pump_price_discounts =
    hash.key?('IncludePumpPriceDiscounts') ? hash['IncludePumpPriceDiscounts'] : SKIP

  # Create object from extracted values.
  CustomerPriceListRequest.new(from_date,
                               to_date,
                               col_co_id,
                               col_co_code,
                               payer_id,
                               payer_number,
                               ,
                               ,
                               customer_specific_list,
                               price_list_type,
                               del_co_id,
                               include_pump_price_discounts)
end

.namesObject

A mapping from model property names to API property names.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 84

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['payer_id'] = 'PayerId'
  @_hash['payer_number'] = 'PayerNumber'
  @_hash['account_id'] = 'AccountId'
  @_hash['account_number'] = 'AccountNumber'
  @_hash['customer_specific_list'] = 'CustomerSpecificList'
  @_hash['price_list_type'] = 'PriceListType'
  @_hash['del_co_id'] = 'DelCoId'
  @_hash['from_date'] = 'FromDate'
  @_hash['to_date'] = 'ToDate'
  @_hash['include_pump_price_discounts'] = 'IncludePumpPriceDiscounts'
  @_hash
end

.nullablesObject

An array for nullable fields



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 118

def self.nullables
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    account_id
    account_number
    customer_specific_list
    price_list_type
    del_co_id
    from_date
    to_date
    include_pump_price_discounts
  ]
end

.optionalsObject

An array for optional fields



102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/shell_data_reporting_ap_is/models/customer_price_list_request.rb', line 102

def self.optionals
  %w[
    col_co_id
    col_co_code
    payer_id
    payer_number
    account_id
    account_number
    customer_specific_list
    price_list_type
    del_co_id
    include_pump_price_discounts
  ]
end