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