{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DataSync.Types.Options
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DataSync.Types.Options where

import qualified Amazonka.Core as Core
import Amazonka.DataSync.Types.Atime
import Amazonka.DataSync.Types.Gid
import Amazonka.DataSync.Types.LogLevel
import Amazonka.DataSync.Types.Mtime
import Amazonka.DataSync.Types.OverwriteMode
import Amazonka.DataSync.Types.PosixPermissions
import Amazonka.DataSync.Types.PreserveDeletedFiles
import Amazonka.DataSync.Types.PreserveDevices
import Amazonka.DataSync.Types.SmbSecurityDescriptorCopyFlags
import Amazonka.DataSync.Types.TaskQueueing
import Amazonka.DataSync.Types.TransferMode
import Amazonka.DataSync.Types.Uid
import Amazonka.DataSync.Types.VerifyMode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the options that are available to control the behavior of a
-- <https://docs.aws.amazon.com/datasync/latest/userguide/API_StartTaskExecution.html StartTaskExecution>
-- operation. Behavior includes preserving metadata such as user ID (UID),
-- group ID (GID), and file permissions, and also overwriting files in the
-- destination, data integrity verification, and so on.
--
-- A task has a set of default options associated with it. If you don\'t
-- specify an option in
-- <https://docs.aws.amazon.com/datasync/latest/userguide/API_StartTaskExecution.html StartTaskExecution>,
-- the default value is used. You can override the defaults options on each
-- task execution by specifying an overriding @Options@ value to
-- <https://docs.aws.amazon.com/datasync/latest/userguide/API_StartTaskExecution.html StartTaskExecution>.
--
-- /See:/ 'newOptions' smart constructor.
data Options = Options'
  { -- | A file metadata value that shows the last time a file was accessed (that
    -- is, when the file was read or written to). If you set @Atime@ to
    -- BEST_EFFORT, DataSync attempts to preserve the original @Atime@
    -- attribute on all source files (that is, the version before the PREPARING
    -- phase). However, @Atime@\'s behavior is not fully standard across
    -- platforms, so DataSync can only do this on a best-effort basis.
    --
    -- Default value: BEST_EFFORT.
    --
    -- BEST_EFFORT: Attempt to preserve the per-file @Atime@ value
    -- (recommended).
    --
    -- NONE: Ignore @Atime@.
    --
    -- If @Atime@ is set to BEST_EFFORT, @Mtime@ must be set to PRESERVE.
    --
    -- If @Atime@ is set to NONE, @Mtime@ must also be NONE.
    Options -> Maybe Atime
atime :: Prelude.Maybe Atime,
    -- | A value that determines whether a data integrity verification should be
    -- performed at the end of a task execution after all data and metadata
    -- have been transferred. For more information, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/create-task.html Configure task settings>.
    --
    -- Default value: POINT_IN_TIME_CONSISTENT.
    --
    -- ONLY_FILES_TRANSFERRED (recommended): Perform verification only on files
    -- that were transferred.
    --
    -- POINT_IN_TIME_CONSISTENT: Scan the entire source and entire destination
    -- at the end of the transfer to verify that source and destination are
    -- fully synchronized. This option isn\'t supported when transferring to S3
    -- Glacier or S3 Glacier Deep Archive storage classes.
    --
    -- NONE: No additional verification is done at the end of the transfer, but
    -- all data transmissions are integrity-checked with checksum verification
    -- during the transfer.
    Options -> Maybe VerifyMode
verifyMode :: Prelude.Maybe VerifyMode,
    -- | A value that determines whether tasks should be queued before executing
    -- the tasks. If set to @ENABLED@, the tasks will be queued. The default is
    -- @ENABLED@.
    --
    -- If you use the same agent to run multiple tasks, you can enable the
    -- tasks to run in series. For more information, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#queue-task-execution Queueing task executions>.
    Options -> Maybe TaskQueueing
taskQueueing :: Prelude.Maybe TaskQueueing,
    -- | A value that determines the type of logs that DataSync publishes to a
    -- log stream in the Amazon CloudWatch log group that you provide. For more
    -- information about providing a log group for DataSync, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/API_CreateTask.html#DataSync-CreateTask-request-CloudWatchLogGroupArn CloudWatchLogGroupArn>.
    -- If set to @OFF@, no logs are published. @BASIC@ publishes logs on errors
    -- for individual files transferred, and @TRANSFER@ publishes logs for
    -- every file or object that is transferred and integrity checked.
    Options -> Maybe LogLevel
logLevel :: Prelude.Maybe LogLevel,
    -- | A value that determines which users or groups can access a file for a
    -- specific purpose such as reading, writing, or execution of the file.
    -- This option should only be set for NFS, EFS, and S3 locations. For more
    -- information about what metadata is copied by DataSync, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
    --
    -- Default value: PRESERVE.
    --
    -- PRESERVE: Preserve POSIX-style permissions (recommended).
    --
    -- NONE: Ignore permissions.
    --
    -- DataSync can preserve extant permissions of a source location.
    Options -> Maybe PosixPermissions
posixPermissions :: Prelude.Maybe PosixPermissions,
    -- | A value that indicates the last time that a file was modified (that is,
    -- a file was written to) before the PREPARING phase. This option is
    -- required for cases when you need to run the same task more than one
    -- time.
    --
    -- Default value: PRESERVE.
    --
    -- PRESERVE: Preserve original @Mtime@ (recommended)
    --
    -- NONE: Ignore @Mtime@.
    --
    -- If @Mtime@ is set to PRESERVE, @Atime@ must be set to BEST_EFFORT.
    --
    -- If @Mtime@ is set to NONE, @Atime@ must also be set to NONE.
    Options -> Maybe Mtime
mtime :: Prelude.Maybe Mtime,
    -- | The POSIX user ID (UID) of the file\'s owner. This option should only be
    -- set for NFS, EFS, and S3 locations. To learn more about what metadata is
    -- copied by DataSync, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
    --
    -- Default value: INT_VALUE. This preserves the integer value of the ID.
    --
    -- INT_VALUE: Preserve the integer value of UID and group ID (GID)
    -- (recommended).
    --
    -- NONE: Ignore UID and GID.
    Options -> Maybe Uid
uid :: Prelude.Maybe Uid,
    -- | A value that limits the bandwidth used by DataSync. For example, if you
    -- want DataSync to use a maximum of 1 MB, set this value to @1048576@
    -- (@=1024*1024@).
    Options -> Maybe Integer
bytesPerSecond :: Prelude.Maybe Prelude.Integer,
    -- | A value that determines which components of the SMB security descriptor
    -- are copied from source to destination objects.
    --
    -- This value is only used for transfers between SMB and Amazon FSx for
    -- Windows File Server locations, or between two Amazon FSx for Windows
    -- File Server locations. For more information about how DataSync handles
    -- metadata, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html How DataSync Handles Metadata and Special Files>.
    --
    -- Default value: OWNER_DACL.
    --
    -- __OWNER_DACL__: For each copied object, DataSync copies the following
    -- metadata:
    --
    -- -   Object owner.
    --
    -- -   NTFS discretionary access control lists (DACLs), which determine
    --     whether to grant access to an object.
    --
    -- When choosing this option, DataSync does NOT copy the NTFS system access
    -- control lists (SACLs), which are used by administrators to log attempts
    -- to access a secured object.
    --
    -- __OWNER_DACL_SACL__: For each copied object, DataSync copies the
    -- following metadata:
    --
    -- -   Object owner.
    --
    -- -   NTFS discretionary access control lists (DACLs), which determine
    --     whether to grant access to an object.
    --
    -- -   NTFS system access control lists (SACLs), which are used by
    --     administrators to log attempts to access a secured object.
    --
    -- Copying SACLs requires granting additional permissions to the Windows
    -- user that DataSync uses to access your SMB location. For information
    -- about choosing a user that ensures sufficient permissions to files,
    -- folders, and metadata, see <create-smb-location.html#SMBuser user>.
    --
    -- __NONE__: None of the SMB security descriptor components are copied.
    -- Destination objects are owned by the user that was provided for
    -- accessing the destination location. DACLs and SACLs are set based on the
    -- destination server’s configuration.
    Options -> Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags :: Prelude.Maybe SmbSecurityDescriptorCopyFlags,
    -- | The POSIX group ID (GID) of the file\'s owners. This option should only
    -- be set for NFS, EFS, and S3 locations. For more information about what
    -- metadata is copied by DataSync, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
    --
    -- Default value: INT_VALUE. This preserves the integer value of the ID.
    --
    -- INT_VALUE: Preserve the integer value of user ID (UID) and GID
    -- (recommended).
    --
    -- NONE: Ignore UID and GID.
    Options -> Maybe Gid
gid :: Prelude.Maybe Gid,
    -- | A value that determines whether files at the destination should be
    -- overwritten or preserved when copying files. If set to @NEVER@ a
    -- destination file will not be replaced by a source file, even if the
    -- destination file differs from the source file. If you modify files in
    -- the destination and you sync the files, you can use this value to
    -- protect against overwriting those changes.
    --
    -- Some storage classes have specific behaviors that can affect your S3
    -- storage cost. For detailed information, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes Considerations when working with Amazon S3 storage classes in DataSync>
    -- in the /DataSync User Guide/.
    Options -> Maybe OverwriteMode
overwriteMode :: Prelude.Maybe OverwriteMode,
    -- | A value that determines whether DataSync transfers only the data and
    -- metadata that differ between the source and the destination location, or
    -- whether DataSync transfers all the content from the source, without
    -- comparing to the destination location.
    --
    -- CHANGED: DataSync copies only data or metadata that is new or different
    -- content from the source location to the destination location.
    --
    -- ALL: DataSync copies all source location content to the destination,
    -- without comparing to existing content on the destination.
    Options -> Maybe TransferMode
transferMode :: Prelude.Maybe TransferMode,
    -- | A value that specifies whether files in the destination that don\'t
    -- exist in the source file system should be preserved. This option can
    -- affect your storage cost. If your task deletes objects, you might incur
    -- minimum storage duration charges for certain storage classes. For
    -- detailed information, see
    -- <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes Considerations when working with Amazon S3 storage classes in DataSync>
    -- in the /DataSync User Guide/.
    --
    -- Default value: PRESERVE.
    --
    -- PRESERVE: Ignore such destination files (recommended).
    --
    -- REMOVE: Delete destination files that aren’t present in the source.
    Options -> Maybe PreserveDeletedFiles
preserveDeletedFiles :: Prelude.Maybe PreserveDeletedFiles,
    -- | A value that determines whether DataSync should preserve the metadata of
    -- block and character devices in the source file system, and re-create the
    -- files with that device name and metadata on the destination. DataSync
    -- does not copy the contents of such devices, only the name and metadata.
    --
    -- DataSync can\'t sync the actual contents of such devices, because they
    -- are nonterminal and don\'t return an end-of-file (EOF) marker.
    --
    -- Default value: NONE.
    --
    -- NONE: Ignore special devices (recommended).
    --
    -- PRESERVE: Preserve character and block device metadata. This option
    -- isn\'t currently supported for Amazon EFS.
    Options -> Maybe PreserveDevices
preserveDevices :: Prelude.Maybe PreserveDevices
  }
  deriving (Options -> Options -> Bool
(Options -> Options -> Bool)
-> (Options -> Options -> Bool) -> Eq Options
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Options -> Options -> Bool
$c/= :: Options -> Options -> Bool
== :: Options -> Options -> Bool
$c== :: Options -> Options -> Bool
Prelude.Eq, ReadPrec [Options]
ReadPrec Options
Int -> ReadS Options
ReadS [Options]
(Int -> ReadS Options)
-> ReadS [Options]
-> ReadPrec Options
-> ReadPrec [Options]
-> Read Options
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Options]
$creadListPrec :: ReadPrec [Options]
readPrec :: ReadPrec Options
$creadPrec :: ReadPrec Options
readList :: ReadS [Options]
$creadList :: ReadS [Options]
readsPrec :: Int -> ReadS Options
$creadsPrec :: Int -> ReadS Options
Prelude.Read, Int -> Options -> ShowS
[Options] -> ShowS
Options -> String
(Int -> Options -> ShowS)
-> (Options -> String) -> ([Options] -> ShowS) -> Show Options
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Options] -> ShowS
$cshowList :: [Options] -> ShowS
show :: Options -> String
$cshow :: Options -> String
showsPrec :: Int -> Options -> ShowS
$cshowsPrec :: Int -> Options -> ShowS
Prelude.Show, (forall x. Options -> Rep Options x)
-> (forall x. Rep Options x -> Options) -> Generic Options
forall x. Rep Options x -> Options
forall x. Options -> Rep Options x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Options x -> Options
$cfrom :: forall x. Options -> Rep Options x
Prelude.Generic)

