Ejemplo n.º 1
0
        /// <summary>
        /// Transfer credits between main and sub accounts. Transfer credits between accounts. - From Main account to Sub account.  - From Sub account to Main account.  - From Sub account to another Sub account.  Your WinSMS account number and sub account number/s can be obtained by logging in to the WinSMS Client Zone (www.winsms.co.za/cz) with the main account&#39;s credentials.  The main account number is on the home tab and the sub account numbers are under the sub accounts tab.  Account numbers should be submitted as integers. Do not add the &#39;W&#39; prefix.
        /// </summary>
        /// <exception cref="winsms.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="creditTransferDetails">The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.</param>
        /// <returns>Task of CreditTransferResponse</returns>
        public async System.Threading.Tasks.Task <CreditTransferResponse> TransferCreditsAsync(CreditTransferDetails creditTransferDetails)
        {
            ApiResponse <CreditTransferResponse> localVarResponse = await TransferCreditsAsyncWithHttpInfo(creditTransferDetails);

            return(localVarResponse.Data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Transfer credits between main and sub accounts. Transfer credits between accounts. - From Main account to Sub account.  - From Sub account to Main account.  - From Sub account to another Sub account.  Your WinSMS account number and sub account number/s can be obtained by logging in to the WinSMS Client Zone (www.winsms.co.za/cz) with the main account&#39;s credentials.  The main account number is on the home tab and the sub account numbers are under the sub accounts tab.  Account numbers should be submitted as integers. Do not add the &#39;W&#39; prefix.
        /// </summary>
        /// <exception cref="winsms.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="creditTransferDetails">The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.</param>
        /// <returns>Task of ApiResponse (CreditTransferResponse)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <CreditTransferResponse> > TransferCreditsAsyncWithHttpInfo(CreditTransferDetails creditTransferDetails)
        {
            // verify the required parameter 'creditTransferDetails' is set
            if (creditTransferDetails == null)
            {
                throw new ApiException(400, "Missing required parameter 'creditTransferDetails' when calling CreditsApi->TransferCredits");
            }

            var    localVarPath         = "/credits/transfer";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.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);
            }

            if (creditTransferDetails != null && creditTransferDetails.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(creditTransferDetails); // http body (model) parameter
            }
            else
            {
                localVarPostBody = creditTransferDetails; // byte array
            }

            // authentication (APIKeyHeader) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("AUTHORIZATION")))
            {
                localVarHeaderParams["AUTHORIZATION"] = this.Configuration.GetApiKeyWithPrefix("AUTHORIZATION");
            }

            // 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;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("TransferCredits", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <CreditTransferResponse>(localVarStatusCode,
                                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                            (CreditTransferResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CreditTransferResponse))));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Transfer credits between main and sub accounts. Transfer credits between accounts. - From Main account to Sub account.  - From Sub account to Main account.  - From Sub account to another Sub account.  Your WinSMS account number and sub account number/s can be obtained by logging in to the WinSMS Client Zone (www.winsms.co.za/cz) with the main account&#39;s credentials.  The main account number is on the home tab and the sub account numbers are under the sub accounts tab.  Account numbers should be submitted as integers. Do not add the &#39;W&#39; prefix.
        /// </summary>
        /// <exception cref="winsms.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="creditTransferDetails">The details of the credit transfer. Sender account number, recipient account number, and number of credits to transfer.</param>
        /// <returns>CreditTransferResponse</returns>
        public CreditTransferResponse TransferCredits(CreditTransferDetails creditTransferDetails)
        {
            ApiResponse <CreditTransferResponse> localVarResponse = TransferCreditsWithHttpInfo(creditTransferDetails);

            return(localVarResponse.Data);
        }