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

#to_hash, #to_json

Constructor Details

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

Returns a new instance of VaultedDigitalWalletShippingDetails.



54
55
56
57
58
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 54

def initialize(name: SKIP, type: SKIP, address: SKIP)
  @name = name unless name == 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:



29
30
31
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 29

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

#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:



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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = ShippingName.from_hash(hash['name']) if hash['name']
  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,
                                          type: type,
                                          address: address)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 32

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

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
# File 'lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb', line 41

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