Class: UspsApi::ParcelLockerLocation
- Defined in:
- lib/usps_api/models/parcel_locker_location.rb
Overview
ParcelLockerLocation Model.
Instance Attribute Summary collapse
-
#delivery_address ⇒ LocationsDomesticAddress
Address fields for US locations.
-
#delivery_point ⇒ String
2-digit Delivery Point Code (DPC) of the Parcel Locker.
-
#facility_id ⇒ String
Unique identifier of the Post Office where the parcel locker is located.
-
#latitude ⇒ Float
The latitude geo coordinate.
-
#location_address ⇒ LocationsDomesticAddress
Address fields for US locations.
-
#location_name ⇒ String
The name of the facility where the parcel locker is located.
-
#locker_online ⇒ TrueClass | FalseClass
Indicates whether the parcel locker is currently online or offline.
-
#locker_size_maximum_height ⇒ Float
Height of the largest locker.
-
#locker_size_maximum_length ⇒ Float
Length of the largest locker.
-
#locker_size_maximum_width ⇒ Float
Width of the largest locker.
-
#locker_status ⇒ String
The current status of the parcel locker.
-
#longitude ⇒ Float
The longitude geo coordinate.
-
#service_direct_ship ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept Direct-to-Locker packages.
-
#service_label_printing ⇒ TrueClass | FalseClass
Indicates whether the parcel locker has printing capability.
-
#service_po_box_overflow ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept packages that do not fit into a PO Box.
-
#service_prepaid ⇒ TrueClass | FalseClass
DEPRECATED, replaced by ‘servicePrepaidReturns`.
-
#service_prepaid_returns ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept prepaid returns packages.
-
#service_redelivery ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept redelivery packages.
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(facility_id: SKIP, location_name: SKIP, location_address: SKIP, latitude: SKIP, longitude: SKIP, delivery_address: SKIP, delivery_point: SKIP, locker_status: SKIP, locker_online: SKIP, locker_size_maximum_length: SKIP, locker_size_maximum_width: SKIP, locker_size_maximum_height: SKIP, service_direct_ship: SKIP, service_redelivery: SKIP, service_po_box_overflow: SKIP, service_prepaid: SKIP, service_prepaid_returns: SKIP, service_label_printing: SKIP, additional_properties: nil) ⇒ ParcelLockerLocation
constructor
A new instance of ParcelLockerLocation.
-
#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(facility_id: SKIP, location_name: SKIP, location_address: SKIP, latitude: SKIP, longitude: SKIP, delivery_address: SKIP, delivery_point: SKIP, locker_status: SKIP, locker_online: SKIP, locker_size_maximum_length: SKIP, locker_size_maximum_width: SKIP, locker_size_maximum_height: SKIP, service_direct_ship: SKIP, service_redelivery: SKIP, service_po_box_overflow: SKIP, service_prepaid: SKIP, service_prepaid_returns: SKIP, service_label_printing: SKIP, additional_properties: nil) ⇒ ParcelLockerLocation
Returns a new instance of ParcelLockerLocation.
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 174 175 176 177 178 179 180 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 139 def initialize(facility_id: SKIP, location_name: SKIP, location_address: SKIP, latitude: SKIP, longitude: SKIP, delivery_address: SKIP, delivery_point: SKIP, locker_status: SKIP, locker_online: SKIP, locker_size_maximum_length: SKIP, locker_size_maximum_width: SKIP, locker_size_maximum_height: SKIP, service_direct_ship: SKIP, service_redelivery: SKIP, service_po_box_overflow: SKIP, service_prepaid: SKIP, service_prepaid_returns: SKIP, service_label_printing: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @facility_id = facility_id unless facility_id == SKIP @location_name = location_name unless location_name == SKIP @location_address = location_address unless location_address == SKIP @latitude = latitude unless latitude == SKIP @longitude = longitude unless longitude == SKIP @delivery_address = delivery_address unless delivery_address == SKIP @delivery_point = delivery_point unless delivery_point == SKIP @locker_status = locker_status unless locker_status == SKIP @locker_online = locker_online unless locker_online == SKIP unless locker_size_maximum_length == SKIP @locker_size_maximum_length = locker_size_maximum_length end unless locker_size_maximum_width == SKIP @locker_size_maximum_width = locker_size_maximum_width end unless locker_size_maximum_height == SKIP @locker_size_maximum_height = locker_size_maximum_height end @service_direct_ship = service_direct_ship unless service_direct_ship == SKIP @service_redelivery = service_redelivery unless service_redelivery == SKIP @service_po_box_overflow = service_po_box_overflow unless service_po_box_overflow == SKIP @service_prepaid = service_prepaid unless service_prepaid == SKIP @service_prepaid_returns = service_prepaid_returns unless service_prepaid_returns == SKIP @service_label_printing = service_label_printing unless service_label_printing == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#delivery_address ⇒ LocationsDomesticAddress
Address fields for US locations
34 35 36 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 34 def delivery_address @delivery_address end |
#delivery_point ⇒ String
2-digit Delivery Point Code (DPC) of the Parcel Locker.
38 39 40 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 38 def delivery_point @delivery_point end |
#facility_id ⇒ String
Unique identifier of the Post Office where the parcel locker is located.
14 15 16 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 14 def facility_id @facility_id end |
#latitude ⇒ Float
The latitude geo coordinate.
26 27 28 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 26 def latitude @latitude end |
#location_address ⇒ LocationsDomesticAddress
Address fields for US locations
22 23 24 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 22 def location_address @location_address end |
#location_name ⇒ String
The name of the facility where the parcel locker is located.
18 19 20 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 18 def location_name @location_name end |
#locker_online ⇒ TrueClass | FalseClass
Indicates whether the parcel locker is currently online or offline.
46 47 48 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 46 def locker_online @locker_online end |
#locker_size_maximum_height ⇒ Float
Height of the largest locker.
58 59 60 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 58 def locker_size_maximum_height @locker_size_maximum_height end |
#locker_size_maximum_length ⇒ Float
Length of the largest locker.
50 51 52 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 50 def locker_size_maximum_length @locker_size_maximum_length end |
#locker_size_maximum_width ⇒ Float
Width of the largest locker.
54 55 56 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 54 def locker_size_maximum_width @locker_size_maximum_width end |
#locker_status ⇒ String
The current status of the parcel locker.
42 43 44 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 42 def locker_status @locker_status end |
#longitude ⇒ Float
The longitude geo coordinate.
30 31 32 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 30 def longitude @longitude end |
#service_direct_ship ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept Direct-to-Locker packages.
62 63 64 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 62 def service_direct_ship @service_direct_ship end |
#service_label_printing ⇒ TrueClass | FalseClass
Indicates whether the parcel locker has printing capability.
84 85 86 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 84 def service_label_printing @service_label_printing end |
#service_po_box_overflow ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept packages that do not fit into a PO Box.
71 72 73 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 71 def service_po_box_overflow @service_po_box_overflow end |
#service_prepaid ⇒ TrueClass | FalseClass
DEPRECATED, replaced by ‘servicePrepaidReturns`. Indicates whether the parcel locker can accept prepaid returns packages.
76 77 78 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 76 def service_prepaid @service_prepaid end |
#service_prepaid_returns ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept prepaid returns packages.
80 81 82 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 80 def service_prepaid_returns @service_prepaid_returns end |
#service_redelivery ⇒ TrueClass | FalseClass
Indicates whether the parcel locker can accept redelivery packages.
66 67 68 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 66 def service_redelivery @service_redelivery end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 183 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. facility_id = hash.key?('facilityID') ? hash['facilityID'] : SKIP location_name = hash.key?('locationName') ? hash['locationName'] : SKIP location_address = LocationsDomesticAddress.from_hash(hash['locationAddress']) if hash['locationAddress'] latitude = hash.key?('latitude') ? hash['latitude'] : SKIP longitude = hash.key?('longitude') ? hash['longitude'] : SKIP delivery_address = LocationsDomesticAddress.from_hash(hash['deliveryAddress']) if hash['deliveryAddress'] delivery_point = hash.key?('deliveryPoint') ? hash['deliveryPoint'] : SKIP locker_status = hash.key?('lockerStatus') ? hash['lockerStatus'] : SKIP locker_online = hash.key?('lockerOnline') ? hash['lockerOnline'] : SKIP locker_size_maximum_length = hash.key?('lockerSizeMaximumLength') ? hash['lockerSizeMaximumLength'] : SKIP locker_size_maximum_width = hash.key?('lockerSizeMaximumWidth') ? hash['lockerSizeMaximumWidth'] : SKIP locker_size_maximum_height = hash.key?('lockerSizeMaximumHeight') ? hash['lockerSizeMaximumHeight'] : SKIP service_direct_ship = hash.key?('serviceDirectShip') ? hash['serviceDirectShip'] : SKIP service_redelivery = hash.key?('serviceRedelivery') ? hash['serviceRedelivery'] : SKIP service_po_box_overflow = hash.key?('servicePOBoxOverflow') ? hash['servicePOBoxOverflow'] : SKIP service_prepaid = hash.key?('servicePrepaid') ? hash['servicePrepaid'] : SKIP service_prepaid_returns = hash.key?('servicePrepaidReturns') ? hash['servicePrepaidReturns'] : SKIP service_label_printing = hash.key?('serviceLabelPrinting') ? hash['serviceLabelPrinting'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. ParcelLockerLocation.new(facility_id: facility_id, location_name: location_name, location_address: location_address, latitude: latitude, longitude: longitude, delivery_address: delivery_address, delivery_point: delivery_point, locker_status: locker_status, locker_online: locker_online, locker_size_maximum_length: locker_size_maximum_length, locker_size_maximum_width: locker_size_maximum_width, locker_size_maximum_height: locker_size_maximum_height, service_direct_ship: service_direct_ship, service_redelivery: service_redelivery, service_po_box_overflow: service_po_box_overflow, service_prepaid: service_prepaid, service_prepaid_returns: service_prepaid_returns, service_label_printing: service_label_printing, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 87 def self.names @_hash = {} if @_hash.nil? @_hash['facility_id'] = 'facilityID' @_hash['location_name'] = 'locationName' @_hash['location_address'] = 'locationAddress' @_hash['latitude'] = 'latitude' @_hash['longitude'] = 'longitude' @_hash['delivery_address'] = 'deliveryAddress' @_hash['delivery_point'] = 'deliveryPoint' @_hash['locker_status'] = 'lockerStatus' @_hash['locker_online'] = 'lockerOnline' @_hash['locker_size_maximum_length'] = 'lockerSizeMaximumLength' @_hash['locker_size_maximum_width'] = 'lockerSizeMaximumWidth' @_hash['locker_size_maximum_height'] = 'lockerSizeMaximumHeight' @_hash['service_direct_ship'] = 'serviceDirectShip' @_hash['service_redelivery'] = 'serviceRedelivery' @_hash['service_po_box_overflow'] = 'servicePOBoxOverflow' @_hash['service_prepaid'] = 'servicePrepaid' @_hash['service_prepaid_returns'] = 'servicePrepaidReturns' @_hash['service_label_printing'] = 'serviceLabelPrinting' @_hash end |
.nullables ⇒ Object
An array for nullable fields
135 136 137 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 135 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 111 def self.optionals %w[ facility_id location_name location_address latitude longitude delivery_address delivery_point locker_status locker_online locker_size_maximum_length locker_size_maximum_width locker_size_maximum_height service_direct_ship service_redelivery service_po_box_overflow service_prepaid service_prepaid_returns service_label_printing ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 263 def inspect class_name = self.class.name.split('::').last "<#{class_name} facility_id: #{@facility_id.inspect}, location_name:"\ " #{@location_name.inspect}, location_address: #{@location_address.inspect}, latitude:"\ " #{@latitude.inspect}, longitude: #{@longitude.inspect}, delivery_address:"\ " #{@delivery_address.inspect}, delivery_point: #{@delivery_point.inspect}, locker_status:"\ " #{@locker_status.inspect}, locker_online: #{@locker_online.inspect},"\ " locker_size_maximum_length: #{@locker_size_maximum_length.inspect},"\ " locker_size_maximum_width: #{@locker_size_maximum_width.inspect},"\ " locker_size_maximum_height: #{@locker_size_maximum_height.inspect}, service_direct_ship:"\ " #{@service_direct_ship.inspect}, service_redelivery: #{@service_redelivery.inspect},"\ " service_po_box_overflow: #{@service_po_box_overflow.inspect}, service_prepaid:"\ " #{@service_prepaid.inspect}, service_prepaid_returns: #{@service_prepaid_returns.inspect},"\ " service_label_printing: #{@service_label_printing.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/usps_api/models/parcel_locker_location.rb', line 247 def to_s class_name = self.class.name.split('::').last "<#{class_name} facility_id: #{@facility_id}, location_name: #{@location_name},"\ " location_address: #{@location_address}, latitude: #{@latitude}, longitude: #{@longitude},"\ " delivery_address: #{@delivery_address}, delivery_point: #{@delivery_point}, locker_status:"\ " #{@locker_status}, locker_online: #{@locker_online}, locker_size_maximum_length:"\ " #{@locker_size_maximum_length}, locker_size_maximum_width: #{@locker_size_maximum_width},"\ " locker_size_maximum_height: #{@locker_size_maximum_height}, service_direct_ship:"\ " #{@service_direct_ship}, service_redelivery: #{@service_redelivery},"\ " service_po_box_overflow: #{@service_po_box_overflow}, service_prepaid:"\ " #{@service_prepaid}, service_prepaid_returns: #{@service_prepaid_returns},"\ " service_label_printing: #{@service_label_printing}, additional_properties:"\ " #{@additional_properties}>" end |