91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# File 'lib/vapi_server_sdk/analytics/client.rb', line 91
def get(queries:, request_options: nil)
Async do
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
end
|