{-# 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.CloudFront.Types.InvalidationBatch where
import Amazonka.CloudFront.Types.Paths
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InvalidationBatch = InvalidationBatch'
{
InvalidationBatch -> Paths
paths :: Paths,
InvalidationBatch -> Text
callerReference :: Prelude.Text
}
deriving (InvalidationBatch -> InvalidationBatch -> Bool
(InvalidationBatch -> InvalidationBatch -> Bool)
-> (InvalidationBatch -> InvalidationBatch -> Bool)
-> Eq InvalidationBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvalidationBatch -> InvalidationBatch -> Bool
$c/= :: InvalidationBatch -> InvalidationBatch -> Bool
== :: InvalidationBatch -> InvalidationBatch -> Bool
$c== :: InvalidationBatch -> InvalidationBatch -> Bool
Prelude.Eq, ReadPrec [InvalidationBatch]
ReadPrec InvalidationBatch
Int -> ReadS InvalidationBatch
ReadS [InvalidationBatch]
(Int -> ReadS InvalidationBatch)
-> ReadS [InvalidationBatch]
-> ReadPrec InvalidationBatch
-> ReadPrec [InvalidationBatch]
-> Read InvalidationBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InvalidationBatch]
$creadListPrec :: ReadPrec [InvalidationBatch]
readPrec :: ReadPrec InvalidationBatch
$creadPrec :: ReadPrec InvalidationBatch
readList :: ReadS [InvalidationBatch]
$creadList :: ReadS [InvalidationBatch]
readsPrec :: Int -> ReadS InvalidationBatch
$creadsPrec :: Int -> ReadS InvalidationBatch
Prelude.Read, Int -> InvalidationBatch -> ShowS
[InvalidationBatch] -> ShowS
InvalidationBatch -> String
(Int -> InvalidationBatch -> ShowS)
-> (InvalidationBatch -> String)
-> ([InvalidationBatch] -> ShowS)
-> Show InvalidationBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvalidationBatch] -> ShowS
$cshowList :: [InvalidationBatch] -> ShowS
show :: InvalidationBatch -> String
$cshow :: InvalidationBatch -> String
showsPrec :: Int -> InvalidationBatch -> ShowS
$cshowsPrec :: Int -> InvalidationBatch -> ShowS
Prelude.Show, (forall x. InvalidationBatch -> Rep InvalidationBatch x)
-> (forall x. Rep InvalidationBatch x -> InvalidationBatch)
-> Generic InvalidationBatch
forall x. Rep InvalidationBatch x -> InvalidationBatch
forall x. InvalidationBatch -> Rep InvalidationBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InvalidationBatch x -> InvalidationBatch
$cfrom :: forall x. InvalidationBatch -> Rep InvalidationBatch x
Prelude.Generic)
newInvalidationBatch ::
Paths ->
Prelude.Text ->
InvalidationBatch
newInvalidationBatch :: Paths -> Text -> InvalidationBatch
newInvalidationBatch Paths
pPaths_ Text
pCallerReference_ =
InvalidationBatch' :: Paths -> Text -> InvalidationBatch
InvalidationBatch'
{ $sel:paths:InvalidationBatch' :: Paths
paths = Paths
pPaths_,
$sel:callerReference:InvalidationBatch' :: Text
callerReference = Text
pCallerReference_
}
invalidationBatch_paths :: Lens.Lens' InvalidationBatch Paths
invalidationBatch_paths :: (Paths -> f Paths) -> InvalidationBatch -> f InvalidationBatch
invalidationBatch_paths = (InvalidationBatch -> Paths)
-> (InvalidationBatch -> Paths -> InvalidationBatch)
-> Lens InvalidationBatch InvalidationBatch Paths Paths
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationBatch' {Paths
paths :: Paths
$sel:paths:InvalidationBatch' :: InvalidationBatch -> Paths
paths} -> Paths
paths) (\s :: InvalidationBatch
s@InvalidationBatch' {} Paths
a -> InvalidationBatch
s {$sel:paths:InvalidationBatch' :: Paths
paths = Paths
a} :: InvalidationBatch)
invalidationBatch_callerReference :: Lens.Lens' InvalidationBatch Prelude.Text
invalidationBatch_callerReference :: (Text -> f Text) -> InvalidationBatch -> f InvalidationBatch
invalidationBatch_callerReference = (InvalidationBatch -> Text)
-> (InvalidationBatch -> Text -> InvalidationBatch)
-> Lens InvalidationBatch InvalidationBatch Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationBatch' {Text
callerReference :: Text
$sel:callerReference:InvalidationBatch' :: InvalidationBatch -> Text
callerReference} -> Text
callerReference) (\s :: InvalidationBatch
s@InvalidationBatch' {} Text
a -> InvalidationBatch
s {$sel:callerReference:InvalidationBatch' :: Text
callerReference = Text
a} :: InvalidationBatch)
instance Core.FromXML InvalidationBatch where
parseXML :: [Node] -> Either String InvalidationBatch
parseXML [Node]
x =
Paths -> Text -> InvalidationBatch
InvalidationBatch'
(Paths -> Text -> InvalidationBatch)
-> Either String Paths -> Either String (Text -> InvalidationBatch)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Paths
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Paths")
Either String (Text -> InvalidationBatch)
-> Either String Text -> Either String InvalidationBatch
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CallerReference")
instance Prelude.Hashable InvalidationBatch
instance Prelude.NFData InvalidationBatch
instance Core.ToXML InvalidationBatch where
toXML :: InvalidationBatch -> XML
toXML InvalidationBatch' {Text
Paths
callerReference :: Text
paths :: Paths
$sel:callerReference:InvalidationBatch' :: InvalidationBatch -> Text
$sel:paths:InvalidationBatch' :: InvalidationBatch -> Paths
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Paths" Name -> Paths -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Paths
paths,
Name
"CallerReference" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
callerReference
]