Class: UspsApi::UspsSummary1
- Defined in:
- lib/usps_api/models/usps_summary1.rb
Overview
UspsSummary1 Model.
Instance Attribute Summary collapse
-
#destination_discount_indicator ⇒ DestinationDiscountIndicator1
Indicator whether this is dropship (NO) or origin entry (YES) appointment.
-
#mail_class ⇒ MailClass2
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.
-
#news_indicator ⇒ NewsIndicator1
Indicator for Newspaper.
-
#perishable ⇒ Perishable1
Is it perishable.
-
#priority_mail_indicator ⇒ PriorityMailIndicator1
Priority Mail Indicator.
-
#processing_category ⇒ ProcessingCategory1
Mail shape category.
-
#rate_type ⇒ RateType
Rate type describes mail class and mail shape combination.
-
#verification_location ⇒ VerificationLocation
Verified Location for BMEU or DMU for FAST appointment.
-
#zone_skipping_indicator ⇒ ZoneSkippingIndicator1
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, processing_category: SKIP, news_indicator: SKIP, priority_mail_indicator: SKIP, verification_location: SKIP, perishable: SKIP, mail_class: SKIP, rate_type: SKIP, additional_properties: nil) ⇒ UspsSummary1
constructor
A new instance of UspsSummary1.
-
#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(destination_discount_indicator: SKIP, zone_skipping_indicator: SKIP, processing_category: SKIP, news_indicator: SKIP, priority_mail_indicator: SKIP, verification_location: SKIP, perishable: SKIP, mail_class: SKIP, rate_type: SKIP, additional_properties: nil) ⇒ UspsSummary1
Returns a new instance of UspsSummary1.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/usps_api/models/usps_summary1.rb', line 90 def initialize(destination_discount_indicator: SKIP, zone_skipping_indicator: SKIP, processing_category: SKIP, news_indicator: SKIP, priority_mail_indicator: SKIP, verification_location: SKIP, perishable: SKIP, mail_class: SKIP, rate_type: 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 @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 @perishable = perishable unless perishable == SKIP @mail_class = mail_class unless mail_class == SKIP @rate_type = rate_type unless rate_type == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#destination_discount_indicator ⇒ DestinationDiscountIndicator1
Indicator whether this is dropship (NO) or origin entry (YES) appointment
14 15 16 |
# File 'lib/usps_api/models/usps_summary1.rb', line 14 def destination_discount_indicator @destination_discount_indicator end |
#mail_class ⇒ MailClass2
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
48 49 50 |
# File 'lib/usps_api/models/usps_summary1.rb', line 48 def mail_class @mail_class end |
#news_indicator ⇒ NewsIndicator1
Indicator for Newspaper
26 27 28 |
# File 'lib/usps_api/models/usps_summary1.rb', line 26 def news_indicator @news_indicator end |
#perishable ⇒ Perishable1
Is it perishable.
38 39 40 |
# File 'lib/usps_api/models/usps_summary1.rb', line 38 def perishable @perishable end |
#priority_mail_indicator ⇒ PriorityMailIndicator1
Priority Mail Indicator
30 31 32 |
# File 'lib/usps_api/models/usps_summary1.rb', line 30 def priority_mail_indicator @priority_mail_indicator end |
#processing_category ⇒ ProcessingCategory1
Mail shape category
22 23 24 |
# File 'lib/usps_api/models/usps_summary1.rb', line 22 def processing_category @processing_category end |
#rate_type ⇒ RateType
Rate type describes mail class and mail shape combination
52 53 54 |
# File 'lib/usps_api/models/usps_summary1.rb', line 52 def rate_type @rate_type end |
#verification_location ⇒ VerificationLocation
Verified Location for BMEU or DMU for FAST appointment
34 35 36 |
# File 'lib/usps_api/models/usps_summary1.rb', line 34 def verification_location @verification_location end |
#zone_skipping_indicator ⇒ ZoneSkippingIndicator1
Zone Skip in the Content of the appointment
18 19 20 |
# File 'lib/usps_api/models/usps_summary1.rb', line 18 def zone_skipping_indicator @zone_skipping_indicator end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/usps_api/models/usps_summary1.rb', line 115 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 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 perishable = hash.key?('perishable') ? hash['perishable'] : SKIP mail_class = hash.key?('mailClass') ? hash['mailClass'] : SKIP rate_type = hash.key?('rateType') ? hash['rateType'] : 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. UspsSummary1.new(destination_discount_indicator: destination_discount_indicator, zone_skipping_indicator: zone_skipping_indicator, processing_category: processing_category, news_indicator: news_indicator, priority_mail_indicator: priority_mail_indicator, verification_location: verification_location, perishable: perishable, mail_class: mail_class, rate_type: rate_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/usps_api/models/usps_summary1.rb', line 55 def self.names @_hash = {} if @_hash.nil? @_hash['destination_discount_indicator'] = 'destinationDiscountIndicator' @_hash['zone_skipping_indicator'] = 'zoneSkippingIndicator' @_hash['processing_category'] = 'processingCategory' @_hash['news_indicator'] = 'newsIndicator' @_hash['priority_mail_indicator'] = 'priorityMailIndicator' @_hash['verification_location'] = 'verificationLocation' @_hash['perishable'] = 'perishable' @_hash['mail_class'] = 'mailClass' @_hash['rate_type'] = 'rateType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
86 87 88 |
# File 'lib/usps_api/models/usps_summary1.rb', line 86 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/usps_api/models/usps_summary1.rb', line 71 def self.optionals %w[ destination_discount_indicator zone_skipping_indicator processing_category news_indicator priority_mail_indicator verification_location perishable mail_class rate_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/usps_api/models/usps_summary1.rb', line 166 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}, processing_category:"\ " #{@processing_category.inspect}, news_indicator: #{@news_indicator.inspect},"\ " priority_mail_indicator: #{@priority_mail_indicator.inspect}, verification_location:"\ " #{@verification_location.inspect}, perishable: #{@perishable.inspect}, mail_class:"\ " #{@mail_class.inspect}, rate_type: #{@rate_type.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
155 156 157 158 159 160 161 162 163 |
# File 'lib/usps_api/models/usps_summary1.rb', line 155 def to_s class_name = self.class.name.split('::').last "<#{class_name} destination_discount_indicator: #{@destination_discount_indicator},"\ " zone_skipping_indicator: #{@zone_skipping_indicator}, processing_category:"\ " #{@processing_category}, news_indicator: #{@news_indicator}, priority_mail_indicator:"\ " #{@priority_mail_indicator}, verification_location: #{@verification_location}, perishable:"\ " #{@perishable}, mail_class: #{@mail_class}, rate_type: #{@rate_type},"\ " additional_properties: #{@additional_properties}>" end |