Class: ShellCardManagementApIs::CardManagementV1UpdatestatusRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CardManagementV1UpdatestatusRequest
- Defined in:
- lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb
Overview
CardManagementV1UpdatestatusRequest Model.
Instance Attribute Summary collapse
-
#cards ⇒ Array[UpdateCard]
List of UpdateCardRequest entity.
-
#reason_id ⇒ Integer
Reason id for updating the card status.<br /> Optional<br /> Either Reason ID or Text is madatory when TargetStatus is ‘Block’ or ‘Damaged’.
-
#reason_text ⇒ String
Reason text for updating the card status.<br /> Optional Either Reason ID or Text is madatory when TargetStatus is ‘Block’ or ‘Damaged’.
-
#target_status ⇒ String
The list of cards passed in Cards parameter will be updated to this status.<br /> Mandatory<br /> Allowed values:<br /> -TemporaryBlock<br /> -Unblock<br /> -Block<br /> -Damaged<br />.
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(cards = nil, target_status = nil, reason_id = SKIP, reason_text = SKIP) ⇒ CardManagementV1UpdatestatusRequest
constructor
A new instance of CardManagementV1UpdatestatusRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(cards = nil, target_status = nil, reason_id = SKIP, reason_text = SKIP) ⇒ CardManagementV1UpdatestatusRequest
Returns a new instance of CardManagementV1UpdatestatusRequest.
88 89 90 91 92 93 94 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 88 def initialize(cards = nil, target_status = nil, reason_id = SKIP, reason_text = SKIP) @cards = cards @reason_id = reason_id unless reason_id == SKIP @reason_text = reason_text unless reason_text == SKIP @target_status = target_status end |
Instance Attribute Details
#cards ⇒ Array[UpdateCard]
List of UpdateCardRequest entity. Each card in the list will be updated to the given target status. The details of the entity are given below.
15 16 17 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 15 def cards @cards end |
#reason_id ⇒ Integer
Reason id for updating the card status.<br /> Optional<br /> Either Reason ID or Text is madatory when TargetStatus is ‘Block’ or ‘Damaged’. Else ignored.<br /> Possible values:<br /> -Lost <br /> -Stolen <br /> -Card no longer required<br /> When passed, the reason Id will be validated with the allowed reason ids configured for the card type of the card.<br /> . If the given reason Id is not allowed for certain card types, then the request will be rejected as invalid ResonId.
30 31 32 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 30 def reason_id @reason_id end |
#reason_text ⇒ String
Reason text for updating the card status.<br /> Optional Either Reason ID or Text is madatory when TargetStatus is ‘Block’ or ‘Damaged’. Else ignored.<br /> Possible values:<br /> -Lost <br /> -Stolen <br /> -Card no longer required <br />
Optional – However, either Reason ID or Text is madatory when
TargetStatus is ‘Block’ or ‘Damaged’.<br />
When Reason Text is passed and the Target Status is either Block or
Damaged, the text will be validated with the allowed list of values configured for the card type of the card.<br />
If the text is not allowed, request will be rejected as invaid
ResonText.<br />
Note:<br />
Customer blocked’ will be used as the reason for ‘Temporary Block’.
49 50 51 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 49 def reason_text @reason_text end |
#target_status ⇒ String
The list of cards passed in Cards parameter will be updated to this status.<br /> Mandatory<br /> Allowed values:<br /> -TemporaryBlock<br /> -Unblock<br /> -Block<br /> -Damaged<br />
60 61 62 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 60 def target_status @target_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 97 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it cards = nil unless hash['Cards'].nil? cards = [] hash['Cards'].each do |structure| cards << (UpdateCard.from_hash(structure) if structure) end end cards = nil unless hash.key?('Cards') target_status = hash.key?('TargetStatus') ? hash['TargetStatus'] : nil reason_id = hash.key?('ReasonId') ? hash['ReasonId'] : SKIP reason_text = hash.key?('ReasonText') ? hash['ReasonText'] : SKIP # Create object from extracted values. CardManagementV1UpdatestatusRequest.new(cards, target_status, reason_id, reason_text) end |
.names ⇒ Object
A mapping from model property names to API property names.
63 64 65 66 67 68 69 70 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 63 def self.names @_hash = {} if @_hash.nil? @_hash['cards'] = 'Cards' @_hash['reason_id'] = 'ReasonId' @_hash['reason_text'] = 'ReasonText' @_hash['target_status'] = 'TargetStatus' @_hash end |
.nullables ⇒ Object
An array for nullable fields
81 82 83 84 85 86 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 81 def self.nullables %w[ reason_id reason_text ] end |
.optionals ⇒ Object
An array for optional fields
73 74 75 76 77 78 |
# File 'lib/shell_card_management_ap_is/models/card_management_v1_updatestatus_request.rb', line 73 def self.optionals %w[ reason_id reason_text ] end |