private Amazon.FSx.Model.DeleteFileSystemResponse CallAWSServiceOperation(IAmazonFSx client, Amazon.FSx.Model.DeleteFileSystemRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon FSx", "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;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.FSx.Model.DeleteFileSystemRequest();

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

            // populate LustreConfiguration
            var requestLustreConfigurationIsNull = true;

            request.LustreConfiguration = new Amazon.FSx.Model.DeleteFileSystemLustreConfiguration();
            List <Amazon.FSx.Model.Tag> requestLustreConfiguration_lustreConfiguration_FinalBackupTag = null;

            if (cmdletContext.LustreConfiguration_FinalBackupTag != null)
            {
                requestLustreConfiguration_lustreConfiguration_FinalBackupTag = cmdletContext.LustreConfiguration_FinalBackupTag;
            }
            if (requestLustreConfiguration_lustreConfiguration_FinalBackupTag != null)
            {
                request.LustreConfiguration.FinalBackupTags = requestLustreConfiguration_lustreConfiguration_FinalBackupTag;
                requestLustreConfigurationIsNull            = false;
            }
            System.Boolean?requestLustreConfiguration_lustreConfiguration_SkipFinalBackup = null;
            if (cmdletContext.LustreConfiguration_SkipFinalBackup != null)
            {
                requestLustreConfiguration_lustreConfiguration_SkipFinalBackup = cmdletContext.LustreConfiguration_SkipFinalBackup.Value;
            }
            if (requestLustreConfiguration_lustreConfiguration_SkipFinalBackup != null)
            {
                request.LustreConfiguration.SkipFinalBackup = requestLustreConfiguration_lustreConfiguration_SkipFinalBackup.Value;
                requestLustreConfigurationIsNull            = false;
            }
            // determine if request.LustreConfiguration should be set to null
            if (requestLustreConfigurationIsNull)
            {
                request.LustreConfiguration = null;
            }

            // populate OpenZFSConfiguration
            var requestOpenZFSConfigurationIsNull = true;

            request.OpenZFSConfiguration = new Amazon.FSx.Model.DeleteFileSystemOpenZFSConfiguration();
            List <Amazon.FSx.Model.Tag> requestOpenZFSConfiguration_openZFSConfiguration_FinalBackupTag = null;

            if (cmdletContext.OpenZFSConfiguration_FinalBackupTag != null)
            {
                requestOpenZFSConfiguration_openZFSConfiguration_FinalBackupTag = cmdletContext.OpenZFSConfiguration_FinalBackupTag;
            }
            if (requestOpenZFSConfiguration_openZFSConfiguration_FinalBackupTag != null)
            {
                request.OpenZFSConfiguration.FinalBackupTags = requestOpenZFSConfiguration_openZFSConfiguration_FinalBackupTag;
                requestOpenZFSConfigurationIsNull            = false;
            }
            System.Boolean?requestOpenZFSConfiguration_openZFSConfiguration_SkipFinalBackup = null;
            if (cmdletContext.OpenZFSConfiguration_SkipFinalBackup != null)
            {
                requestOpenZFSConfiguration_openZFSConfiguration_SkipFinalBackup = cmdletContext.OpenZFSConfiguration_SkipFinalBackup.Value;
            }
            if (requestOpenZFSConfiguration_openZFSConfiguration_SkipFinalBackup != null)
            {
                request.OpenZFSConfiguration.SkipFinalBackup = requestOpenZFSConfiguration_openZFSConfiguration_SkipFinalBackup.Value;
                requestOpenZFSConfigurationIsNull            = false;
            }
            // determine if request.OpenZFSConfiguration should be set to null
            if (requestOpenZFSConfigurationIsNull)
            {
                request.OpenZFSConfiguration = null;
            }

            // populate WindowsConfiguration
            var requestWindowsConfigurationIsNull = true;

            request.WindowsConfiguration = new Amazon.FSx.Model.DeleteFileSystemWindowsConfiguration();
            List <Amazon.FSx.Model.Tag> requestWindowsConfiguration_windowsConfiguration_FinalBackupTag = null;

            if (cmdletContext.WindowsConfiguration_FinalBackupTag != null)
            {
                requestWindowsConfiguration_windowsConfiguration_FinalBackupTag = cmdletContext.WindowsConfiguration_FinalBackupTag;
            }
            if (requestWindowsConfiguration_windowsConfiguration_FinalBackupTag != null)
            {
                request.WindowsConfiguration.FinalBackupTags = requestWindowsConfiguration_windowsConfiguration_FinalBackupTag;
                requestWindowsConfigurationIsNull            = false;
            }
            System.Boolean?requestWindowsConfiguration_windowsConfiguration_SkipFinalBackup = null;
            if (cmdletContext.WindowsConfiguration_SkipFinalBackup != null)
            {
                requestWindowsConfiguration_windowsConfiguration_SkipFinalBackup = cmdletContext.WindowsConfiguration_SkipFinalBackup.Value;
            }
            if (requestWindowsConfiguration_windowsConfiguration_SkipFinalBackup != null)
            {
                request.WindowsConfiguration.SkipFinalBackup = requestWindowsConfiguration_windowsConfiguration_SkipFinalBackup.Value;
                requestWindowsConfigurationIsNull            = false;
            }
            // determine if request.WindowsConfiguration should be set to null
            if (requestWindowsConfigurationIsNull)
            {
                request.WindowsConfiguration = null;
            }

            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);
        }