Class: ShellEv::ChargesessionStartBody

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_ev/models/chargesession_start_body.rb

Overview

ChargesessionStartBody Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(ev_charge_number = nil, evse_id = nil) ⇒ ChargesessionStartBody

Returns a new instance of ChargesessionStartBody.



38
39
40
41
# File 'lib/shell_ev/models/chargesession_start_body.rb', line 38

def initialize(ev_charge_number = nil, evse_id = nil)
  @ev_charge_number = ev_charge_number
  @evse_id = evse_id
end

Instance Attribute Details

#ev_charge_numberString

Ev charge number

Returns:

  • (String)


14
15
16
# File 'lib/shell_ev/models/chargesession_start_body.rb', line 14

def ev_charge_number
  @ev_charge_number
end

#evse_idString

This is the Electric Vehicle EquipmentID

Returns:

  • (String)


18
19
20
# File 'lib/shell_ev/models/chargesession_start_body.rb', line 18

def evse_id
  @evse_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/shell_ev/models/chargesession_start_body.rb', line 44

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ev_charge_number =
    hash.key?('evChargeNumber') ? hash['evChargeNumber'] : nil
  evse_id = hash.key?('evseId') ? hash['evseId'] : nil

  # Create object from extracted values.
  ChargesessionStartBody.new(ev_charge_number,
                             evse_id)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ev_charge_number'] = 'evChargeNumber'
  @_hash['evse_id'] = 'evseId'
  @_hash
end

.nullablesObject

An array for nullable fields



34
35
36
# File 'lib/shell_ev/models/chargesession_start_body.rb', line 34

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
# File 'lib/shell_ev/models/chargesession_start_body.rb', line 29

def self.optionals
  []
end