-- |
-- Create a value of 'Options' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'atime', 'options_atime' - A file metadata value that shows the last time a file was accessed (that
-- is, when the file was read or written to). If you set @Atime@ to
-- BEST_EFFORT, DataSync attempts to preserve the original @Atime@
-- attribute on all source files (that is, the version before the PREPARING
-- phase). However, @Atime@\'s behavior is not fully standard across
-- platforms, so DataSync can only do this on a best-effort basis.
--
-- Default value: BEST_EFFORT.
--
-- BEST_EFFORT: Attempt to preserve the per-file @Atime@ value
-- (recommended).
--
-- NONE: Ignore @Atime@.
--
-- If @Atime@ is set to BEST_EFFORT, @Mtime@ must be set to PRESERVE.
--
-- If @Atime@ is set to NONE, @Mtime@ must also be NONE.
--
-- 'verifyMode', 'options_verifyMode' - A value that determines whether a data integrity verification should be
-- performed at the end of a task execution after all data and metadata
-- have been transferred. For more information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-task.html Configure task settings>.
--
-- Default value: POINT_IN_TIME_CONSISTENT.
--
-- ONLY_FILES_TRANSFERRED (recommended): Perform verification only on files
-- that were transferred.
--
-- POINT_IN_TIME_CONSISTENT: Scan the entire source and entire destination
-- at the end of the transfer to verify that source and destination are
-- fully synchronized. This option isn\'t supported when transferring to S3
-- Glacier or S3 Glacier Deep Archive storage classes.
--
-- NONE: No additional verification is done at the end of the transfer, but
-- all data transmissions are integrity-checked with checksum verification
-- during the transfer.
--
-- 'taskQueueing', 'options_taskQueueing' - A value that determines whether tasks should be queued before executing
-- the tasks. If set to @ENABLED@, the tasks will be queued. The default is
-- @ENABLED@.
--
-- If you use the same agent to run multiple tasks, you can enable the
-- tasks to run in series. For more information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#queue-task-execution Queueing task executions>.
--
-- 'logLevel', 'options_logLevel' - A value that determines the type of logs that DataSync publishes to a
-- log stream in the Amazon CloudWatch log group that you provide. For more
-- information about providing a log group for DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/API_CreateTask.html#DataSync-CreateTask-request-CloudWatchLogGroupArn CloudWatchLogGroupArn>.
-- If set to @OFF@, no logs are published. @BASIC@ publishes logs on errors
-- for individual files transferred, and @TRANSFER@ publishes logs for
-- every file or object that is transferred and integrity checked.
--
-- 'posixPermissions', 'options_posixPermissions' - A value that determines which users or groups can access a file for a
-- specific purpose such as reading, writing, or execution of the file.
-- This option should only be set for NFS, EFS, and S3 locations. For more
-- information about what metadata is copied by DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
--
-- Default value: PRESERVE.
--
-- PRESERVE: Preserve POSIX-style permissions (recommended).
--
-- NONE: Ignore permissions.
--
-- DataSync can preserve extant permissions of a source location.
--
-- 'mtime', 'options_mtime' - A value that indicates the last time that a file was modified (that is,
-- a file was written to) before the PREPARING phase. This option is
-- required for cases when you need to run the same task more than one
-- time.
--
-- Default value: PRESERVE.
--
-- PRESERVE: Preserve original @Mtime@ (recommended)
--
-- NONE: Ignore @Mtime@.
--
-- If @Mtime@ is set to PRESERVE, @Atime@ must be set to BEST_EFFORT.
--
-- If @Mtime@ is set to NONE, @Atime@ must also be set to NONE.
--
-- 'uid', 'options_uid' - The POSIX user ID (UID) of the file\'s owner. This option should only be
-- set for NFS, EFS, and S3 locations. To learn more about what metadata is
-- copied by DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
--
-- Default value: INT_VALUE. This preserves the integer value of the ID.
--
-- INT_VALUE: Preserve the integer value of UID and group ID (GID)
-- (recommended).
--
-- NONE: Ignore UID and GID.
--
-- 'bytesPerSecond', 'options_bytesPerSecond' - A value that limits the bandwidth used by DataSync. For example, if you
-- want DataSync to use a maximum of 1 MB, set this value to @1048576@
-- (@=1024*1024@).
--
-- 'securityDescriptorCopyFlags', 'options_securityDescriptorCopyFlags' - A value that determines which components of the SMB security descriptor
-- are copied from source to destination objects.
--
-- This value is only used for transfers between SMB and Amazon FSx for
-- Windows File Server locations, or between two Amazon FSx for Windows
-- File Server locations. For more information about how DataSync handles
-- metadata, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html How DataSync Handles Metadata and Special Files>.
--
-- Default value: OWNER_DACL.
--
-- __OWNER_DACL__: For each copied object, DataSync copies the following
-- metadata:
--
-- -   Object owner.
--
-- -   NTFS discretionary access control lists (DACLs), which determine
--     whether to grant access to an object.
--
-- When choosing this option, DataSync does NOT copy the NTFS system access
-- control lists (SACLs), which are used by administrators to log attempts
-- to access a secured object.
--
-- __OWNER_DACL_SACL__: For each copied object, DataSync copies the
-- following metadata:
--
-- -   Object owner.
--
-- -   NTFS discretionary access control lists (DACLs), which determine
--     whether to grant access to an object.
--
-- -   NTFS system access control lists (SACLs), which are used by
--     administrators to log attempts to access a secured object.
--
-- Copying SACLs requires granting additional permissions to the Windows
-- user that DataSync uses to access your SMB location. For information
-- about choosing a user that ensures sufficient permissions to files,
-- folders, and metadata, see <create-smb-location.html#SMBuser user>.
--
-- __NONE__: None of the SMB security descriptor components are copied.
-- Destination objects are owned by the user that was provided for
-- accessing the destination location. DACLs and SACLs are set based on the
-- destination server’s configuration.
--
-- 'gid', 'options_gid' - The POSIX group ID (GID) of the file\'s owners. This option should only
-- be set for NFS, EFS, and S3 locations. For more information about what
-- metadata is copied by DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
--
-- Default value: INT_VALUE. This preserves the integer value of the ID.
--
-- INT_VALUE: Preserve the integer value of user ID (UID) and GID
-- (recommended).
--
-- NONE: Ignore UID and GID.
--
-- 'overwriteMode', 'options_overwriteMode' - A value that determines whether files at the destination should be
-- overwritten or preserved when copying files. If set to @NEVER@ a
-- destination file will not be replaced by a source file, even if the
-- destination file differs from the source file. If you modify files in
-- the destination and you sync the files, you can use this value to
-- protect against overwriting those changes.
--
-- Some storage classes have specific behaviors that can affect your S3
-- storage cost. For detailed information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes Considerations when working with Amazon S3 storage classes in DataSync>
-- in the /DataSync User Guide/.
--
-- 'transferMode', 'options_transferMode' - A value that determines whether DataSync transfers only the data and
-- metadata that differ between the source and the destination location, or
-- whether DataSync transfers all the content from the source, without
-- comparing to the destination location.
--
-- CHANGED: DataSync copies only data or metadata that is new or different
-- content from the source location to the destination location.
--
-- ALL: DataSync copies all source location content to the destination,
-- without comparing to existing content on the destination.
--
-- 'preserveDeletedFiles', 'options_preserveDeletedFiles' - A value that specifies whether files in the destination that don\'t
-- exist in the source file system should be preserved. This option can
-- affect your storage cost. If your task deletes objects, you might incur
-- minimum storage duration charges for certain storage classes. For
-- detailed information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes Considerations when working with Amazon S3 storage classes in DataSync>
-- in the /DataSync User Guide/.
--
-- Default value: PRESERVE.
--
-- PRESERVE: Ignore such destination files (recommended).
--
-- REMOVE: Delete destination files that aren’t present in the source.
--
-- 'preserveDevices', 'options_preserveDevices' - A value that determines whether DataSync should preserve the metadata of
-- block and character devices in the source file system, and re-create the
-- files with that device name and metadata on the destination. DataSync
-- does not copy the contents of such devices, only the name and metadata.
--
-- DataSync can\'t sync the actual contents of such devices, because they
-- are nonterminal and don\'t return an end-of-file (EOF) marker.
--
-- Default value: NONE.
--
-- NONE: Ignore special devices (recommended).
--
-- PRESERVE: Preserve character and block device metadata. This option
-- isn\'t currently supported for Amazon EFS.
newOptions ::
  Options
