/// <summary> /// Query for flow aggregates /// </summary> /// <exception cref="PureCloudPlatform.Client.V2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body">query</param> /// <returns>Task of FlowAggregateQueryResponse</returns> public async System.Threading.Tasks.Task <FlowAggregateQueryResponse> PostAnalyticsFlowsAggregatesQueryAsync(FlowAggregationQuery body) { ApiResponse <FlowAggregateQueryResponse> localVarResponse = await PostAnalyticsFlowsAggregatesQueryAsyncWithHttpInfo(body); return(localVarResponse.Data); }
/// <summary> /// Query for flow aggregates /// </summary> /// <exception cref="PureCloudPlatform.Client.V2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body">query</param> /// <returns>Task of ApiResponse (FlowAggregateQueryResponse)</returns> public async System.Threading.Tasks.Task <ApiResponse <FlowAggregateQueryResponse> > PostAnalyticsFlowsAggregatesQueryAsyncWithHttpInfo(FlowAggregationQuery body) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling FlowsApi->PostAnalyticsFlowsAggregatesQuery"); } var localVarPath = "/api/v2/analytics/flows/aggregates/query"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <Tuple <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); // Path params // Query params // Header params // Form params // Body param if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // authentication (PureCloud OAuth) required // oauth required if (!String.IsNullOrEmpty(Configuration.AccessToken)) { localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; Dictionary <string, string> localVarHeaders = localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()); if (localVarStatusCode >= 400) { throw new ApiException(localVarStatusCode, "Error calling PostAnalyticsFlowsAggregatesQuery: " + localVarResponse.Content, localVarResponse.Content, localVarHeaders); } else if (localVarStatusCode == 0) { throw new ApiException(localVarStatusCode, "Error calling PostAnalyticsFlowsAggregatesQuery: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); } return(new ApiResponse <FlowAggregateQueryResponse>(localVarStatusCode, localVarHeaders, (FlowAggregateQueryResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(FlowAggregateQueryResponse)), localVarResponse.Content, localVarResponse.StatusDescription)); }
/// <summary> /// Query for flow aggregates /// </summary> /// <exception cref="PureCloudPlatform.Client.V2.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body">query</param> /// <returns>FlowAggregateQueryResponse</returns> public FlowAggregateQueryResponse PostAnalyticsFlowsAggregatesQuery(FlowAggregationQuery body) { ApiResponse <FlowAggregateQueryResponse> localVarResponse = PostAnalyticsFlowsAggregatesQueryWithHttpInfo(body); return(localVarResponse.Data); }