Class: ShellEv::EvseVO
- Defined in:
- lib/shell_ev/models/evse_vo.rb
Overview
Each Location will contain one or more EVSEs (Electric Vehicle Supply Equipment). Each EVSE is capable of charging one car at a time.
Instance Attribute Summary collapse
-
#authorization_methods ⇒ EvseVOAuthorizationMethodsEnum
Methods that can be used to Authorize sessions on this EVSE.
-
#connectors ⇒ Array[ConnectorVO]
List of all connectors available on this EVSE unit.
-
#deleted ⇒ String
optional ISO8601-compliant UTC deletion timestamp of the Evse.
-
#evse_id ⇒ String
Standard EVSEId identifier (ISO-IEC-15118).
-
#external_id ⇒ String
Identifier of the Evse as given by the Operator, unique for that Operator.
-
#physical_reference ⇒ String
An optional number/string printed on the outside of the EVSE for visual identification.
-
#status ⇒ EvseVOStatusEnum
The current status of the EVSE units availability.
-
#uid ⇒ Integer
Internal identifier used to refer to single individual EVSE unit.
-
#updated ⇒ String
ISO8601-compliant UTC datetime of the last update of the EVSE.
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(uid = SKIP, external_id = SKIP, evse_id = SKIP, status = SKIP, connectors = SKIP, authorization_methods = SKIP, updated = SKIP, deleted = SKIP, physical_reference = SKIP) ⇒ EvseVO
constructor
A new instance of EvseVO.
Methods inherited from BaseModel
Constructor Details
#initialize(uid = SKIP, external_id = SKIP, evse_id = SKIP, status = SKIP, connectors = SKIP, authorization_methods = SKIP, updated = SKIP, deleted = SKIP, physical_reference = SKIP) ⇒ EvseVO
Returns a new instance of EvseVO.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/shell_ev/models/evse_vo.rb', line 85 def initialize(uid = SKIP, external_id = SKIP, evse_id = SKIP, status = SKIP, connectors = SKIP, = SKIP, updated = SKIP, deleted = SKIP, physical_reference = SKIP) @uid = uid unless uid == SKIP @external_id = external_id unless external_id == SKIP @evse_id = evse_id unless evse_id == SKIP @status = status unless status == SKIP @connectors = connectors unless connectors == SKIP @authorization_methods = unless == SKIP @updated = updated unless updated == SKIP @deleted = deleted unless deleted == SKIP @physical_reference = physical_reference unless physical_reference == SKIP end |
Instance Attribute Details
#authorization_methods ⇒ EvseVOAuthorizationMethodsEnum
Methods that can be used to Authorize sessions on this EVSE
35 36 37 |
# File 'lib/shell_ev/models/evse_vo.rb', line 35 def @authorization_methods end |
#connectors ⇒ Array[ConnectorVO]
List of all connectors available on this EVSE unit.
31 32 33 |
# File 'lib/shell_ev/models/evse_vo.rb', line 31 def connectors @connectors end |
#deleted ⇒ String
optional ISO8601-compliant UTC deletion timestamp of the Evse
43 44 45 |
# File 'lib/shell_ev/models/evse_vo.rb', line 43 def deleted @deleted end |
#evse_id ⇒ String
Standard EVSEId identifier (ISO-IEC-15118)
23 24 25 |
# File 'lib/shell_ev/models/evse_vo.rb', line 23 def evse_id @evse_id end |
#external_id ⇒ String
Identifier of the Evse as given by the Operator, unique for that Operator
19 20 21 |
# File 'lib/shell_ev/models/evse_vo.rb', line 19 def external_id @external_id end |
#physical_reference ⇒ String
An optional number/string printed on the outside of the EVSE for visual identification
48 49 50 |
# File 'lib/shell_ev/models/evse_vo.rb', line 48 def physical_reference @physical_reference end |
#status ⇒ EvseVOStatusEnum
The current status of the EVSE units availability
27 28 29 |
# File 'lib/shell_ev/models/evse_vo.rb', line 27 def status @status end |
#uid ⇒ Integer
Internal identifier used to refer to single individual EVSE unit.
15 16 17 |
# File 'lib/shell_ev/models/evse_vo.rb', line 15 def uid @uid end |
#updated ⇒ String
ISO8601-compliant UTC datetime of the last update of the EVSE
39 40 41 |
# File 'lib/shell_ev/models/evse_vo.rb', line 39 def updated @updated end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
101 102 103 104 105 106 107 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 |
# File 'lib/shell_ev/models/evse_vo.rb', line 101 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. uid = hash.key?('uid') ? hash['uid'] : SKIP external_id = hash.key?('externalId') ? hash['externalId'] : SKIP evse_id = hash.key?('evseId') ? hash['evseId'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP # Parameter is an array, so we need to iterate through it connectors = nil unless hash['connectors'].nil? connectors = [] hash['connectors'].each do |structure| connectors << (ConnectorVO.from_hash(structure) if structure) end end connectors = SKIP unless hash.key?('connectors') = hash.key?('authorizationMethods') ? hash['authorizationMethods'] : SKIP updated = hash.key?('updated') ? hash['updated'] : SKIP deleted = hash.key?('deleted') ? hash['deleted'] : SKIP physical_reference = hash.key?('physicalReference') ? hash['physicalReference'] : SKIP # Create object from extracted values. EvseVO.new(uid, external_id, evse_id, status, connectors, , updated, deleted, physical_reference) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/shell_ev/models/evse_vo.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['uid'] = 'uid' @_hash['external_id'] = 'externalId' @_hash['evse_id'] = 'evseId' @_hash['status'] = 'status' @_hash['connectors'] = 'connectors' @_hash['authorization_methods'] = 'authorizationMethods' @_hash['updated'] = 'updated' @_hash['deleted'] = 'deleted' @_hash['physical_reference'] = 'physicalReference' @_hash end |
.nullables ⇒ Object
An array for nullable fields
81 82 83 |
# File 'lib/shell_ev/models/evse_vo.rb', line 81 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/shell_ev/models/evse_vo.rb', line 66 def self.optionals %w[ uid external_id evse_id status connectors authorization_methods updated deleted physical_reference ] end |