newOptions :: Options
newOptions =
  Options' :: Maybe Atime
-> Maybe VerifyMode
-> Maybe TaskQueueing
-> Maybe LogLevel
-> Maybe PosixPermissions
-> Maybe Mtime
-> Maybe Uid
-> Maybe Integer
-> Maybe SmbSecurityDescriptorCopyFlags
-> Maybe Gid
-> Maybe OverwriteMode
-> Maybe TransferMode
-> Maybe PreserveDeletedFiles
-> Maybe PreserveDevices
-> Options
Options'
    { $sel:atime:Options' :: Maybe Atime
atime = Maybe Atime
forall a. Maybe a
Prelude.Nothing,
      $sel:verifyMode:Options' :: Maybe VerifyMode
verifyMode = Maybe VerifyMode
forall a. Maybe a
Prelude.Nothing,
      $sel:taskQueueing:Options' :: Maybe TaskQueueing
taskQueueing = Maybe TaskQueueing
forall a. Maybe a
Prelude.Nothing,
      $sel:logLevel:Options' :: Maybe LogLevel
logLevel = Maybe LogLevel
forall a. Maybe a
Prelude.Nothing,
      $sel:posixPermissions:Options' :: Maybe PosixPermissions
posixPermissions = Maybe PosixPermissions
forall a. Maybe a
Prelude.Nothing,
      $sel:mtime:Options' :: Maybe Mtime
mtime = Maybe Mtime
forall a. Maybe a
Prelude.Nothing,
      $sel:uid:Options' :: Maybe Uid
uid = Maybe Uid
forall a. Maybe a
Prelude.Nothing,
      $sel:bytesPerSecond:Options' :: Maybe Integer
bytesPerSecond = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:securityDescriptorCopyFlags:Options' :: Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags = Maybe SmbSecurityDescriptorCopyFlags
forall a. Maybe a
Prelude.Nothing,
      $sel:gid:Options' :: Maybe Gid
gid = Maybe Gid
forall a. Maybe a
Prelude.Nothing,
      $sel:overwriteMode:Options' :: Maybe OverwriteMode
overwriteMode = Maybe OverwriteMode
forall a. Maybe a
Prelude.Nothing,
      $sel:transferMode:Options' :: Maybe TransferMode
transferMode = Maybe TransferMode
forall a. Maybe a
Prelude.Nothing,
      $sel:preserveDeletedFiles:Options' :: Maybe PreserveDeletedFiles
preserveDeletedFiles = Maybe PreserveDeletedFiles
forall a. Maybe a
Prelude.Nothing,
      $sel:preserveDevices:Options' :: Maybe PreserveDevices
preserveDevices = Maybe PreserveDevices
forall a. Maybe a
Prelude.Nothing
    }

