Example #1
0
        /// <summary>
        /// Announce the DataHash to NEM/P2P Storage and P2P Database Endpoint that can be use to announce the data hash transaction. This will grab the signed BinaryTransaferTransaction and create the P2P Database Entry for the specific data hash / transaction.
        /// </summary>
        /// <exception cref="Io.Xpx.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="requestAnnounceDataSignature">The Request Announce Data Signature Json Format (optional)</param>
        /// <returns>Task of ApiResponse (string)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <string> > AnnounceRequestPublishDataSignatureUsingPOSTAsyncWithHttpInfo(RequestAnnounceDataSignature requestAnnounceDataSignature = null)
        {
            var    localVarPath         = "/transaction/announce";
            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);
            }

            if (requestAnnounceDataSignature != null && requestAnnounceDataSignature.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(requestAnnounceDataSignature); // http body (model) parameter
            }
            else
            {
                localVarPostBody = requestAnnounceDataSignature; // 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("AnnounceRequestPublishDataSignatureUsingPOST", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <string>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                            (string)Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))));
        }
Example #2
0
        /// <summary>
        /// Announce the DataHash to NEM/P2P Storage and P2P Database Endpoint that can be use to announce the data hash transaction. This will grab the signed BinaryTransaferTransaction and create the P2P Database Entry for the specific data hash / transaction.
        /// </summary>
        /// <exception cref="Io.Xpx.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="requestAnnounceDataSignature">The Request Announce Data Signature Json Format (optional)</param>
        /// <returns>Task of string</returns>
        public async System.Threading.Tasks.Task <string> AnnounceRequestPublishDataSignatureUsingPOSTAsync(RequestAnnounceDataSignature requestAnnounceDataSignature = null)
        {
            ApiResponse <string> localVarResponse = await AnnounceRequestPublishDataSignatureUsingPOSTAsyncWithHttpInfo(requestAnnounceDataSignature);

            return(localVarResponse.Data);
        }
Example #3
0
        /// <summary>
        /// Announce the DataHash to NEM/P2P Storage and P2P Database Endpoint that can be use to announce the data hash transaction. This will grab the signed BinaryTransaferTransaction and create the P2P Database Entry for the specific data hash / transaction.
        /// </summary>
        /// <exception cref="Io.Xpx.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="requestAnnounceDataSignature">The Request Announce Data Signature Json Format (optional)</param>
        /// <returns>string</returns>
        public string AnnounceRequestPublishDataSignatureUsingPOST(RequestAnnounceDataSignature requestAnnounceDataSignature = null)
        {
            ApiResponse <string> localVarResponse = AnnounceRequestPublishDataSignatureUsingPOSTWithHttpInfo(requestAnnounceDataSignature);

            return(localVarResponse.Data);
        }