Class: ShellEv::SearchByIdLocationRespone
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellEv::SearchByIdLocationRespone
- Defined in:
- lib/shell_ev/models/search_by_id_location_respone.rb
Overview
SearchByIdLocationRespone Model.
Instance Attribute Summary collapse
-
#accessibility ⇒ AccessibilityV2
Accessibility of the Location.
-
#address ⇒ Address
Address of the Shell Recharge Location.
-
#coordinates ⇒ Coordinates
Coordinates of the Shell Recharge Site Location.
-
#evses ⇒ Array[SearchByIdEvse]
Accessibility of the Location.
-
#external_id ⇒ String
Identifier as given by the Shell Recharge Operator, unique for that Operator.
-
#location_type ⇒ String
the type of the location.
-
#open_twenty_four_seven ⇒ TrueClass | FalseClass
Whether the location is open 24/7.
-
#opening_hours ⇒ Array[OpeningHoursObject]
Optional Opening Hours of the Location.
-
#operator_id ⇒ String
Unique Id of the operator.
-
#operator_name ⇒ String
Operator of this Shell Recharge Location.
-
#uid ⇒ String
Unique Internal identifier used to refer to this Location by Shell Recharge.
-
#updated ⇒ String
ISO8601-compliant UTC datetime of the last update of the location.
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, coordinates = SKIP, operator_name = SKIP, address = SKIP, accessibility = SKIP, evses = SKIP, opening_hours = SKIP, updated = SKIP, location_type = SKIP, operator_id = SKIP, open_twenty_four_seven = SKIP) ⇒ SearchByIdLocationRespone
constructor
A new instance of SearchByIdLocationRespone.
-
#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(uid = SKIP, external_id = SKIP, coordinates = SKIP, operator_name = SKIP, address = SKIP, accessibility = SKIP, evses = SKIP, opening_hours = SKIP, updated = SKIP, location_type = SKIP, operator_id = SKIP, open_twenty_four_seven = SKIP) ⇒ SearchByIdLocationRespone
Returns a new instance of SearchByIdLocationRespone.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 104 def initialize(uid = SKIP, external_id = SKIP, coordinates = SKIP, operator_name = SKIP, address = SKIP, accessibility = SKIP, evses = SKIP, opening_hours = SKIP, updated = SKIP, location_type = SKIP, operator_id = SKIP, open_twenty_four_seven = SKIP) @uid = uid unless uid == SKIP @external_id = external_id unless external_id == SKIP @coordinates = coordinates unless coordinates == SKIP @operator_name = operator_name unless operator_name == SKIP @address = address unless address == SKIP @accessibility = accessibility unless accessibility == SKIP @evses = evses unless evses == SKIP @opening_hours = opening_hours unless opening_hours == SKIP @updated = updated unless updated == SKIP @location_type = location_type unless location_type == SKIP @operator_id = operator_id unless operator_id == SKIP @open_twenty_four_seven = open_twenty_four_seven unless open_twenty_four_seven == SKIP end |
Instance Attribute Details
#accessibility ⇒ AccessibilityV2
Accessibility of the Location
36 37 38 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 36 def accessibility @accessibility end |
#address ⇒ Address
Address of the Shell Recharge Location
32 33 34 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 32 def address @address end |
#coordinates ⇒ Coordinates
Coordinates of the Shell Recharge Site Location
24 25 26 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 24 def coordinates @coordinates end |
#evses ⇒ Array[SearchByIdEvse]
Accessibility of the Location
40 41 42 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 40 def evses @evses end |
#external_id ⇒ String
Identifier as given by the Shell Recharge Operator, unique for that Operator
20 21 22 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 20 def external_id @external_id end |
#location_type ⇒ String
the type of the location. Could be “UNKNOWN”.
53 54 55 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 53 def location_type @location_type end |
#open_twenty_four_seven ⇒ TrueClass | FalseClass
Whether the location is open 24/7
61 62 63 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 61 def open_twenty_four_seven @open_twenty_four_seven end |
#opening_hours ⇒ Array[OpeningHoursObject]
Optional Opening Hours of the Location. Please note that it is not available for all sites.
45 46 47 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 45 def opening_hours @opening_hours end |
#operator_id ⇒ String
Unique Id of the operator
57 58 59 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 57 def operator_id @operator_id end |
#operator_name ⇒ String
Operator of this Shell Recharge Location
28 29 30 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 28 def operator_name @operator_name end |
#uid ⇒ String
Unique Internal identifier used to refer to this Location by Shell Recharge
15 16 17 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 15 def uid @uid end |
#updated ⇒ String
ISO8601-compliant UTC datetime of the last update of the location
49 50 51 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 49 def updated @updated end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 124 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 coordinates = Coordinates.from_hash(hash['coordinates']) if hash['coordinates'] operator_name = hash.key?('operatorName') ? hash['operatorName'] : SKIP address = Address.from_hash(hash['address']) if hash['address'] accessibility = AccessibilityV2.from_hash(hash['accessibility']) if hash['accessibility'] # Parameter is an array, so we need to iterate through it evses = nil unless hash['evses'].nil? evses = [] hash['evses'].each do |structure| evses << (SearchByIdEvse.from_hash(structure) if structure) end end evses = SKIP unless hash.key?('evses') # Parameter is an array, so we need to iterate through it opening_hours = nil unless hash['openingHours'].nil? opening_hours = [] hash['openingHours'].each do |structure| opening_hours << (OpeningHoursObject.from_hash(structure) if structure) end end opening_hours = SKIP unless hash.key?('openingHours') updated = hash.key?('updated') ? hash['updated'] : SKIP location_type = hash.key?('locationType') ? hash['locationType'] : SKIP operator_id = hash.key?('operatorId') ? hash['operatorId'] : SKIP open_twenty_four_seven = hash.key?('openTwentyFourSeven') ? hash['openTwentyFourSeven'] : SKIP # Create object from extracted values. SearchByIdLocationRespone.new(uid, external_id, coordinates, operator_name, address, accessibility, evses, opening_hours, updated, location_type, operator_id, open_twenty_four_seven) end |
.names ⇒ Object
A mapping from model property names to API property names.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 64 def self.names @_hash = {} if @_hash.nil? @_hash['uid'] = 'uid' @_hash['external_id'] = 'externalId' @_hash['coordinates'] = 'coordinates' @_hash['operator_name'] = 'operatorName' @_hash['address'] = 'address' @_hash['accessibility'] = 'accessibility' @_hash['evses'] = 'evses' @_hash['opening_hours'] = 'openingHours' @_hash['updated'] = 'updated' @_hash['location_type'] = 'locationType' @_hash['operator_id'] = 'operatorId' @_hash['open_twenty_four_seven'] = 'openTwentyFourSeven' @_hash end |
.nullables ⇒ Object
An array for nullable fields
100 101 102 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 100 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 82 def self.optionals %w[ uid external_id coordinates operator_name address accessibility evses opening_hours updated location_type operator_id open_twenty_four_seven ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
186 187 188 189 190 191 192 193 194 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 186 def inspect class_name = self.class.name.split('::').last "<#{class_name} uid: #{@uid.inspect}, external_id: #{@external_id.inspect}, coordinates:"\ " #{@coordinates.inspect}, operator_name: #{@operator_name.inspect}, address:"\ " #{@address.inspect}, accessibility: #{@accessibility.inspect}, evses: #{@evses.inspect},"\ " opening_hours: #{@opening_hours.inspect}, updated: #{@updated.inspect}, location_type:"\ " #{@location_type.inspect}, operator_id: #{@operator_id.inspect}, open_twenty_four_seven:"\ " #{@open_twenty_four_seven.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
176 177 178 179 180 181 182 183 |
# File 'lib/shell_ev/models/search_by_id_location_respone.rb', line 176 def to_s class_name = self.class.name.split('::').last "<#{class_name} uid: #{@uid}, external_id: #{@external_id}, coordinates: #{@coordinates},"\ " operator_name: #{@operator_name}, address: #{@address}, accessibility: #{@accessibility},"\ " evses: #{@evses}, opening_hours: #{@opening_hours}, updated: #{@updated}, location_type:"\ " #{@location_type}, operator_id: #{@operator_id}, open_twenty_four_seven:"\ " #{@open_twenty_four_seven}>" end |