/// <summary>
 /// Transfer a GUID or collection, obtaining it (i.e. becoming the holder) and if allowed also taking ownership Taking ownership can be forbidden by a previous owner. See methods prepare and getInfo
 /// </summary>
 /// <exception cref="BlueRain.ID4i.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="id4n">This ID4N identifies the object to take hold of</param>
 /// <param name="request">Required information to receive an id4n object</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task ReceiveAsync(string id4n, TransferReceiveInfo request)
 {
     await ReceiveAsyncWithHttpInfo(id4n, request);
 }
        /// <summary>
        /// Transfer a GUID or collection, obtaining it (i.e. becoming the holder) and if allowed also taking ownership Taking ownership can be forbidden by a previous owner. See methods prepare and getInfo
        /// </summary>
        /// <exception cref="BlueRain.ID4i.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id4n">This ID4N identifies the object to take hold of</param>
        /// <param name="request">Required information to receive an id4n object</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > ReceiveAsyncWithHttpInfo(string id4n, TransferReceiveInfo request)
        {
            // verify the required parameter 'id4n' is set
            if (id4n == null)
            {
                throw new ApiException(400, "Missing required parameter 'id4n' when calling TransferApi->Receive");
            }
            // verify the required parameter 'request' is set
            if (request == null)
            {
                throw new ApiException(400, "Missing required parameter 'request' when calling TransferApi->Receive");
            }

            var    localVarPath         = "./api/v1/transfers/{id4n}/receiveInfo";
            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("Receive", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
                                            null));
        }
 /// <summary>
 /// Transfer a GUID or collection, obtaining it (i.e. becoming the holder) and if allowed also taking ownership Taking ownership can be forbidden by a previous owner. See methods prepare and getInfo
 /// </summary>
 /// <exception cref="BlueRain.ID4i.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="id4n">This ID4N identifies the object to take hold of</param>
 /// <param name="request">Required information to receive an id4n object</param>
 /// <returns></returns>
 public void Receive(string id4n, TransferReceiveInfo request)
 {
     ReceiveWithHttpInfo(id4n, request);
 }