Class: UspsApi::ParcelDropShipmentFacilityLocation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::ParcelDropShipmentFacilityLocation
- Defined in:
- lib/usps_api/models/parcel_drop_shipment_facility_location.rb
Overview
USPS® Destination Entry Drop Shipment Location
Instance Attribute Summary collapse
-
#accepted_package_types ⇒ Array[PackageTypesAccepted]
Accepted Package Types at USPS® Destination Entry Drop Shipment Location.
-
#destination_entry_facility_type ⇒ DestinationEntryFacilityType
The destination entry service accepted at the facility.
-
#destination_zip_code ⇒ String
5-digit ZIP code.
-
#drop_ship_acceptance_times ⇒ Array[HoursOfOperation]
The available acceptance times and days for drop shipments.
-
#drop_shipment_facility_details ⇒ AdditionalFacilityDetails
Information about the drop-off location facility.
-
#drop_shipment_key ⇒ String
the unique identifier for the facility.
-
#drop_site_phone_number ⇒ String
The phone number for the facility.
-
#dst_observed ⇒ TrueClass | FalseClass
Indicator for whether Daylight Savings Time is observed for a given facility.
-
#facility_address ⇒ FacilityAddress
The name of the facility.
-
#facility_name ⇒ String
The name of the facility.
-
#time_zone ⇒ String
The time zone returned for a given facility.
-
#usps_connect_details ⇒ UspsConnect8482Services
Provides details on USPS Connect® services offered at the facility.
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(drop_shipment_key: SKIP, facility_name: SKIP, facility_address: SKIP, drop_site_phone_number: SKIP, destination_zip_code: SKIP, destination_entry_facility_type: SKIP, accepted_package_types: SKIP, drop_ship_acceptance_times: SKIP, drop_shipment_facility_details: SKIP, usps_connect_details: SKIP, time_zone: SKIP, dst_observed: SKIP) ⇒ ParcelDropShipmentFacilityLocation
constructor
A new instance of ParcelDropShipmentFacilityLocation.
-
#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(drop_shipment_key: SKIP, facility_name: SKIP, facility_address: SKIP, drop_site_phone_number: SKIP, destination_zip_code: SKIP, destination_entry_facility_type: SKIP, accepted_package_types: SKIP, drop_ship_acceptance_times: SKIP, drop_shipment_facility_details: SKIP, usps_connect_details: SKIP, time_zone: SKIP, dst_observed: SKIP) ⇒ ParcelDropShipmentFacilityLocation
Returns a new instance of ParcelDropShipmentFacilityLocation.
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 137 138 139 140 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 110 def initialize(drop_shipment_key: SKIP, facility_name: SKIP, facility_address: SKIP, drop_site_phone_number: SKIP, destination_zip_code: SKIP, destination_entry_facility_type: SKIP, accepted_package_types: SKIP, drop_ship_acceptance_times: SKIP, drop_shipment_facility_details: SKIP, usps_connect_details: SKIP, time_zone: SKIP, dst_observed: SKIP) @drop_shipment_key = drop_shipment_key unless drop_shipment_key == SKIP @facility_name = facility_name unless facility_name == SKIP @facility_address = facility_address unless facility_address == SKIP @drop_site_phone_number = drop_site_phone_number unless drop_site_phone_number == SKIP @destination_zip_code = destination_zip_code unless destination_zip_code == SKIP unless destination_entry_facility_type == SKIP @destination_entry_facility_type = destination_entry_facility_type end @accepted_package_types = accepted_package_types unless accepted_package_types == SKIP unless drop_ship_acceptance_times == SKIP @drop_ship_acceptance_times = drop_ship_acceptance_times end unless drop_shipment_facility_details == SKIP @drop_shipment_facility_details = drop_shipment_facility_details end @usps_connect_details = usps_connect_details unless usps_connect_details == SKIP @time_zone = time_zone unless time_zone == SKIP @dst_observed = dst_observed unless dst_observed == SKIP end |
Instance Attribute Details
#accepted_package_types ⇒ Array[PackageTypesAccepted]
Accepted Package Types at USPS® Destination Entry Drop Shipment Location.
45 46 47 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 45 def accepted_package_types @accepted_package_types end |
#destination_entry_facility_type ⇒ DestinationEntryFacilityType
The destination entry service accepted at the facility. Note:
-
Effective 01/18/2026: ‘DESTINATION_NETWORK_DISTRIBUTION_CENTER` with
‘PARCEL_SELECT` is no longer eligible.
-
Effective 01/18/2026: (NSA Only)
‘DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.
40 41 42 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 40 def destination_entry_facility_type @destination_entry_facility_type end |
#destination_zip_code ⇒ String
5-digit ZIP code.
30 31 32 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 30 def destination_zip_code @destination_zip_code end |
#drop_ship_acceptance_times ⇒ Array[HoursOfOperation]
The available acceptance times and days for drop shipments.
49 50 51 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 49 def drop_ship_acceptance_times @drop_ship_acceptance_times end |
#drop_shipment_facility_details ⇒ AdditionalFacilityDetails
Information about the drop-off location facility.
53 54 55 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 53 def drop_shipment_facility_details @drop_shipment_facility_details end |
#drop_shipment_key ⇒ String
the unique identifier for the facility.
14 15 16 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 14 def drop_shipment_key @drop_shipment_key end |
#drop_site_phone_number ⇒ String
The phone number for the facility.
26 27 28 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 26 def drop_site_phone_number @drop_site_phone_number end |
#dst_observed ⇒ TrueClass | FalseClass
Indicator for whether Daylight Savings Time is observed for a given facility.
66 67 68 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 66 def dst_observed @dst_observed end |
#facility_address ⇒ FacilityAddress
The name of the facility.
22 23 24 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 22 def facility_address @facility_address end |
#facility_name ⇒ String
The name of the facility.
18 19 20 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 18 def facility_name @facility_name end |
#time_zone ⇒ String
The time zone returned for a given facility.
61 62 63 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 61 def time_zone @time_zone end |
#usps_connect_details ⇒ UspsConnect8482Services
Provides details on USPS Connect® services offered at the facility.
57 58 59 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 57 def usps_connect_details @usps_connect_details end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 143 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. drop_shipment_key = hash.key?('dropShipmentKey') ? hash['dropShipmentKey'] : SKIP facility_name = hash.key?('facilityName') ? hash['facilityName'] : SKIP facility_address = FacilityAddress.from_hash(hash['facilityAddress']) if hash['facilityAddress'] drop_site_phone_number = hash.key?('dropSitePhoneNumber') ? hash['dropSitePhoneNumber'] : SKIP destination_zip_code = hash.key?('destinationZIPCode') ? hash['destinationZIPCode'] : SKIP destination_entry_facility_type = hash.key?('destinationEntryFacilityType') ? hash['destinationEntryFacilityType'] : SKIP # Parameter is an array, so we need to iterate through it accepted_package_types = nil unless hash['acceptedPackageTypes'].nil? accepted_package_types = [] hash['acceptedPackageTypes'].each do |structure| accepted_package_types << (PackageTypesAccepted.from_hash(structure) if structure) end end accepted_package_types = SKIP unless hash.key?('acceptedPackageTypes') # Parameter is an array, so we need to iterate through it drop_ship_acceptance_times = nil unless hash['dropShipAcceptanceTimes'].nil? drop_ship_acceptance_times = [] hash['dropShipAcceptanceTimes'].each do |structure| drop_ship_acceptance_times << (HoursOfOperation.from_hash(structure) if structure) end end drop_ship_acceptance_times = SKIP unless hash.key?('dropShipAcceptanceTimes') if hash['dropShipmentFacilityDetails'] drop_shipment_facility_details = AdditionalFacilityDetails.from_hash(hash['dropShipmentFacilityDetails']) end usps_connect_details = UspsConnect8482Services.from_hash(hash['USPSConnectDetails']) if hash['USPSConnectDetails'] time_zone = hash.key?('timeZone') ? hash['timeZone'] : SKIP dst_observed = hash.key?('DSTObserved') ? hash['DSTObserved'] : SKIP # Create object from extracted values. ParcelDropShipmentFacilityLocation.new(drop_shipment_key: drop_shipment_key, facility_name: facility_name, facility_address: facility_address, drop_site_phone_number: drop_site_phone_number, destination_zip_code: destination_zip_code, destination_entry_facility_type: destination_entry_facility_type, accepted_package_types: accepted_package_types, drop_ship_acceptance_times: drop_ship_acceptance_times, drop_shipment_facility_details: drop_shipment_facility_details, usps_connect_details: usps_connect_details, time_zone: time_zone, dst_observed: dst_observed) end |
.names ⇒ Object
A mapping from model property names to API property names.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 69 def self.names @_hash = {} if @_hash.nil? @_hash['drop_shipment_key'] = 'dropShipmentKey' @_hash['facility_name'] = 'facilityName' @_hash['facility_address'] = 'facilityAddress' @_hash['drop_site_phone_number'] = 'dropSitePhoneNumber' @_hash['destination_zip_code'] = 'destinationZIPCode' @_hash['destination_entry_facility_type'] = 'destinationEntryFacilityType' @_hash['accepted_package_types'] = 'acceptedPackageTypes' @_hash['drop_ship_acceptance_times'] = 'dropShipAcceptanceTimes' @_hash['drop_shipment_facility_details'] = 'dropShipmentFacilityDetails' @_hash['usps_connect_details'] = 'USPSConnectDetails' @_hash['time_zone'] = 'timeZone' @_hash['dst_observed'] = 'DSTObserved' @_hash end |
.nullables ⇒ Object
An array for nullable fields
106 107 108 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 106 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 88 def self.optionals %w[ drop_shipment_key facility_name facility_address drop_site_phone_number destination_zip_code destination_entry_facility_type accepted_package_types drop_ship_acceptance_times drop_shipment_facility_details usps_connect_details time_zone dst_observed ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 215 def inspect class_name = self.class.name.split('::').last "<#{class_name} drop_shipment_key: #{@drop_shipment_key.inspect}, facility_name:"\ " #{@facility_name.inspect}, facility_address: #{@facility_address.inspect},"\ " drop_site_phone_number: #{@drop_site_phone_number.inspect}, destination_zip_code:"\ " #{@destination_zip_code.inspect}, destination_entry_facility_type:"\ " #{@destination_entry_facility_type.inspect}, accepted_package_types:"\ " #{@accepted_package_types.inspect}, drop_ship_acceptance_times:"\ " #{@drop_ship_acceptance_times.inspect}, drop_shipment_facility_details:"\ " #{@drop_shipment_facility_details.inspect}, usps_connect_details:"\ " #{@usps_connect_details.inspect}, time_zone: #{@time_zone.inspect}, dst_observed:"\ " #{@dst_observed.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/usps_api/models/parcel_drop_shipment_facility_location.rb', line 202 def to_s class_name = self.class.name.split('::').last "<#{class_name} drop_shipment_key: #{@drop_shipment_key}, facility_name: #{@facility_name},"\ " facility_address: #{@facility_address}, drop_site_phone_number:"\ " #{@drop_site_phone_number}, destination_zip_code: #{@destination_zip_code},"\ " destination_entry_facility_type: #{@destination_entry_facility_type},"\ " accepted_package_types: #{@accepted_package_types}, drop_ship_acceptance_times:"\ " #{@drop_ship_acceptance_times}, drop_shipment_facility_details:"\ " #{@drop_shipment_facility_details}, usps_connect_details: #{@usps_connect_details},"\ " time_zone: #{@time_zone}, dst_observed: #{@dst_observed}>" end |