Container for the parameters to the DeleteFileSystem operation. Deletes a file system, permanently severing access to its contents. Upon return, the file system no longer exists and you can't access any contents of the deleted file system.

You can't delete a file system that is in use. That is, if the file system has any mount targets, you must first delete them. For more information, see DescribeMountTargets and DeleteMountTarget.

The DeleteFileSystem call returns while the file system state is still deleting. You can check the file system deletion status by calling the DescribeFileSystems operation, which returns a list of file systems in your account. If you pass file system ID or creation token for the deleted file system, the DescribeFileSystems returns a 404 FileSystemNotFound error.

This operation requires permissions for the elasticfilesystem:DeleteFileSystem action.

Inheritance: AmazonElasticFileSystemRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ElasticFileSystem.Model.DeleteFileSystemRequest();

            if (cmdletContext.FileSystemId != null)
            {
                request.FileSystemId = cmdletContext.FileSystemId;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteFileSystem operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteFileSystem 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>
        public Task<DeleteFileSystemResponse> DeleteFileSystemAsync(DeleteFileSystemRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DeleteFileSystemRequestMarshaller();
            var unmarshaller = DeleteFileSystemResponseUnmarshaller.Instance;

            return InvokeAsync<DeleteFileSystemRequest,DeleteFileSystemResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal DeleteFileSystemResponse DeleteFileSystem(DeleteFileSystemRequest request)
        {
            var marshaller = new DeleteFileSystemRequestMarshaller();
            var unmarshaller = DeleteFileSystemResponseUnmarshaller.Instance;

            return Invoke<DeleteFileSystemRequest,DeleteFileSystemResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Deletes a file system, permanently severing access to its contents. Upon return,
 /// the file system no longer exists and you will not be able to access any contents of
 /// the deleted file system. 
 /// 
 ///  
 /// <para>
 ///  You cannot delete a file system that is in use. That is, if the file system has any
 /// mount targets, you must first delete them. For more information, see <a>DescribeMountTargets</a>
 /// and <a>DeleteMountTarget</a>. 
 /// </para>
 ///  <note>The <code>DeleteFileSystem</code> call returns while the file system state
 /// is still "deleting". You can check the file system deletion status by calling the
 /// <a>DescribeFileSystems</a> API, which returns a list of file systems in your account.
 /// If you pass file system ID or creation token for the deleted file system, the <a>DescribeFileSystems</a>
 /// will return a 404 "FileSystemNotFound" error.</note> 
 /// <para>
 /// This operation requires permission for the <code>elasticfilesystem:DeleteFileSystem</code>
 /// action.
 /// </para>
 /// </summary>
 /// <param name="fileSystemId">The ID of the file system you want to delete.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the DeleteFileSystem service method, as returned by ElasticFileSystem.</returns>
 /// <exception cref="Amazon.ElasticFileSystem.Model.BadRequestException">
 /// Returned if the request is malformed or contains an error such as an invalid parameter
 /// value or a missing required parameter.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.FileSystemInUseException">
 /// Returned if a file system has mount targets.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.FileSystemNotFoundException">
 /// Returned if the specified <code>FileSystemId</code> does not exist in the requester's
 /// AWS account.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException">
 /// Returned if an error occurred on the server side.
 /// </exception>
 public Task<DeleteFileSystemResponse> DeleteFileSystemAsync(string fileSystemId, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new DeleteFileSystemRequest();
     request.FileSystemId = fileSystemId;
     return DeleteFileSystemAsync(request, cancellationToken);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteFileSystem operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteFileSystem operation on AmazonElasticFileSystemClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteFileSystem
        ///         operation.</returns>
        public IAsyncResult BeginDeleteFileSystem(DeleteFileSystemRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DeleteFileSystemRequestMarshaller();
            var unmarshaller = DeleteFileSystemResponseUnmarshaller.Instance;

            return BeginInvoke<DeleteFileSystemRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// Deletes a file system, permanently severing access to its contents. Upon return,
 /// the file system no longer exists and you will not be able to access any contents of
 /// the deleted file system. 
 /// 
 ///  
 /// <para>
 ///  You cannot delete a file system that is in use. That is, if the file system has any
 /// mount targets, you must first delete them. For more information, see <a>DescribeMountTargets</a>
 /// and <a>DeleteMountTarget</a>. 
 /// </para>
 ///  <note>The <code>DeleteFileSystem</code> call returns while the file system state
 /// is still "deleting". You can check the file system deletion status by calling the
 /// <a>DescribeFileSystems</a> API, which returns a list of file systems in your account.
 /// If you pass file system ID or creation token for the deleted file system, the <a>DescribeFileSystems</a>
 /// will return a 404 "FileSystemNotFound" error.</note> 
 /// <para>
 /// This operation requires permission for the <code>elasticfilesystem:DeleteFileSystem</code>
 /// action.
 /// </para>
 /// </summary>
 /// <param name="fileSystemId">The ID of the file system you want to delete.</param>
 /// 
 /// <returns>The response from the DeleteFileSystem service method, as returned by ElasticFileSystem.</returns>
 /// <exception cref="Amazon.ElasticFileSystem.Model.BadRequestException">
 /// Returned if the request is malformed or contains an error such as an invalid parameter
 /// value or a missing required parameter.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.FileSystemInUseException">
 /// Returned if a file system has mount targets.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.FileSystemNotFoundException">
 /// Returned if the specified <code>FileSystemId</code> does not exist in the requester's
 /// AWS account.
 /// </exception>
 /// <exception cref="Amazon.ElasticFileSystem.Model.InternalServerErrorException">
 /// Returned if an error occurred on the server side.
 /// </exception>
 public DeleteFileSystemResponse DeleteFileSystem(string fileSystemId)
 {
     var request = new DeleteFileSystemRequest();
     request.FileSystemId = fileSystemId;
     return DeleteFileSystem(request);
 }
 private Amazon.ElasticFileSystem.Model.DeleteFileSystemResponse CallAWSServiceOperation(IAmazonElasticFileSystem client, Amazon.ElasticFileSystem.Model.DeleteFileSystemRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic File System", "DeleteFileSystem");
     try
     {
         #if DESKTOP
         return(client.DeleteFileSystem(request));
         #elif CORECLR
         return(client.DeleteFileSystemAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }