{-# 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 #-}
module Amazonka.S3.Types.SourceSelectionCriteria where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
import Amazonka.S3.Types.ReplicaModifications
import Amazonka.S3.Types.SseKmsEncryptedObjects
data SourceSelectionCriteria = SourceSelectionCriteria'
{
SourceSelectionCriteria -> Maybe ReplicaModifications
replicaModifications :: Prelude.Maybe ReplicaModifications,
SourceSelectionCriteria -> Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects :: Prelude.Maybe SseKmsEncryptedObjects
}
deriving (SourceSelectionCriteria -> SourceSelectionCriteria -> Bool
(SourceSelectionCriteria -> SourceSelectionCriteria -> Bool)
-> (SourceSelectionCriteria -> SourceSelectionCriteria -> Bool)
-> Eq SourceSelectionCriteria
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceSelectionCriteria -> SourceSelectionCriteria -> Bool
$c/= :: SourceSelectionCriteria -> SourceSelectionCriteria -> Bool
== :: SourceSelectionCriteria -> SourceSelectionCriteria -> Bool
$c== :: SourceSelectionCriteria -> SourceSelectionCriteria -> Bool
Prelude.Eq, ReadPrec [SourceSelectionCriteria]
ReadPrec SourceSelectionCriteria
Int -> ReadS SourceSelectionCriteria
ReadS [SourceSelectionCriteria]
(Int -> ReadS SourceSelectionCriteria)
-> ReadS [SourceSelectionCriteria]
-> ReadPrec SourceSelectionCriteria
-> ReadPrec [SourceSelectionCriteria]
-> Read SourceSelectionCriteria
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceSelectionCriteria]
$creadListPrec :: ReadPrec [SourceSelectionCriteria]
readPrec :: ReadPrec SourceSelectionCriteria
$creadPrec :: ReadPrec SourceSelectionCriteria
readList :: ReadS [SourceSelectionCriteria]
$creadList :: ReadS [SourceSelectionCriteria]
readsPrec :: Int -> ReadS SourceSelectionCriteria
$creadsPrec :: Int -> ReadS SourceSelectionCriteria
Prelude.Read, Int -> SourceSelectionCriteria -> ShowS
[SourceSelectionCriteria] -> ShowS
SourceSelectionCriteria -> String
(Int -> SourceSelectionCriteria -> ShowS)
-> (SourceSelectionCriteria -> String)
-> ([SourceSelectionCriteria] -> ShowS)
-> Show SourceSelectionCriteria
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceSelectionCriteria] -> ShowS
$cshowList :: [SourceSelectionCriteria] -> ShowS
show :: SourceSelectionCriteria -> String
$cshow :: SourceSelectionCriteria -> String
showsPrec :: Int -> SourceSelectionCriteria -> ShowS
$cshowsPrec :: Int -> SourceSelectionCriteria -> ShowS
Prelude.Show, (forall x.
SourceSelectionCriteria -> Rep SourceSelectionCriteria x)
-> (forall x.
Rep SourceSelectionCriteria x -> SourceSelectionCriteria)
-> Generic SourceSelectionCriteria
forall x. Rep SourceSelectionCriteria x -> SourceSelectionCriteria
forall x. SourceSelectionCriteria -> Rep SourceSelectionCriteria x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceSelectionCriteria x -> SourceSelectionCriteria
$cfrom :: forall x. SourceSelectionCriteria -> Rep SourceSelectionCriteria x
Prelude.Generic)
newSourceSelectionCriteria ::
SourceSelectionCriteria
newSourceSelectionCriteria :: SourceSelectionCriteria
newSourceSelectionCriteria =
SourceSelectionCriteria' :: Maybe ReplicaModifications
-> Maybe SseKmsEncryptedObjects -> SourceSelectionCriteria
SourceSelectionCriteria'
{ $sel:replicaModifications:SourceSelectionCriteria' :: Maybe ReplicaModifications
replicaModifications =
Maybe ReplicaModifications
forall a. Maybe a
Prelude.Nothing,
$sel:sseKmsEncryptedObjects:SourceSelectionCriteria' :: Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects = Maybe SseKmsEncryptedObjects
forall a. Maybe a
Prelude.Nothing
}
sourceSelectionCriteria_replicaModifications :: Lens.Lens' SourceSelectionCriteria (Prelude.Maybe ReplicaModifications)
sourceSelectionCriteria_replicaModifications :: (Maybe ReplicaModifications -> f (Maybe ReplicaModifications))
-> SourceSelectionCriteria -> f SourceSelectionCriteria
sourceSelectionCriteria_replicaModifications = (SourceSelectionCriteria -> Maybe ReplicaModifications)
-> (SourceSelectionCriteria
-> Maybe ReplicaModifications -> SourceSelectionCriteria)
-> Lens
SourceSelectionCriteria
SourceSelectionCriteria
(Maybe ReplicaModifications)
(Maybe ReplicaModifications)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceSelectionCriteria' {Maybe ReplicaModifications
replicaModifications :: Maybe ReplicaModifications
$sel:replicaModifications:SourceSelectionCriteria' :: SourceSelectionCriteria -> Maybe ReplicaModifications
replicaModifications} -> Maybe ReplicaModifications
replicaModifications) (\s :: SourceSelectionCriteria
s@SourceSelectionCriteria' {} Maybe ReplicaModifications
a -> SourceSelectionCriteria
s {$sel:replicaModifications:SourceSelectionCriteria' :: Maybe ReplicaModifications
replicaModifications = Maybe ReplicaModifications
a} :: SourceSelectionCriteria)
sourceSelectionCriteria_sseKmsEncryptedObjects :: Lens.Lens' SourceSelectionCriteria (Prelude.Maybe SseKmsEncryptedObjects)
sourceSelectionCriteria_sseKmsEncryptedObjects :: (Maybe SseKmsEncryptedObjects -> f (Maybe SseKmsEncryptedObjects))
-> SourceSelectionCriteria -> f SourceSelectionCriteria
sourceSelectionCriteria_sseKmsEncryptedObjects = (SourceSelectionCriteria -> Maybe SseKmsEncryptedObjects)
-> (SourceSelectionCriteria
-> Maybe SseKmsEncryptedObjects -> SourceSelectionCriteria)
-> Lens
SourceSelectionCriteria
SourceSelectionCriteria
(Maybe SseKmsEncryptedObjects)
(Maybe SseKmsEncryptedObjects)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceSelectionCriteria' {Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects :: Maybe SseKmsEncryptedObjects
$sel:sseKmsEncryptedObjects:SourceSelectionCriteria' :: SourceSelectionCriteria -> Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects} -> Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects) (\s :: SourceSelectionCriteria
s@SourceSelectionCriteria' {} Maybe SseKmsEncryptedObjects
a -> SourceSelectionCriteria
s {$sel:sseKmsEncryptedObjects:SourceSelectionCriteria' :: Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects = Maybe SseKmsEncryptedObjects
a} :: SourceSelectionCriteria)
instance Core.FromXML SourceSelectionCriteria where
parseXML :: [Node] -> Either String SourceSelectionCriteria
parseXML [Node]
x =
Maybe ReplicaModifications
-> Maybe SseKmsEncryptedObjects -> SourceSelectionCriteria
SourceSelectionCriteria'
(Maybe ReplicaModifications
-> Maybe SseKmsEncryptedObjects -> SourceSelectionCriteria)
-> Either String (Maybe ReplicaModifications)
-> Either
String (Maybe SseKmsEncryptedObjects -> SourceSelectionCriteria)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ReplicaModifications)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReplicaModifications")
Either
String (Maybe SseKmsEncryptedObjects -> SourceSelectionCriteria)
-> Either String (Maybe SseKmsEncryptedObjects)
-> Either String SourceSelectionCriteria
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe SseKmsEncryptedObjects)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SseKmsEncryptedObjects")
instance Prelude.Hashable SourceSelectionCriteria
instance Prelude.NFData SourceSelectionCriteria
instance Core.ToXML SourceSelectionCriteria where
toXML :: SourceSelectionCriteria -> XML
toXML SourceSelectionCriteria' {Maybe ReplicaModifications
Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects :: Maybe SseKmsEncryptedObjects
replicaModifications :: Maybe ReplicaModifications
$sel:sseKmsEncryptedObjects:SourceSelectionCriteria' :: SourceSelectionCriteria -> Maybe SseKmsEncryptedObjects
$sel:replicaModifications:SourceSelectionCriteria' :: SourceSelectionCriteria -> Maybe ReplicaModifications
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"ReplicaModifications" Name -> Maybe ReplicaModifications -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe ReplicaModifications
replicaModifications,
Name
"SseKmsEncryptedObjects"
Name -> Maybe SseKmsEncryptedObjects -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe SseKmsEncryptedObjects
sseKmsEncryptedObjects
]