Class: Retab::WorkflowTableExplain

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/tables/workflow_table_explain.rb

Constant Summary collapse

HASH_ATTRS =
{
  table_id: :table_id,
  snapshot_file_id: :snapshot_file_id,
  selected_columns: :selected_columns,
  filters: :filters,
  search: :search,
  sort: :sort,
  offset: :offset,
  limit: :limit,
  distinct: :distinct,
  group_by: :group_by,
  aggregations: :aggregations
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowTableExplain

Returns a new instance of WorkflowTableExplain.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/retab/tables/workflow_table_explain.rb', line 36

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @table_id = hash[:table_id]
  @snapshot_file_id = hash[:snapshot_file_id].nil? ? "" : hash[:snapshot_file_id]
  @selected_columns = (hash[:selected_columns] || [])
  @filters = (hash[:filters] || []).map { |item| item ? Retab::WorkflowTableFilterRule.new(item) : nil }
  @search = hash[:search] ? Retab::WorkflowTableSearchRequest.new(hash[:search]) : nil
  @sort = (hash[:sort] || []).map { |item| item ? Retab::WorkflowTableSortRule.new(item) : nil }
  @offset = hash[:offset]
  @limit = hash[:limit]
  @distinct = hash[:distinct] ? Retab::WorkflowTableDistinctRequest.new(hash[:distinct]) : nil
  @group_by = (hash[:group_by] || [])
  @aggregations = (hash[:aggregations] || []).map { |item|
    item ? Retab::WorkflowTableAggregationRequest.new(item) : nil
  }
end

Instance Attribute Details

#aggregationsObject

Returns the value of attribute aggregations.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def aggregations
  @aggregations
end

#distinctObject

Returns the value of attribute distinct.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def distinct
  @distinct
end

#filtersObject

Returns the value of attribute filters.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def filters
  @filters
end

#group_byObject

Returns the value of attribute group_by.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def group_by
  @group_by
end

#limitObject

Returns the value of attribute limit.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def offset
  @offset
end

#searchObject

Returns the value of attribute search.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def search
  @search
end

#selected_columnsObject

Returns the value of attribute selected_columns.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def selected_columns
  @selected_columns
end

#snapshot_file_idObject

Returns the value of attribute snapshot_file_id.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def snapshot_file_id
  @snapshot_file_id
end

#sortObject

Returns the value of attribute sort.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def sort
  @sort
end

#table_idObject

Returns the value of attribute table_id.



22
23
24
# File 'lib/retab/tables/workflow_table_explain.rb', line 22

def table_id
  @table_id
end