Class: ShellCardManagementApIs::CreateCardGroupResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CreateCardGroupResponse
- Defined in:
- lib/shell_card_management_ap_is/models/create_card_group_response.rb
Overview
CreateCardGroupResponse Model.
Instance Attribute Summary collapse
-
#error_cards ⇒ Array[CreateCardGroupResponseErrorCardsItems]
List of cards that failed validation and not submitted for processing.
-
#main_reference ⇒ Integer
Reference number for tracking the execution of the requests – new Card Group creation and to move the cards to the new card group.
-
#new_card_group_reference ⇒ Integer
Reference number for tracking the execution of card group creation.
-
#successful_requests ⇒ Array[CreateCardGroupResponseSuccessfulRequestsItems]
List of cards validated and submitted successfully for processing.
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(main_reference = SKIP, new_card_group_reference = SKIP, successful_requests = SKIP, error_cards = SKIP) ⇒ CreateCardGroupResponse
constructor
A new instance of CreateCardGroupResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(main_reference = SKIP, new_card_group_reference = SKIP, successful_requests = SKIP, error_cards = SKIP) ⇒ CreateCardGroupResponse
Returns a new instance of CreateCardGroupResponse.
61 62 63 64 65 66 67 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 61 def initialize(main_reference = SKIP, new_card_group_reference = SKIP, successful_requests = SKIP, error_cards = SKIP) @main_reference = main_reference unless main_reference == SKIP @new_card_group_reference = new_card_group_reference unless new_card_group_reference == SKIP @successful_requests = successful_requests unless successful_requests == SKIP @error_cards = error_cards unless error_cards == SKIP end |
Instance Attribute Details
#error_cards ⇒ Array[CreateCardGroupResponseErrorCardsItems]
List of cards that failed validation and not submitted for processing. Entity: FailedCardReference This list will be empty when the validations of new card group parameters fail.
34 35 36 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 34 def error_cards @error_cards end |
#main_reference ⇒ Integer
Reference number for tracking the execution of the requests – new Card Group creation and to move the cards to the new card group. Reference number will be null when the validations of new card group parameters fail.
17 18 19 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 17 def main_reference @main_reference end |
#new_card_group_reference ⇒ Integer
Reference number for tracking the execution of card group creation. Reference number will be null when the validations of new card group parameters fail.
23 24 25 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 23 def new_card_group_reference @new_card_group_reference end |
#successful_requests ⇒ Array[CreateCardGroupResponseSuccessfulRequestsItems]
List of cards validated and submitted successfully for processing.
27 28 29 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 27 def successful_requests @successful_requests end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 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 99 100 101 102 103 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. main_reference = hash.key?('MainReference') ? hash['MainReference'] : SKIP new_card_group_reference = hash.key?('NewCardGroupReference') ? hash['NewCardGroupReference'] : SKIP # Parameter is an array, so we need to iterate through it successful_requests = nil unless hash['SuccessfulRequests'].nil? successful_requests = [] hash['SuccessfulRequests'].each do |structure| successful_requests << (CreateCardGroupResponseSuccessfulRequestsItems.from_hash(structure) if structure) end end successful_requests = SKIP unless hash.key?('SuccessfulRequests') # Parameter is an array, so we need to iterate through it error_cards = nil unless hash['ErrorCards'].nil? error_cards = [] hash['ErrorCards'].each do |structure| error_cards << (CreateCardGroupResponseErrorCardsItems.from_hash(structure) if structure) end end error_cards = SKIP unless hash.key?('ErrorCards') # Create object from extracted values. CreateCardGroupResponse.new(main_reference, new_card_group_reference, successful_requests, error_cards) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['main_reference'] = 'MainReference' @_hash['new_card_group_reference'] = 'NewCardGroupReference' @_hash['successful_requests'] = 'SuccessfulRequests' @_hash['error_cards'] = 'ErrorCards' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 54 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 47 def self.optionals %w[ main_reference new_card_group_reference successful_requests error_cards ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} main_reference: #{@main_reference.inspect}, new_card_group_reference:"\ " #{@new_card_group_reference.inspect}, successful_requests:"\ " #{@successful_requests.inspect}, error_cards: #{@error_cards.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
106 107 108 109 110 111 |
# File 'lib/shell_card_management_ap_is/models/create_card_group_response.rb', line 106 def to_s class_name = self.class.name.split('::').last "<#{class_name} main_reference: #{@main_reference}, new_card_group_reference:"\ " #{@new_card_group_reference}, successful_requests: #{@successful_requests}, error_cards:"\ " #{@error_cards}>" end |