Class: FdxV660Api::AccountPaymentNetworks

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

Overview

An array of payment networks supported by the account. If array contains ACCOUNT_NUMBER identifiers which are not masked this is sensitive data which should only be exchanged if encrypted. For detailed information on implementing encryption see the FDX CSDF API Security Model document's "Part 2 FDX Message Encryption" in the Security folder of the latest FDX Release download

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) ⇒ AccountPaymentNetworks

Returns a new instance of AccountPaymentNetworks.



54
55
56
57
58
59
60
61
62
63
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 54

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:



25
26
27
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 25

def links
  @links
end

#pagePageMetadata5

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

Returns:



20
21
22
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 20

def page
  @page
end

#payment_networksArray[AccountPaymentNetwork]

Array of payment networks

Returns:



29
30
31
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 29

def payment_networks
  @payment_networks
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
94
95
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 66

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.
  AccountPaymentNetworks.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.



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

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



50
51
52
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



105
106
107
108
109
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 105

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.



98
99
100
101
102
# File 'lib/fdx_v660_api/models/account_payment_networks.rb', line 98

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