{-# 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.DecryptStepDetails
-- 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.DecryptStepDetails 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
import Amazonka.Transfer.Types.EncryptionType
import Amazonka.Transfer.Types.InputFileLocation
import Amazonka.Transfer.Types.OverwriteExisting

-- | /See:/ 'newDecryptStepDetails' smart constructor.
data DecryptStepDetails = DecryptStepDetails'
  { DecryptStepDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    DecryptStepDetails -> Maybe OverwriteExisting
overwriteExisting :: Prelude.Maybe OverwriteExisting,
    DecryptStepDetails -> Maybe Text
sourceFileLocation :: Prelude.Maybe Prelude.Text,
    DecryptStepDetails -> EncryptionType
type' :: EncryptionType,
    DecryptStepDetails -> InputFileLocation
destinationFileLocation :: InputFileLocation
  }
  deriving (DecryptStepDetails -> DecryptStepDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecryptStepDetails -> DecryptStepDetails -> Bool
$c/= :: DecryptStepDetails -> DecryptStepDetails -> Bool
== :: DecryptStepDetails -> DecryptStepDetails -> Bool
$c== :: DecryptStepDetails -> DecryptStepDetails -> Bool
Prelude.Eq, ReadPrec [DecryptStepDetails]
ReadPrec DecryptStepDetails
Int -> ReadS DecryptStepDetails
ReadS [DecryptStepDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecryptStepDetails]
$creadListPrec :: ReadPrec [DecryptStepDetails]
readPrec :: ReadPrec DecryptStepDetails
$creadPrec :: ReadPrec DecryptStepDetails
readList :: ReadS [DecryptStepDetails]
$creadList :: ReadS [DecryptStepDetails]
readsPrec :: Int -> ReadS DecryptStepDetails
$creadsPrec :: Int -> ReadS DecryptStepDetails
Prelude.Read, Int -> DecryptStepDetails -> ShowS
[DecryptStepDetails] -> ShowS
DecryptStepDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecryptStepDetails] -> ShowS
$cshowList :: [DecryptStepDetails] -> ShowS
show :: DecryptStepDetails -> String
$cshow :: DecryptStepDetails -> String
showsPrec :: Int -> DecryptStepDetails -> ShowS
$cshowsPrec :: Int -> DecryptStepDetails -> ShowS
Prelude.Show, forall x. Rep DecryptStepDetails x -> DecryptStepDetails
forall x. DecryptStepDetails -> Rep DecryptStepDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DecryptStepDetails x -> DecryptStepDetails
$cfrom :: forall x. DecryptStepDetails -> Rep DecryptStepDetails x
Prelude.Generic)

-- |
-- Create a value of 'DecryptStepDetails' 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', 'decryptStepDetails_name' - Undocumented member.
--
-- 'overwriteExisting', 'decryptStepDetails_overwriteExisting' - Undocumented member.
--
-- 'sourceFileLocation', 'decryptStepDetails_sourceFileLocation' - Undocumented member.
--
-- 'type'', 'decryptStepDetails_type' - Undocumented member.
--
-- 'destinationFileLocation', 'decryptStepDetails_destinationFileLocation' - Undocumented member.
newDecryptStepDetails ::
  -- | 'type''
  EncryptionType ->
  -- | 'destinationFileLocation'
  InputFileLocation ->
  DecryptStepDetails
newDecryptStepDetails :: EncryptionType -> InputFileLocation -> DecryptStepDetails
newDecryptStepDetails
  EncryptionType
pType_
  InputFileLocation
pDestinationFileLocation_ =
    DecryptStepDetails'
      { $sel:name:DecryptStepDetails' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:overwriteExisting:DecryptStepDetails' :: Maybe OverwriteExisting
overwriteExisting = forall a. Maybe a
Prelude.Nothing,
        $sel:sourceFileLocation:DecryptStepDetails' :: Maybe Text
sourceFileLocation = forall a. Maybe a
Prelude.Nothing,
        $sel:type':DecryptStepDetails' :: EncryptionType
type' = EncryptionType
pType_,
        $sel:destinationFileLocation:DecryptStepDetails' :: InputFileLocation
destinationFileLocation = InputFileLocation
pDestinationFileLocation_
      }

