/// <summary> /// Create The create operation creates a new subscription ledger entry. /// </summary> /// <exception cref="Customweb.Wallee.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="spaceId"></param> /// <param name="entry"></param> /// <returns>Task of SubscriptionLedgerEntry</returns> public async System.Threading.Tasks.Task <SubscriptionLedgerEntry> CreateAsync(long?spaceId, SubscriptionLedgerEntryCreate entry) { ApiResponse <SubscriptionLedgerEntry> localVarResponse = await CreateAsyncWithHttpInfo(spaceId, entry); return(localVarResponse.Data); }
/// <summary> /// Create The create operation creates a new subscription ledger entry. /// </summary> /// <exception cref="Customweb.Wallee.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="spaceId"></param> /// <param name="entry"></param> /// <returns>Task of ApiResponse (SubscriptionLedgerEntry)</returns> public async System.Threading.Tasks.Task <ApiResponse <SubscriptionLedgerEntry> > CreateAsyncWithHttpInfo(long?spaceId, SubscriptionLedgerEntryCreate entry) { // verify the required parameter 'spaceId' is set if (spaceId == null) { throw new ApiException(400, "Missing required parameter 'spaceId' when calling SubscriptionLedgerEntryService->Create"); } // verify the required parameter 'entry' is set if (entry == null) { throw new ApiException(400, "Missing required parameter 'entry' when calling SubscriptionLedgerEntryService->Create"); } var localVarPath = "/subscription-ledger-entry/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 (entry != null && entry.GetType() != typeof(byte[])) { localVarPostBody = ApiClient.Serialize(entry); // http body (model) parameter } else { localVarPostBody = entry; // 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 <SubscriptionLedgerEntry>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (SubscriptionLedgerEntry)ApiClient.Deserialize(localVarResponse, typeof(SubscriptionLedgerEntry)))); }
/// <summary> /// Create The create operation creates a new subscription ledger entry. /// </summary> /// <exception cref="Customweb.Wallee.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="spaceId"></param> /// <param name="entry"></param> /// <returns>SubscriptionLedgerEntry</returns> public SubscriptionLedgerEntry Create(long?spaceId, SubscriptionLedgerEntryCreate entry) { ApiResponse <SubscriptionLedgerEntry> localVarResponse = CreateWithHttpInfo(spaceId, entry); return(localVarResponse.Data); }