Class: ShellCardManagementApIs::SummaryResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::SummaryResponse
- Defined in:
- lib/shell_card_management_ap_is/models/summary_response.rb
Overview
Encapsulates the details of a Summary response.
Instance Attribute Summary collapse
-
#active_cards ⇒ Integer
Total number of active cards for the given search criteria.
-
#blocked_cards ⇒ Integer
Total number of cards for the given search criteria that are permanently blocked (Blocked).
-
#cancelled_cards ⇒ Integer
Total number of cards for the given search criteria that are cancelled (at cancelled status) blocked by customer.
-
#expired_cards ⇒ Integer
Total number of expired cards for the given search criteria.
-
#expiring_cards ⇒ Integer
Cards that are active and expiring in X days, X should be configurable.
-
#fraud_cards ⇒ Integer
Totalnumber of Cards in Fraud status for the given search criteria.
-
#new_cards ⇒ Integer
Total number of cards in New status for the given search criteria.
-
#renewal_pending_cards ⇒ Integer
Total number of Renewal Pending cards for the given search criteria.
-
#replaced_cards ⇒ Integer
Cards with status Replaced.
-
#temporary_block_by_customer ⇒ Integer
Total number of cards for the given search criteria that are temporarily blocked by customer.
-
#temporary_block_by_shell ⇒ Integer
Total number of cards for the given search criteria that are temporarily blocked by Shell.
-
#total_cards ⇒ Integer
Total number of cards for the given search criteria.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(active_cards = SKIP, blocked_cards = SKIP, cancelled_cards = SKIP, expired_cards = SKIP, expiring_cards = SKIP, fraud_cards = SKIP, new_cards = SKIP, renewal_pending_cards = SKIP, replaced_cards = SKIP, temporary_block_by_customer = SKIP, temporary_block_by_shell = SKIP, total_cards = SKIP) ⇒ SummaryResponse
constructor
A new instance of SummaryResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(active_cards = SKIP, blocked_cards = SKIP, cancelled_cards = SKIP, expired_cards = SKIP, expiring_cards = SKIP, fraud_cards = SKIP, new_cards = SKIP, renewal_pending_cards = SKIP, replaced_cards = SKIP, temporary_block_by_customer = SKIP, temporary_block_by_shell = SKIP, total_cards = SKIP) ⇒ SummaryResponse
Returns a new instance of SummaryResponse.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 118 def initialize(active_cards = SKIP, blocked_cards = SKIP, cancelled_cards = SKIP, expired_cards = SKIP, expiring_cards = SKIP, fraud_cards = SKIP, new_cards = SKIP, renewal_pending_cards = SKIP, replaced_cards = SKIP, temporary_block_by_customer = SKIP, temporary_block_by_shell = SKIP, total_cards = SKIP) @active_cards = active_cards unless active_cards == SKIP @blocked_cards = blocked_cards unless blocked_cards == SKIP @cancelled_cards = cancelled_cards unless cancelled_cards == SKIP @expired_cards = expired_cards unless expired_cards == SKIP @expiring_cards = expiring_cards unless expiring_cards == SKIP @fraud_cards = fraud_cards unless fraud_cards == SKIP @new_cards = new_cards unless new_cards == SKIP @renewal_pending_cards = renewal_pending_cards unless renewal_pending_cards == SKIP @replaced_cards = replaced_cards unless replaced_cards == SKIP unless temporary_block_by_customer == SKIP @temporary_block_by_customer = temporary_block_by_customer end @temporary_block_by_shell = temporary_block_by_shell unless temporary_block_by_shell == SKIP @total_cards = total_cards unless total_cards == SKIP end |
Instance Attribute Details
#active_cards ⇒ Integer
Total number of active cards for the given search criteria
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 14 def active_cards @active_cards end |
#blocked_cards ⇒ Integer
Total number of cards for the given search criteria that are permanently blocked (Blocked)
19 20 21 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 19 def blocked_cards @blocked_cards end |
#cancelled_cards ⇒ Integer
Total number of cards for the given search criteria that are cancelled (at cancelled status) blocked by customer
24 25 26 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 24 def cancelled_cards @cancelled_cards end |
#expired_cards ⇒ Integer
Total number of expired cards for the given search criteria
28 29 30 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 28 def expired_cards @expired_cards end |
#expiring_cards ⇒ Integer
Cards that are active and expiring in X days, X should be configurable
32 33 34 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 32 def expiring_cards @expiring_cards end |
#fraud_cards ⇒ Integer
Totalnumber of Cards in Fraud status for the given search criteria.
36 37 38 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 36 def fraud_cards @fraud_cards end |
#new_cards ⇒ Integer
Total number of cards in New status for the given search criteria.
40 41 42 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 40 def new_cards @new_cards end |
#renewal_pending_cards ⇒ Integer
Total number of Renewal Pending cards for the given search criteria
44 45 46 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 44 def renewal_pending_cards @renewal_pending_cards end |
#replaced_cards ⇒ Integer
Cards with status Replaced
48 49 50 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 48 def replaced_cards @replaced_cards end |
#temporary_block_by_customer ⇒ Integer
Total number of cards for the given search criteria that are temporarily blocked by customer
53 54 55 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 53 def temporary_block_by_customer @temporary_block_by_customer end |
#temporary_block_by_shell ⇒ Integer
Total number of cards for the given search criteria that are temporarily blocked by Shell
58 59 60 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 58 def temporary_block_by_shell @temporary_block_by_shell end |
#total_cards ⇒ Integer
Total number of cards for the given search criteria
62 63 64 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 62 def total_cards @total_cards end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 142 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. active_cards = hash.key?('ActiveCards') ? hash['ActiveCards'] : SKIP blocked_cards = hash.key?('BlockedCards') ? hash['BlockedCards'] : SKIP cancelled_cards = hash.key?('CancelledCards') ? hash['CancelledCards'] : SKIP expired_cards = hash.key?('ExpiredCards') ? hash['ExpiredCards'] : SKIP expiring_cards = hash.key?('ExpiringCards') ? hash['ExpiringCards'] : SKIP fraud_cards = hash.key?('FraudCards') ? hash['FraudCards'] : SKIP new_cards = hash.key?('NewCards') ? hash['NewCards'] : SKIP renewal_pending_cards = hash.key?('RenewalPendingCards') ? hash['RenewalPendingCards'] : SKIP replaced_cards = hash.key?('ReplacedCards') ? hash['ReplacedCards'] : SKIP temporary_block_by_customer = hash.key?('TemporaryBlockByCustomer') ? hash['TemporaryBlockByCustomer'] : SKIP temporary_block_by_shell = hash.key?('TemporaryBlockByShell') ? hash['TemporaryBlockByShell'] : SKIP total_cards = hash.key?('TotalCards') ? hash['TotalCards'] : SKIP # Create object from extracted values. SummaryResponse.new(active_cards, blocked_cards, cancelled_cards, expired_cards, expiring_cards, fraud_cards, new_cards, renewal_pending_cards, replaced_cards, temporary_block_by_customer, temporary_block_by_shell, total_cards) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['active_cards'] = 'ActiveCards' @_hash['blocked_cards'] = 'BlockedCards' @_hash['cancelled_cards'] = 'CancelledCards' @_hash['expired_cards'] = 'ExpiredCards' @_hash['expiring_cards'] = 'ExpiringCards' @_hash['fraud_cards'] = 'FraudCards' @_hash['new_cards'] = 'NewCards' @_hash['renewal_pending_cards'] = 'RenewalPendingCards' @_hash['replaced_cards'] = 'ReplacedCards' @_hash['temporary_block_by_customer'] = 'TemporaryBlockByCustomer' @_hash['temporary_block_by_shell'] = 'TemporaryBlockByShell' @_hash['total_cards'] = 'TotalCards' @_hash end |
.nullables ⇒ Object
An array for nullable fields
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 101 def self.nullables %w[ active_cards blocked_cards cancelled_cards expired_cards expiring_cards fraud_cards new_cards renewal_pending_cards replaced_cards temporary_block_by_customer temporary_block_by_shell total_cards ] end |
.optionals ⇒ Object
An array for optional fields
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/shell_card_management_ap_is/models/summary_response.rb', line 83 def self.optionals %w[ active_cards blocked_cards cancelled_cards expired_cards expiring_cards fraud_cards new_cards renewal_pending_cards replaced_cards temporary_block_by_customer temporary_block_by_shell total_cards ] end |