/// <summary> /// CRUD: Create Export /// </summary> /// <param name="createRequest"></param> /// <returns>ProxyCreateOrModifyResponse</returns> public ProxyCreateOrModifyResponse ProxyPOSTExport(ProxyCreateExport createRequest) { // verify the required parameter 'createRequest' is set if (createRequest == null) { throw new ApiException(400, "Missing required parameter 'createRequest' when calling ProxyPOSTExport"); } var path = "/object/export"; 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(createRequest); // 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 ProxyPOSTExport: " + response.Content, response.Content); } else if (((int)response.StatusCode) == 0) { throw new ApiException((int)response.StatusCode, "Error calling ProxyPOSTExport: " + response.ErrorMessage, response.ErrorMessage); } return((ProxyCreateOrModifyResponse)ApiClient.Deserialize(response.Content, typeof(ProxyCreateOrModifyResponse), response.Headers)); }
/// <summary> /// CRUD: Create Export /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="createRequest"></param> /// <returns>Task of ProxyCreateOrModifyResponse</returns> public async System.Threading.Tasks.Task <ProxyCreateOrModifyResponse> ProxyPOSTExportAsync(ProxyCreateExport createRequest) { ApiResponse <ProxyCreateOrModifyResponse> localVarResponse = await ProxyPOSTExportAsyncWithHttpInfo(createRequest); return(localVarResponse.Data); }
/// <summary> /// CRUD: Create Export /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="createRequest"></param> /// <returns>Task of ApiResponse (ProxyCreateOrModifyResponse)</returns> public async System.Threading.Tasks.Task <ApiResponse <ProxyCreateOrModifyResponse> > ProxyPOSTExportAsyncWithHttpInfo(ProxyCreateExport createRequest) { // verify the required parameter 'createRequest' is set if (createRequest == null) { throw new ApiException(400, "Missing required parameter 'createRequest' when calling ExportsApi->ProxyPOSTExport"); } var localVarPath = "/object/export"; 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 (createRequest != null && createRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(createRequest); // http body (model) parameter } else { localVarPostBody = createRequest; // 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("ProxyPOSTExport", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <ProxyCreateOrModifyResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (ProxyCreateOrModifyResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ProxyCreateOrModifyResponse)))); }
/// <summary> /// CRUD: Create Export /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="createRequest"></param> /// <returns>ProxyCreateOrModifyResponse</returns> public ProxyCreateOrModifyResponse ProxyPOSTExport(ProxyCreateExport createRequest) { ApiResponse <ProxyCreateOrModifyResponse> localVarResponse = ProxyPOSTExportWithHttpInfo(createRequest); return(localVarResponse.Data); }