Class: ShellDataReportingApIs::PricedTransactionResponseV2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::PricedTransactionResponseV2
- Defined in:
- lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb
Overview
PricedTransactionResponseV2 Model.
Instance Attribute Summary collapse
-
#data ⇒ Array[PricedResponseData]
Indicates overall status of the request.
-
#page ⇒ Integer
Current page.
-
#page_size ⇒ Integer
Number of records returned in the response.
-
#request_id ⇒ String
Mandatory UUID (according to RFC 4122 standards) for requests and responses.
-
#status ⇒ String
Indicates overall status of the request.
-
#total_pages ⇒ Integer
Total number of pages available for the requested data.
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) ⇒ PricedTransactionResponseV2
constructor
A new instance of PricedTransactionResponseV2.
Methods inherited from BaseModel
Constructor Details
#initialize(request_id = SKIP, status = SKIP, data = SKIP, page = SKIP, page_size = SKIP, total_pages = SKIP) ⇒ PricedTransactionResponseV2
Returns a new instance of PricedTransactionResponseV2.
66 67 68 69 70 71 72 73 74 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 66 def initialize(request_id = SKIP, status = SKIP, data = SKIP, page = SKIP, page_size = SKIP, total_pages = 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 end |
Instance Attribute Details
#data ⇒ Array[PricedResponseData]
Indicates overall status of the request
23 24 25 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 23 def data @data end |
#page ⇒ Integer
Current page
27 28 29 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 27 def page @page end |
#page_size ⇒ Integer
Number of records returned in the response
31 32 33 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 31 def page_size @page_size end |
#request_id ⇒ String
Mandatory UUID (according to RFC 4122 standards) for requests and responses. This will be played back in the response from the req
15 16 17 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 15 def request_id @request_id end |
#status ⇒ String
Indicates overall status of the request
19 20 21 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 19 def status @status end |
#total_pages ⇒ Integer
Total number of pages available for the requested data
35 36 37 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 35 def total_pages @total_pages end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 104 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 77 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 << (PricedResponseData.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 # Create object from extracted values. PricedTransactionResponseV2.new(request_id, status, data, page, page_size, total_pages) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 38 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 end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/shell_data_reporting_ap_is/models/priced_transaction_response_v2.rb', line 50 def self.optionals %w[ request_id status data page page_size total_pages ] end |