/// <summary> /// Prepare an object for transfer /// </summary> /// <exception cref="BlueRain.ID4i.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id4n">The ID4N to prepare for transfer</param> /// <param name="request">Transfer preparation status</param> /// <returns>Task of Object</returns> public async System.Threading.Tasks.Task <Object> PrepareAsync(string id4n, TransferSendInfo request) { ApiResponse <Object> localVarResponse = await PrepareAsyncWithHttpInfo(id4n, request); return(localVarResponse.Data); }
/// <summary> /// Prepare an object for transfer /// </summary> /// <exception cref="BlueRain.ID4i.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id4n">The ID4N to prepare for transfer</param> /// <param name="request">Transfer preparation status</param> /// <returns>Task of ApiResponse (Object)</returns> public async System.Threading.Tasks.Task <ApiResponse <Object> > PrepareAsyncWithHttpInfo(string id4n, TransferSendInfo request) { // verify the required parameter 'id4n' is set if (id4n == null) { throw new ApiException(400, "Missing required parameter 'id4n' when calling TransferApi->Prepare"); } // verify the required parameter 'request' is set if (request == null) { throw new ApiException(400, "Missing required parameter 'request' when calling TransferApi->Prepare"); } var localVarPath = "./api/v1/transfers/{id4n}/sendInfo"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <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/xml", "application/json" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/xml", "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (id4n != null) { localVarPathParams.Add("id4n", Configuration.ApiClient.ParameterToString(id4n)); // path parameter } if (request != null && request.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { localVarPostBody = request; // byte array } // authentication (Authorization) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarHeaderParams["Authorization"] = Configuration.GetApiKeyWithPrefix("Authorization"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("Prepare", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <Object>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (Object)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)))); }
/// <summary> /// Prepare an object for transfer /// </summary> /// <exception cref="BlueRain.ID4i.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id4n">The ID4N to prepare for transfer</param> /// <param name="request">Transfer preparation status</param> /// <returns>Object</returns> public Object Prepare(string id4n, TransferSendInfo request) { ApiResponse <Object> localVarResponse = PrepareWithHttpInfo(id4n, request); return(localVarResponse.Data); }