Class: UspsApi::SubscriptionsNcoaChangeOfAddressDetailFields1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- UspsApi::SubscriptionsNcoaChangeOfAddressDetailFields1
- Defined in:
- lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb
Overview
Shared attributes between internal and external requests.
Instance Attribute Summary collapse
-
#move_effective_date ⇒ Date
Date move is created.
-
#new_city ⇒ String
New City.
-
#new_last_line ⇒ String
New City State ZIP.
-
#new_state_abbrevation ⇒ String
The two-character state code.
-
#new_street_address ⇒ String
New Street Address.
-
#new_urbanization ⇒ String
New Urbanization.
-
#new_zip_code ⇒ String
New ZIP Codeu2122.
-
#new_zip_plus4 ⇒ String
New ZIP 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(new_street_address: SKIP, new_last_line: SKIP, new_city: SKIP, new_state_abbrevation: SKIP, new_zip_code: SKIP, move_effective_date: SKIP, new_zip_plus4: SKIP, new_urbanization: SKIP) ⇒ SubscriptionsNcoaChangeOfAddressDetailFields1
constructor
A new instance of SubscriptionsNcoaChangeOfAddressDetailFields1.
-
#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(new_street_address: SKIP, new_last_line: SKIP, new_city: SKIP, new_state_abbrevation: SKIP, new_zip_code: SKIP, move_effective_date: SKIP, new_zip_plus4: SKIP, new_urbanization: SKIP) ⇒ SubscriptionsNcoaChangeOfAddressDetailFields1
Returns a new instance of SubscriptionsNcoaChangeOfAddressDetailFields1.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 77 def initialize(new_street_address: SKIP, new_last_line: SKIP, new_city: SKIP, new_state_abbrevation: SKIP, new_zip_code: SKIP, move_effective_date: SKIP, new_zip_plus4: SKIP, new_urbanization: SKIP) @new_street_address = new_street_address unless new_street_address == SKIP @new_last_line = new_last_line unless new_last_line == SKIP @new_city = new_city unless new_city == SKIP @new_state_abbrevation = new_state_abbrevation unless new_state_abbrevation == SKIP @new_zip_code = new_zip_code unless new_zip_code == SKIP @move_effective_date = move_effective_date unless move_effective_date == SKIP @new_zip_plus4 = new_zip_plus4 unless new_zip_plus4 == SKIP @new_urbanization = new_urbanization unless new_urbanization == SKIP end |
Instance Attribute Details
#move_effective_date ⇒ Date
Date move is created.
34 35 36 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 34 def move_effective_date @move_effective_date end |
#new_city ⇒ String
New City.
22 23 24 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 22 def new_city @new_city end |
#new_last_line ⇒ String
New City State ZIP.
18 19 20 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 18 def new_last_line @new_last_line end |
#new_state_abbrevation ⇒ String
The two-character state code.
26 27 28 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 26 def new_state_abbrevation @new_state_abbrevation end |
#new_street_address ⇒ String
New Street Address.
14 15 16 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 14 def new_street_address @new_street_address end |
#new_urbanization ⇒ String
New Urbanization.
42 43 44 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 42 def new_urbanization @new_urbanization end |
#new_zip_code ⇒ String
New ZIP Codeu2122.
30 31 32 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 30 def new_zip_code @new_zip_code end |
#new_zip_plus4 ⇒ String
New ZIP Addon.
38 39 40 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 38 def new_zip_plus4 @new_zip_plus4 end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. new_street_address = hash.key?('newStreetAddress') ? hash['newStreetAddress'] : SKIP new_last_line = hash.key?('newLastLine') ? hash['newLastLine'] : SKIP new_city = hash.key?('newCity') ? hash['newCity'] : SKIP new_state_abbrevation = hash.key?('newStateAbbrevation') ? hash['newStateAbbrevation'] : SKIP new_zip_code = hash.key?('newZIPCode') ? hash['newZIPCode'] : SKIP move_effective_date = hash.key?('moveEffectiveDate') ? hash['moveEffectiveDate'] : SKIP new_zip_plus4 = hash.key?('newZIPPlus4') ? hash['newZIPPlus4'] : SKIP new_urbanization = hash.key?('newUrbanization') ? hash['newUrbanization'] : SKIP # Create object from extracted values. SubscriptionsNcoaChangeOfAddressDetailFields1.new(new_street_address: new_street_address, new_last_line: new_last_line, new_city: new_city, new_state_abbrevation: new_state_abbrevation, new_zip_code: new_zip_code, move_effective_date: move_effective_date, new_zip_plus4: new_zip_plus4, new_urbanization: new_urbanization) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['new_street_address'] = 'newStreetAddress' @_hash['new_last_line'] = 'newLastLine' @_hash['new_city'] = 'newCity' @_hash['new_state_abbrevation'] = 'newStateAbbrevation' @_hash['new_zip_code'] = 'newZIPCode' @_hash['move_effective_date'] = 'moveEffectiveDate' @_hash['new_zip_plus4'] = 'newZIPPlus4' @_hash['new_urbanization'] = 'newUrbanization' @_hash end |
.nullables ⇒ Object
An array for nullable fields
73 74 75 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 73 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 59 def self.optionals %w[ new_street_address new_last_line new_city new_state_abbrevation new_zip_code move_effective_date new_zip_plus4 new_urbanization ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
131 132 133 134 135 136 137 138 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 131 def inspect class_name = self.class.name.split('::').last "<#{class_name} new_street_address: #{@new_street_address.inspect}, new_last_line:"\ " #{@new_last_line.inspect}, new_city: #{@new_city.inspect}, new_state_abbrevation:"\ " #{@new_state_abbrevation.inspect}, new_zip_code: #{@new_zip_code.inspect},"\ " move_effective_date: #{@move_effective_date.inspect}, new_zip_plus4:"\ " #{@new_zip_plus4.inspect}, new_urbanization: #{@new_urbanization.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 127 128 |
# File 'lib/usps_api/models/subscriptions_ncoa_change_of_address_detail_fields1.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} new_street_address: #{@new_street_address}, new_last_line:"\ " #{@new_last_line}, new_city: #{@new_city}, new_state_abbrevation:"\ " #{@new_state_abbrevation}, new_zip_code: #{@new_zip_code}, move_effective_date:"\ " #{@move_effective_date}, new_zip_plus4: #{@new_zip_plus4}, new_urbanization:"\ " #{@new_urbanization}>" end |