protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!ConfirmDelete("OCIDatacatalogNamespace", "Remove"))
            {
                return;
            }

            DeleteNamespaceRequest request;

            try
            {
                request = new DeleteNamespaceRequest
                {
                    CatalogId    = CatalogId,
                    NamespaceId  = NamespaceId,
                    IfMatch      = IfMatch,
                    OpcRequestId = OpcRequestId
                };

                response = client.DeleteNamespace(request).GetAwaiter().GetResult();
                WriteOutput(response);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Exemplo n.º 2
0
        internal virtual DeleteNamespaceResponse DeleteNamespace(DeleteNamespaceRequest request)
        {
            var marshaller   = DeleteNamespaceRequestMarshaller.Instance;
            var unmarshaller = DeleteNamespaceResponseUnmarshaller.Instance;

            return(Invoke <DeleteNamespaceRequest, DeleteNamespaceResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteNamespace operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteNamespace 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/servicediscovery-2017-03-14/DeleteNamespace">REST API Reference for DeleteNamespace Operation</seealso>
        public virtual Task <DeleteNamespaceResponse> DeleteNamespaceAsync(DeleteNamespaceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DeleteNamespaceRequestMarshaller.Instance;
            var unmarshaller = DeleteNamespaceResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteNamespaceRequest, DeleteNamespaceResponse>(request, marshaller,
                                                                                 unmarshaller, cancellationToken));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteNamespace operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteNamespace 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/servicediscovery-2017-03-14/DeleteNamespace">REST API Reference for DeleteNamespace Operation</seealso>
        public virtual Task <DeleteNamespaceResponse> DeleteNamespaceAsync(DeleteNamespaceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteNamespaceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteNamespaceResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteNamespaceResponse>(request, options, cancellationToken));
        }
Exemplo n.º 5
0
        internal virtual DeleteNamespaceResponse DeleteNamespace(DeleteNamespaceRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteNamespaceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteNamespaceResponseUnmarshaller.Instance;

            return(Invoke <DeleteNamespaceResponse>(request, options));
        }
Exemplo n.º 6
0
        /// <summary>
        /// DeleteNamespace接口的同步版本,该接口根据传入的参数创建命名空间。
        /// </summary>
        /// <param name="req">参考<see cref="DeleteNamespaceRequest"/></param>
        /// <returns>参考<see cref="DeleteNamespaceResponse"/>实例</returns>
        public DeleteNamespaceResponse DeleteNamespaceSync(DeleteNamespaceRequest req)
        {
            JsonResponseModel <DeleteNamespaceResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DeleteNamespace");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DeleteNamespaceResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
Exemplo n.º 7
0
 /// <summary>
 ///  删除namespace,如果旗下关联有其他资源,不允许删除
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <DeleteNamespaceResponse> DeleteNamespace(DeleteNamespaceRequest request)
 {
     return(await new DeleteNamespaceExecutor().Client(this).Execute <DeleteNamespaceResponse, DeleteNamespaceResult, DeleteNamespaceRequest>(request).ConfigureAwait(false));
 }
Exemplo n.º 8
0
 /// <summary>
 ///  删除namespace,如果旗下关联有其他资源,不允许删除
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public DeleteNamespaceResponse DeleteNamespace(DeleteNamespaceRequest request)
 {
     return(new DeleteNamespaceExecutor().Client(this).Execute <DeleteNamespaceResponse, DeleteNamespaceResult, DeleteNamespaceRequest>(request));
 }