-- | A file metadata value that shows the last time a file was accessed (that
-- is, when the file was read or written to). If you set @Atime@ to
-- BEST_EFFORT, DataSync attempts to preserve the original @Atime@
-- attribute on all source files (that is, the version before the PREPARING
-- phase). However, @Atime@\'s behavior is not fully standard across
-- platforms, so DataSync can only do this on a best-effort basis.
--
-- Default value: BEST_EFFORT.
--
-- BEST_EFFORT: Attempt to preserve the per-file @Atime@ value
-- (recommended).
--
-- NONE: Ignore @Atime@.
--
-- If @Atime@ is set to BEST_EFFORT, @Mtime@ must be set to PRESERVE.
--
-- If @Atime@ is set to NONE, @Mtime@ must also be NONE.
options_atime :: Lens.Lens' Options (Prelude.Maybe Atime)
options_atime :: (Maybe Atime -> f (Maybe Atime)) -> Options -> f Options
options_atime = (Options -> Maybe Atime)
-> (Options -> Maybe Atime -> Options)
-> Lens Options Options (Maybe Atime) (Maybe Atime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe Atime
atime :: Maybe Atime
$sel:atime:Options' :: Options -> Maybe Atime
atime} -> Maybe Atime
atime) (\s :: Options
s@Options' {} Maybe Atime
a -> Options
s {$sel:atime:Options' :: Maybe Atime
atime = Maybe Atime
a} :: Options)

-- | A value that determines whether a data integrity verification should be
-- performed at the end of a task execution after all data and metadata
-- have been transferred. For more information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-task.html Configure task settings>.
--
-- Default value: POINT_IN_TIME_CONSISTENT.
--
-- ONLY_FILES_TRANSFERRED (recommended): Perform verification only on files
-- that were transferred.
--
-- POINT_IN_TIME_CONSISTENT: Scan the entire source and entire destination
-- at the end of the transfer to verify that source and destination are
-- fully synchronized. This option isn\'t supported when transferring to S3
-- Glacier or S3 Glacier Deep Archive storage classes.
--
-- NONE: No additional verification is done at the end of the transfer, but
-- all data transmissions are integrity-checked with checksum verification
-- during the transfer.
options_verifyMode :: Lens.Lens' Options (Prelude.Maybe VerifyMode)
options_verifyMode :: (Maybe VerifyMode -> f (Maybe VerifyMode)) -> Options -> f Options
options_verifyMode = (Options -> Maybe VerifyMode)
-> (Options -> Maybe VerifyMode -> Options)
-> Lens Options Options (Maybe VerifyMode) (Maybe VerifyMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe VerifyMode
verifyMode :: Maybe VerifyMode
$sel:verifyMode:Options' :: Options -> Maybe VerifyMode
verifyMode} -> Maybe VerifyMode
verifyMode) (\s :: Options
s@Options' {} Maybe VerifyMode
a -> Options
s {$sel:verifyMode:Options' :: Maybe VerifyMode
verifyMode = Maybe VerifyMode
a} :: Options)

