Class: ShellEv::ConnectorVO
- Defined in:
- lib/shell_ev/models/connector_vo.rb
Overview
An EVSE can have one or many Connectors. Each Connector will normally have a different socket / cable and only one can be used to charge at a time.
Instance Attribute Summary collapse
-
#connector_type ⇒ ConnectorVOConnectorTypeEnum
Identifier of the Evse as given by the Operator, unique for the containing EVSE’.
-
#deleted ⇒ String
optional ISO8601-compliant UTC deletion timestamp of the connector.
-
#electrical_properties ⇒ ElectricalProperties
Electrical Properties of the Connector.
-
#external_id ⇒ String
Identifier of the Evse as given by the Operator, unique for the containing EVSE’.
-
#fixed_cable ⇒ TrueClass | FalseClass
Indicates whether Connector has a fixed cable attached.
-
#tariff ⇒ Tariff
Indicates whether Connector has a fixed cable attached.
-
#uid ⇒ Integer
Internal identifier used to refer to this Connector.
-
#updated ⇒ String
ISO8601-compliant UTC datetime of the last update of the Connector’s data.
-
#updated_by ⇒ ConnectorVOUpdatedByEnum
ISO8601-compliant UTC datetime of the last update of the Connector’s data.
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, connector_type = SKIP, electrical_properties = SKIP, fixed_cable = SKIP, tariff = SKIP, updated = SKIP, updated_by = SKIP, deleted = SKIP) ⇒ ConnectorVO
constructor
A new instance of ConnectorVO.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(uid = SKIP, external_id = SKIP, connector_type = SKIP, electrical_properties = SKIP, fixed_cable = SKIP, tariff = SKIP, updated = SKIP, updated_by = SKIP, deleted = SKIP) ⇒ ConnectorVO
Returns a new instance of ConnectorVO.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/shell_ev/models/connector_vo.rb', line 88 def initialize(uid = SKIP, external_id = SKIP, connector_type = SKIP, electrical_properties = SKIP, fixed_cable = SKIP, tariff = SKIP, updated = SKIP, updated_by = SKIP, deleted = SKIP) @uid = uid unless uid == SKIP @external_id = external_id unless external_id == SKIP @connector_type = connector_type unless connector_type == SKIP @electrical_properties = electrical_properties unless electrical_properties == SKIP @fixed_cable = fixed_cable unless fixed_cable == SKIP @tariff = tariff unless tariff == SKIP @updated = updated unless updated == SKIP @updated_by = updated_by unless updated_by == SKIP @deleted = deleted unless deleted == SKIP end |
Instance Attribute Details
#connector_type ⇒ ConnectorVOConnectorTypeEnum
Identifier of the Evse as given by the Operator, unique for the containing EVSE’
25 26 27 |
# File 'lib/shell_ev/models/connector_vo.rb', line 25 def connector_type @connector_type end |
#deleted ⇒ String
optional ISO8601-compliant UTC deletion timestamp of the connector
51 52 53 |
# File 'lib/shell_ev/models/connector_vo.rb', line 51 def deleted @deleted end |
#electrical_properties ⇒ ElectricalProperties
Electrical Properties of the Connector
29 30 31 |
# File 'lib/shell_ev/models/connector_vo.rb', line 29 def electrical_properties @electrical_properties end |
#external_id ⇒ String
Identifier of the Evse as given by the Operator, unique for the containing EVSE’
20 21 22 |
# File 'lib/shell_ev/models/connector_vo.rb', line 20 def external_id @external_id end |
#fixed_cable ⇒ TrueClass | FalseClass
Indicates whether Connector has a fixed cable attached. False by default (not sent in this case)
34 35 36 |
# File 'lib/shell_ev/models/connector_vo.rb', line 34 def fixed_cable @fixed_cable end |
#tariff ⇒ Tariff
Indicates whether Connector has a fixed cable attached. False by default (not sent in this case)
39 40 41 |
# File 'lib/shell_ev/models/connector_vo.rb', line 39 def tariff @tariff end |
#uid ⇒ Integer
Internal identifier used to refer to this Connector
15 16 17 |
# File 'lib/shell_ev/models/connector_vo.rb', line 15 def uid @uid end |
#updated ⇒ String
ISO8601-compliant UTC datetime of the last update of the Connector’s data
43 44 45 |
# File 'lib/shell_ev/models/connector_vo.rb', line 43 def updated @updated end |
#updated_by ⇒ ConnectorVOUpdatedByEnum
ISO8601-compliant UTC datetime of the last update of the Connector’s data
47 48 49 |
# File 'lib/shell_ev/models/connector_vo.rb', line 47 def updated_by @updated_by end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/shell_ev/models/connector_vo.rb', line 104 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 connector_type = hash.key?('connectorType') ? hash['connectorType'] : SKIP electrical_properties = ElectricalProperties.from_hash(hash['electricalProperties']) if hash['electricalProperties'] fixed_cable = hash.key?('fixedCable') ? hash['fixedCable'] : SKIP tariff = Tariff.from_hash(hash['tariff']) if hash['tariff'] updated = hash.key?('updated') ? hash['updated'] : SKIP updated_by = hash.key?('updatedBy') ? hash['updatedBy'] : SKIP deleted = hash.key?('deleted') ? hash['deleted'] : SKIP # Create object from extracted values. ConnectorVO.new(uid, external_id, connector_type, electrical_properties, fixed_cable, tariff, updated, updated_by, deleted) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/shell_ev/models/connector_vo.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['uid'] = 'uid' @_hash['external_id'] = 'externalId' @_hash['connector_type'] = 'connectorType' @_hash['electrical_properties'] = 'electricalProperties' @_hash['fixed_cable'] = 'fixedCable' @_hash['tariff'] = 'tariff' @_hash['updated'] = 'updated' @_hash['updated_by'] = 'updatedBy' @_hash['deleted'] = 'deleted' @_hash end |
.nullables ⇒ Object
An array for nullable fields
84 85 86 |
# File 'lib/shell_ev/models/connector_vo.rb', line 84 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/shell_ev/models/connector_vo.rb', line 69 def self.optionals %w[ uid external_id connector_type electrical_properties fixed_cable tariff updated updated_by deleted ] end |