Class: CtdDocumentation::GetQueriesIdsAndAssignedTaskResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb

Overview

GetQueriesIdsAndAssignedTaskResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(queries = SKIP, selected_queries = SKIP) ⇒ GetQueriesIdsAndAssignedTaskResponse

Returns a new instance of GetQueriesIdsAndAssignedTaskResponse.



41
42
43
44
45
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 41

def initialize(queries = SKIP,
               selected_queries = SKIP)
  @queries = queries unless queries == SKIP
  @selected_queries = selected_queries unless selected_queries == SKIP
end

Instance Attribute Details

#queriesList of Object

List of lists that contains the id and name of each query

Returns:



14
15
16
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 14

def queries
  @queries
end

#selected_queriesList of Integer

List of lists that contains the id of each query assigned to the task

Returns:

  • (List of Integer)


18
19
20
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 18

def selected_queries
  @selected_queries
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 48

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

  queries = nil
  unless hash['queries'].nil?
    queries = []
    hash['queries'].each do |structure|
      queries << (Object.from_hash(structure) if structure)
    end
  end

  queries = SKIP unless hash.key?('queries')
  selected_queries =
    hash.key?('selected_queries') ? hash['selected_queries'] : SKIP

  # Create object from extracted values.

  GetQueriesIdsAndAssignedTaskResponse.new(queries,
                                           selected_queries)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['queries'] = 'queries'
  @_hash['selected_queries'] = 'selected_queries'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 37

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/ctd_documentation/models/get_queries_ids_and_assigned_task_response.rb', line 29

def self.optionals
  %w[
    queries
    selected_queries
  ]
end