-- | A value that determines whether tasks should be queued before executing
-- the tasks. If set to @ENABLED@, the tasks will be queued. The default is
-- @ENABLED@.
--
-- If you use the same agent to run multiple tasks, you can enable the
-- tasks to run in series. For more information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/run-task.html#queue-task-execution Queueing task executions>.
options_taskQueueing :: Lens.Lens' Options (Prelude.Maybe TaskQueueing)
options_taskQueueing :: (Maybe TaskQueueing -> f (Maybe TaskQueueing))
-> Options -> f Options
options_taskQueueing = (Options -> Maybe TaskQueueing)
-> (Options -> Maybe TaskQueueing -> Options)
-> Lens Options Options (Maybe TaskQueueing) (Maybe TaskQueueing)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe TaskQueueing
taskQueueing :: Maybe TaskQueueing
$sel:taskQueueing:Options' :: Options -> Maybe TaskQueueing
taskQueueing} -> Maybe TaskQueueing
taskQueueing) (\s :: Options
s@Options' {} Maybe TaskQueueing
a -> Options
s {$sel:taskQueueing:Options' :: Maybe TaskQueueing
taskQueueing = Maybe TaskQueueing
a} :: Options)

-- | A value that determines the type of logs that DataSync publishes to a
-- log stream in the Amazon CloudWatch log group that you provide. For more
-- information about providing a log group for DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/API_CreateTask.html#DataSync-CreateTask-request-CloudWatchLogGroupArn CloudWatchLogGroupArn>.
-- If set to @OFF@, no logs are published. @BASIC@ publishes logs on errors
-- for individual files transferred, and @TRANSFER@ publishes logs for
-- every file or object that is transferred and integrity checked.
options_logLevel :: Lens.Lens' Options (Prelude.Maybe LogLevel)
options_logLevel :: (Maybe LogLevel -> f (Maybe LogLevel)) -> Options -> f Options
options_logLevel = (Options -> Maybe LogLevel)
-> (Options -> Maybe LogLevel -> Options)
-> Lens Options Options (Maybe LogLevel) (Maybe LogLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe LogLevel
logLevel :: Maybe LogLevel
$sel:logLevel:Options' :: Options -> Maybe LogLevel
logLevel} -> Maybe LogLevel
logLevel) (\s :: Options
s@Options' {} Maybe LogLevel
a -> Options
s {$sel:logLevel:Options' :: Maybe LogLevel
logLevel = Maybe LogLevel
a} :: Options)

-- | A value that determines which users or groups can access a file for a
-- specific purpose such as reading, writing, or execution of the file.
-- This option should only be set for NFS, EFS, and S3 locations. For more
-- information about what metadata is copied by DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
--
-- Default value: PRESERVE.
--
-- PRESERVE: Preserve POSIX-style permissions (recommended).
--
-- NONE: Ignore permissions.
--
-- DataSync can preserve extant permissions of a source location.
options_posixPermissions :: Lens.Lens' Options (Prelude.Maybe PosixPermissions)
options_posixPermissions :: (Maybe PosixPermissions -> f (Maybe PosixPermissions))
-> Options -> f Options
options_posixPermissions = (Options -> Maybe PosixPermissions)
-> (Options -> Maybe PosixPermissions -> Options)
-> Lens
     Options Options (Maybe PosixPermissions) (Maybe PosixPermissions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe PosixPermissions
posixPermissions :: Maybe PosixPermissions
$sel:posixPermissions:Options' :: Options -> Maybe PosixPermissions
posixPermissions} -> Maybe PosixPermissions
posixPermissions) (\s :: Options
s@Options' {} Maybe PosixPermissions
a -> Options
s {$sel:posixPermissions:Options' :: Maybe PosixPermissions
posixPermissions = Maybe PosixPermissions
a} :: Options)

-- | A value that indicates the last time that a file was modified (that is,
-- a file was written to) before the PREPARING phase. This option is
-- required for cases when you need to run the same task more than one
-- time.
--
-- Default value: PRESERVE.
--
-- PRESERVE: Preserve original @Mtime@ (recommended)
--
-- NONE: Ignore @Mtime@.
--
-- If @Mtime@ is set to PRESERVE, @Atime@ must be set to BEST_EFFORT.
--
-- If @Mtime@ is set to NONE, @Atime@ must also be set to NONE.
options_mtime :: Lens.Lens' Options (Prelude.Maybe Mtime)
options_mtime :: (Maybe Mtime -> f (Maybe Mtime)) -> Options -> f Options
options_mtime = (Options -> Maybe Mtime)
-> (Options -> Maybe Mtime -> Options)
-> Lens Options Options (Maybe Mtime) (Maybe Mtime)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe Mtime
mtime :: Maybe Mtime
$sel:mtime:Options' :: Options -> Maybe Mtime
mtime} -> Maybe Mtime
mtime) (\s :: Options
s@Options' {} Maybe Mtime
a -> Options
s {$sel:mtime:Options' :: Maybe Mtime
mtime = Maybe Mtime
a} :: Options)

-- | The POSIX user ID (UID) of the file\'s owner. This option should only be
-- set for NFS, EFS, and S3 locations. To learn more about what metadata is
-- copied by DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
--
-- Default value: INT_VALUE. This preserves the integer value of the ID.
--
-- INT_VALUE: Preserve the integer value of UID and group ID (GID)
-- (recommended).
--
-- NONE: Ignore UID and GID.
options_uid :: Lens.Lens' Options (Prelude.Maybe Uid)
options_uid :: (Maybe Uid -> f (Maybe Uid)) -> Options -> f Options
options_uid = (Options -> Maybe Uid)
-> (Options -> Maybe Uid -> Options)
-> Lens Options Options (Maybe Uid) (Maybe Uid)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe Uid
uid :: Maybe Uid
$sel:uid:Options' :: Options -> Maybe Uid
uid} -> Maybe Uid
uid) (\s :: Options
s@Options' {} Maybe Uid
a -> Options
s {$sel:uid:Options' :: Maybe Uid
uid = Maybe Uid
a} :: Options)

