Class: UspsApi::UspsSummary
- Defined in:
- lib/usps_api/models/usps_summary.rb
Overview
UspsSummary Model.
Instance Attribute Summary collapse
-
#bedload ⇒ Bedload
Details and properties of the bedload for the appointment.
-
#consignee_content_id ⇒ String
Consignee Content ID for this USPSSummary object.
-
#destination_discount_indicator ⇒ DestinationDiscountIndicator
Indicator whether this is dropship (NO) or origin entry (YES) appointment.
-
#e_induction_indicator ⇒ EInductionIndicator
Yes/No indicator representing if IMCB is part of an eInduction Content.
-
#full_service_indicator ⇒ FullServiceIndicator
Indicate content is full service.
-
#in_home_end ⇒ DateTime
End Date of Appointment in Home DELIVERY.
-
#in_home_start ⇒ DateTime
Start Date of Appointment in Home DELIVERY.
-
#mail_class ⇒ MailClass
Required for Create actions.| Numbers represent the mailClass within legacy systems for understanding 1 FIRST CLASS MAIL 2 PERIODICALS 3 USPS MARKETING MAIL (PREVIOUSLY STANDARD MAIL) 4 PACKAGE SERVICES 6 PARCEL SELECT 7 PRIORITY MAIL.
-
#mail_content_name ⇒ String
Shipper assigned name to content.
-
#mail_preparer_crid ⇒ String
CRID of the mail preparer.
-
#mail_preparer_id ⇒ String
The unique ID of the mail preparer.
-
#news_indicator ⇒ NewsIndicator
Indicator for Newspaper.
-
#pallets ⇒ Array[Pallet]
Details and properties of the pallets for the appointment.
-
#perishable ⇒ Perishable
Is it perishable.
-
#priority_mail_indicator ⇒ PriorityMailIndicator
Priority Mail Indicator.
-
#processing_category ⇒ ProcessingCategory
Mail shape category.
-
#rate_type ⇒ RateType
Rate type describes mail class and mail shape combination.
-
#scheduler_content_id ⇒ String
The unique ID of the Scheduler.
-
#verification_location ⇒ VerificationLocation
Verified Location for BMEU or DMU for FAST appointment.
-
#zone_skipping_indicator ⇒ ZoneSkippingIndicator
Zone Skip in the Content of the appointment.
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(destination_discount_indicator: SKIP, zone_skipping_indicator: SKIP, full_service_indicator: SKIP, e_induction_indicator: SKIP, pallets: SKIP, bedload: SKIP, perishable: SKIP, mail_class: SKIP, rate_type: SKIP, in_home_start: SKIP, in_home_end: SKIP, processing_category: SKIP, news_indicator: SKIP, priority_mail_indicator: SKIP, verification_location: SKIP, mail_content_name: SKIP, mail_preparer_id: SKIP, mail_preparer_crid: SKIP, scheduler_content_id: SKIP, consignee_content_id: SKIP, additional_properties: nil) ⇒ UspsSummary
constructor
A new instance of UspsSummary.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_in_home_end ⇒ Object
- #to_custom_in_home_start ⇒ Object
-
#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(destination_discount_indicator: SKIP, zone_skipping_indicator: SKIP, full_service_indicator: SKIP, e_induction_indicator: SKIP, pallets: SKIP, bedload: SKIP, perishable: SKIP, mail_class: SKIP, rate_type: SKIP, in_home_start: SKIP, in_home_end: SKIP, processing_category: SKIP, news_indicator: SKIP, priority_mail_indicator: SKIP, verification_location: SKIP, mail_content_name: SKIP, mail_preparer_id: SKIP, mail_preparer_crid: SKIP, scheduler_content_id: SKIP, consignee_content_id: SKIP, additional_properties: nil) ⇒ UspsSummary
Returns a new instance of UspsSummary.
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 |
# File 'lib/usps_api/models/usps_summary.rb', line 155 def initialize(destination_discount_indicator: SKIP, zone_skipping_indicator: SKIP, full_service_indicator: SKIP, e_induction_indicator: SKIP, pallets: SKIP, bedload: SKIP, perishable: SKIP, mail_class: SKIP, rate_type: SKIP, in_home_start: SKIP, in_home_end: SKIP, processing_category: SKIP, news_indicator: SKIP, priority_mail_indicator: SKIP, verification_location: SKIP, mail_content_name: SKIP, mail_preparer_id: SKIP, mail_preparer_crid: SKIP, scheduler_content_id: SKIP, consignee_content_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? unless destination_discount_indicator == SKIP @destination_discount_indicator = destination_discount_indicator end @zone_skipping_indicator = zone_skipping_indicator unless zone_skipping_indicator == SKIP @full_service_indicator = full_service_indicator unless full_service_indicator == SKIP @e_induction_indicator = e_induction_indicator unless e_induction_indicator == SKIP @pallets = pallets unless pallets == SKIP @bedload = bedload unless bedload == SKIP @perishable = perishable unless perishable == SKIP @mail_class = mail_class unless mail_class == SKIP @rate_type = rate_type unless rate_type == SKIP @in_home_start = in_home_start unless in_home_start == SKIP @in_home_end = in_home_end unless in_home_end == SKIP @processing_category = processing_category unless processing_category == SKIP @news_indicator = news_indicator unless news_indicator == SKIP @priority_mail_indicator = priority_mail_indicator unless priority_mail_indicator == SKIP @verification_location = verification_location unless verification_location == SKIP @mail_content_name = mail_content_name unless mail_content_name == SKIP @mail_preparer_id = mail_preparer_id unless mail_preparer_id == SKIP @mail_preparer_crid = mail_preparer_crid unless mail_preparer_crid == SKIP @scheduler_content_id = scheduler_content_id unless scheduler_content_id == SKIP @consignee_content_id = consignee_content_id unless consignee_content_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#bedload ⇒ Bedload
Details and properties of the bedload for the appointment.
36 37 38 |
# File 'lib/usps_api/models/usps_summary.rb', line 36 def bedload @bedload end |
#consignee_content_id ⇒ String
Consignee Content ID for this USPSSummary object
95 96 97 |
# File 'lib/usps_api/models/usps_summary.rb', line 95 def consignee_content_id @consignee_content_id end |
#destination_discount_indicator ⇒ DestinationDiscountIndicator
Indicator whether this is dropship (NO) or origin entry (YES) appointment. Required for Create actions.
16 17 18 |
# File 'lib/usps_api/models/usps_summary.rb', line 16 def destination_discount_indicator @destination_discount_indicator end |
#e_induction_indicator ⇒ EInductionIndicator
Yes/No indicator representing if IMCB is part of an eInduction Content
28 29 30 |
# File 'lib/usps_api/models/usps_summary.rb', line 28 def e_induction_indicator @e_induction_indicator end |
#full_service_indicator ⇒ FullServiceIndicator
Indicate content is full service
24 25 26 |
# File 'lib/usps_api/models/usps_summary.rb', line 24 def full_service_indicator @full_service_indicator end |
#in_home_end ⇒ DateTime
End Date of Appointment in Home DELIVERY
59 60 61 |
# File 'lib/usps_api/models/usps_summary.rb', line 59 def in_home_end @in_home_end end |
#in_home_start ⇒ DateTime
Start Date of Appointment in Home DELIVERY
55 56 57 |
# File 'lib/usps_api/models/usps_summary.rb', line 55 def in_home_start @in_home_start end |
#mail_class ⇒ MailClass
Required for Create actions.| Numbers represent the mailClass within legacy systems for understanding 1 FIRST CLASS MAIL 2 PERIODICALS 3 USPS MARKETING MAIL (PREVIOUSLY STANDARD MAIL) 4 PACKAGE SERVICES 6 PARCEL SELECT 7 PRIORITY MAIL
47 48 49 |
# File 'lib/usps_api/models/usps_summary.rb', line 47 def mail_class @mail_class end |
#mail_content_name ⇒ String
Shipper assigned name to content
79 80 81 |
# File 'lib/usps_api/models/usps_summary.rb', line 79 def mail_content_name @mail_content_name end |
#mail_preparer_crid ⇒ String
CRID of the mail preparer
87 88 89 |
# File 'lib/usps_api/models/usps_summary.rb', line 87 def mail_preparer_crid @mail_preparer_crid end |
#mail_preparer_id ⇒ String
The unique ID of the mail preparer
83 84 85 |
# File 'lib/usps_api/models/usps_summary.rb', line 83 def mail_preparer_id @mail_preparer_id end |
#news_indicator ⇒ NewsIndicator
Indicator for Newspaper. Required for Create actions.
67 68 69 |
# File 'lib/usps_api/models/usps_summary.rb', line 67 def news_indicator @news_indicator end |
#pallets ⇒ Array[Pallet]
Details and properties of the pallets for the appointment.
32 33 34 |
# File 'lib/usps_api/models/usps_summary.rb', line 32 def pallets @pallets end |
#perishable ⇒ Perishable
Is it perishable. Required for Create actions.
40 41 42 |
# File 'lib/usps_api/models/usps_summary.rb', line 40 def perishable @perishable end |
#priority_mail_indicator ⇒ PriorityMailIndicator
Priority Mail Indicator. Required for Create actions.
71 72 73 |
# File 'lib/usps_api/models/usps_summary.rb', line 71 def priority_mail_indicator @priority_mail_indicator end |
#processing_category ⇒ ProcessingCategory
Mail shape category. Required for Create actions.
63 64 65 |
# File 'lib/usps_api/models/usps_summary.rb', line 63 def processing_category @processing_category end |
#rate_type ⇒ RateType
Rate type describes mail class and mail shape combination
51 52 53 |
# File 'lib/usps_api/models/usps_summary.rb', line 51 def rate_type @rate_type end |
#scheduler_content_id ⇒ String
The unique ID of the Scheduler
91 92 93 |
# File 'lib/usps_api/models/usps_summary.rb', line 91 def scheduler_content_id @scheduler_content_id end |
#verification_location ⇒ VerificationLocation
Verified Location for BMEU or DMU for FAST appointment
75 76 77 |
# File 'lib/usps_api/models/usps_summary.rb', line 75 def verification_location @verification_location end |
#zone_skipping_indicator ⇒ ZoneSkippingIndicator
Zone Skip in the Content of the appointment. Required for Create actions.
20 21 22 |
# File 'lib/usps_api/models/usps_summary.rb', line 20 def zone_skipping_indicator @zone_skipping_indicator end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/usps_api/models/usps_summary.rb', line 195 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. destination_discount_indicator = hash.key?('destinationDiscountIndicator') ? hash['destinationDiscountIndicator'] : SKIP zone_skipping_indicator = hash.key?('zoneSkippingIndicator') ? hash['zoneSkippingIndicator'] : SKIP full_service_indicator = hash.key?('fullServiceIndicator') ? hash['fullServiceIndicator'] : SKIP e_induction_indicator = hash.key?('eInductionIndicator') ? hash['eInductionIndicator'] : SKIP # Parameter is an array, so we need to iterate through it pallets = nil unless hash['pallets'].nil? pallets = [] hash['pallets'].each do |structure| pallets << (Pallet.from_hash(structure) if structure) end end pallets = SKIP unless hash.key?('pallets') bedload = Bedload.from_hash(hash['bedload']) if hash['bedload'] perishable = hash.key?('perishable') ? hash['perishable'] : SKIP mail_class = hash.key?('mailClass') ? hash['mailClass'] : SKIP rate_type = hash.key?('rateType') ? hash['rateType'] : SKIP in_home_start = if hash.key?('inHomeStart') (DateTimeHelper.from_rfc3339(hash['inHomeStart']) if hash['inHomeStart']) else SKIP end in_home_end = if hash.key?('inHomeEnd') (DateTimeHelper.from_rfc3339(hash['inHomeEnd']) if hash['inHomeEnd']) else SKIP end processing_category = hash.key?('processingCategory') ? hash['processingCategory'] : SKIP news_indicator = hash.key?('newsIndicator') ? hash['newsIndicator'] : SKIP priority_mail_indicator = hash.key?('priorityMailIndicator') ? hash['priorityMailIndicator'] : SKIP verification_location = hash.key?('verificationLocation') ? hash['verificationLocation'] : SKIP mail_content_name = hash.key?('mailContentName') ? hash['mailContentName'] : SKIP mail_preparer_id = hash.key?('mailPreparerID') ? hash['mailPreparerID'] : SKIP mail_preparer_crid = hash.key?('mailPreparerCRID') ? hash['mailPreparerCRID'] : SKIP scheduler_content_id = hash.key?('schedulerContentID') ? hash['schedulerContentID'] : SKIP consignee_content_id = hash.key?('consigneeContentID') ? hash['consigneeContentID'] : 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. UspsSummary.new(destination_discount_indicator: destination_discount_indicator, zone_skipping_indicator: zone_skipping_indicator, full_service_indicator: full_service_indicator, e_induction_indicator: e_induction_indicator, pallets: pallets, bedload: bedload, perishable: perishable, mail_class: mail_class, rate_type: rate_type, in_home_start: in_home_start, in_home_end: in_home_end, processing_category: processing_category, news_indicator: news_indicator, priority_mail_indicator: priority_mail_indicator, verification_location: verification_location, mail_content_name: mail_content_name, mail_preparer_id: mail_preparer_id, mail_preparer_crid: mail_preparer_crid, scheduler_content_id: scheduler_content_id, consignee_content_id: consignee_content_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/usps_api/models/usps_summary.rb', line 98 def self.names @_hash = {} if @_hash.nil? @_hash['destination_discount_indicator'] = 'destinationDiscountIndicator' @_hash['zone_skipping_indicator'] = 'zoneSkippingIndicator' @_hash['full_service_indicator'] = 'fullServiceIndicator' @_hash['e_induction_indicator'] = 'eInductionIndicator' @_hash['pallets'] = 'pallets' @_hash['bedload'] = 'bedload' @_hash['perishable'] = 'perishable' @_hash['mail_class'] = 'mailClass' @_hash['rate_type'] = 'rateType' @_hash['in_home_start'] = 'inHomeStart' @_hash['in_home_end'] = 'inHomeEnd' @_hash['processing_category'] = 'processingCategory' @_hash['news_indicator'] = 'newsIndicator' @_hash['priority_mail_indicator'] = 'priorityMailIndicator' @_hash['verification_location'] = 'verificationLocation' @_hash['mail_content_name'] = 'mailContentName' @_hash['mail_preparer_id'] = 'mailPreparerID' @_hash['mail_preparer_crid'] = 'mailPreparerCRID' @_hash['scheduler_content_id'] = 'schedulerContentID' @_hash['consignee_content_id'] = 'consigneeContentID' @_hash end |
.nullables ⇒ Object
An array for nullable fields
151 152 153 |
# File 'lib/usps_api/models/usps_summary.rb', line 151 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/usps_api/models/usps_summary.rb', line 125 def self.optionals %w[ destination_discount_indicator zone_skipping_indicator full_service_indicator e_induction_indicator pallets bedload perishable mail_class rate_type in_home_start in_home_end processing_category news_indicator priority_mail_indicator verification_location mail_content_name mail_preparer_id mail_preparer_crid scheduler_content_id consignee_content_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/usps_api/models/usps_summary.rb', line 305 def inspect class_name = self.class.name.split('::').last "<#{class_name} destination_discount_indicator: #{@destination_discount_indicator.inspect},"\ " zone_skipping_indicator: #{@zone_skipping_indicator.inspect}, full_service_indicator:"\ " #{@full_service_indicator.inspect}, e_induction_indicator:"\ " #{@e_induction_indicator.inspect}, pallets: #{@pallets.inspect}, bedload:"\ " #{@bedload.inspect}, perishable: #{@perishable.inspect}, mail_class:"\ " #{@mail_class.inspect}, rate_type: #{@rate_type.inspect}, in_home_start:"\ " #{@in_home_start.inspect}, in_home_end: #{@in_home_end.inspect}, processing_category:"\ " #{@processing_category.inspect}, news_indicator: #{@news_indicator.inspect},"\ " priority_mail_indicator: #{@priority_mail_indicator.inspect}, verification_location:"\ " #{@verification_location.inspect}, mail_content_name: #{@mail_content_name.inspect},"\ " mail_preparer_id: #{@mail_preparer_id.inspect}, mail_preparer_crid:"\ " #{@mail_preparer_crid.inspect}, scheduler_content_id: #{@scheduler_content_id.inspect},"\ " consignee_content_id: #{@consignee_content_id.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_in_home_end ⇒ Object
284 285 286 |
# File 'lib/usps_api/models/usps_summary.rb', line 284 def to_custom_in_home_end DateTimeHelper.to_rfc3339(in_home_end) end |
#to_custom_in_home_start ⇒ Object
280 281 282 |
# File 'lib/usps_api/models/usps_summary.rb', line 280 def to_custom_in_home_start DateTimeHelper.to_rfc3339(in_home_start) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/usps_api/models/usps_summary.rb', line 289 def to_s class_name = self.class.name.split('::').last "<#{class_name} destination_discount_indicator: #{@destination_discount_indicator},"\ " zone_skipping_indicator: #{@zone_skipping_indicator}, full_service_indicator:"\ " #{@full_service_indicator}, e_induction_indicator: #{@e_induction_indicator}, pallets:"\ " #{@pallets}, bedload: #{@bedload}, perishable: #{@perishable}, mail_class: #{@mail_class},"\ " rate_type: #{@rate_type}, in_home_start: #{@in_home_start}, in_home_end: #{@in_home_end},"\ " processing_category: #{@processing_category}, news_indicator: #{@news_indicator},"\ " priority_mail_indicator: #{@priority_mail_indicator}, verification_location:"\ " #{@verification_location}, mail_content_name: #{@mail_content_name}, mail_preparer_id:"\ " #{@mail_preparer_id}, mail_preparer_crid: #{@mail_preparer_crid}, scheduler_content_id:"\ " #{@scheduler_content_id}, consignee_content_id: #{@consignee_content_id},"\ " additional_properties: #{@additional_properties}>" end |