Class: ShellCardManagementApIs::CardGroupResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CardGroupResponse
- Defined in:
- lib/shell_card_management_ap_is/models/card_group_response.rb
Overview
CardGroupResponse Model.
Instance Attribute Summary collapse
-
#card_groups ⇒ Array[CardGroupResponseCardGroupsItems]
TODO: Write general description for this method.
-
#current_page ⇒ Integer
current page.
-
#error ⇒ ErrorStatus
Total pages available.
-
#request_id ⇒ String
API Request id.
-
#row_count ⇒ Integer
number of records in current response.
-
#total_pages ⇒ Integer
Total pages available.
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(card_groups = SKIP, current_page = SKIP, row_count = SKIP, total_pages = SKIP, error = SKIP, request_id = SKIP) ⇒ CardGroupResponse
constructor
A new instance of CardGroupResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(card_groups = SKIP, current_page = SKIP, row_count = SKIP, total_pages = SKIP, error = SKIP, request_id = SKIP) ⇒ CardGroupResponse
Returns a new instance of CardGroupResponse.
65 66 67 68 69 70 71 72 73 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 65 def initialize(card_groups = SKIP, current_page = SKIP, row_count = SKIP, total_pages = SKIP, error = SKIP, request_id = SKIP) @card_groups = card_groups unless card_groups == SKIP @current_page = current_page unless current_page == SKIP @row_count = row_count unless row_count == SKIP @total_pages = total_pages unless total_pages == SKIP @error = error unless error == SKIP @request_id = request_id unless request_id == SKIP end |
Instance Attribute Details
#card_groups ⇒ Array[CardGroupResponseCardGroupsItems]
TODO: Write general description for this method
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 14 def card_groups @card_groups end |
#current_page ⇒ Integer
current page
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 18 def current_page @current_page end |
#error ⇒ ErrorStatus
Total pages available
30 31 32 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 30 def error @error end |
#request_id ⇒ String
API Request id
34 35 36 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 34 def request_id @request_id end |
#row_count ⇒ Integer
number of records in current response
22 23 24 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 22 def row_count @row_count end |
#total_pages ⇒ Integer
Total pages available
26 27 28 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 26 def total_pages @total_pages end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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/card_group_response.rb', line 76 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 card_groups = nil unless hash['CardGroups'].nil? card_groups = [] hash['CardGroups'].each do |structure| card_groups << (CardGroupResponseCardGroupsItems.from_hash(structure) if structure) end end card_groups = SKIP unless hash.key?('CardGroups') current_page = hash.key?('CurrentPage') ? hash['CurrentPage'] : SKIP row_count = hash.key?('RowCount') ? hash['RowCount'] : SKIP total_pages = hash.key?('TotalPages') ? hash['TotalPages'] : SKIP error = ErrorStatus.from_hash(hash['Error']) if hash['Error'] request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP # Create object from extracted values. CardGroupResponse.new(card_groups, current_page, row_count, total_pages, error, request_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['card_groups'] = 'CardGroups' @_hash['current_page'] = 'CurrentPage' @_hash['row_count'] = 'RowCount' @_hash['total_pages'] = 'TotalPages' @_hash['error'] = 'Error' @_hash['request_id'] = 'RequestId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/shell_card_management_ap_is/models/card_group_response.rb', line 49 def self.optionals %w[ card_groups current_page row_count total_pages error request_id ] end |