-- | A value that limits the bandwidth used by DataSync. For example, if you
-- want DataSync to use a maximum of 1 MB, set this value to @1048576@
-- (@=1024*1024@).
options_bytesPerSecond :: Lens.Lens' Options (Prelude.Maybe Prelude.Integer)
options_bytesPerSecond :: (Maybe Integer -> f (Maybe Integer)) -> Options -> f Options
options_bytesPerSecond = (Options -> Maybe Integer)
-> (Options -> Maybe Integer -> Options)
-> Lens Options Options (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe Integer
bytesPerSecond :: Maybe Integer
$sel:bytesPerSecond:Options' :: Options -> Maybe Integer
bytesPerSecond} -> Maybe Integer
bytesPerSecond) (\s :: Options
s@Options' {} Maybe Integer
a -> Options
s {$sel:bytesPerSecond:Options' :: Maybe Integer
bytesPerSecond = Maybe Integer
a} :: Options)

-- | A value that determines which components of the SMB security descriptor
-- are copied from source to destination objects.
--
-- This value is only used for transfers between SMB and Amazon FSx for
-- Windows File Server locations, or between two Amazon FSx for Windows
-- File Server locations. For more information about how DataSync handles
-- metadata, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html How DataSync Handles Metadata and Special Files>.
--
-- Default value: OWNER_DACL.
--
-- __OWNER_DACL__: For each copied object, DataSync copies the following
-- metadata:
--
-- -   Object owner.
--
-- -   NTFS discretionary access control lists (DACLs), which determine
--     whether to grant access to an object.
--
-- When choosing this option, DataSync does NOT copy the NTFS system access
-- control lists (SACLs), which are used by administrators to log attempts
-- to access a secured object.
--
-- __OWNER_DACL_SACL__: For each copied object, DataSync copies the
-- following metadata:
--
-- -   Object owner.
--
-- -   NTFS discretionary access control lists (DACLs), which determine
--     whether to grant access to an object.
--
-- -   NTFS system access control lists (SACLs), which are used by
--     administrators to log attempts to access a secured object.
--
-- Copying SACLs requires granting additional permissions to the Windows
-- user that DataSync uses to access your SMB location. For information
-- about choosing a user that ensures sufficient permissions to files,
-- folders, and metadata, see <create-smb-location.html#SMBuser user>.
--
-- __NONE__: None of the SMB security descriptor components are copied.
-- Destination objects are owned by the user that was provided for
-- accessing the destination location. DACLs and SACLs are set based on the
-- destination server’s configuration.
options_securityDescriptorCopyFlags :: Lens.Lens' Options (Prelude.Maybe SmbSecurityDescriptorCopyFlags)
options_securityDescriptorCopyFlags :: (Maybe SmbSecurityDescriptorCopyFlags
 -> f (Maybe SmbSecurityDescriptorCopyFlags))
-> Options -> f Options
options_securityDescriptorCopyFlags = (Options -> Maybe SmbSecurityDescriptorCopyFlags)
-> (Options -> Maybe SmbSecurityDescriptorCopyFlags -> Options)
-> Lens
     Options
     Options
     (Maybe SmbSecurityDescriptorCopyFlags)
     (Maybe SmbSecurityDescriptorCopyFlags)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags :: Maybe SmbSecurityDescriptorCopyFlags
$sel:securityDescriptorCopyFlags:Options' :: Options -> Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags} -> Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags) (\s :: Options
s@Options' {} Maybe SmbSecurityDescriptorCopyFlags
a -> Options
s {$sel:securityDescriptorCopyFlags:Options' :: Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags = Maybe SmbSecurityDescriptorCopyFlags
a} :: Options)

-- | The POSIX group ID (GID) of the file\'s owners. This option should only
-- be set for NFS, EFS, and S3 locations. For more information about what
-- metadata is copied by DataSync, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/special-files.html#metadata-copied Metadata Copied by DataSync>.
--
-- Default value: INT_VALUE. This preserves the integer value of the ID.
--
-- INT_VALUE: Preserve the integer value of user ID (UID) and GID
-- (recommended).
--
-- NONE: Ignore UID and GID.
options_gid :: Lens.Lens' Options (Prelude.Maybe Gid)
options_gid :: (Maybe Gid -> f (Maybe Gid)) -> Options -> f Options
options_gid = (Options -> Maybe Gid)
-> (Options -> Maybe Gid -> Options)
-> Lens Options Options (Maybe Gid) (Maybe Gid)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe Gid
gid :: Maybe Gid
$sel:gid:Options' :: Options -> Maybe Gid
gid} -> Maybe Gid
gid) (\s :: Options
s@Options' {} Maybe Gid
a -> Options
s {$sel:gid:Options' :: Maybe Gid
gid = Maybe Gid
a} :: Options)

-- | A value that determines whether files at the destination should be
-- overwritten or preserved when copying files. If set to @NEVER@ a
-- destination file will not be replaced by a source file, even if the
-- destination file differs from the source file. If you modify files in
-- the destination and you sync the files, you can use this value to
-- protect against overwriting those changes.
--
-- Some storage classes have specific behaviors that can affect your S3
-- storage cost. For detailed information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes Considerations when working with Amazon S3 storage classes in DataSync>
-- in the /DataSync User Guide/.
options_overwriteMode :: Lens.Lens' Options (Prelude.Maybe OverwriteMode)
options_overwriteMode :: (Maybe OverwriteMode -> f (Maybe OverwriteMode))
-> Options -> f Options
options_overwriteMode = (Options -> Maybe OverwriteMode)
-> (Options -> Maybe OverwriteMode -> Options)
-> Lens Options Options (Maybe OverwriteMode) (Maybe OverwriteMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe OverwriteMode
overwriteMode :: Maybe OverwriteMode
$sel:overwriteMode:Options' :: Options -> Maybe OverwriteMode
overwriteMode} -> Maybe OverwriteMode
overwriteMode) (\s :: Options
s@Options' {} Maybe OverwriteMode
a -> Options
s {$sel:overwriteMode:Options' :: Maybe OverwriteMode
overwriteMode = Maybe OverwriteMode
a} :: Options)

-- | A value that determines whether DataSync transfers only the data and
-- metadata that differ between the source and the destination location, or
-- whether DataSync transfers all the content from the source, without
-- comparing to the destination location.
--
-- CHANGED: DataSync copies only data or metadata that is new or different
-- content from the source location to the destination location.
--
-- ALL: DataSync copies all source location content to the destination,
-- without comparing to existing content on the destination.
options_transferMode :: Lens.Lens' Options (Prelude.Maybe TransferMode)
options_transferMode :: (Maybe TransferMode -> f (Maybe TransferMode))
-> Options -> f Options
options_transferMode = (Options -> Maybe TransferMode)
-> (Options -> Maybe TransferMode -> Options)
-> Lens Options Options (Maybe TransferMode) (Maybe TransferMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe TransferMode
transferMode :: Maybe TransferMode
$sel:transferMode:Options' :: Options -> Maybe TransferMode
transferMode} -> Maybe TransferMode
transferMode) (\s :: Options
s@Options' {} Maybe TransferMode
a -> Options
s {$sel:transferMode:Options' :: Maybe TransferMode
transferMode = Maybe TransferMode
a} :: Options)

