public static StatisticsSubscribe ToModel(this StatisticsSubscribeData node) { return(new StatisticsSubscribe() { Id = node.Id, CategoryDictionary = node.CategoryDictionary, TargetId = node.TargetId, EnergyCategoryId = node.EnergyCategoryId, Emails = node.Emails, SubDate = node.SubDate, //IsPeriodMonth = node.IsPeriodMonth, From = node.From, To = node.To, Period = node.Period }); }
/// <summary> /// Subscribe to statistics. Open a subscription for the specified set of statistics. The values are returned when you request them using [/reporting/subscriptions/{subscriptionId}](/reference/workspace/Reporting/index.html#peek). /// </summary> /// <exception cref="Genesys.Internal.Workspace.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="statisticsSubscribeData">The collection of statistics you want to include in your subscription.</param> /// <returns>Task of InlineResponse2002</returns> public async System.Threading.Tasks.Task <InlineResponse2002> SubscribeAsync(StatisticsSubscribeData statisticsSubscribeData) { ApiResponse <InlineResponse2002> localVarResponse = await SubscribeAsyncWithHttpInfo(statisticsSubscribeData); return(localVarResponse.Data); }
/// <summary> /// Subscribe to statistics. Open a subscription for the specified set of statistics. The values are returned when you request them using [/reporting/subscriptions/{subscriptionId}](/reference/workspace/Reporting/index.html#peek). /// </summary> /// <exception cref="Genesys.Internal.Workspace.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="statisticsSubscribeData">The collection of statistics you want to include in your subscription.</param> /// <returns>Task of ApiResponse (InlineResponse2002)</returns> public async System.Threading.Tasks.Task <ApiResponse <InlineResponse2002> > SubscribeAsyncWithHttpInfo(StatisticsSubscribeData statisticsSubscribeData) { // verify the required parameter 'statisticsSubscribeData' is set if (statisticsSubscribeData == null) { throw new ApiException(400, "Missing required parameter 'statisticsSubscribeData' when calling ReportingApi->Subscribe"); } var localVarPath = "/reporting/subscriptions"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (statisticsSubscribeData != null && statisticsSubscribeData.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(statisticsSubscribeData); // http body (model) parameter } else { localVarPostBody = statisticsSubscribeData; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("Subscribe", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <InlineResponse2002>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (InlineResponse2002)Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse2002)))); }
/// <summary> /// Subscribe to statistics. Open a subscription for the specified set of statistics. The values are returned when you request them using [/reporting/subscriptions/{subscriptionId}](/reference/workspace/Reporting/index.html#peek). /// </summary> /// <exception cref="Genesys.Internal.Workspace.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="statisticsSubscribeData">The collection of statistics you want to include in your subscription.</param> /// <returns>InlineResponse2002</returns> public InlineResponse2002 Subscribe(StatisticsSubscribeData statisticsSubscribeData) { ApiResponse <InlineResponse2002> localVarResponse = SubscribeWithHttpInfo(statisticsSubscribeData); return(localVarResponse.Data); }