39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/vapi_server_sdk/analytics/client.rb', line 39
def get(queries:, request_options: nil)
response = @request_client.conn.post do |req|
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
req.["Authorization"] = request_options.token unless request_options&.token.nil?
req. = {
**(req. || {}),
**@request_client.,
**(request_options&. || {})
}.compact
unless request_options.nil? || request_options&.additional_query_parameters.nil?
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
end
req.body = { **(request_options&.additional_body_parameters || {}), queries: queries }.compact
req.url "#{@request_client.get_url(request_options: request_options)}/analytics"
end
parsed_json = JSON.parse(response.body)
parsed_json&.map do |item|
item = item.to_json
Vapi::AnalyticsQueryResult.from_json(json_object: item)
end
end
|