Class: FdxV660Api::AccountPaymentNetworks1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/account_payment_networks1.rb

Overview

Represents what the encrypted JSON payload would be in a response containing sensitive data (ACCOUNT_NUMBER identifiers). Data Provider could return this as an unencrypted response when it contains only non-sensitive data (such as TOKENIZED_ACCOUNT_NUMBER identifiers)

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(page: SKIP, links: SKIP, payment_networks: SKIP, additional_properties: nil) ⇒ AccountPaymentNetworks1

Returns a new instance of AccountPaymentNetworks1.



52
53
54
55
56
57
58
59
60
61
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 52

def initialize(page: SKIP, links: SKIP, payment_networks: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @page = page unless page == SKIP
  @links = links unless links == SKIP
  @payment_networks = payment_networks unless payment_networks == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

Resource URLs for navigating result sets. Pagination for /accounts/{accountId}/payment-network is deprecated in v6.5

Returns:



23
24
25
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 23

def links
  @links
end

#pagePageMetadata5

Page keys for navigating result sets. Pagination for /accounts/{accountId}/payment-network is deprecated in v6.5

Returns:



18
19
20
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 18

def page
  @page
end

#payment_networksArray[AccountPaymentNetwork]

Array of payment networks

Returns:



27
28
29
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 27

def payment_networks
  @payment_networks
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
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
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  page = PageMetadata5.from_hash(hash['page']) if hash['page']
  links = PageMetadataLinks4.from_hash(hash['links']) if hash['links']
  # Parameter is an array, so we need to iterate through it
  payment_networks = nil
  unless hash['paymentNetworks'].nil?
    payment_networks = []
    hash['paymentNetworks'].each do |structure|
      payment_networks << (AccountPaymentNetwork.from_hash(structure) if structure)
    end
  end

  payment_networks = SKIP unless hash.key?('paymentNetworks')

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  AccountPaymentNetworks1.new(page: page,
                              links: links,
                              payment_networks: payment_networks,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['page'] = 'page'
  @_hash['links'] = 'links'
  @_hash['payment_networks'] = 'paymentNetworks'
  @_hash
end

.nullablesObject

An array for nullable fields



48
49
50
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 48

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 39

def self.optionals
  %w[
    page
    links
    payment_networks
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



103
104
105
106
107
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 103

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} page: #{@page.inspect}, links: #{@links.inspect}, payment_networks:"\
  " #{@payment_networks.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



96
97
98
99
100
# File 'lib/fdx_v660_api/models/account_payment_networks1.rb', line 96

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} page: #{@page}, links: #{@links}, payment_networks: #{@payment_networks},"\
  " additional_properties: #{@additional_properties}>"
end