{-# 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.CachePolicyList where
import Amazonka.CloudFront.Types.CachePolicySummary
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
data CachePolicyList = CachePolicyList'
{
CachePolicyList -> Maybe [CachePolicySummary]
items :: Prelude.Maybe [CachePolicySummary],
CachePolicyList -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
CachePolicyList -> Int
maxItems :: Prelude.Int,
CachePolicyList -> Int
quantity :: Prelude.Int
}
deriving (CachePolicyList -> CachePolicyList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CachePolicyList -> CachePolicyList -> Bool
$c/= :: CachePolicyList -> CachePolicyList -> Bool
== :: CachePolicyList -> CachePolicyList -> Bool
$c== :: CachePolicyList -> CachePolicyList -> Bool
Prelude.Eq, ReadPrec [CachePolicyList]
ReadPrec CachePolicyList
Int -> ReadS CachePolicyList
ReadS [CachePolicyList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CachePolicyList]
$creadListPrec :: ReadPrec [CachePolicyList]
readPrec :: ReadPrec CachePolicyList
$creadPrec :: ReadPrec CachePolicyList
readList :: ReadS [CachePolicyList]
$creadList :: ReadS [CachePolicyList]
readsPrec :: Int -> ReadS CachePolicyList
$creadsPrec :: Int -> ReadS CachePolicyList
Prelude.Read, Int -> CachePolicyList -> ShowS
[CachePolicyList] -> ShowS
CachePolicyList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CachePolicyList] -> ShowS
$cshowList :: [CachePolicyList] -> ShowS
show :: CachePolicyList -> String
$cshow :: CachePolicyList -> String
showsPrec :: Int -> CachePolicyList -> ShowS
$cshowsPrec :: Int -> CachePolicyList -> ShowS
Prelude.Show, forall x. Rep CachePolicyList x -> CachePolicyList
forall x. CachePolicyList -> Rep CachePolicyList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CachePolicyList x -> CachePolicyList
$cfrom :: forall x. CachePolicyList -> Rep CachePolicyList x
Prelude.Generic)
newCachePolicyList ::
Prelude.Int ->
Prelude.Int ->
CachePolicyList
newCachePolicyList :: Int -> Int -> CachePolicyList
newCachePolicyList Int
pMaxItems_ Int
pQuantity_ =
CachePolicyList'
{ $sel:items:CachePolicyList' :: Maybe [CachePolicySummary]
items = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:CachePolicyList' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:CachePolicyList' :: Int
maxItems = Int
pMaxItems_,
$sel:quantity:CachePolicyList' :: Int
quantity = Int
pQuantity_
}
cachePolicyList_items :: Lens.Lens' CachePolicyList (Prelude.Maybe [CachePolicySummary])
cachePolicyList_items :: Lens' CachePolicyList (Maybe [CachePolicySummary])
cachePolicyList_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyList' {Maybe [CachePolicySummary]
items :: Maybe [CachePolicySummary]
$sel:items:CachePolicyList' :: CachePolicyList -> Maybe [CachePolicySummary]
items} -> Maybe [CachePolicySummary]
items) (\s :: CachePolicyList
s@CachePolicyList' {} Maybe [CachePolicySummary]
a -> CachePolicyList
s {$sel:items:CachePolicyList' :: Maybe [CachePolicySummary]
items = Maybe [CachePolicySummary]
a} :: CachePolicyList) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
cachePolicyList_nextMarker :: Lens.Lens' CachePolicyList (Prelude.Maybe Prelude.Text)
cachePolicyList_nextMarker :: Lens' CachePolicyList (Maybe Text)
cachePolicyList_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyList' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:CachePolicyList' :: CachePolicyList -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: CachePolicyList
s@CachePolicyList' {} Maybe Text
a -> CachePolicyList
s {$sel:nextMarker:CachePolicyList' :: Maybe Text
nextMarker = Maybe Text
a} :: CachePolicyList)
cachePolicyList_maxItems :: Lens.Lens' CachePolicyList Prelude.Int
cachePolicyList_maxItems :: Lens' CachePolicyList Int
cachePolicyList_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyList' {Int
maxItems :: Int
$sel:maxItems:CachePolicyList' :: CachePolicyList -> Int
maxItems} -> Int
maxItems) (\s :: CachePolicyList
s@CachePolicyList' {} Int
a -> CachePolicyList
s {$sel:maxItems:CachePolicyList' :: Int
maxItems = Int
a} :: CachePolicyList)
cachePolicyList_quantity :: Lens.Lens' CachePolicyList Prelude.Int
cachePolicyList_quantity :: Lens' CachePolicyList Int
cachePolicyList_quantity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicyList' {Int
quantity :: Int
$sel:quantity:CachePolicyList' :: CachePolicyList -> Int
quantity} -> Int
quantity) (\s :: CachePolicyList
s@CachePolicyList' {} Int
a -> CachePolicyList
s {$sel:quantity:CachePolicyList' :: Int
quantity = Int
a} :: CachePolicyList)
instance Data.FromXML CachePolicyList where
parseXML :: [Node] -> Either String CachePolicyList
parseXML [Node]
x =
Maybe [CachePolicySummary]
-> Maybe Text -> Int -> Int -> CachePolicyList
CachePolicyList'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Items"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"CachePolicySummary")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"NextMarker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"MaxItems")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Quantity")
instance Prelude.Hashable CachePolicyList where
hashWithSalt :: Int -> CachePolicyList -> Int
hashWithSalt Int
_salt CachePolicyList' {Int
Maybe [CachePolicySummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [CachePolicySummary]
$sel:quantity:CachePolicyList' :: CachePolicyList -> Int
$sel:maxItems:CachePolicyList' :: CachePolicyList -> Int
$sel:nextMarker:CachePolicyList' :: CachePolicyList -> Maybe Text
$sel:items:CachePolicyList' :: CachePolicyList -> Maybe [CachePolicySummary]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CachePolicySummary]
items
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextMarker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
quantity
instance Prelude.NFData CachePolicyList where
rnf :: CachePolicyList -> ()
rnf CachePolicyList' {Int
Maybe [CachePolicySummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [CachePolicySummary]
$sel:quantity:CachePolicyList' :: CachePolicyList -> Int
$sel:maxItems:CachePolicyList' :: CachePolicyList -> Int
$sel:nextMarker:CachePolicyList' :: CachePolicyList -> Maybe Text
$sel:items:CachePolicyList' :: CachePolicyList -> Maybe [CachePolicySummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [CachePolicySummary]
items
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
quantity