/// <summary>
        /// Initiates the asynchronous execution of the DeleteNode operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteNode operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/managedblockchain-2018-09-24/DeleteNode">REST API Reference for DeleteNode Operation</seealso>
        public virtual Task <DeleteNodeResponse> DeleteNodeAsync(DeleteNodeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteNodeRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteNodeResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteNodeResponse>(request, options, cancellationToken));
        }
        internal virtual DeleteNodeResponse DeleteNode(DeleteNodeRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteNodeRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteNodeResponseUnmarshaller.Instance;

            return(Invoke <DeleteNodeResponse>(request, options));
        }
コード例 #3
0
        /// <summary>
        /// 删除节点
        /// </summary>
        public async Task <DeleteNodeResponse> DeleteNodeAsync(DeleteNodeRequest deleteNodeRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("cluster_id", deleteNodeRequest.ClusterId.ToString());
            urlParam.Add("node_id", deleteNodeRequest.NodeId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/{node_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", deleteNodeRequest);
            HttpResponseMessage response = await DoHttpRequestAsync("DELETE", request);

            return(JsonUtils.DeSerialize <DeleteNodeResponse>(response));
        }
コード例 #4
0
ファイル: OrgDemo.Nodes.cs プロジェクト: juafdiazdam/samples
        /// <summary>
        /// Delete a node.
        /// </summary>
        /// <param name="node">The node to delete.</param>
        /// <returns>The deleted node.</returns>
        private async Task <Node> DeleteNode(Node node)
        {
            if (node != null)
            {
                var deleteNodeRequest = new DeleteNodeRequest
                {
                    ForestId = node.ForestId,
                    TreeId   = node.TreeId,
                    NodeId   = node.Id,
                };

                Console.WriteLine($"Deleting node with ForestId={deleteNodeRequest.ForestId}, TreeId={deleteNodeRequest.TreeId}, NodeId={deleteNodeRequest.NodeId}...");

                Node deletedNode = await this.orgClient.DeleteNodeAsync(deleteNodeRequest).ConfigureAwait(false);

                Console.Write($"Deleted node: ");
                this.PrintNode(deletedNode);
                Console.WriteLine();

                return(deletedNode);
            }

            return(null);
        }
コード例 #5
0
ファイル: NodeService.cs プロジェクト: Steinerd/BetterCMS
        /// <summary>
        /// Deletes the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>
        ///   <c>DeleteNodeResponse</c> with success status.
        /// </returns>
        public DeleteNodeResponse Delete(DeleteNodeRequest request)
        {
            if (request.Data == null || request.CategoryTreeId.HasDefaultValue() || request.Id.HasDefaultValue())
            {
                return new DeleteNodeResponse { Data = false };
            }
            
            categoryService.DeleteCategoryNode(request.Id, request.Data.Version, request.CategoryTreeId);

            return new DeleteNodeResponse { Data = true };
        }
コード例 #6
0
ファイル: NodeService.cs プロジェクト: k4gdw/BetterCMS
        /// <summary>
        /// Deletes the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>
        ///   <c>DeleteNodeResponse</c> with success status.
        /// </returns>
        public DeleteNodeResponse Delete(DeleteNodeRequest request)
        {
            if (request.Data == null || request.SitemapId.HasDefaultValue() || request.Id.HasDefaultValue())
            {
                return new DeleteNodeResponse { Data = false };
            }

            sitemapService.DeleteNode(request.Id, request.Data.Version, request.SitemapId);

            return new DeleteNodeResponse { Data = true };
        }
コード例 #7
0
        /// <summary>
        /// Deletes the node asynchronously
        /// </summary>
        /// <param name="authenticationKey">The authentication key.</param>
        /// <param name="serialNumber">The serial number.</param>
        /// <returns></returns>
        public async Task DeleteNodeAsync(string authenticationKey, string serialNumber)
        {
            var request = new DeleteNodeRequest(authenticationKey, serialNumber);

            await this.ProcessRequest(request);
        }