-- | Undocumented member.
decryptStepDetails_name :: Lens.Lens' DecryptStepDetails (Prelude.Maybe Prelude.Text)
decryptStepDetails_name :: Lens' DecryptStepDetails (Maybe Text)
decryptStepDetails_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptStepDetails' {Maybe Text
name :: Maybe Text
$sel:name:DecryptStepDetails' :: DecryptStepDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: DecryptStepDetails
s@DecryptStepDetails' {} Maybe Text
a -> DecryptStepDetails
s {$sel:name:DecryptStepDetails' :: Maybe Text
name = Maybe Text
a} :: DecryptStepDetails)

-- | Undocumented member.
decryptStepDetails_overwriteExisting :: Lens.Lens' DecryptStepDetails (Prelude.Maybe OverwriteExisting)
decryptStepDetails_overwriteExisting :: Lens' DecryptStepDetails (Maybe OverwriteExisting)
decryptStepDetails_overwriteExisting = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptStepDetails' {Maybe OverwriteExisting
overwriteExisting :: Maybe OverwriteExisting
$sel:overwriteExisting:DecryptStepDetails' :: DecryptStepDetails -> Maybe OverwriteExisting
overwriteExisting} -> Maybe OverwriteExisting
overwriteExisting) (\s :: DecryptStepDetails
s@DecryptStepDetails' {} Maybe OverwriteExisting
a -> DecryptStepDetails
s {$sel:overwriteExisting:DecryptStepDetails' :: Maybe OverwriteExisting
overwriteExisting = Maybe OverwriteExisting
a} :: DecryptStepDetails)

-- | Undocumented member.
decryptStepDetails_sourceFileLocation :: Lens.Lens' DecryptStepDetails (Prelude.Maybe Prelude.Text)
decryptStepDetails_sourceFileLocation :: Lens' DecryptStepDetails (Maybe Text)
decryptStepDetails_sourceFileLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptStepDetails' {Maybe Text
sourceFileLocation :: Maybe Text
$sel:sourceFileLocation:DecryptStepDetails' :: DecryptStepDetails -> Maybe Text
sourceFileLocation} -> Maybe Text
sourceFileLocation) (\s :: DecryptStepDetails
s@DecryptStepDetails' {} Maybe Text
a -> DecryptStepDetails
s {$sel:sourceFileLocation:DecryptStepDetails' :: Maybe Text
sourceFileLocation = Maybe Text
a} :: DecryptStepDetails)

-- | Undocumented member.
decryptStepDetails_type :: Lens.Lens' DecryptStepDetails EncryptionType
decryptStepDetails_type :: Lens' DecryptStepDetails EncryptionType
decryptStepDetails_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptStepDetails' {EncryptionType
type' :: EncryptionType
$sel:type':DecryptStepDetails' :: DecryptStepDetails -> EncryptionType
type'} -> EncryptionType
type') (\s :: DecryptStepDetails
s@DecryptStepDetails' {} EncryptionType
a -> DecryptStepDetails
s {$sel:type':DecryptStepDetails' :: EncryptionType
type' = EncryptionType
a} :: DecryptStepDetails)

-- | Undocumented member.
decryptStepDetails_destinationFileLocation :: Lens.Lens' DecryptStepDetails InputFileLocation
decryptStepDetails_destinationFileLocation :: Lens' DecryptStepDetails InputFileLocation
decryptStepDetails_destinationFileLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecryptStepDetails' {InputFileLocation
destinationFileLocation :: InputFileLocation
$sel:destinationFileLocation:DecryptStepDetails' :: DecryptStepDetails -> InputFileLocation
destinationFileLocation} -> InputFileLocation
destinationFileLocation) (\s :: DecryptStepDetails
s@DecryptStepDetails' {} InputFileLocation
a -> DecryptStepDetails
s {$sel:destinationFileLocation:DecryptStepDetails' :: InputFileLocation
destinationFileLocation = InputFileLocation
a} :: DecryptStepDetails)