-- | A value that specifies whether files in the destination that don\'t
-- exist in the source file system should be preserved. This option can
-- affect your storage cost. If your task deletes objects, you might incur
-- minimum storage duration charges for certain storage classes. For
-- detailed information, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes Considerations when working with Amazon S3 storage classes in DataSync>
-- in the /DataSync User Guide/.
--
-- Default value: PRESERVE.
--
-- PRESERVE: Ignore such destination files (recommended).
--
-- REMOVE: Delete destination files that aren’t present in the source.
options_preserveDeletedFiles :: Lens.Lens' Options (Prelude.Maybe PreserveDeletedFiles)
options_preserveDeletedFiles :: (Maybe PreserveDeletedFiles -> f (Maybe PreserveDeletedFiles))
-> Options -> f Options
options_preserveDeletedFiles = (Options -> Maybe PreserveDeletedFiles)
-> (Options -> Maybe PreserveDeletedFiles -> Options)
-> Lens
     Options
     Options
     (Maybe PreserveDeletedFiles)
     (Maybe PreserveDeletedFiles)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe PreserveDeletedFiles
preserveDeletedFiles :: Maybe PreserveDeletedFiles
$sel:preserveDeletedFiles:Options' :: Options -> Maybe PreserveDeletedFiles
preserveDeletedFiles} -> Maybe PreserveDeletedFiles
preserveDeletedFiles) (\s :: Options
s@Options' {} Maybe PreserveDeletedFiles
a -> Options
s {$sel:preserveDeletedFiles:Options' :: Maybe PreserveDeletedFiles
preserveDeletedFiles = Maybe PreserveDeletedFiles
a} :: Options)

-- | A value that determines whether DataSync should preserve the metadata of
-- block and character devices in the source file system, and re-create the
-- files with that device name and metadata on the destination. DataSync
-- does not copy the contents of such devices, only the name and metadata.
--
-- DataSync can\'t sync the actual contents of such devices, because they
-- are nonterminal and don\'t return an end-of-file (EOF) marker.
--
-- Default value: NONE.
--
-- NONE: Ignore special devices (recommended).
--
-- PRESERVE: Preserve character and block device metadata. This option
-- isn\'t currently supported for Amazon EFS.
options_preserveDevices :: Lens.Lens' Options (Prelude.Maybe PreserveDevices)
options_preserveDevices :: (Maybe PreserveDevices -> f (Maybe PreserveDevices))
-> Options -> f Options
options_preserveDevices = (Options -> Maybe PreserveDevices)
-> (Options -> Maybe PreserveDevices -> Options)
-> Lens
     Options Options (Maybe PreserveDevices) (Maybe PreserveDevices)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Options' {Maybe PreserveDevices
preserveDevices :: Maybe PreserveDevices
$sel:preserveDevices:Options' :: Options -> Maybe PreserveDevices
preserveDevices} -> Maybe PreserveDevices
preserveDevices) (\s :: Options
s@Options' {} Maybe PreserveDevices
a -> Options
s {$sel:preserveDevices:Options' :: Maybe PreserveDevices
preserveDevices = Maybe PreserveDevices
a} :: Options)

instance Core.FromJSON Options where
  parseJSON :: Value -> Parser Options
