{-# 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.Transfer.Types.DeleteStepDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transfer.Types.DeleteStepDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The name of the step, used to identify the delete step.
--
-- /See:/ 'newDeleteStepDetails' smart constructor.
data DeleteStepDetails = DeleteStepDetails'
  { -- | The name of the step, used as an identifier.
    DeleteStepDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Specifies which file to use as input to the workflow step: either the
    -- output from the previous step, or the originally uploaded file for the
    -- workflow.
    --
    -- -   Enter @${previous.file}@ to use the previous file as the input. In
    --     this case, this workflow step uses the output file from the previous
    --     workflow step as input. This is the default value.
    --
    -- -   Enter @${original.file}@ to use the originally-uploaded file
    --     location as input for this step.
    DeleteStepDetails -> Maybe Text
sourceFileLocation :: Prelude.Maybe Prelude.Text
  }
  deriving (DeleteStepDetails -> DeleteStepDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStepDetails -> DeleteStepDetails -> Bool
$c/= :: DeleteStepDetails -> DeleteStepDetails -> Bool
== :: DeleteStepDetails -> DeleteStepDetails -> Bool
$c== :: DeleteStepDetails -> DeleteStepDetails -> Bool
Prelude.Eq, ReadPrec [DeleteStepDetails]
ReadPrec DeleteStepDetails
Int -> ReadS DeleteStepDetails
ReadS [DeleteStepDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStepDetails]
$creadListPrec :: ReadPrec [DeleteStepDetails]
readPrec :: ReadPrec DeleteStepDetails
$creadPrec :: ReadPrec DeleteStepDetails
readList :: ReadS [DeleteStepDetails]
$creadList :: ReadS [DeleteStepDetails]
readsPrec :: Int -> ReadS DeleteStepDetails
$creadsPrec :: Int -> ReadS DeleteStepDetails
Prelude.Read, Int -> DeleteStepDetails -> ShowS
[DeleteStepDetails] -> ShowS
DeleteStepDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStepDetails] -> ShowS
$cshowList :: [DeleteStepDetails] -> ShowS
show :: DeleteStepDetails -> String
$cshow :: DeleteStepDetails -> String
showsPrec :: Int -> DeleteStepDetails -> ShowS
$cshowsPrec :: Int -> DeleteStepDetails -> ShowS
Prelude.Show, forall x. Rep DeleteStepDetails x -> DeleteStepDetails
forall x. DeleteStepDetails -> Rep DeleteStepDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStepDetails x -> DeleteStepDetails
$cfrom :: forall x. DeleteStepDetails -> Rep DeleteStepDetails x
Prelude.Generic)

-- |
-- Create a value of 'DeleteStepDetails' 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:
--
-- 'name', 'deleteStepDetails_name' - The name of the step, used as an identifier.
--
-- 'sourceFileLocation', 'deleteStepDetails_sourceFileLocation' - Specifies which file to use as input to the workflow step: either the
-- output from the previous step, or the originally uploaded file for the
-- workflow.
--
-- -   Enter @${previous.file}@ to use the previous file as the input. In
--     this case, this workflow step uses the output file from the previous
--     workflow step as input. This is the default value.
--
-- -   Enter @${original.file}@ to use the originally-uploaded file
--     location as input for this step.
newDeleteStepDetails ::
  DeleteStepDetails
newDeleteStepDetails :: DeleteStepDetails
newDeleteStepDetails =
  DeleteStepDetails'
    { $sel:name:DeleteStepDetails' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceFileLocation:DeleteStepDetails' :: Maybe Text
sourceFileLocation = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the step, used as an identifier.
deleteStepDetails_name :: Lens.Lens' DeleteStepDetails (Prelude.Maybe Prelude.Text)
deleteStepDetails_name :: Lens' DeleteStepDetails (Maybe Text)
deleteStepDetails_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStepDetails' {Maybe Text
name :: Maybe Text
$sel:name:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: DeleteStepDetails
s@DeleteStepDetails' {} Maybe Text
a -> DeleteStepDetails
s {$sel:name:DeleteStepDetails' :: Maybe Text
name = Maybe Text
a} :: DeleteStepDetails)

-- | Specifies which file to use as input to the workflow step: either the
-- output from the previous step, or the originally uploaded file for the
-- workflow.
--
-- -   Enter @${previous.file}@ to use the previous file as the input. In
--     this case, this workflow step uses the output file from the previous
--     workflow step as input. This is the default value.
--
-- -   Enter @${original.file}@ to use the originally-uploaded file
--     location as input for this step.
deleteStepDetails_sourceFileLocation :: Lens.Lens' DeleteStepDetails (Prelude.Maybe Prelude.Text)
deleteStepDetails_sourceFileLocation :: Lens' DeleteStepDetails (Maybe Text)
deleteStepDetails_sourceFileLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStepDetails' {Maybe Text
sourceFileLocation :: Maybe Text
$sel:sourceFileLocation:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
sourceFileLocation} -> Maybe Text
sourceFileLocation) (\s :: DeleteStepDetails
s@DeleteStepDetails' {} Maybe Text
a -> DeleteStepDetails
s {$sel:sourceFileLocation:DeleteStepDetails' :: Maybe Text
sourceFileLocation = Maybe Text
a} :: DeleteStepDetails)

instance Data.FromJSON DeleteStepDetails where
  parseJSON :: Value -> Parser DeleteStepDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DeleteStepDetails"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> DeleteStepDetails
DeleteStepDetails'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SourceFileLocation")
      )

instance Prelude.Hashable DeleteStepDetails where
  hashWithSalt :: Int -> DeleteStepDetails -> Int
hashWithSalt Int
_salt DeleteStepDetails' {Maybe Text
sourceFileLocation :: Maybe Text
name :: Maybe Text
$sel:sourceFileLocation:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
$sel:name:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceFileLocation

instance Prelude.NFData DeleteStepDetails where
  rnf :: DeleteStepDetails -> ()
rnf DeleteStepDetails' {Maybe Text
sourceFileLocation :: Maybe Text
name :: Maybe Text
$sel:sourceFileLocation:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
$sel:name:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceFileLocation

instance Data.ToJSON DeleteStepDetails where
  toJSON :: DeleteStepDetails -> Value
toJSON DeleteStepDetails' {Maybe Text
sourceFileLocation :: Maybe Text
name :: Maybe Text
$sel:sourceFileLocation:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
$sel:name:DeleteStepDetails' :: DeleteStepDetails -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"SourceFileLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceFileLocation
          ]
      )