{-# 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.ResponseHeadersPolicyCustomHeadersConfig where
import Amazonka.CloudFront.Types.ResponseHeadersPolicyCustomHeader
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 =
{
:: Prelude.Maybe [ResponseHeadersPolicyCustomHeader],
:: Prelude.Int
}
deriving (ResponseHeadersPolicyCustomHeadersConfig
-> ResponseHeadersPolicyCustomHeadersConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResponseHeadersPolicyCustomHeadersConfig
-> ResponseHeadersPolicyCustomHeadersConfig -> Bool
$c/= :: ResponseHeadersPolicyCustomHeadersConfig
-> ResponseHeadersPolicyCustomHeadersConfig -> Bool
== :: ResponseHeadersPolicyCustomHeadersConfig
-> ResponseHeadersPolicyCustomHeadersConfig -> Bool
$c== :: ResponseHeadersPolicyCustomHeadersConfig
-> ResponseHeadersPolicyCustomHeadersConfig -> Bool
Prelude.Eq, ReadPrec [ResponseHeadersPolicyCustomHeadersConfig]
ReadPrec ResponseHeadersPolicyCustomHeadersConfig
Int -> ReadS ResponseHeadersPolicyCustomHeadersConfig
ReadS [ResponseHeadersPolicyCustomHeadersConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResponseHeadersPolicyCustomHeadersConfig]
$creadListPrec :: ReadPrec [ResponseHeadersPolicyCustomHeadersConfig]
readPrec :: ReadPrec ResponseHeadersPolicyCustomHeadersConfig
$creadPrec :: ReadPrec ResponseHeadersPolicyCustomHeadersConfig
readList :: ReadS [ResponseHeadersPolicyCustomHeadersConfig]
$creadList :: ReadS [ResponseHeadersPolicyCustomHeadersConfig]
readsPrec :: Int -> ReadS ResponseHeadersPolicyCustomHeadersConfig
$creadsPrec :: Int -> ReadS ResponseHeadersPolicyCustomHeadersConfig
Prelude.Read, Int -> ResponseHeadersPolicyCustomHeadersConfig -> ShowS
[ResponseHeadersPolicyCustomHeadersConfig] -> ShowS
ResponseHeadersPolicyCustomHeadersConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResponseHeadersPolicyCustomHeadersConfig] -> ShowS
$cshowList :: [ResponseHeadersPolicyCustomHeadersConfig] -> ShowS
show :: ResponseHeadersPolicyCustomHeadersConfig -> String
$cshow :: ResponseHeadersPolicyCustomHeadersConfig -> String
showsPrec :: Int -> ResponseHeadersPolicyCustomHeadersConfig -> ShowS
$cshowsPrec :: Int -> ResponseHeadersPolicyCustomHeadersConfig -> ShowS
Prelude.Show, forall x.
Rep ResponseHeadersPolicyCustomHeadersConfig x
-> ResponseHeadersPolicyCustomHeadersConfig
forall x.
ResponseHeadersPolicyCustomHeadersConfig
-> Rep ResponseHeadersPolicyCustomHeadersConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResponseHeadersPolicyCustomHeadersConfig x
-> ResponseHeadersPolicyCustomHeadersConfig
$cfrom :: forall x.
ResponseHeadersPolicyCustomHeadersConfig
-> Rep ResponseHeadersPolicyCustomHeadersConfig x
Prelude.Generic)
newResponseHeadersPolicyCustomHeadersConfig ::
Prelude.Int ->
ResponseHeadersPolicyCustomHeadersConfig
Int
pQuantity_ =
ResponseHeadersPolicyCustomHeadersConfig'
{ $sel:items:ResponseHeadersPolicyCustomHeadersConfig' :: Maybe [ResponseHeadersPolicyCustomHeader]
items =
forall a. Maybe a
Prelude.Nothing,
$sel:quantity:ResponseHeadersPolicyCustomHeadersConfig' :: Int
quantity = Int
pQuantity_
}
responseHeadersPolicyCustomHeadersConfig_items :: Lens.Lens' ResponseHeadersPolicyCustomHeadersConfig (Prelude.Maybe [ResponseHeadersPolicyCustomHeader])
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponseHeadersPolicyCustomHeadersConfig' {Maybe [ResponseHeadersPolicyCustomHeader]
items :: Maybe [ResponseHeadersPolicyCustomHeader]
$sel:items:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig
-> Maybe [ResponseHeadersPolicyCustomHeader]
items} -> Maybe [ResponseHeadersPolicyCustomHeader]
items) (\s :: ResponseHeadersPolicyCustomHeadersConfig
s@ResponseHeadersPolicyCustomHeadersConfig' {} Maybe [ResponseHeadersPolicyCustomHeader]
a -> ResponseHeadersPolicyCustomHeadersConfig
s {$sel:items:ResponseHeadersPolicyCustomHeadersConfig' :: Maybe [ResponseHeadersPolicyCustomHeader]
items = Maybe [ResponseHeadersPolicyCustomHeader]
a} :: ResponseHeadersPolicyCustomHeadersConfig) 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
responseHeadersPolicyCustomHeadersConfig_quantity :: Lens.Lens' ResponseHeadersPolicyCustomHeadersConfig Prelude.Int
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponseHeadersPolicyCustomHeadersConfig' {Int
quantity :: Int
$sel:quantity:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig -> Int
quantity} -> Int
quantity) (\s :: ResponseHeadersPolicyCustomHeadersConfig
s@ResponseHeadersPolicyCustomHeadersConfig' {} Int
a -> ResponseHeadersPolicyCustomHeadersConfig
s {$sel:quantity:ResponseHeadersPolicyCustomHeadersConfig' :: Int
quantity = Int
a} :: ResponseHeadersPolicyCustomHeadersConfig)
instance
Data.FromXML
ResponseHeadersPolicyCustomHeadersConfig
where
parseXML :: [Node] -> Either String ResponseHeadersPolicyCustomHeadersConfig
parseXML [Node]
x =
Maybe [ResponseHeadersPolicyCustomHeader]
-> Int -> ResponseHeadersPolicyCustomHeadersConfig
ResponseHeadersPolicyCustomHeadersConfig'
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
"ResponseHeadersPolicyCustomHeader"
)
)
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
ResponseHeadersPolicyCustomHeadersConfig
where
hashWithSalt :: Int -> ResponseHeadersPolicyCustomHeadersConfig -> Int
hashWithSalt
Int
_salt
ResponseHeadersPolicyCustomHeadersConfig' {Int
Maybe [ResponseHeadersPolicyCustomHeader]
quantity :: Int
items :: Maybe [ResponseHeadersPolicyCustomHeader]
$sel:quantity:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig -> Int
$sel:items:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig
-> Maybe [ResponseHeadersPolicyCustomHeader]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ResponseHeadersPolicyCustomHeader]
items
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
quantity
instance
Prelude.NFData
ResponseHeadersPolicyCustomHeadersConfig
where
rnf :: ResponseHeadersPolicyCustomHeadersConfig -> ()
rnf ResponseHeadersPolicyCustomHeadersConfig' {Int
Maybe [ResponseHeadersPolicyCustomHeader]
quantity :: Int
items :: Maybe [ResponseHeadersPolicyCustomHeader]
$sel:quantity:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig -> Int
$sel:items:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig
-> Maybe [ResponseHeadersPolicyCustomHeader]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ResponseHeadersPolicyCustomHeader]
items
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
quantity
instance
Data.ToXML
ResponseHeadersPolicyCustomHeadersConfig
where
toXML :: ResponseHeadersPolicyCustomHeadersConfig -> XML
toXML ResponseHeadersPolicyCustomHeadersConfig' {Int
Maybe [ResponseHeadersPolicyCustomHeader]
quantity :: Int
items :: Maybe [ResponseHeadersPolicyCustomHeader]
$sel:quantity:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig -> Int
$sel:items:ResponseHeadersPolicyCustomHeadersConfig' :: ResponseHeadersPolicyCustomHeadersConfig
-> Maybe [ResponseHeadersPolicyCustomHeader]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"Items"
forall a. ToXML a => Name -> a -> XML
Data.@= forall a. ToXML a => a -> XML
Data.toXML
( forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Data.toXMLList Name
"ResponseHeadersPolicyCustomHeader"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResponseHeadersPolicyCustomHeader]
items
),
Name
"Quantity" forall a. ToXML a => Name -> a -> XML
Data.@= Int
quantity
]