Class: PaypalServerSdk::CustomerVaultPaymentTokensResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::CustomerVaultPaymentTokensResponse
- Defined in:
- lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb
Overview
Collection of payment tokens saved for a given customer.
Instance Attribute Summary collapse
-
#customer ⇒ CustomerRequest
Customer in merchant’s or partner’s system of records.
-
#links ⇒ Array[LinkDescription]
An array of related [HATEOAS links](/api/rest/responses/#hateoas).
-
#payment_tokens ⇒ Array[PaymentTokenResponse]
Customer in merchant’s or partner’s system of records.
-
#total_items ⇒ Integer
Total number of items.
-
#total_pages ⇒ Integer
Total number of pages.
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(total_items: SKIP, total_pages: SKIP, customer: SKIP, payment_tokens: SKIP, links: SKIP) ⇒ CustomerVaultPaymentTokensResponse
constructor
A new instance of CustomerVaultPaymentTokensResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(total_items: SKIP, total_pages: SKIP, customer: SKIP, payment_tokens: SKIP, links: SKIP) ⇒ CustomerVaultPaymentTokensResponse
Returns a new instance of CustomerVaultPaymentTokensResponse.
59 60 61 62 63 64 65 66 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 59 def initialize(total_items: SKIP, total_pages: SKIP, customer: SKIP, payment_tokens: SKIP, links: SKIP) @total_items = total_items unless total_items == SKIP @total_pages = total_pages unless total_pages == SKIP @customer = customer unless customer == SKIP @payment_tokens = payment_tokens unless payment_tokens == SKIP @links = links unless links == SKIP end |
Instance Attribute Details
#customer ⇒ CustomerRequest
Customer in merchant’s or partner’s system of records.
22 23 24 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 22 def customer @customer end |
#links ⇒ Array[LinkDescription]
An array of related [HATEOAS links](/api/rest/responses/#hateoas).
30 31 32 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 30 def links @links end |
#payment_tokens ⇒ Array[PaymentTokenResponse]
Customer in merchant’s or partner’s system of records.
26 27 28 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 26 def payment_tokens @payment_tokens end |
#total_items ⇒ Integer
Total number of items.
14 15 16 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 14 def total_items @total_items end |
#total_pages ⇒ Integer
Total number of pages.
18 19 20 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 18 def total_pages @total_pages 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. total_items = hash.key?('total_items') ? hash['total_items'] : SKIP total_pages = hash.key?('total_pages') ? hash['total_pages'] : SKIP customer = CustomerRequest.from_hash(hash['customer']) if hash['customer'] # Parameter is an array, so we need to iterate through it payment_tokens = nil unless hash['payment_tokens'].nil? payment_tokens = [] hash['payment_tokens'].each do |structure| payment_tokens << (PaymentTokenResponse.from_hash(structure) if structure) end end payment_tokens = SKIP unless hash.key?('payment_tokens') # 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') # Create object from extracted values. CustomerVaultPaymentTokensResponse.new(total_items: total_items, total_pages: total_pages, customer: customer, payment_tokens: payment_tokens, links: links) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['total_items'] = 'total_items' @_hash['total_pages'] = 'total_pages' @_hash['customer'] = 'customer' @_hash['payment_tokens'] = 'payment_tokens' @_hash['links'] = 'links' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/paypal_server_sdk/models/customer_vault_payment_tokens_response.rb', line 44 def self.optionals %w[ total_items total_pages customer payment_tokens links ] end |