Class: ShellCardManagementApIs::CardSearchResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::CardSearchResponse
- Defined in:
- lib/shell_card_management_ap_is/models/card_search_response.rb
Overview
CardSearchResponse Model.
Instance Attribute Summary collapse
-
#data ⇒ Array[Card]
Indicates overall status of the request.
-
#page ⇒ Integer
Specifies the returned page of the results.
-
#page_size ⇒ Integer
Specifies the number of records to be returned which could be less than the PageSize in the request.
-
#request_id ⇒ String
Unique request identifier passed from end user.
-
#status ⇒ String
Indicates overall status of the request.
-
#total_pages ⇒ Integer
Specifies the total pages available in the result.
-
#total_records ⇒ Integer
Specifies the total pages available in the result.
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(request_id = SKIP, status = SKIP, data = SKIP, page = SKIP, page_size = SKIP, total_pages = SKIP, total_records = SKIP) ⇒ CardSearchResponse
constructor
A new instance of CardSearchResponse.
-
#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(request_id = SKIP, status = SKIP, data = SKIP, page = SKIP, page_size = SKIP, total_pages = SKIP, total_records = SKIP) ⇒ CardSearchResponse
Returns a new instance of CardSearchResponse.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 78 def initialize(request_id = SKIP, status = SKIP, data = SKIP, page = SKIP, page_size = SKIP, total_pages = SKIP, total_records = SKIP) @request_id = request_id unless request_id == SKIP @status = status unless status == SKIP @data = data unless data == SKIP @page = page unless page == SKIP @page_size = page_size unless page_size == SKIP @total_pages = total_pages unless total_pages == SKIP @total_records = total_records unless total_records == SKIP end |
Instance Attribute Details
#data ⇒ Array[Card]
Indicates overall status of the request. Allowed values: SUCCES, FAILED, PARTIAL_SUCCES
25 26 27 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 25 def data @data end |
#page ⇒ Integer
Specifies the returned page of the results
29 30 31 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 29 def page @page end |
#page_size ⇒ Integer
Specifies the number of records to be returned which could be less than the PageSize in the request
34 35 36 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 34 def page_size @page_size end |
#request_id ⇒ String
Unique request identifier passed from end user. This identifier helps in tracing a transaction
15 16 17 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 15 def request_id @request_id end |
#status ⇒ String
Indicates overall status of the request. Allowed values: SUCCES, FAILED, PARTIAL_SUCCES
20 21 22 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 20 def status @status end |
#total_pages ⇒ Integer
Specifies the total pages available in the result
38 39 40 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 38 def total_pages @total_pages end |
#total_records ⇒ Integer
Specifies the total pages available in the result
42 43 44 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 42 def total_records @total_records end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 90 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP status = hash.key?('Status') ? hash['Status'] : SKIP # Parameter is an array, so we need to iterate through it data = nil unless hash['Data'].nil? data = [] hash['Data'].each do |structure| data << (Card.from_hash(structure) if structure) end end data = SKIP unless hash.key?('Data') page = hash.key?('Page') ? hash['Page'] : SKIP page_size = hash.key?('PageSize') ? hash['PageSize'] : SKIP total_pages = hash.key?('TotalPages') ? hash['TotalPages'] : SKIP total_records = hash.key?('TotalRecords') ? hash['TotalRecords'] : SKIP # Create object from extracted values. CardSearchResponse.new(request_id, status, data, page, page_size, total_pages, total_records) end |
.names ⇒ Object
A mapping from model property names to API property names.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 45 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'RequestId' @_hash['status'] = 'Status' @_hash['data'] = 'Data' @_hash['page'] = 'Page' @_hash['page_size'] = 'PageSize' @_hash['total_pages'] = 'TotalPages' @_hash['total_records'] = 'TotalRecords' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 74 75 76 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 71 def self.nullables %w[ request_id status ] end |
.optionals ⇒ Object
An array for optional fields
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 58 def self.optionals %w[ request_id status data page page_size total_pages total_records ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
130 131 132 133 134 135 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect}, data:"\ " #{@data.inspect}, page: #{@page.inspect}, page_size: #{@page_size.inspect}, total_pages:"\ " #{@total_pages.inspect}, total_records: #{@total_records.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
122 123 124 125 126 127 |
# File 'lib/shell_card_management_ap_is/models/card_search_response.rb', line 122 def to_s class_name = self.class.name.split('::').last "<#{class_name} request_id: #{@request_id}, status: #{@status}, data: #{@data}, page:"\ " #{@page}, page_size: #{@page_size}, total_pages: #{@total_pages}, total_records:"\ " #{@total_records}>" end |