Class: ShellDataReportingApIs::UpdateOdometerReference

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

Overview

UpdateOdometerReference Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(sales_item_id = SKIP, update_odometer_reference_id = SKIP) ⇒ UpdateOdometerReference

Returns a new instance of UpdateOdometerReference.



44
45
46
47
48
49
50
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb', line 44

def initialize(sales_item_id = SKIP, update_odometer_reference_id = SKIP)
  @sales_item_id = sales_item_id unless sales_item_id == SKIP
  unless update_odometer_reference_id == SKIP
    @update_odometer_reference_id =
      update_odometer_reference_id
  end
end

Instance Attribute Details

#sales_item_idInteger

SalesItemId of input parameter

Returns:

  • (Integer)


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

def sales_item_id
  @sales_item_id
end

#update_odometer_reference_idInteger

Reference number for each individual update odometer reference.

Returns:

  • (Integer)


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

def update_odometer_reference_id
  @update_odometer_reference_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb', line 53

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  sales_item_id = hash.key?('SalesItemId') ? hash['SalesItemId'] : SKIP
  update_odometer_reference_id =
    hash.key?('UpdateOdometerReferenceId') ? hash['UpdateOdometerReferenceId'] : SKIP

  # Create object from extracted values.
  UpdateOdometerReference.new(sales_item_id,
                              update_odometer_reference_id)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['sales_item_id'] = 'SalesItemId'
  @_hash['update_odometer_reference_id'] = 'UpdateOdometerReferenceId'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
40
41
42
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb', line 37

def self.nullables
  %w[
    sales_item_id
    update_odometer_reference_id
  ]
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/shell_data_reporting_ap_is/models/update_odometer_reference.rb', line 29

def self.optionals
  %w[
    sales_item_id
    update_odometer_reference_id
  ]
end