{-# 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.KeyGroupList where
import Amazonka.CloudFront.Types.KeyGroupSummary
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data KeyGroupList = KeyGroupList'
{
KeyGroupList -> Maybe [KeyGroupSummary]
items :: Prelude.Maybe [KeyGroupSummary],
KeyGroupList -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
KeyGroupList -> Int
maxItems :: Prelude.Int,
KeyGroupList -> Int
quantity :: Prelude.Int
}
deriving (KeyGroupList -> KeyGroupList -> Bool
(KeyGroupList -> KeyGroupList -> Bool)
-> (KeyGroupList -> KeyGroupList -> Bool) -> Eq KeyGroupList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyGroupList -> KeyGroupList -> Bool
$c/= :: KeyGroupList -> KeyGroupList -> Bool
== :: KeyGroupList -> KeyGroupList -> Bool
$c== :: KeyGroupList -> KeyGroupList -> Bool
Prelude.Eq, ReadPrec [KeyGroupList]
ReadPrec KeyGroupList
Int -> ReadS KeyGroupList
ReadS [KeyGroupList]
(Int -> ReadS KeyGroupList)
-> ReadS [KeyGroupList]
-> ReadPrec KeyGroupList
-> ReadPrec [KeyGroupList]
-> Read KeyGroupList
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeyGroupList]
$creadListPrec :: ReadPrec [KeyGroupList]
readPrec :: ReadPrec KeyGroupList
$creadPrec :: ReadPrec KeyGroupList
readList :: ReadS [KeyGroupList]
$creadList :: ReadS [KeyGroupList]
readsPrec :: Int -> ReadS KeyGroupList
$creadsPrec :: Int -> ReadS KeyGroupList
Prelude.Read, Int -> KeyGroupList -> ShowS
[KeyGroupList] -> ShowS
KeyGroupList -> String
(Int -> KeyGroupList -> ShowS)
-> (KeyGroupList -> String)
-> ([KeyGroupList] -> ShowS)
-> Show KeyGroupList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyGroupList] -> ShowS
$cshowList :: [KeyGroupList] -> ShowS
show :: KeyGroupList -> String
$cshow :: KeyGroupList -> String
showsPrec :: Int -> KeyGroupList -> ShowS
$cshowsPrec :: Int -> KeyGroupList -> ShowS
Prelude.Show, (forall x. KeyGroupList -> Rep KeyGroupList x)
-> (forall x. Rep KeyGroupList x -> KeyGroupList)
-> Generic KeyGroupList
forall x. Rep KeyGroupList x -> KeyGroupList
forall x. KeyGroupList -> Rep KeyGroupList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyGroupList x -> KeyGroupList
$cfrom :: forall x. KeyGroupList -> Rep KeyGroupList x
Prelude.Generic)
newKeyGroupList ::
Prelude.Int ->
Prelude.Int ->
KeyGroupList
newKeyGroupList :: Int -> Int -> KeyGroupList
newKeyGroupList Int
pMaxItems_ Int
pQuantity_ =
KeyGroupList' :: Maybe [KeyGroupSummary] -> Maybe Text -> Int -> Int -> KeyGroupList
KeyGroupList'
{ $sel:items:KeyGroupList' :: Maybe [KeyGroupSummary]
items = Maybe [KeyGroupSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:KeyGroupList' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:KeyGroupList' :: Int
maxItems = Int
pMaxItems_,
$sel:quantity:KeyGroupList' :: Int
quantity = Int
pQuantity_
}
keyGroupList_items :: Lens.Lens' KeyGroupList (Prelude.Maybe [KeyGroupSummary])
keyGroupList_items :: (Maybe [KeyGroupSummary] -> f (Maybe [KeyGroupSummary]))
-> KeyGroupList -> f KeyGroupList
keyGroupList_items = (KeyGroupList -> Maybe [KeyGroupSummary])
-> (KeyGroupList -> Maybe [KeyGroupSummary] -> KeyGroupList)
-> Lens
KeyGroupList
KeyGroupList
(Maybe [KeyGroupSummary])
(Maybe [KeyGroupSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroupList' {Maybe [KeyGroupSummary]
items :: Maybe [KeyGroupSummary]
$sel:items:KeyGroupList' :: KeyGroupList -> Maybe [KeyGroupSummary]
items} -> Maybe [KeyGroupSummary]
items) (\s :: KeyGroupList
s@KeyGroupList' {} Maybe [KeyGroupSummary]
a -> KeyGroupList
s {$sel:items:KeyGroupList' :: Maybe [KeyGroupSummary]
items = Maybe [KeyGroupSummary]
a} :: KeyGroupList) ((Maybe [KeyGroupSummary] -> f (Maybe [KeyGroupSummary]))
-> KeyGroupList -> f KeyGroupList)
-> ((Maybe [KeyGroupSummary] -> f (Maybe [KeyGroupSummary]))
-> Maybe [KeyGroupSummary] -> f (Maybe [KeyGroupSummary]))
-> (Maybe [KeyGroupSummary] -> f (Maybe [KeyGroupSummary]))
-> KeyGroupList
-> f KeyGroupList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[KeyGroupSummary]
[KeyGroupSummary]
[KeyGroupSummary]
[KeyGroupSummary]
-> Iso
(Maybe [KeyGroupSummary])
(Maybe [KeyGroupSummary])
(Maybe [KeyGroupSummary])
(Maybe [KeyGroupSummary])
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
[KeyGroupSummary]
[KeyGroupSummary]
[KeyGroupSummary]
[KeyGroupSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
keyGroupList_nextMarker :: Lens.Lens' KeyGroupList (Prelude.Maybe Prelude.Text)
keyGroupList_nextMarker :: (Maybe Text -> f (Maybe Text)) -> KeyGroupList -> f KeyGroupList
keyGroupList_nextMarker = (KeyGroupList -> Maybe Text)
-> (KeyGroupList -> Maybe Text -> KeyGroupList)
-> Lens KeyGroupList KeyGroupList (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroupList' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:KeyGroupList' :: KeyGroupList -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: KeyGroupList
s@KeyGroupList' {} Maybe Text
a -> KeyGroupList
s {$sel:nextMarker:KeyGroupList' :: Maybe Text
nextMarker = Maybe Text
a} :: KeyGroupList)
keyGroupList_maxItems :: Lens.Lens' KeyGroupList Prelude.Int
keyGroupList_maxItems :: (Int -> f Int) -> KeyGroupList -> f KeyGroupList
keyGroupList_maxItems = (KeyGroupList -> Int)
-> (KeyGroupList -> Int -> KeyGroupList)
-> Lens KeyGroupList KeyGroupList Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroupList' {Int
maxItems :: Int
$sel:maxItems:KeyGroupList' :: KeyGroupList -> Int
maxItems} -> Int
maxItems) (\s :: KeyGroupList
s@KeyGroupList' {} Int
a -> KeyGroupList
s {$sel:maxItems:KeyGroupList' :: Int
maxItems = Int
a} :: KeyGroupList)
keyGroupList_quantity :: Lens.Lens' KeyGroupList Prelude.Int
keyGroupList_quantity :: (Int -> f Int) -> KeyGroupList -> f KeyGroupList
keyGroupList_quantity = (KeyGroupList -> Int)
-> (KeyGroupList -> Int -> KeyGroupList)
-> Lens KeyGroupList KeyGroupList Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroupList' {Int
quantity :: Int
$sel:quantity:KeyGroupList' :: KeyGroupList -> Int
quantity} -> Int
quantity) (\s :: KeyGroupList
s@KeyGroupList' {} Int
a -> KeyGroupList
s {$sel:quantity:KeyGroupList' :: Int
quantity = Int
a} :: KeyGroupList)
instance Core.FromXML KeyGroupList where
parseXML :: [Node] -> Either String KeyGroupList
parseXML [Node]
x =
Maybe [KeyGroupSummary] -> Maybe Text -> Int -> Int -> KeyGroupList
KeyGroupList'
(Maybe [KeyGroupSummary]
-> Maybe Text -> Int -> Int -> KeyGroupList)
-> Either String (Maybe [KeyGroupSummary])
-> Either String (Maybe Text -> Int -> Int -> KeyGroupList)
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 [KeyGroupSummary]))
-> Either String (Maybe [KeyGroupSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [KeyGroupSummary])
-> [Node] -> Either String (Maybe [KeyGroupSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [KeyGroupSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"KeyGroupSummary")
)
Either String (Maybe Text -> Int -> Int -> KeyGroupList)
-> Either String (Maybe Text)
-> Either String (Int -> Int -> KeyGroupList)
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 (Int -> Int -> KeyGroupList)
-> Either String Int -> Either String (Int -> KeyGroupList)
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 (Int -> KeyGroupList)
-> Either String Int -> Either String KeyGroupList
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 KeyGroupList
instance Prelude.NFData KeyGroupList