Class: ShellCardManagementApIs::AccountVelocityLimit

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/account_velocity_limit.rb

Overview

AccountVelocityLimit Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(type = SKIP, period = SKIP, limit = SKIP, accumulation = SKIP, balance = SKIP, override = SKIP, product_group = SKIP, threshold = SKIP) ⇒ AccountVelocityLimit

Returns a new instance of AccountVelocityLimit.



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 99

def initialize(type = SKIP, period = SKIP, limit = SKIP,
               accumulation = SKIP, balance = SKIP, override = SKIP,
               product_group = SKIP, threshold = SKIP)
  @type = type unless type == SKIP
  @period = period unless period == SKIP
  @limit = limit unless limit == SKIP
  @accumulation = accumulation unless accumulation == SKIP
  @balance = balance unless balance == SKIP
  @override = override unless override == SKIP
  @product_group = product_group unless product_group == SKIP
  @threshold = threshold unless threshold == SKIP
end

Instance Attribute Details

#accumulationFloat

The transaction accumulation during the current period with the correct number of digits after the decimal point according to the minor denomination of the currency of the card issuer (except for COUNT type velocity). Not present for PERTRX period. Example: 1100.55

Returns:

  • (Float)


35
36
37
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 35

def accumulation
  @accumulation
end

#balanceFloat

The remaining/available balance at this point in time with the correct number of digits after the decimal point according to the minor denomination of the currency of the card issuer (except for COUNT type velocity). Not present for PERTRX period. Example: 400.55

Returns:

  • (Float)


43
44
45
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 43

def balance
  @balance
end

#limitFloat

The limit associated with this velocity with the correct number of digits after the decimal point according to the minor denomination of the currency of the card issuer. Example: 1500.55

Returns:

  • (Float)


27
28
29
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 27

def limit
  @limit
end

#overrideTrueClass | FalseClass

Indicate if the limit is overridden or default. (false for default). Example: false

Returns:

  • (TrueClass | FalseClass)


48
49
50
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 48

def override
  @override
end

#periodString

Duration of the velocity or threshold alert. Possible Values: DAILY, WEEKLY, MONTHLY, ANNUAL, LIFETIME, PERTRX

Returns:

  • (String)


20
21
22
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 20

def period
  @period
end

#product_groupString

The reference group name for product differentiated velocities. This field cannot be used with Volume type velocity. Example: RoadSvc This is an optional output field.

Returns:

  • (String)


55
56
57
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 55

def product_group
  @product_group
end

#thresholdFloat

The limit to trigger an alert if the balance after a transaction reaches it or below. 0 indicates no alerts will be sent. Not present if not set (issuer value threshold limit applies if available). Not present for COUNT type velocity. Example: 50.55 This is an optional output field.

Returns:

  • (Float)


64
65
66
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 64

def threshold
  @threshold
end

#typeString

Type of velocity (COUNT type is not present for limits of PERTRX period Possible Values: VALUE, VOLUME, COUNT

Returns:

  • (String)


15
16
17
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 15

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 113

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('Type') ? hash['Type'] : SKIP
  period = hash.key?('Period') ? hash['Period'] : SKIP
  limit = hash.key?('Limit') ? hash['Limit'] : SKIP
  accumulation = hash.key?('Accumulation') ? hash['Accumulation'] : SKIP
  balance = hash.key?('Balance') ? hash['Balance'] : SKIP
  override = hash.key?('Override') ? hash['Override'] : SKIP
  product_group = hash.key?('ProductGroup') ? hash['ProductGroup'] : SKIP
  threshold = hash.key?('Threshold') ? hash['Threshold'] : SKIP

  # Create object from extracted values.
  AccountVelocityLimit.new(type,
                           period,
                           limit,
                           accumulation,
                           balance,
                           override,
                           product_group,
                           threshold)
end

.namesObject

A mapping from model property names to API property names.



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 67

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'Type'
  @_hash['period'] = 'Period'
  @_hash['limit'] = 'Limit'
  @_hash['accumulation'] = 'Accumulation'
  @_hash['balance'] = 'Balance'
  @_hash['override'] = 'Override'
  @_hash['product_group'] = 'ProductGroup'
  @_hash['threshold'] = 'Threshold'
  @_hash
end

.nullablesObject

An array for nullable fields



95
96
97
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 95

def self.nullables
  []
end

.optionalsObject

An array for optional fields



81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/shell_card_management_ap_is/models/account_velocity_limit.rb', line 81

def self.optionals
  %w[
    type
    period
    limit
    accumulation
    balance
    override
    product_group
    threshold
  ]
end