Class: ShellDataReportingApIs::UpdateOdometer
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::UpdateOdometer
- Defined in:
- lib/shell_data_reporting_ap_is/models/update_odometer.rb
Overview
UpdateOdometer Model.
Instance Attribute Summary collapse
-
#new_odometer_value ⇒ Integer
NewOdometerValue that needs to be updated.
-
#sales_item_id ⇒ String
Unique SalesItemId (Either Billed on Unbilled) Mandatory.
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(sales_item_id = nil, new_odometer_value = nil) ⇒ UpdateOdometer
constructor
A new instance of UpdateOdometer.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(sales_item_id = nil, new_odometer_value = nil) ⇒ UpdateOdometer
Returns a new instance of UpdateOdometer.
42 43 44 45 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 42 def initialize(sales_item_id = nil, new_odometer_value = nil) @sales_item_id = sales_item_id @new_odometer_value = new_odometer_value end |
Instance Attribute Details
#new_odometer_value ⇒ Integer
NewOdometerValue that needs to be updated
19 20 21 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 19 def new_odometer_value @new_odometer_value end |
#sales_item_id ⇒ String
Unique SalesItemId (Either Billed on Unbilled) Mandatory
15 16 17 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 15 def sales_item_id @sales_item_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 48 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. sales_item_id = hash.key?('SalesItemId') ? hash['SalesItemId'] : nil new_odometer_value = hash.key?('NewOdometerValue') ? hash['NewOdometerValue'] : nil # Create object from extracted values. UpdateOdometer.new(sales_item_id, new_odometer_value) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['sales_item_id'] = 'SalesItemId' @_hash['new_odometer_value'] = 'NewOdometerValue' @_hash end |
.nullables ⇒ Object
An array for nullable fields
35 36 37 38 39 40 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 35 def self.nullables %w[ sales_item_id new_odometer_value ] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 30 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
69 70 71 72 73 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 69 def inspect class_name = self.class.name.split('::').last "<#{class_name} sales_item_id: #{@sales_item_id.inspect}, new_odometer_value:"\ " #{@new_odometer_value.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
62 63 64 65 66 |
# File 'lib/shell_data_reporting_ap_is/models/update_odometer.rb', line 62 def to_s class_name = self.class.name.split('::').last "<#{class_name} sales_item_id: #{@sales_item_id}, new_odometer_value:"\ " #{@new_odometer_value}>" end |