/// <summary> /// Create This operation creates a new metric usage report. /// </summary> /// <exception cref="Customweb.Wallee.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="spaceId"></param> /// <param name="usageReport">The usage report which should be created.</param> /// <returns>Task of SubscriptionMetricUsageReport</returns> public async System.Threading.Tasks.Task <SubscriptionMetricUsageReport> CreateAsync(long?spaceId, SubscriptionMetricUsageReportCreate usageReport) { ApiResponse <SubscriptionMetricUsageReport> localVarResponse = await CreateAsyncWithHttpInfo(spaceId, usageReport); return(localVarResponse.Data); }
/// <summary> /// Create This operation creates a new metric usage report. /// </summary> /// <exception cref="Customweb.Wallee.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="spaceId"></param> /// <param name="usageReport">The usage report which should be created.</param> /// <returns>Task of ApiResponse (SubscriptionMetricUsageReport)</returns> public async System.Threading.Tasks.Task <ApiResponse <SubscriptionMetricUsageReport> > CreateAsyncWithHttpInfo(long?spaceId, SubscriptionMetricUsageReportCreate usageReport) { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException(400, "Missing required parameter 'spaceId' when calling SubscriptionMetricUsageService->Create"); } // verify the required parameter 'usageReport' is set if (usageReport == null) { throw new ApiException(400, "Missing required parameter 'usageReport' when calling SubscriptionMetricUsageService->Create"); } var localVarPath = "/subscription-metric-usage/create"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new Dictionary <String, String>(); var localVarHeaderParams = new Dictionary <String, String>(); 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;charset=utf-8" }; String localVarHttpContentType = ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json;charset=utf-8" }; String localVarHttpHeaderAccept = ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (spaceId != null) { localVarQueryParams.Add("spaceId", ApiClient.ParameterToString(spaceId)); // query parameter } if (usageReport != null && usageReport.GetType() != typeof(byte[])) { localVarPostBody = ApiClient.Serialize(usageReport); // http body (model) parameter } else { localVarPostBody = usageReport; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("Create", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <SubscriptionMetricUsageReport>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (SubscriptionMetricUsageReport)ApiClient.Deserialize(localVarResponse, typeof(SubscriptionMetricUsageReport)))); }
/// <summary> /// Create This operation creates a new metric usage report. /// </summary> /// <exception cref="Customweb.Wallee.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="spaceId"></param> /// <param name="usageReport">The usage report which should be created.</param> /// <returns>SubscriptionMetricUsageReport</returns> public SubscriptionMetricUsageReport Create(long?spaceId, SubscriptionMetricUsageReportCreate usageReport) { ApiResponse <SubscriptionMetricUsageReport> localVarResponse = CreateWithHttpInfo(spaceId, usageReport); return(localVarResponse.Data); }