Class: ShellDataReportingApIs::RecentTransactionsResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb

Overview

RecentTransactionsResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(request_id = SKIP, status = SKIP, page = SKIP, row_count = SKIP, total_pages = SKIP, data = SKIP) ⇒ RecentTransactionsResponse

Returns a new instance of RecentTransactionsResponse.



66
67
68
69
70
71
72
73
74
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 66

def initialize(request_id = SKIP, status = SKIP, page = SKIP,
               row_count = SKIP, total_pages = SKIP, data = SKIP)
  @request_id = request_id unless request_id == SKIP
  @status = status unless status == SKIP
  @page = page unless page == SKIP
  @row_count = row_count unless row_count == SKIP
  @total_pages = total_pages unless total_pages == SKIP
  @data = data unless data == SKIP
end

Instance Attribute Details

#dataArray[RecentTransactions]

API Response

Returns:



35
36
37
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 35

def data
  @data
end

#pageInteger

CurrentPage

Returns:

  • (Integer)


23
24
25
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 23

def page
  @page
end

#request_idString

RequestID is unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain.

Returns:

  • (String)


15
16
17
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 15

def request_id
  @request_id
end

#row_countInteger

RowCount

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 27

def row_count
  @row_count
end

#statusString

status of the API call

Returns:

  • (String)


19
20
21
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 19

def status
  @status
end

#total_pagesInteger

TotalPages

Returns:

  • (Integer)


31
32
33
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 31

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/recent_transactions_response.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
  page = hash.key?('Page') ? hash['Page'] : SKIP
  row_count = hash.key?('RowCount') ? hash['RowCount'] : SKIP
  total_pages = hash.key?('TotalPages') ? hash['TotalPages'] : 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 << (RecentTransactions.from_hash(structure) if structure)
    end
  end

  data = SKIP unless hash.key?('Data')

  # Create object from extracted values.
  RecentTransactionsResponse.new(request_id,
                                 status,
                                 page,
                                 row_count,
                                 total_pages,
                                 data)
end

.namesObject

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/recent_transactions_response.rb', line 38

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'RequestId'
  @_hash['status'] = 'Status'
  @_hash['page'] = 'Page'
  @_hash['row_count'] = 'RowCount'
  @_hash['total_pages'] = 'TotalPages'
  @_hash['data'] = 'Data'
  @_hash
end

.nullablesObject

An array for nullable fields



62
63
64
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 62

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
59
# File 'lib/shell_data_reporting_ap_is/models/recent_transactions_response.rb', line 50

def self.optionals
  %w[
    request_id
    status
    page
    row_count
    total_pages
    data
  ]
end