/// <summary> /// Return HMAC signatures This REST API reference describes how to return unique signature and token values that used to process a [CORS enabled API call](https://knowledgecenter.zuora.com/DC_Developers/REST_API/A_REST_basics/G_CORS_REST). /// </summary> /// <param name="request"></param> /// <returns>POSTHMACSignatureResponseType</returns> public POSTHMACSignatureResponseType POSTHMACSignature(POSTHMACSignatureType request) { // verify the required parameter 'request' is set if (request == null) { throw new ApiException(400, "Missing required parameter 'request' when calling POSTHMACSignature"); } var path = "/hmac-signatures"; path = path.Replace("{format}", "json"); var queryParams = new Dictionary <String, String>(); var headerParams = new Dictionary <String, String>(); var formParams = new Dictionary <String, String>(); var fileParams = new Dictionary <String, FileParameter>(); String postBody = null; postBody = ApiClient.Serialize(request); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; // make the HTTP request IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings); if (((int)response.StatusCode) >= 400) { throw new ApiException((int)response.StatusCode, "Error calling POSTHMACSignature: " + response.Content, response.Content); } else if (((int)response.StatusCode) == 0) { throw new ApiException((int)response.StatusCode, "Error calling POSTHMACSignature: " + response.ErrorMessage, response.ErrorMessage); } return((POSTHMACSignatureResponseType)ApiClient.Deserialize(response.Content, typeof(POSTHMACSignatureResponseType), response.Headers)); }
/// <summary> /// Return HMAC signatures This REST API reference describes how to return unique signature and token values that used to process a [CORS enabled API call](https://knowledgecenter.zuora.com/DC_Developers/REST_API/A_REST_basics/G_CORS_REST). /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="request"></param> /// <returns>Task of ApiResponse (POSTHMACSignatureResponseType)</returns> public async System.Threading.Tasks.Task <ApiResponse <POSTHMACSignatureResponseType> > POSTHMACSignatureAsyncWithHttpInfo(POSTHMACSignatureType request) { // verify the required parameter 'request' is set if (request == null) { throw new ApiException(400, "Missing required parameter 'request' when calling HMACSignaturesApi->POSTHMACSignature"); } var localVarPath = "/hmac-signatures"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new Dictionary <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); } // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (request != null && request.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { localVarPostBody = request; // 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("POSTHMACSignature", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <POSTHMACSignatureResponseType>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (POSTHMACSignatureResponseType)Configuration.ApiClient.Deserialize(localVarResponse, typeof(POSTHMACSignatureResponseType)))); }
/// <summary> /// Return HMAC signatures This REST API reference describes how to return unique signature and token values that used to process a [CORS enabled API call](https://knowledgecenter.zuora.com/DC_Developers/REST_API/A_REST_basics/G_CORS_REST). /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="request"></param> /// <returns>Task of POSTHMACSignatureResponseType</returns> public async System.Threading.Tasks.Task <POSTHMACSignatureResponseType> POSTHMACSignatureAsync(POSTHMACSignatureType request) { ApiResponse <POSTHMACSignatureResponseType> localVarResponse = await POSTHMACSignatureAsyncWithHttpInfo(request); return(localVarResponse.Data); }
/// <summary> /// Return HMAC signatures This REST API reference describes how to return unique signature and token values that used to process a [CORS enabled API call](https://knowledgecenter.zuora.com/DC_Developers/REST_API/A_REST_basics/G_CORS_REST). /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="request"></param> /// <returns>POSTHMACSignatureResponseType</returns> public POSTHMACSignatureResponseType POSTHMACSignature(POSTHMACSignatureType request) { ApiResponse <POSTHMACSignatureResponseType> localVarResponse = POSTHMACSignatureWithHttpInfo(request); return(localVarResponse.Data); }