Class: UspsApi::SubscriptionsNcoaChangeOfAddressDetailFields
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::SubscriptionsNcoaChangeOfAddressDetailFields
- Defined in:
- lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb
Overview
Shared attributes between internal and external requests.
Instance Attribute Summary collapse
-
#old_city ⇒ String
Original City.
-
#old_last_line ⇒ String
Original City Sate ZIP.
-
#old_state_abbrevation ⇒ String
The two-character state code.
-
#old_street_address ⇒ String
Originial Street Address.
-
#old_urbanization ⇒ String
Original Urbanization.
-
#old_zip_code ⇒ String
Original ZIP Codeu2122.
-
#old_zip_plus4 ⇒ String
Original ZIP Code Addon.
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(old_street_address: SKIP, old_last_line: SKIP, old_city: SKIP, old_state_abbrevation: SKIP, old_zip_code: SKIP, old_zip_plus4: SKIP, old_urbanization: SKIP) ⇒ SubscriptionsNcoaChangeOfAddressDetailFields
constructor
A new instance of SubscriptionsNcoaChangeOfAddressDetailFields.
-
#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(old_street_address: SKIP, old_last_line: SKIP, old_city: SKIP, old_state_abbrevation: SKIP, old_zip_code: SKIP, old_zip_plus4: SKIP, old_urbanization: SKIP) ⇒ SubscriptionsNcoaChangeOfAddressDetailFields
Returns a new instance of SubscriptionsNcoaChangeOfAddressDetailFields.
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 71 def initialize(old_street_address: SKIP, old_last_line: SKIP, old_city: SKIP, old_state_abbrevation: SKIP, old_zip_code: SKIP, old_zip_plus4: SKIP, old_urbanization: SKIP) @old_street_address = old_street_address unless old_street_address == SKIP @old_last_line = old_last_line unless old_last_line == SKIP @old_city = old_city unless old_city == SKIP @old_state_abbrevation = old_state_abbrevation unless old_state_abbrevation == SKIP @old_zip_code = old_zip_code unless old_zip_code == SKIP @old_zip_plus4 = old_zip_plus4 unless old_zip_plus4 == SKIP @old_urbanization = old_urbanization unless old_urbanization == SKIP end |
Instance Attribute Details
#old_city ⇒ String
Original City.
22 23 24 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 22 def old_city @old_city end |
#old_last_line ⇒ String
Original City Sate ZIP.
18 19 20 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 18 def old_last_line @old_last_line end |
#old_state_abbrevation ⇒ String
The two-character state code.
26 27 28 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 26 def old_state_abbrevation @old_state_abbrevation end |
#old_street_address ⇒ String
Originial Street Address.
14 15 16 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 14 def old_street_address @old_street_address end |
#old_urbanization ⇒ String
Original Urbanization.
38 39 40 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 38 def old_urbanization @old_urbanization end |
#old_zip_code ⇒ String
Original ZIP Codeu2122.
30 31 32 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 30 def old_zip_code @old_zip_code end |
#old_zip_plus4 ⇒ String
Original ZIP Code Addon.
34 35 36 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 34 def old_zip_plus4 @old_zip_plus4 end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 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/subscriptions_ncoa_change_of_address_detail_fields.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. old_street_address = hash.key?('oldStreetAddress') ? hash['oldStreetAddress'] : SKIP old_last_line = hash.key?('oldLastLine') ? hash['oldLastLine'] : SKIP old_city = hash.key?('oldCity') ? hash['oldCity'] : SKIP old_state_abbrevation = hash.key?('oldStateAbbrevation') ? hash['oldStateAbbrevation'] : SKIP old_zip_code = hash.key?('oldZIPCode') ? hash['oldZIPCode'] : SKIP old_zip_plus4 = hash.key?('oldZIPPlus4') ? hash['oldZIPPlus4'] : SKIP old_urbanization = hash.key?('oldUrbanization') ? hash['oldUrbanization'] : SKIP # Create object from extracted values. SubscriptionsNcoaChangeOfAddressDetailFields.new(old_street_address: old_street_address, old_last_line: old_last_line, old_city: old_city, old_state_abbrevation: old_state_abbrevation, old_zip_code: old_zip_code, old_zip_plus4: old_zip_plus4, old_urbanization: old_urbanization) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['old_street_address'] = 'oldStreetAddress' @_hash['old_last_line'] = 'oldLastLine' @_hash['old_city'] = 'oldCity' @_hash['old_state_abbrevation'] = 'oldStateAbbrevation' @_hash['old_zip_code'] = 'oldZIPCode' @_hash['old_zip_plus4'] = 'oldZIPPlus4' @_hash['old_urbanization'] = 'oldUrbanization' @_hash end |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 54 def self.optionals %w[ old_street_address old_last_line old_city old_state_abbrevation old_zip_code old_zip_plus4 old_urbanization ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 126 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} old_street_address: #{@old_street_address.inspect}, old_last_line:"\ " #{@old_last_line.inspect}, old_city: #{@old_city.inspect}, old_state_abbrevation:"\ " #{@old_state_abbrevation.inspect}, old_zip_code: #{@old_zip_code.inspect}, old_zip_plus4:"\ " #{@old_zip_plus4.inspect}, old_urbanization: #{@old_urbanization.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
111 112 113 114 115 116 117 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields.rb', line 111 def to_s class_name = self.class.name.split('::').last "<#{class_name} old_street_address: #{@old_street_address}, old_last_line:"\ " #{@old_last_line}, old_city: #{@old_city}, old_state_abbrevation:"\ " #{@old_state_abbrevation}, old_zip_code: #{@old_zip_code}, old_zip_plus4:"\ " #{@old_zip_plus4}, old_urbanization: #{@old_urbanization}>" end |