Class: FdxV660Api::TimeframeBasedLimitsForAPaymentNetwork3

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

Overview

The transfer limits for the current year

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(resets_on: SKIP, transfer_max_amount: SKIP, transfer_remaining_amount: SKIP, max_occurrence: SKIP, remaining_occurrence: SKIP, additional_properties: nil) ⇒ TimeframeBasedLimitsForAPaymentNetwork3

Returns a new instance of TimeframeBasedLimitsForAPaymentNetwork3.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 64

def initialize(resets_on: SKIP, transfer_max_amount: SKIP,
               transfer_remaining_amount: SKIP, max_occurrence: SKIP,
               remaining_occurrence: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @resets_on = resets_on unless resets_on == SKIP
  @transfer_max_amount = transfer_max_amount unless transfer_max_amount == SKIP
  unless transfer_remaining_amount == SKIP
    @transfer_remaining_amount =
      transfer_remaining_amount
  end
  @max_occurrence = max_occurrence unless max_occurrence == SKIP
  @remaining_occurrence = remaining_occurrence unless remaining_occurrence == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#max_occurrenceInteger

Maximum number of transfers that can be made in this direction for this timeframe

Returns:

  • (Integer)


30
31
32
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 30

def max_occurrence
  @max_occurrence
end

#remaining_occurrenceInteger

Remaining number of transfers that can be made in this direction for this timeframe

Returns:

  • (Integer)


35
36
37
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 35

def remaining_occurrence
  @remaining_occurrence
end

#resets_onDateTime

Date/time at which this timeframe will reset next

Returns:

  • (DateTime)


15
16
17
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 15

def resets_on
  @resets_on
end

#transfer_max_amountFloat

Maximum limit of funds that can be transferred to/from the account in this timeframe

Returns:

  • (Float)


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

def transfer_max_amount
  @transfer_max_amount
end

#transfer_remaining_amountFloat

Remaining value of the maximum limit of funds that can be transferred to/from the account in this timeframe

Returns:

  • (Float)


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

def transfer_remaining_amount
  @transfer_remaining_amount
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  resets_on = if hash.key?('resetsOn')
                (DateTimeHelper.from_rfc3339(hash['resetsOn']) if hash['resetsOn'])
              else
                SKIP
              end
  transfer_max_amount =
    hash.key?('transferMaxAmount') ? hash['transferMaxAmount'] : SKIP
  transfer_remaining_amount =
    hash.key?('transferRemainingAmount') ? hash['transferRemainingAmount'] : SKIP
  max_occurrence = hash.key?('maxOccurrence') ? hash['maxOccurrence'] : SKIP
  remaining_occurrence =
    hash.key?('remainingOccurrence') ? hash['remainingOccurrence'] : SKIP

  # 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.
  TimeframeBasedLimitsForAPaymentNetwork3.new(resets_on: resets_on,
                                              transfer_max_amount: transfer_max_amount,
                                              transfer_remaining_amount: transfer_remaining_amount,
                                              max_occurrence: max_occurrence,
                                              remaining_occurrence: remaining_occurrence,
                                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['resets_on'] = 'resetsOn'
  @_hash['transfer_max_amount'] = 'transferMaxAmount'
  @_hash['transfer_remaining_amount'] = 'transferRemainingAmount'
  @_hash['max_occurrence'] = 'maxOccurrence'
  @_hash['remaining_occurrence'] = 'remainingOccurrence'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 60

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 49

def self.optionals
  %w[
    resets_on
    transfer_max_amount
    transfer_remaining_amount
    max_occurrence
    remaining_occurrence
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



129
130
131
132
133
134
135
136
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 129

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} resets_on: #{@resets_on.inspect}, transfer_max_amount:"\
  " #{@transfer_max_amount.inspect}, transfer_remaining_amount:"\
  " #{@transfer_remaining_amount.inspect}, max_occurrence: #{@max_occurrence.inspect},"\
  " remaining_occurrence: #{@remaining_occurrence.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_resets_onObject



115
116
117
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 115

def to_custom_resets_on
  DateTimeHelper.to_rfc3339(resets_on)
end

#to_sObject

Provides a human-readable string representation of the object.



120
121
122
123
124
125
126
# File 'lib/fdx_v660_api/models/timeframe_based_limits_for_a_payment_network3.rb', line 120

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} resets_on: #{@resets_on}, transfer_max_amount: #{@transfer_max_amount},"\
  " transfer_remaining_amount: #{@transfer_remaining_amount}, max_occurrence:"\
  " #{@max_occurrence}, remaining_occurrence: #{@remaining_occurrence}, additional_properties:"\
  " #{@additional_properties}>"
end