Class: PaypalServerSdk::VaultedDigitalWalletShippingDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb

Overview

The shipping details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(name: SKIP, phone_number: SKIP, type: SKIP, address: SKIP) ⇒ VaultedDigitalWalletShippingDetails

Returns a new instance of VaultedDigitalWalletShippingDetails.



61
62
63
64
65
66
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 61

def initialize(name: SKIP, phone_number: SKIP, type: SKIP, address: SKIP)
  @name = name unless name == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @type = type unless type == SKIP
  @address = address unless address == SKIP
end

Instance Attribute Details

#addressAddress

The portable international postal address. Maps to [AddressValidationMetadata](github.com/googlei18n/libaddressinput/ wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls: the autocomplete attribute](www.w3.org/TR/html51/sec-forms.html#autofilling-form-co ntrols-the-autocomplete-attribute).

Returns:



34
35
36
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 34

def address
  @address
end

#nameShippingName

The name of the party.

Returns:



14
15
16
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 14

def name
  @name
end

#phone_numberPhoneNumberWithCountryCode

The phone number, in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).



19
20
21
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 19

def phone_number
  @phone_number
end

#typeFulfillmentType

A classification for the method of purchase fulfillment (e.g shipping, in-store pickup, etc). Either ‘type` or `options` may be present, but not both.

Returns:



25
26
27
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 25

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = ShippingName.from_hash(hash['name']) if hash['name']
  phone_number = PhoneNumberWithCountryCode.from_hash(hash['phone_number']) if
    hash['phone_number']
  type = hash.key?('type') ? hash['type'] : SKIP
  address = Address.from_hash(hash['address']) if hash['address']

  # Create object from extracted values.
  VaultedDigitalWalletShippingDetails.new(name: name,
                                          phone_number: phone_number,
                                          type: type,
                                          address: address)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['phone_number'] = 'phone_number'
  @_hash['type'] = 'type'
  @_hash['address'] = 'address'
  @_hash
end

.nullablesObject

An array for nullable fields



57
58
59
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 57

def self.nullables
  []
end

.optionalsObject

An array for optional fields



47
48
49
50
51
52
53
54
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 47

def self.optionals
  %w[
    name
    phone_number
    type
    address
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 94

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, phone_number: #{@phone_number.inspect}, type:"\
  " #{@type.inspect}, address: #{@address.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 87

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, phone_number: #{@phone_number}, type: #{@type}, address:"\
  " #{@address}>"
end