parseJSON =
    String -> (Object -> Parser Options) -> Value -> Parser Options
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Options"
      ( \Object
x ->
          Maybe Atime
-> Maybe VerifyMode
-> Maybe TaskQueueing
-> Maybe LogLevel
-> Maybe PosixPermissions
-> Maybe Mtime
-> Maybe Uid
-> Maybe Integer
-> Maybe SmbSecurityDescriptorCopyFlags
-> Maybe Gid
-> Maybe OverwriteMode
-> Maybe TransferMode
-> Maybe PreserveDeletedFiles
-> Maybe PreserveDevices
-> Options
Options'
            (Maybe Atime
 -> Maybe VerifyMode
 -> Maybe TaskQueueing
 -> Maybe LogLevel
 -> Maybe PosixPermissions
 -> Maybe Mtime
 -> Maybe Uid
 -> Maybe Integer
 -> Maybe SmbSecurityDescriptorCopyFlags
 -> Maybe Gid
 -> Maybe OverwriteMode
 -> Maybe TransferMode
 -> Maybe PreserveDeletedFiles
 -> Maybe PreserveDevices
 -> Options)
-> Parser (Maybe Atime)
-> Parser
     (Maybe VerifyMode
      -> Maybe TaskQueueing
      -> Maybe LogLevel
      -> Maybe PosixPermissions
      -> Maybe Mtime
      -> Maybe Uid
      -> Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Atime)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Atime")
            Parser
  (Maybe VerifyMode
   -> Maybe TaskQueueing
   -> Maybe LogLevel
   -> Maybe PosixPermissions
   -> Maybe Mtime
   -> Maybe Uid
   -> Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe VerifyMode)
-> Parser
     (Maybe TaskQueueing
      -> Maybe LogLevel
      -> Maybe PosixPermissions
      -> Maybe Mtime
      -> Maybe Uid
      -> Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VerifyMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VerifyMode")
            Parser
  (Maybe TaskQueueing
   -> Maybe LogLevel
   -> Maybe PosixPermissions
   -> Maybe Mtime
   -> Maybe Uid
   -> Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe TaskQueueing)
-> Parser
     (Maybe LogLevel
      -> Maybe PosixPermissions
      -> Maybe Mtime
      -> Maybe Uid
      -> Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TaskQueueing)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TaskQueueing")
            Parser
  (Maybe LogLevel
   -> Maybe PosixPermissions
   -> Maybe Mtime
   -> Maybe Uid
   -> Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe LogLevel)
-> Parser
     (Maybe PosixPermissions
      -> Maybe Mtime
      -> Maybe Uid
      -> Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LogLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogLevel")
            Parser
  (Maybe PosixPermissions
   -> Maybe Mtime
   -> Maybe Uid
   -> Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe PosixPermissions)
-> Parser
     (Maybe Mtime
      -> Maybe Uid
      -> Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PosixPermissions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PosixPermissions")
            Parser
  (Maybe Mtime
   -> Maybe Uid
   -> Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe Mtime)
-> Parser
     (Maybe Uid
      -> Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mtime)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Mtime")
            Parser
  (Maybe Uid
   -> Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe Uid)
-> Parser
     (Maybe Integer
      -> Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Uid)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Uid")
            Parser
  (Maybe Integer
   -> Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe Integer)
-> Parser
     (Maybe SmbSecurityDescriptorCopyFlags
      -> Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BytesPerSecond")
            Parser
  (Maybe SmbSecurityDescriptorCopyFlags
   -> Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe SmbSecurityDescriptorCopyFlags)
-> Parser
     (Maybe Gid
      -> Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SmbSecurityDescriptorCopyFlags)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityDescriptorCopyFlags")
            Parser
  (Maybe Gid
   -> Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe Gid)
-> Parser
     (Maybe OverwriteMode
      -> Maybe TransferMode
      -> Maybe PreserveDeletedFiles
      -> Maybe PreserveDevices
      -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Gid)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Gid")
            Parser
  (Maybe OverwriteMode
   -> Maybe TransferMode
   -> Maybe PreserveDeletedFiles
   -> Maybe PreserveDevices
   -> Options)
-> Parser (Maybe OverwriteMode)
-> Parser
     (Maybe TransferMode
      -> Maybe PreserveDeletedFiles -> Maybe PreserveDevices -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OverwriteMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OverwriteMode")
            Parser
  (Maybe TransferMode
   -> Maybe PreserveDeletedFiles -> Maybe PreserveDevices -> Options)
-> Parser (Maybe TransferMode)
-> Parser
     (Maybe PreserveDeletedFiles -> Maybe PreserveDevices -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TransferMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TransferMode")
            Parser
  (Maybe PreserveDeletedFiles -> Maybe PreserveDevices -> Options)
-> Parser (Maybe PreserveDeletedFiles)
-> Parser (Maybe PreserveDevices -> Options)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PreserveDeletedFiles)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PreserveDeletedFiles")
            Parser (Maybe PreserveDevices -> Options)
-> Parser (Maybe PreserveDevices) -> Parser Options
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PreserveDevices)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PreserveDevices")
      )

instance Prelude.Hashable Options

instance Prelude.NFData Options

instance Core.ToJSON Options where
  toJSON :: Options -> Value
toJSON Options' {Maybe Integer
Maybe Atime
Maybe Gid
Maybe LogLevel
Maybe Mtime
Maybe OverwriteMode
Maybe PosixPermissions
Maybe PreserveDeletedFiles
Maybe PreserveDevices
Maybe SmbSecurityDescriptorCopyFlags
Maybe TaskQueueing
Maybe TransferMode
Maybe Uid
Maybe VerifyMode
preserveDevices :: Maybe PreserveDevices
preserveDeletedFiles :: Maybe PreserveDeletedFiles
transferMode :: Maybe TransferMode
overwriteMode :: Maybe OverwriteMode
gid :: Maybe Gid
securityDescriptorCopyFlags :: Maybe SmbSecurityDescriptorCopyFlags
bytesPerSecond :: Maybe Integer
uid :: Maybe Uid
mtime :: Maybe Mtime
posixPermissions :: Maybe PosixPermissions
logLevel :: Maybe LogLevel
taskQueueing :: Maybe TaskQueueing
verifyMode :: Maybe VerifyMode
atime :: Maybe Atime
$sel:preserveDevices:Options' :: Options -> Maybe PreserveDevices
$sel:preserveDeletedFiles:Options' :: Options -> Maybe PreserveDeletedFiles
$sel:transferMode:Options' :: Options -> Maybe TransferMode
$sel:overwriteMode:Options' :: Options -> Maybe OverwriteMode
$sel:gid:Options' :: Options -> Maybe Gid
$sel:securityDescriptorCopyFlags:Options' :: Options -> Maybe SmbSecurityDescriptorCopyFlags
$sel:bytesPerSecond:Options' :: Options -> Maybe Integer
$sel:uid:Options' :: Options -> Maybe Uid
$sel:mtime:Options' :: Options -> Maybe Mtime
$sel:posixPermissions:Options' :: Options -> Maybe PosixPermissions
$sel:logLevel:Options' :: Options -> Maybe LogLevel
$sel:taskQueueing:Options' :: Options -> Maybe TaskQueueing
$sel:verifyMode:Options' :: Options -> Maybe VerifyMode
$sel:atime:Options' :: Options -> Maybe Atime
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Atime" Text -> Atime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Atime -> Pair) -> Maybe Atime -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Atime
atime,
            (Text
"VerifyMode" Text -> VerifyMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VerifyMode -> Pair) -> Maybe VerifyMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VerifyMode
verifyMode,
            (Text
"TaskQueueing" Text -> TaskQueueing -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TaskQueueing -> Pair) -> Maybe TaskQueueing -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaskQueueing
taskQueueing,
            (Text
"LogLevel" Text -> LogLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LogLevel -> Pair) -> Maybe LogLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LogLevel
logLevel,
            (Text
"PosixPermissions" Text -> PosixPermissions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PosixPermissions -> Pair) -> Maybe PosixPermissions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PosixPermissions
posixPermissions,
            (Text
"Mtime" Text -> Mtime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mtime -> Pair) -> Maybe Mtime -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mtime
mtime,
            (Text
"Uid" Text -> Uid -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Uid -> Pair) -> Maybe Uid -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Uid
uid,
            (Text
"BytesPerSecond" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
bytesPerSecond,
            (Text
"SecurityDescriptorCopyFlags" Text -> SmbSecurityDescriptorCopyFlags -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SmbSecurityDescriptorCopyFlags -> Pair)
-> Maybe SmbSecurityDescriptorCopyFlags -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SmbSecurityDescriptorCopyFlags
securityDescriptorCopyFlags,
            (Text
"Gid" Text -> Gid -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Gid -> Pair) -> Maybe Gid -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Gid
gid,
            (Text
"OverwriteMode" Text -> OverwriteMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OverwriteMode -> Pair) -> Maybe OverwriteMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OverwriteMode
overwriteMode,
            (Text
"TransferMode" Text -> TransferMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TransferMode -> Pair) -> Maybe TransferMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TransferMode
transferMode,
            (Text
"PreserveDeletedFiles" Text -> PreserveDeletedFiles -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PreserveDeletedFiles -> Pair)
-> Maybe PreserveDeletedFiles -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PreserveDeletedFiles
preserveDeletedFiles,
            (Text
"PreserveDevices" Text -> PreserveDevices -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PreserveDevices -> Pair) -> Maybe PreserveDevices -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PreserveDevices
preserveDevices
          ]
      )