Class: ShellCardManagementApIs::AuditResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellCardManagementApIs::AuditResponse
- Defined in:
- lib/shell_card_management_ap_is/models/audit_response.rb
Overview
AuditResponse Model.
Instance Attribute Summary collapse
-
#audits ⇒ Array[AuditResponseAuditsItems]
TODO: Write general description for this method.
-
#current_page ⇒ Integer
Current Page.
-
#error ⇒ ErrorStatus
Calculated page count based on page size from the incoming API request and total number of rows matched for the given input criteria.
-
#request_id ⇒ String
API RequestId.
-
#row_count ⇒ Integer
Total row count matched for the given input criteria.
-
#total_pages ⇒ Integer
Calculated page count based on page size from the incoming API request and total number of rows matched for the given input 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(audits = SKIP, current_page = SKIP, row_count = SKIP, total_pages = SKIP, error = SKIP, request_id = SKIP) ⇒ AuditResponse
constructor
A new instance of AuditResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(audits = SKIP, current_page = SKIP, row_count = SKIP, total_pages = SKIP, error = SKIP, request_id = SKIP) ⇒ AuditResponse
Returns a new instance of AuditResponse.
67 68 69 70 71 72 73 74 75 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 67 def initialize(audits = SKIP, current_page = SKIP, row_count = SKIP, total_pages = SKIP, error = SKIP, request_id = SKIP) @audits = audits unless audits == 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
#audits ⇒ Array[AuditResponseAuditsItems]
TODO: Write general description for this method
14 15 16 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 14 def audits @audits end |
#current_page ⇒ Integer
Current Page
18 19 20 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 18 def current_page @current_page end |
#error ⇒ ErrorStatus
Calculated page count based on page size from the incoming API request and total number of rows matched for the given input criteria
32 33 34 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 32 def error @error end |
#request_id ⇒ String
API RequestId
36 37 38 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 36 def request_id @request_id end |
#row_count ⇒ Integer
Total row count matched for the given input criteria
22 23 24 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 22 def row_count @row_count end |
#total_pages ⇒ Integer
Calculated page count based on page size from the incoming API request and total number of rows matched for the given input criteria
27 28 29 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 27 def total_pages @total_pages end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 104 105 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 78 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 audits = nil unless hash['Audits'].nil? audits = [] hash['Audits'].each do |structure| audits << (AuditResponseAuditsItems.from_hash(structure) if structure) end end audits = SKIP unless hash.key?('Audits') 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. AuditResponse.new(audits, current_page, row_count, total_pages, error, request_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['audits'] = 'Audits' @_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
63 64 65 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/shell_card_management_ap_is/models/audit_response.rb', line 51 def self.optionals %w[ audits current_page row_count total_pages error request_id ] end |