Class: FdxV660Api::TimeAndOccurrenceBasedTransferLimits3

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

Overview

Limits for outgoing transfers from the account

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(day: SKIP, week: SKIP, month: SKIP, year: SKIP, transaction: SKIP, additional_properties: nil) ⇒ TimeAndOccurrenceBasedTransferLimits3

Returns a new instance of TimeAndOccurrenceBasedTransferLimits3.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 59

def initialize(day: SKIP, week: SKIP, month: SKIP, year: SKIP,
               transaction: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @day = day unless day == SKIP
  @week = week unless week == SKIP
  @month = month unless month == SKIP
  @year = year unless year == SKIP
  @transaction = transaction unless transaction == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#dayTimeframeBasedLimitsForAPaymentNetwork5

The transfer limits for the current day



14
15
16
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 14

def day
  @day
end

#monthTimeframeBasedLimitsForAPaymentNetwork2

The transfer limits for the current month



22
23
24
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 22

def month
  @month
end

#transactionOccurrenceBasedLimitsForAPaymentNetwork2

The transfer limits taking effect from all the timeframe limits



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

def transaction
  @transaction
end

#weekTimeframeBasedLimitsForAPaymentNetwork1

The transfer limits for the current week



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

def week
  @week
end

#yearTimeframeBasedLimitsForAPaymentNetwork3

The transfer limits for the current year



26
27
28
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 26

def year
  @year
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  day = TimeframeBasedLimitsForAPaymentNetwork5.from_hash(hash['day']) if hash['day']
  week = TimeframeBasedLimitsForAPaymentNetwork1.from_hash(hash['week']) if hash['week']
  month = TimeframeBasedLimitsForAPaymentNetwork2.from_hash(hash['month']) if hash['month']
  year = TimeframeBasedLimitsForAPaymentNetwork3.from_hash(hash['year']) if hash['year']
  transaction = OccurrenceBasedLimitsForAPaymentNetwork2.from_hash(hash['transaction']) if
    hash['transaction']

  # 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.
  TimeAndOccurrenceBasedTransferLimits3.new(day: day,
                                            week: week,
                                            month: month,
                                            year: year,
                                            transaction: transaction,
                                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['day'] = 'day'
  @_hash['week'] = 'week'
  @_hash['month'] = 'month'
  @_hash['year'] = 'year'
  @_hash['transaction'] = 'transaction'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 44

def self.optionals
  %w[
    day
    week
    month
    year
    transaction
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
113
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 108

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} day: #{@day.inspect}, week: #{@week.inspect}, month: #{@month.inspect},"\
  " year: #{@year.inspect}, transaction: #{@transaction.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
# File 'lib/fdx_v660_api/models/time_and_occurrence_based_transfer_limits3.rb', line 101

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} day: #{@day}, week: #{@week}, month: #{@month}, year: #{@year},"\
  " transaction: #{@transaction}, additional_properties: #{@additional_properties}>"
end