instance Data.FromJSON DecryptStepDetails where
  parseJSON :: Value -> Parser DecryptStepDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DecryptStepDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe OverwriteExisting
-> Maybe Text
-> EncryptionType
-> InputFileLocation
-> DecryptStepDetails
DecryptStepDetails'
            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
"OverwriteExisting")
            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")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DestinationFileLocation")
      )

instance Prelude.Hashable DecryptStepDetails where
  hashWithSalt :: Int -> DecryptStepDetails -> Int
hashWithSalt Int
_salt DecryptStepDetails' {Maybe Text
Maybe OverwriteExisting
EncryptionType
InputFileLocation
destinationFileLocation :: InputFileLocation
type' :: EncryptionType
sourceFileLocation :: Maybe Text
overwriteExisting :: Maybe OverwriteExisting
name :: Maybe Text
$sel:destinationFileLocation:DecryptStepDetails' :: DecryptStepDetails -> InputFileLocation
$sel:type':DecryptStepDetails' :: DecryptStepDetails -> EncryptionType
$sel:sourceFileLocation:DecryptStepDetails' :: DecryptStepDetails -> Maybe Text
$sel:overwriteExisting:DecryptStepDetails' :: DecryptStepDetails -> Maybe OverwriteExisting
$sel:name:DecryptStepDetails' :: DecryptStepDetails -> 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 OverwriteExisting
overwriteExisting
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceFileLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EncryptionType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InputFileLocation
destinationFileLocation

instance Prelude.NFData DecryptStepDetails where
  rnf :: DecryptStepDetails -> ()
rnf DecryptStepDetails' {Maybe Text
Maybe OverwriteExisting
EncryptionType
InputFileLocation
destinationFileLocation :: InputFileLocation
type' :: EncryptionType
sourceFileLocation :: Maybe Text
overwriteExisting :: Maybe OverwriteExisting
name :: Maybe Text
$sel:destinationFileLocation:DecryptStepDetails' :: DecryptStepDetails -> InputFileLocation
$sel:type':DecryptStepDetails' :: DecryptStepDetails -> EncryptionType
$sel:sourceFileLocation:DecryptStepDetails' :: DecryptStepDetails -> Maybe Text
$sel:overwriteExisting:DecryptStepDetails' :: DecryptStepDetails -> Maybe OverwriteExisting
$sel:name:DecryptStepDetails' :: DecryptStepDetails -> 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 OverwriteExisting
overwriteExisting
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceFileLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EncryptionType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InputFileLocation
destinationFileLocation

instance Data.ToJSON DecryptStepDetails where
  toJSON :: DecryptStepDetails -> Value
toJSON DecryptStepDetails' {Maybe Text
Maybe OverwriteExisting
EncryptionType
InputFileLocation
destinationFileLocation :: InputFileLocation
type' :: EncryptionType
sourceFileLocation :: Maybe Text
overwriteExisting :: Maybe OverwriteExisting
name :: Maybe Text
$sel:destinationFileLocation:DecryptStepDetails' :: DecryptStepDetails -> InputFileLocation
$sel:type':DecryptStepDetails' :: DecryptStepDetails -> EncryptionType
$sel:sourceFileLocation:DecryptStepDetails' :: DecryptStepDetails -> Maybe Text
$sel:overwriteExisting:DecryptStepDetails' :: DecryptStepDetails -> Maybe OverwriteExisting
$sel:name:DecryptStepDetails' :: DecryptStepDetails -> 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
"OverwriteExisting" 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 OverwriteExisting
overwriteExisting,
            (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,
            forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EncryptionType
type'),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"DestinationFileLocation"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InputFileLocation
destinationFileLocation
              )
          ]
      )