{-# 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.InvalidationList where
import Amazonka.CloudFront.Types.InvalidationSummary
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InvalidationList = InvalidationList'
{
InvalidationList -> Maybe [InvalidationSummary]
items :: Prelude.Maybe [InvalidationSummary],
InvalidationList -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
InvalidationList -> Text
marker :: Prelude.Text,
InvalidationList -> Int
maxItems :: Prelude.Int,
InvalidationList -> Bool
isTruncated :: Prelude.Bool,
InvalidationList -> Int
quantity :: Prelude.Int
}
deriving (InvalidationList -> InvalidationList -> Bool
(InvalidationList -> InvalidationList -> Bool)
-> (InvalidationList -> InvalidationList -> Bool)
-> Eq InvalidationList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvalidationList -> InvalidationList -> Bool
$c/= :: InvalidationList -> InvalidationList -> Bool
== :: InvalidationList -> InvalidationList -> Bool
$c== :: InvalidationList -> InvalidationList -> Bool
Prelude.Eq, ReadPrec [InvalidationList]
ReadPrec InvalidationList
Int -> ReadS InvalidationList
ReadS [InvalidationList]
(Int -> ReadS InvalidationList)
-> ReadS [InvalidationList]
-> ReadPrec InvalidationList
-> ReadPrec [InvalidationList]
-> Read InvalidationList
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InvalidationList]
$creadListPrec :: ReadPrec [InvalidationList]
readPrec :: ReadPrec InvalidationList
$creadPrec :: ReadPrec InvalidationList
readList :: ReadS [InvalidationList]
$creadList :: ReadS [InvalidationList]
readsPrec :: Int -> ReadS InvalidationList
$creadsPrec :: Int -> ReadS InvalidationList
Prelude.Read, Int -> InvalidationList -> ShowS
[InvalidationList] -> ShowS
InvalidationList -> String
(Int -> InvalidationList -> ShowS)
-> (InvalidationList -> String)
-> ([InvalidationList] -> ShowS)
-> Show InvalidationList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvalidationList] -> ShowS
$cshowList :: [InvalidationList] -> ShowS
show :: InvalidationList -> String
$cshow :: InvalidationList -> String
showsPrec :: Int -> InvalidationList -> ShowS
$cshowsPrec :: Int -> InvalidationList -> ShowS
Prelude.Show, (forall x. InvalidationList -> Rep InvalidationList x)
-> (forall x. Rep InvalidationList x -> InvalidationList)
-> Generic InvalidationList
forall x. Rep InvalidationList x -> InvalidationList
forall x. InvalidationList -> Rep InvalidationList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InvalidationList x -> InvalidationList
$cfrom :: forall x. InvalidationList -> Rep InvalidationList x
Prelude.Generic)
newInvalidationList ::
Prelude.Text ->
Prelude.Int ->
Prelude.Bool ->
Prelude.Int ->
InvalidationList
newInvalidationList :: Text -> Int -> Bool -> Int -> InvalidationList
newInvalidationList
Text
pMarker_
Int
pMaxItems_
Bool
pIsTruncated_
Int
pQuantity_ =
InvalidationList' :: Maybe [InvalidationSummary]
-> Maybe Text -> Text -> Int -> Bool -> Int -> InvalidationList
InvalidationList'
{ $sel:items:InvalidationList' :: Maybe [InvalidationSummary]
items = Maybe [InvalidationSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:InvalidationList' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:marker:InvalidationList' :: Text
marker = Text
pMarker_,
$sel:maxItems:InvalidationList' :: Int
maxItems = Int
pMaxItems_,
$sel:isTruncated:InvalidationList' :: Bool
isTruncated = Bool
pIsTruncated_,
$sel:quantity:InvalidationList' :: Int
quantity = Int
pQuantity_
}
invalidationList_items :: Lens.Lens' InvalidationList (Prelude.Maybe [InvalidationSummary])
invalidationList_items :: (Maybe [InvalidationSummary] -> f (Maybe [InvalidationSummary]))
-> InvalidationList -> f InvalidationList
invalidationList_items = (InvalidationList -> Maybe [InvalidationSummary])
-> (InvalidationList
-> Maybe [InvalidationSummary] -> InvalidationList)
-> Lens
InvalidationList
InvalidationList
(Maybe [InvalidationSummary])
(Maybe [InvalidationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationList' {Maybe [InvalidationSummary]
items :: Maybe [InvalidationSummary]
$sel:items:InvalidationList' :: InvalidationList -> Maybe [InvalidationSummary]
items} -> Maybe [InvalidationSummary]
items) (\s :: InvalidationList
s@InvalidationList' {} Maybe [InvalidationSummary]
a -> InvalidationList
s {$sel:items:InvalidationList' :: Maybe [InvalidationSummary]
items = Maybe [InvalidationSummary]
a} :: InvalidationList) ((Maybe [InvalidationSummary] -> f (Maybe [InvalidationSummary]))
-> InvalidationList -> f InvalidationList)
-> ((Maybe [InvalidationSummary]
-> f (Maybe [InvalidationSummary]))
-> Maybe [InvalidationSummary] -> f (Maybe [InvalidationSummary]))
-> (Maybe [InvalidationSummary] -> f (Maybe [InvalidationSummary]))
-> InvalidationList
-> f InvalidationList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InvalidationSummary]
[InvalidationSummary]
[InvalidationSummary]
[InvalidationSummary]
-> Iso
(Maybe [InvalidationSummary])
(Maybe [InvalidationSummary])
(Maybe [InvalidationSummary])
(Maybe [InvalidationSummary])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[InvalidationSummary]
[InvalidationSummary]
[InvalidationSummary]
[InvalidationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
invalidationList_nextMarker :: Lens.Lens' InvalidationList (Prelude.Maybe Prelude.Text)
invalidationList_nextMarker :: (Maybe Text -> f (Maybe Text))
-> InvalidationList -> f InvalidationList
invalidationList_nextMarker = (InvalidationList -> Maybe Text)
-> (InvalidationList -> Maybe Text -> InvalidationList)
-> Lens InvalidationList InvalidationList (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationList' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:InvalidationList' :: InvalidationList -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: InvalidationList
s@InvalidationList' {} Maybe Text
a -> InvalidationList
s {$sel:nextMarker:InvalidationList' :: Maybe Text
nextMarker = Maybe Text
a} :: InvalidationList)
invalidationList_marker :: Lens.Lens' InvalidationList Prelude.Text
invalidationList_marker :: (Text -> f Text) -> InvalidationList -> f InvalidationList
invalidationList_marker = (InvalidationList -> Text)
-> (InvalidationList -> Text -> InvalidationList)
-> Lens InvalidationList InvalidationList Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationList' {Text
marker :: Text
$sel:marker:InvalidationList' :: InvalidationList -> Text
marker} -> Text
marker) (\s :: InvalidationList
s@InvalidationList' {} Text
a -> InvalidationList
s {$sel:marker:InvalidationList' :: Text
marker = Text
a} :: InvalidationList)
invalidationList_maxItems :: Lens.Lens' InvalidationList Prelude.Int
invalidationList_maxItems :: (Int -> f Int) -> InvalidationList -> f InvalidationList
invalidationList_maxItems = (InvalidationList -> Int)
-> (InvalidationList -> Int -> InvalidationList)
-> Lens InvalidationList InvalidationList Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationList' {Int
maxItems :: Int
$sel:maxItems:InvalidationList' :: InvalidationList -> Int
maxItems} -> Int
maxItems) (\s :: InvalidationList
s@InvalidationList' {} Int
a -> InvalidationList
s {$sel:maxItems:InvalidationList' :: Int
maxItems = Int
a} :: InvalidationList)
invalidationList_isTruncated :: Lens.Lens' InvalidationList Prelude.Bool
invalidationList_isTruncated :: (Bool -> f Bool) -> InvalidationList -> f InvalidationList
invalidationList_isTruncated = (InvalidationList -> Bool)
-> (InvalidationList -> Bool -> InvalidationList)
-> Lens InvalidationList InvalidationList Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationList' {Bool
isTruncated :: Bool
$sel:isTruncated:InvalidationList' :: InvalidationList -> Bool
isTruncated} -> Bool
isTruncated) (\s :: InvalidationList
s@InvalidationList' {} Bool
a -> InvalidationList
s {$sel:isTruncated:InvalidationList' :: Bool
isTruncated = Bool
a} :: InvalidationList)
invalidationList_quantity :: Lens.Lens' InvalidationList Prelude.Int
invalidationList_quantity :: (Int -> f Int) -> InvalidationList -> f InvalidationList
invalidationList_quantity = (InvalidationList -> Int)
-> (InvalidationList -> Int -> InvalidationList)
-> Lens InvalidationList InvalidationList Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvalidationList' {Int
quantity :: Int
$sel:quantity:InvalidationList' :: InvalidationList -> Int
quantity} -> Int
quantity) (\s :: InvalidationList
s@InvalidationList' {} Int
a -> InvalidationList
s {$sel:quantity:InvalidationList' :: Int
quantity = Int
a} :: InvalidationList)
instance Core.FromXML InvalidationList where
parseXML :: [Node] -> Either String InvalidationList
parseXML [Node]
x =
Maybe [InvalidationSummary]
-> Maybe Text -> Text -> Int -> Bool -> Int -> InvalidationList
InvalidationList'
(Maybe [InvalidationSummary]
-> Maybe Text -> Text -> Int -> Bool -> Int -> InvalidationList)
-> Either String (Maybe [InvalidationSummary])
-> Either
String
(Maybe Text -> Text -> Int -> Bool -> Int -> InvalidationList)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Items" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [InvalidationSummary]))
-> Either String (Maybe [InvalidationSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [InvalidationSummary])
-> [Node] -> Either String (Maybe [InvalidationSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [InvalidationSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"InvalidationSummary")
)
Either
String
(Maybe Text -> Text -> Int -> Bool -> Int -> InvalidationList)
-> Either String (Maybe Text)
-> Either String (Text -> Int -> Bool -> Int -> InvalidationList)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextMarker")
Either String (Text -> Int -> Bool -> Int -> InvalidationList)
-> Either String Text
-> Either String (Int -> Bool -> Int -> InvalidationList)
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
"Marker")
Either String (Int -> Bool -> Int -> InvalidationList)
-> Either String Int
-> Either String (Bool -> Int -> InvalidationList)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Int
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"MaxItems")
Either String (Bool -> Int -> InvalidationList)
-> Either String Bool -> Either String (Int -> InvalidationList)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"IsTruncated")
Either String (Int -> InvalidationList)
-> Either String Int -> Either String InvalidationList
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Int
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Quantity")
instance Prelude.Hashable InvalidationList
instance Prelude.NFData InvalidationList