Class: PaypalServerSdk::CardResponseAddress
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::CardResponseAddress
- Defined in:
- lib/paypal_server_sdk/models/card_response_address.rb
Overview
Address request details.
Instance Attribute Summary collapse
-
#address_line_1 ⇒ String
The first line of the address, such as number and street, for example,
173 Drury Lane. -
#address_line_2 ⇒ String
The second line of the address, for example, a suite or apartment number.
-
#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 that identifies the country or region.
-
#id ⇒ String
The resource ID of the address.
-
#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:, address_line_1: SKIP, address_line_2: SKIP, admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP, id: SKIP) ⇒ CardResponseAddress
constructor
A new instance of CardResponseAddress.
-
#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:, address_line_1: SKIP, address_line_2: SKIP, admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP, id: SKIP) ⇒ CardResponseAddress
Returns a new instance of CardResponseAddress.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 83 def initialize(country_code:, address_line_1: SKIP, address_line_2: SKIP, admin_area_2: SKIP, admin_area_1: SKIP, postal_code: SKIP, id: SKIP) @address_line_1 = address_line_1 unless address_line_1 == SKIP @address_line_2 = address_line_2 unless address_line_2 == 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 @id = id unless id == SKIP end |
Instance Attribute Details
#address_line_1 ⇒ String
The first line of the address, such as number and street, for example,
173 Drury Lane. Needed for data entry, and Compliance and Risk checks.
This field needs to pass the full address.
16 17 18 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 16 def address_line_1 @address_line_1 end |
#address_line_2 ⇒ String
The second line of the address, for example, a suite or apartment number.
20 21 22 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 20 def address_line_2 @address_line_2 end |
#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.
32 33 34 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 32 def admin_area_1 @admin_area_1 end |
#admin_area_2 ⇒ String
A city, town, or village. Smaller than admin_area_level_1.
24 25 26 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 24 def admin_area_2 @admin_area_2 end |
#country_code ⇒ String
The 2-character ISO 3166-1
code 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.
47 48 49 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 47 def country_code @country_code end |
#id ⇒ String
The resource ID of the address.
51 52 53 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 51 def id @id 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.
38 39 40 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 38 def postal_code @postal_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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/paypal_server_sdk/models/card_response_address.rb', line 96 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country_code = hash.key?('country_code') ? hash['country_code'] : nil address_line_1 = hash.key?('address_line_1') ? hash['address_line_1'] : SKIP address_line_2 = hash.key?('address_line_2') ? hash['address_line_2'] : SKIP 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 id = hash.key?('id') ? hash['id'] : SKIP # Create object from extracted values. CardResponseAddress.new(country_code: country_code, address_line_1: address_line_1, address_line_2: address_line_2, admin_area_2: admin_area_2, admin_area_1: admin_area_1, postal_code: postal_code, id: id) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['address_line_1'] = 'address_line_1' @_hash['address_line_2'] = 'address_line_2' @_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['id'] = 'id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 79 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 67 def self.optionals %w[ address_line_1 address_line_2 admin_area_2 admin_area_1 postal_code id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 135 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 129 def inspect class_name = self.class.name.split('::').last "<#{class_name} address_line_1: #{@address_line_1.inspect}, address_line_2:"\ " #{@address_line_2.inspect}, admin_area_2: #{@admin_area_2.inspect}, admin_area_1:"\ " #{@admin_area_1.inspect}, postal_code: #{@postal_code.inspect}, country_code:"\ " #{@country_code.inspect}, id: #{@id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 |
# File 'lib/paypal_server_sdk/models/card_response_address.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} address_line_1: #{@address_line_1}, address_line_2: #{@address_line_2},"\ " admin_area_2: #{@admin_area_2}, admin_area_1: #{@admin_area_1}, postal_code:"\ " #{@postal_code}, country_code: #{@country_code}, id: #{@id}>" end |