{-# 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.FunctionList where
import Amazonka.CloudFront.Types.FunctionSummary
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 FunctionList = FunctionList'
{
FunctionList -> Maybe [FunctionSummary]
items :: Prelude.Maybe [FunctionSummary],
FunctionList -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
FunctionList -> Int
maxItems :: Prelude.Int,
FunctionList -> Int
quantity :: Prelude.Int
}
deriving (FunctionList -> FunctionList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FunctionList -> FunctionList -> Bool
$c/= :: FunctionList -> FunctionList -> Bool
== :: FunctionList -> FunctionList -> Bool
$c== :: FunctionList -> FunctionList -> Bool
Prelude.Eq, ReadPrec [FunctionList]
ReadPrec FunctionList
Int -> ReadS FunctionList
ReadS [FunctionList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FunctionList]
$creadListPrec :: ReadPrec [FunctionList]
readPrec :: ReadPrec FunctionList
$creadPrec :: ReadPrec FunctionList
readList :: ReadS [FunctionList]
$creadList :: ReadS [FunctionList]
readsPrec :: Int -> ReadS FunctionList
$creadsPrec :: Int -> ReadS FunctionList
Prelude.Read, Int -> FunctionList -> ShowS
[FunctionList] -> ShowS
FunctionList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FunctionList] -> ShowS
$cshowList :: [FunctionList] -> ShowS
show :: FunctionList -> String
$cshow :: FunctionList -> String
showsPrec :: Int -> FunctionList -> ShowS
$cshowsPrec :: Int -> FunctionList -> ShowS
Prelude.Show, forall x. Rep FunctionList x -> FunctionList
forall x. FunctionList -> Rep FunctionList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FunctionList x -> FunctionList
$cfrom :: forall x. FunctionList -> Rep FunctionList x
Prelude.Generic)
newFunctionList ::
Prelude.Int ->
Prelude.Int ->
FunctionList
newFunctionList :: Int -> Int -> FunctionList
newFunctionList Int
pMaxItems_ Int
pQuantity_ =
FunctionList'
{ $sel:items:FunctionList' :: Maybe [FunctionSummary]
items = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:FunctionList' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:FunctionList' :: Int
maxItems = Int
pMaxItems_,
$sel:quantity:FunctionList' :: Int
quantity = Int
pQuantity_
}
functionList_items :: Lens.Lens' FunctionList (Prelude.Maybe [FunctionSummary])
functionList_items :: Lens' FunctionList (Maybe [FunctionSummary])
functionList_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionList' {Maybe [FunctionSummary]
items :: Maybe [FunctionSummary]
$sel:items:FunctionList' :: FunctionList -> Maybe [FunctionSummary]
items} -> Maybe [FunctionSummary]
items) (\s :: FunctionList
s@FunctionList' {} Maybe [FunctionSummary]
a -> FunctionList
s {$sel:items:FunctionList' :: Maybe [FunctionSummary]
items = Maybe [FunctionSummary]
a} :: FunctionList) 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
functionList_nextMarker :: Lens.Lens' FunctionList (Prelude.Maybe Prelude.Text)
functionList_nextMarker :: Lens' FunctionList (Maybe Text)
functionList_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionList' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:FunctionList' :: FunctionList -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: FunctionList
s@FunctionList' {} Maybe Text
a -> FunctionList
s {$sel:nextMarker:FunctionList' :: Maybe Text
nextMarker = Maybe Text
a} :: FunctionList)
functionList_maxItems :: Lens.Lens' FunctionList Prelude.Int
functionList_maxItems :: Lens' FunctionList Int
functionList_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionList' {Int
maxItems :: Int
$sel:maxItems:FunctionList' :: FunctionList -> Int
maxItems} -> Int
maxItems) (\s :: FunctionList
s@FunctionList' {} Int
a -> FunctionList
s {$sel:maxItems:FunctionList' :: Int
maxItems = Int
a} :: FunctionList)
functionList_quantity :: Lens.Lens' FunctionList Prelude.Int
functionList_quantity :: Lens' FunctionList Int
functionList_quantity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FunctionList' {Int
quantity :: Int
$sel:quantity:FunctionList' :: FunctionList -> Int
quantity} -> Int
quantity) (\s :: FunctionList
s@FunctionList' {} Int
a -> FunctionList
s {$sel:quantity:FunctionList' :: Int
quantity = Int
a} :: FunctionList)
instance Data.FromXML FunctionList where
parseXML :: [Node] -> Either String FunctionList
parseXML [Node]
x =
Maybe [FunctionSummary] -> Maybe Text -> Int -> Int -> FunctionList
FunctionList'
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
"FunctionSummary")
)
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 FunctionList where
hashWithSalt :: Int -> FunctionList -> Int
hashWithSalt Int
_salt FunctionList' {Int
Maybe [FunctionSummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [FunctionSummary]
$sel:quantity:FunctionList' :: FunctionList -> Int
$sel:maxItems:FunctionList' :: FunctionList -> Int
$sel:nextMarker:FunctionList' :: FunctionList -> Maybe Text
$sel:items:FunctionList' :: FunctionList -> Maybe [FunctionSummary]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [FunctionSummary]
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 FunctionList where
rnf :: FunctionList -> ()
rnf FunctionList' {Int
Maybe [FunctionSummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [FunctionSummary]
$sel:quantity:FunctionList' :: FunctionList -> Int
$sel:maxItems:FunctionList' :: FunctionList -> Int
$sel:nextMarker:FunctionList' :: FunctionList -> Maybe Text
$sel:items:FunctionList' :: FunctionList -> Maybe [FunctionSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [FunctionSummary]
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