Class: PaypalServerSdk::PaypalWalletVaultResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::PaypalWalletVaultResponse
- Defined in:
- lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb
Overview
The details about a saved PayPal Wallet payment source.
Instance Attribute Summary collapse
-
#customer ⇒ PaypalWalletCustomer
The details about a customer in PayPal’s system of record.
-
#id ⇒ String
The PayPal-generated ID for the saved payment source.
-
#links ⇒ Array[LinkDescription]
An array of request-related HATEOAS links.
-
#status ⇒ PaypalWalletVaultStatus
The vault status.
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(id: SKIP, status: SKIP, links: SKIP, customer: SKIP) ⇒ PaypalWalletVaultResponse
constructor
A new instance of PaypalWalletVaultResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id: SKIP, status: SKIP, links: SKIP, customer: SKIP) ⇒ PaypalWalletVaultResponse
Returns a new instance of PaypalWalletVaultResponse.
53 54 55 56 57 58 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 53 def initialize(id: SKIP, status: SKIP, links: SKIP, customer: SKIP) @id = id unless id == SKIP @status = status unless status == SKIP @links = links unless links == SKIP @customer = customer unless customer == SKIP end |
Instance Attribute Details
#customer ⇒ PaypalWalletCustomer
The details about a customer in PayPal’s system of record.
26 27 28 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 26 def customer @customer end |
#id ⇒ String
The PayPal-generated ID for the saved payment source.
14 15 16 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 14 def id @id end |
#links ⇒ Array[LinkDescription]
An array of request-related HATEOAS links.
22 23 24 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 22 def links @links end |
#status ⇒ PaypalWalletVaultStatus
The vault status.
18 19 20 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 18 def status @status 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 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP # Parameter is an array, so we need to iterate through it links = nil unless hash['links'].nil? links = [] hash['links'].each do |structure| links << (LinkDescription.from_hash(structure) if structure) end end links = SKIP unless hash.key?('links') customer = PaypalWalletCustomer.from_hash(hash['customer']) if hash['customer'] # Create object from extracted values. PaypalWalletVaultResponse.new(id: id, status: status, links: links, customer: customer) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['status'] = 'status' @_hash['links'] = 'links' @_hash['customer'] = 'customer' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/paypal_server_sdk/models/paypal_wallet_vault_response.rb', line 39 def self.optionals %w[ id status links customer ] end |