{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:items:PublicKeyList' :: Maybe [PublicKeySummary]
items = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:PublicKeyList' :: Maybe Text
nextMarker = 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 :: Lens' PublicKeyList (Maybe [PublicKeySummary])
publicKeyList_items = 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) 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
publicKeyList_nextMarker :: Lens.Lens' PublicKeyList (Prelude.Maybe Prelude.Text)
publicKeyList_nextMarker :: Lens' PublicKeyList (Maybe Text)
publicKeyList_nextMarker = 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 :: Lens' PublicKeyList Int
publicKeyList_maxItems = 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 :: Lens' PublicKeyList Int
publicKeyList_quantity = 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 Data.FromXML PublicKeyList where
parseXML :: [Node] -> Either String PublicKeyList
parseXML [Node]
x =
Maybe [PublicKeySummary]
-> Maybe Text -> Int -> Int -> PublicKeyList
PublicKeyList'
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
"PublicKeySummary")
)
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 PublicKeyList where
hashWithSalt :: Int -> PublicKeyList -> Int
hashWithSalt Int
_salt PublicKeyList' {Int
Maybe [PublicKeySummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [PublicKeySummary]
$sel:quantity:PublicKeyList' :: PublicKeyList -> Int
$sel:maxItems:PublicKeyList' :: PublicKeyList -> Int
$sel:nextMarker:PublicKeyList' :: PublicKeyList -> Maybe Text
$sel:items:PublicKeyList' :: PublicKeyList -> Maybe [PublicKeySummary]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PublicKeySummary]
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 PublicKeyList where
rnf :: PublicKeyList -> ()
rnf PublicKeyList' {Int
Maybe [PublicKeySummary]
Maybe Text
quantity :: Int
maxItems :: Int
nextMarker :: Maybe Text
items :: Maybe [PublicKeySummary]
$sel:quantity:PublicKeyList' :: PublicKeyList -> Int
$sel:maxItems:PublicKeyList' :: PublicKeyList -> Int
$sel:nextMarker:PublicKeyList' :: PublicKeyList -> Maybe Text
$sel:items:PublicKeyList' :: PublicKeyList -> Maybe [PublicKeySummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [PublicKeySummary]
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