Method: PureCloud::QueryRequest#initialize

Defined in:
lib/purecloud/models/query_request.rb

#initialize(attributes = {}) ⇒ QueryRequest

Returns a new instance of QueryRequest.



75
76
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/purecloud/models/query_request.rb', line 75

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}

  
  if attributes[:'queryPhrase']
    self.query_phrase = attributes[:'queryPhrase']
  end
  
  if attributes[:'pageNumber']
    self.page_number = attributes[:'pageNumber']
  end
  
  if attributes[:'pageSize']
    self.page_size = attributes[:'pageSize']
  end
  
  if attributes[:'facetNameRequests']
    if (value = attributes[:'facetNameRequests']).is_a?(Array)
      self.facet_name_requests = value
    end
  end
  
  if attributes[:'sort']
    if (value = attributes[:'sort']).is_a?(Array)
      self.sort = value
    end
  end
  
  if attributes[:'filters']
    if (value = attributes[:'filters']).is_a?(Array)
      self.filters = value
    end
  end
  
  if attributes[:'attributeFilters']
    if (value = attributes[:'attributeFilters']).is_a?(Array)
      self.attribute_filters = value
    end
  end
  
  if attributes[:'includeShares']
    self.include_shares = attributes[:'includeShares']
  else
    self.include_shares = false
  end
  
end