Class: PaypalServerSdk::OrderUpdateCallbackShippingAddress
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::OrderUpdateCallbackShippingAddress
- Defined in:
- lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb
Overview
The portable international postal address. Maps to [AddressValidationMetadata](github.com/googlei18n/libaddressinput/wi ki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](www.w3.org/TR/html51/sec-forms.html#autofilling-form-cont rols-the-autocomplete-attribute).
Instance Attribute Summary collapse
-
#admin_area_1 ⇒ String
The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision.
-
#admin_area_2 ⇒ String
A city, town, or village.
-
#country_code ⇒ String
The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.
-
#postal_code ⇒ String
The postal code, which is the ZIP code or equivalent.
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(country_code:, admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP) ⇒ OrderUpdateCallbackShippingAddress
constructor
A new instance of OrderUpdateCallbackShippingAddress.
-
#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(country_code:, admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP) ⇒ OrderUpdateCallbackShippingAddress
Returns a new instance of OrderUpdateCallbackShippingAddress.
67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 67 def initialize(country_code:, admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP) @admin_area_2 = admin_area_2 unless admin_area_2 == SKIP @admin_area_1 = admin_area_1 unless admin_area_1 == SKIP @postal_code = postal_code unless postal_code == SKIP @country_code = country_code end |
Instance Attribute Details
#admin_area_1 ⇒ String
The highest-level sub-division in a country, which is usually a province, state, or ISO-3166-2 subdivision. This data is formatted for postal delivery, for example, ‘CA` and not `California`. Value, by country, is: UK. A county. US. A state. Canada. A province. Japan. A prefecture. Switzerland. A kanton.
27 28 29 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 27 def admin_area_1 @admin_area_1 end |
#admin_area_2 ⇒ String
A city, town, or village. Smaller than ‘admin_area_level_1`.
19 20 21 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 19 def admin_area_2 @admin_area_2 end |
#country_code ⇒ String
The [2-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the ‘C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
41 42 43 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 41 def country_code @country_code end |
#postal_code ⇒ String
The postal code, which is the ZIP code or equivalent. Typically required for countries with a postal code or an equivalent. See [postal code](en.wikipedia.org/wiki/Postal_code).
33 34 35 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 33 def postal_code @postal_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country_code = hash.key?('country_code') ? hash['country_code'] : nil admin_area_2 = hash.key?('admin_area_2') ? hash['admin_area_2'] : SKIP admin_area_1 = hash.key?('admin_area_1') ? hash['admin_area_1'] : SKIP postal_code = hash.key?('postal_code') ? hash['postal_code'] : SKIP # Create object from extracted values. OrderUpdateCallbackShippingAddress.new(country_code: country_code, admin_area_2: admin_area_2, admin_area_1: admin_area_1, postal_code: postal_code) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['admin_area_2'] = 'admin_area_2' @_hash['admin_area_1'] = 'admin_area_1' @_hash['postal_code'] = 'postal_code' @_hash['country_code'] = 'country_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 54 def self.optionals %w[ admin_area_2 admin_area_1 postal_code ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
100 101 102 103 104 105 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 100 def inspect class_name = self.class.name.split('::').last "<#{class_name} admin_area_2: #{@admin_area_2.inspect}, admin_area_1:"\ " #{@admin_area_1.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\ " #{@country_code.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
93 94 95 96 97 |
# File 'lib/paypal_server_sdk/models/order_update_callback_shipping_address.rb', line 93 def to_s class_name = self.class.name.split('::').last "<#{class_name} admin_area_2: #{@admin_area_2}, admin_area_1: #{@admin_area_1},"\ " postal_code: #{@postal_code}, country_code: #{@country_code}>" end |