{-# 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.DistributionList where
import Amazonka.CloudFront.Types.DistributionSummary
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 DistributionList = DistributionList'
{
DistributionList -> Maybe [DistributionSummary]
items :: Prelude.Maybe [DistributionSummary],
DistributionList -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
DistributionList -> Text
marker :: Prelude.Text,
DistributionList -> Int
maxItems :: Prelude.Int,
DistributionList -> Bool
isTruncated :: Prelude.Bool,
DistributionList -> Int
quantity :: Prelude.Int
}
deriving (DistributionList -> DistributionList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DistributionList -> DistributionList -> Bool
$c/= :: DistributionList -> DistributionList -> Bool
== :: DistributionList -> DistributionList -> Bool
$c== :: DistributionList -> DistributionList -> Bool
Prelude.Eq, Int -> DistributionList -> ShowS
[DistributionList] -> ShowS
DistributionList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DistributionList] -> ShowS
$cshowList :: [DistributionList] -> ShowS
show :: DistributionList -> String
$cshow :: DistributionList -> String
showsPrec :: Int -> DistributionList -> ShowS
$cshowsPrec :: Int -> DistributionList -> ShowS
Prelude.Show, forall x. Rep DistributionList x -> DistributionList
forall x. DistributionList -> Rep DistributionList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DistributionList x -> DistributionList
$cfrom :: forall x. DistributionList -> Rep DistributionList x
Prelude.Generic)
newDistributionList ::
Prelude.Text ->
Prelude.Int ->
Prelude.Bool ->
Prelude.Int ->
DistributionList
newDistributionList :: Text -> Int -> Bool -> Int -> DistributionList
newDistributionList
Text
pMarker_
Int
pMaxItems_
Bool
pIsTruncated_
Int
pQuantity_ =
DistributionList'
{ $sel:items:DistributionList' :: Maybe [DistributionSummary]
items = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:DistributionList' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:marker:DistributionList' :: Text
marker = Text
pMarker_,
$sel:maxItems:DistributionList' :: Int
maxItems = Int
pMaxItems_,
$sel:isTruncated:DistributionList' :: Bool
isTruncated = Bool
pIsTruncated_,
$sel:quantity:DistributionList' :: Int
quantity = Int
pQuantity_
}
distributionList_items :: Lens.Lens' DistributionList (Prelude.Maybe [DistributionSummary])
distributionList_items :: Lens' DistributionList (Maybe [DistributionSummary])
distributionList_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionList' {Maybe [DistributionSummary]
items :: Maybe [DistributionSummary]
$sel:items:DistributionList' :: DistributionList -> Maybe [DistributionSummary]
items} -> Maybe [DistributionSummary]
items) (\s :: DistributionList
s@DistributionList' {} Maybe [DistributionSummary]
a -> DistributionList
s {$sel:items:DistributionList' :: Maybe [DistributionSummary]
items = Maybe [DistributionSummary]
a} :: DistributionList) 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
distributionList_nextMarker :: Lens.Lens' DistributionList (Prelude.Maybe Prelude.Text)
distributionList_nextMarker :: Lens' DistributionList (Maybe Text)
distributionList_nextMarker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionList' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:DistributionList' :: DistributionList -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: DistributionList
s@DistributionList' {} Maybe Text
a -> DistributionList
s {$sel:nextMarker:DistributionList' :: Maybe Text
nextMarker = Maybe Text
a} :: DistributionList)
distributionList_marker :: Lens.Lens' DistributionList Prelude.Text
distributionList_marker :: Lens' DistributionList Text
distributionList_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionList' {Text
marker :: Text
$sel:marker:DistributionList' :: DistributionList -> Text
marker} -> Text
marker) (\s :: DistributionList
s@DistributionList' {} Text
a -> DistributionList
s {$sel:marker:DistributionList' :: Text
marker = Text
a} :: DistributionList)
distributionList_maxItems :: Lens.Lens' DistributionList Prelude.Int
distributionList_maxItems :: Lens' DistributionList Int
distributionList_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionList' {Int
maxItems :: Int
$sel:maxItems:DistributionList' :: DistributionList -> Int
maxItems} -> Int
maxItems) (\s :: DistributionList
s@DistributionList' {} Int
a -> DistributionList
s {$sel:maxItems:DistributionList' :: Int
maxItems = Int
a} :: DistributionList)
distributionList_isTruncated :: Lens.Lens' DistributionList Prelude.Bool
distributionList_isTruncated :: Lens' DistributionList Bool
distributionList_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionList' {Bool
isTruncated :: Bool
$sel:isTruncated:DistributionList' :: DistributionList -> Bool
isTruncated} -> Bool
isTruncated) (\s :: DistributionList
s@DistributionList' {} Bool
a -> DistributionList
s {$sel:isTruncated:DistributionList' :: Bool
isTruncated = Bool
a} :: DistributionList)
distributionList_quantity :: Lens.Lens' DistributionList Prelude.Int
distributionList_quantity :: Lens' DistributionList Int
distributionList_quantity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionList' {Int
quantity :: Int
$sel:quantity:DistributionList' :: DistributionList -> Int
quantity} -> Int
quantity) (\s :: DistributionList
s@DistributionList' {} Int
a -> DistributionList
s {$sel:quantity:DistributionList' :: Int
quantity = Int
a} :: DistributionList)
instance Data.FromXML DistributionList where
parseXML :: [Node] -> Either String DistributionList
parseXML [Node]
x =
Maybe [DistributionSummary]
-> Maybe Text -> Text -> Int -> Bool -> Int -> DistributionList
DistributionList'
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
"DistributionSummary")
)
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
"Marker")
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
"IsTruncated")
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 DistributionList where
hashWithSalt :: Int -> DistributionList -> Int
hashWithSalt Int
_salt DistributionList' {Bool
Int
Maybe [DistributionSummary]
Maybe Text
Text
quantity :: Int
isTruncated :: Bool
maxItems :: Int
marker :: Text
nextMarker :: Maybe Text
items :: Maybe [DistributionSummary]
$sel:quantity:DistributionList' :: DistributionList -> Int
$sel:isTruncated:DistributionList' :: DistributionList -> Bool
$sel:maxItems:DistributionList' :: DistributionList -> Int
$sel:marker:DistributionList' :: DistributionList -> Text
$sel:nextMarker:DistributionList' :: DistributionList -> Maybe Text
$sel:items:DistributionList' :: DistributionList -> Maybe [DistributionSummary]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DistributionSummary]
items
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextMarker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
isTruncated
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
quantity
instance Prelude.NFData DistributionList where
rnf :: DistributionList -> ()
rnf DistributionList' {Bool
Int
Maybe [DistributionSummary]
Maybe Text
Text
quantity :: Int
isTruncated :: Bool
maxItems :: Int
marker :: Text
nextMarker :: Maybe Text
items :: Maybe [DistributionSummary]
$sel:quantity:DistributionList' :: DistributionList -> Int
$sel:isTruncated:DistributionList' :: DistributionList -> Bool
$sel:maxItems:DistributionList' :: DistributionList -> Int
$sel:marker:DistributionList' :: DistributionList -> Text
$sel:nextMarker:DistributionList' :: DistributionList -> Maybe Text
$sel:items:DistributionList' :: DistributionList -> Maybe [DistributionSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DistributionSummary]
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 Text
marker
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 Bool
isTruncated
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
quantity