Class: ShellDataReportingApIs::UpdateOdometerRequest

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

Overview

UpdateOdometerRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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,
                = SKIP,  = 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 =  unless  == SKIP
  @account_number =  unless  == 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_idInteger

Account Id (i.e. Customer Id of the Sub Account in GFN) of the selected account. Optional if AccountNumber is passed else Mandatory

Returns:

  • (Integer)


36
37
38
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 36

def 
  @account_id
end

#account_numberString

Account Number (ex: GB000000123) of the selected account. Optional if AccountId is passed else Mandatory

Returns:

  • (String)


41
42
43
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 41

def 
  @account_number
end

#callerString

The caller to be notified with the status of the update odometer. Mandatory, if NotifyCaller is true.

Returns:

  • (String)


59
60
61
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 59

def caller
  @caller
end

#col_co_codeInteger

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.

Returns:

  • (Integer)


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_idInteger

Collecting Company Id of the selected payer. Optional if ColCoCode is passed else Mandatory. Example: 1 for Philippines 5 for UK

Returns:

  • (Integer)


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_callerTrueClass | 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.

Returns:

  • (TrueClass | FalseClass)


54
55
56
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 54

def notify_caller
  @notify_caller
end

#payer_idInteger

Payer Id (i.e. Customer Id of the Payment Customer in Cards Platform) of the selected payer. Optional if PayerNumber is passed else Mandatory

Returns:

  • (Integer)


30
31
32
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_request.rb', line 30

def payer_id
  @payer_id
end

#update_odometersArray[UpdateOdometer]

Account Number (ex: GB000000123) of the selected account. Optional if AccountId is passed else Mandatory

Returns:



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
   = hash.key?('AccountId') ? hash['AccountId'] : SKIP
   = 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,
                            ,
                            ,
                            update_odometers,
                            notify_caller,
                            caller)
end

.namesObject

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

.nullablesObject

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

.optionalsObject

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