Class: ShellDataReportingApIs::UpdateOdometerRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::UpdateOdometerRequest
- Defined in:
- lib/shell_data_reporting_ap_is/models/update_odometer_request.rb
Overview
UpdateOdometerRequest Model.
Instance Attribute Summary collapse
-
#account_id ⇒ Integer
Account Id (i.e. Customer Id of the Sub Account in GFN) of the selected account.
-
#account_number ⇒ String
Account Number (ex: GB000000123) of the selected account.
-
#caller ⇒ String
The caller to be notified with the status of the update odometer.
-
#col_co_code ⇒ Integer
Collecting Company Code (Shell Code) of the selected payer.
-
#col_co_id ⇒ Integer
Collecting Company Id of the selected payer.
-
#notify_caller ⇒ TrueClass | FalseClass
True/False.
-
#payer_id ⇒ Integer
Payer Id (i.e. Customer Id of the Payment Customer in Cards Platform) of the selected payer.
-
#update_odometers ⇒ Array[UpdateOdometer]
Account Number (ex: GB000000123) of the selected account.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, account_id = SKIP, account_number = SKIP, update_odometers = SKIP, notify_caller = SKIP, caller = SKIP) ⇒ UpdateOdometerRequest
constructor
A new instance of UpdateOdometerRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, account_id = SKIP, account_number = SKIP, update_odometers = SKIP, notify_caller = SKIP, caller = SKIP) ⇒ UpdateOdometerRequest
Returns a new instance of UpdateOdometerRequest.
94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 94 def initialize(col_co_id = SKIP, col_co_code = SKIP, payer_id = SKIP, account_id = SKIP, account_number = SKIP, update_odometers = SKIP, notify_caller = SKIP, caller = 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 @account_id = account_id unless account_id == SKIP @account_number = account_number unless account_number == SKIP @update_odometers = update_odometers unless update_odometers == SKIP @notify_caller = notify_caller unless notify_caller == SKIP @caller = caller unless caller == SKIP end |
Instance Attribute Details
#account_id ⇒ Integer
Account Id (i.e. Customer Id of the Sub Account in GFN) of the selected account. Optional if AccountNumber is passed else Mandatory
36 37 38 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 36 def account_id @account_id end |
#account_number ⇒ String
Account Number (ex: GB000000123) of the selected account. Optional if AccountId is passed else Mandatory
41 42 43 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 41 def account_number @account_number end |
#caller ⇒ String
The caller to be notified with the status of the update odometer. Mandatory, if NotifyCaller is true.
59 60 61 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 59 def caller @caller end |
#col_co_code ⇒ Integer
Collecting Company Code (Shell Code) of the selected payer. Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided.
24 25 26 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 24 def col_co_code @col_co_code end |
#col_co_id ⇒ Integer
Collecting Company Id of the selected payer. Optional if ColCoCode is passed else Mandatory. Example: 1 for Philippines 5 for UK
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 18 def col_co_id @col_co_id end |
#notify_caller ⇒ TrueClass | FalseClass
True/False. Optional. Default: False If true, the caller would be notified back with the status as success or failure after the update odometer is processed.
54 55 56 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 54 def notify_caller @notify_caller end |
#payer_id ⇒ Integer
Payer Id (i.e. Customer Id of the Payment Customer in Cards Platform) of the selected payer. Optional if PayerNumber is passed else Mandatory
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 30 def payer_id @payer_id end |
#update_odometers ⇒ Array[UpdateOdometer]
Account Number (ex: GB000000123) of the selected account. Optional if AccountId is passed else Mandatory
46 47 48 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 46 def update_odometers @update_odometers end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 108 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. 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 account_id = hash.key?('AccountId') ? hash['AccountId'] : SKIP account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP # Parameter is an array, so we need to iterate through it update_odometers = nil unless hash['UpdateOdometers'].nil? update_odometers = [] hash['UpdateOdometers'].each do |structure| update_odometers << (UpdateOdometer.from_hash(structure) if structure) end end update_odometers = SKIP unless hash.key?('UpdateOdometers') notify_caller = hash.key?('NotifyCaller') ? hash['NotifyCaller'] : SKIP caller = hash.key?('Caller') ? hash['Caller'] : SKIP # Create object from extracted values. UpdateOdometerRequest.new(col_co_id, col_co_code, payer_id, account_id, account_number, update_odometers, notify_caller, caller) end |
.names ⇒ Object
A mapping from model property names to API property names.
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 62 def self.names @_hash = {} if @_hash.nil? @_hash['col_co_id'] = 'ColCoId' @_hash['col_co_code'] = 'ColCoCode' @_hash['payer_id'] = 'PayerId' @_hash['account_id'] = 'AccountId' @_hash['account_number'] = 'AccountNumber' @_hash['update_odometers'] = 'UpdateOdometers' @_hash['notify_caller'] = 'NotifyCaller' @_hash['caller'] = 'Caller' @_hash end |
.nullables ⇒ Object
An array for nullable fields
90 91 92 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 90 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 76 def self.optionals %w[ col_co_id col_co_code payer_id account_id account_number update_odometers notify_caller caller ] end |