@@ -23,6 +23,143 @@ def initialize(api_client = DatadogAPIClient::APIClient.default)
2323 @api_client = api_client
2424 end
2525
26+ # Compute scalar analytics.
27+ #
28+ # @see #query_product_analytics_scalar_with_http_info
29+ def query_product_analytics_scalar ( body , opts = { } )
30+ data , _status_code , _headers = query_product_analytics_scalar_with_http_info ( body , opts )
31+ data
32+ end
33+
34+ # Compute scalar analytics.
35+ #
36+ # Compute scalar analytics results for Product Analytics data.
37+ # Returns aggregated values (counts, averages, percentiles) optionally grouped by facets.
38+ #
39+ # @param body [ProductAnalyticsAnalyticsRequest]
40+ # @param opts [Hash] the optional parameters
41+ # @return [Array<(ProductAnalyticsScalarResponse, Integer, Hash)>] ProductAnalyticsScalarResponse data, response status code and response headers
42+ def query_product_analytics_scalar_with_http_info ( body , opts = { } )
43+
44+ if @api_client . config . debugging
45+ @api_client . config . logger . debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_scalar ...'
46+ end
47+ # verify the required parameter 'body' is set
48+ if @api_client . config . client_side_validation && body . nil?
49+ fail ArgumentError , "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_scalar"
50+ end
51+ # resource path
52+ local_var_path = '/api/v2/product-analytics/analytics/scalar'
53+
54+ # query parameters
55+ query_params = opts [ :query_params ] || { }
56+
57+ # header parameters
58+ header_params = opts [ :header_params ] || { }
59+ # HTTP header 'Accept' (if needed)
60+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
61+ # HTTP header 'Content-Type'
62+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] )
63+
64+ # form parameters
65+ form_params = opts [ :form_params ] || { }
66+
67+ # http body (model)
68+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( body )
69+
70+ # return_type
71+ return_type = opts [ :debug_return_type ] || 'ProductAnalyticsScalarResponse'
72+
73+ # auth_names
74+ auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth ]
75+
76+ new_options = opts . merge (
77+ :operation => :query_product_analytics_scalar ,
78+ :header_params => header_params ,
79+ :query_params => query_params ,
80+ :form_params => form_params ,
81+ :body => post_body ,
82+ :auth_names => auth_names ,
83+ :return_type => return_type ,
84+ :api_version => "V2"
85+ )
86+
87+ data , status_code , headers = @api_client . call_api ( Net ::HTTP ::Post , local_var_path , new_options )
88+ if @api_client . config . debugging
89+ @api_client . config . logger . debug "API called: ProductAnalyticsAPI#query_product_analytics_scalar\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
90+ end
91+ return data , status_code , headers
92+ end
93+
94+ # Compute timeseries analytics.
95+ #
96+ # @see #query_product_analytics_timeseries_with_http_info
97+ def query_product_analytics_timeseries ( body , opts = { } )
98+ data , _status_code , _headers = query_product_analytics_timeseries_with_http_info ( body , opts )
99+ data
100+ end
101+
102+ # Compute timeseries analytics.
103+ #
104+ # Compute timeseries analytics results for Product Analytics data.
105+ # Returns time-bucketed values for charts and trend analysis.
106+ # The `compute.interval` field (milliseconds) is required for time bucketing.
107+ #
108+ # @param body [ProductAnalyticsAnalyticsRequest]
109+ # @param opts [Hash] the optional parameters
110+ # @return [Array<(ProductAnalyticsTimeseriesResponse, Integer, Hash)>] ProductAnalyticsTimeseriesResponse data, response status code and response headers
111+ def query_product_analytics_timeseries_with_http_info ( body , opts = { } )
112+
113+ if @api_client . config . debugging
114+ @api_client . config . logger . debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_timeseries ...'
115+ end
116+ # verify the required parameter 'body' is set
117+ if @api_client . config . client_side_validation && body . nil?
118+ fail ArgumentError , "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_timeseries"
119+ end
120+ # resource path
121+ local_var_path = '/api/v2/product-analytics/analytics/timeseries'
122+
123+ # query parameters
124+ query_params = opts [ :query_params ] || { }
125+
126+ # header parameters
127+ header_params = opts [ :header_params ] || { }
128+ # HTTP header 'Accept' (if needed)
129+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
130+ # HTTP header 'Content-Type'
131+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/json' ] )
132+
133+ # form parameters
134+ form_params = opts [ :form_params ] || { }
135+
136+ # http body (model)
137+ post_body = opts [ :debug_body ] || @api_client . object_to_http_body ( body )
138+
139+ # return_type
140+ return_type = opts [ :debug_return_type ] || 'ProductAnalyticsTimeseriesResponse'
141+
142+ # auth_names
143+ auth_names = opts [ :debug_auth_names ] || [ :apiKeyAuth , :appKeyAuth ]
144+
145+ new_options = opts . merge (
146+ :operation => :query_product_analytics_timeseries ,
147+ :header_params => header_params ,
148+ :query_params => query_params ,
149+ :form_params => form_params ,
150+ :body => post_body ,
151+ :auth_names => auth_names ,
152+ :return_type => return_type ,
153+ :api_version => "V2"
154+ )
155+
156+ data , status_code , headers = @api_client . call_api ( Net ::HTTP ::Post , local_var_path , new_options )
157+ if @api_client . config . debugging
158+ @api_client . config . logger . debug "API called: ProductAnalyticsAPI#query_product_analytics_timeseries\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
159+ end
160+ return data , status_code , headers
161+ end
162+
26163 # Send server-side events.
27164 #
28165 # @see #submit_product_analytics_event_with_http_info
0 commit comments