Class: Retab::QueryWorkflowTableRequest

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

Constant Summary collapse

HASH_ATTRS =
{
  filters: :filters,
  search: :search,
  case_sensitive: :case_sensitive,
  select: :select,
  distinct: :distinct,
  group_by: :group_by,
  aggregations: :aggregations,
  sort: :sort,
  sample: :sample,
  tail: :tail,
  count_only: :count_only,
  include_explain: :include_explain,
  sort_column: :sort_column,
  sort_direction: :sort_direction,
  viewer_mode: :viewer_mode,
  offset: :offset,
  limit: :limit
}.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) ⇒ QueryWorkflowTableRequest

Returns a new instance of QueryWorkflowTableRequest.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/retab/tables/query_workflow_table_request.rb', line 48

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @filters = (hash[:filters] || []).map { |item| item ? Retab::WorkflowTableFilterRule.new(item) : nil }
  @search = hash[:search] ? Retab::WorkflowTableSearchRequest.new(hash[:search]) : nil
  @case_sensitive = hash[:case_sensitive].nil? ? false : hash[:case_sensitive]
  @select = (hash[:select] || [])
  @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
  }
  @sort = (hash[:sort] || []).map { |item| item ? Retab::WorkflowTableSortRule.new(item) : nil }
  @sample = hash[:sample] ? Retab::WorkflowTableSampleRequest.new(hash[:sample]) : nil
  @tail = hash[:tail] ? Retab::WorkflowTableTailRequest.new(hash[:tail]) : nil
  @count_only = hash[:count_only].nil? ? false : hash[:count_only]
  @include_explain = hash[:include_explain].nil? ? false : hash[:include_explain]
  @sort_column = hash[:sort_column]
  @sort_direction = hash[:sort_direction]
  @viewer_mode = hash[:viewer_mode]
  @offset = hash[:offset]
  @limit = hash[:limit]
end

Instance Attribute Details

#aggregationsObject

Returns the value of attribute aggregations.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def aggregations
  @aggregations
end

#case_sensitiveObject

Returns the value of attribute case_sensitive.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def case_sensitive
  @case_sensitive
end

#count_onlyObject

Returns the value of attribute count_only.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def count_only
  @count_only
end

#distinctObject

Returns the value of attribute distinct.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def distinct
  @distinct
end

#filtersObject

Returns the value of attribute filters.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def filters
  @filters
end

#group_byObject

Returns the value of attribute group_by.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def group_by
  @group_by
end

#include_explainObject

Returns the value of attribute include_explain.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def include_explain
  @include_explain
end

#limitObject

Returns the value of attribute limit.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def offset
  @offset
end

#sampleObject

Returns the value of attribute sample.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def sample
  @sample
end

#searchObject

Returns the value of attribute search.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def search
  @search
end

#selectObject

Returns the value of attribute select.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def select
  @select
end

#sortObject

Returns the value of attribute sort.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def sort
  @sort
end

#sort_columnObject

Returns the value of attribute sort_column.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def sort_column
  @sort_column
end

#sort_directionObject

Returns the value of attribute sort_direction.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def sort_direction
  @sort_direction
end

#tailObject

Returns the value of attribute tail.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def tail
  @tail
end

#viewer_modeObject

Returns the value of attribute viewer_mode.



28
29
30
# File 'lib/retab/tables/query_workflow_table_request.rb', line 28

def viewer_mode
  @viewer_mode
end