{-# 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.CachePolicySummary where
import Amazonka.CloudFront.Types.CachePolicy
import Amazonka.CloudFront.Types.CachePolicyType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CachePolicySummary = CachePolicySummary'
{
CachePolicySummary -> CachePolicyType
type' :: CachePolicyType,
CachePolicySummary -> CachePolicy
cachePolicy :: CachePolicy
}
deriving (CachePolicySummary -> CachePolicySummary -> Bool
(CachePolicySummary -> CachePolicySummary -> Bool)
-> (CachePolicySummary -> CachePolicySummary -> Bool)
-> Eq CachePolicySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CachePolicySummary -> CachePolicySummary -> Bool
$c/= :: CachePolicySummary -> CachePolicySummary -> Bool
== :: CachePolicySummary -> CachePolicySummary -> Bool
$c== :: CachePolicySummary -> CachePolicySummary -> Bool
Prelude.Eq, ReadPrec [CachePolicySummary]
ReadPrec CachePolicySummary
Int -> ReadS CachePolicySummary
ReadS [CachePolicySummary]
(Int -> ReadS CachePolicySummary)
-> ReadS [CachePolicySummary]
-> ReadPrec CachePolicySummary
-> ReadPrec [CachePolicySummary]
-> Read CachePolicySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CachePolicySummary]
$creadListPrec :: ReadPrec [CachePolicySummary]
readPrec :: ReadPrec CachePolicySummary
$creadPrec :: ReadPrec CachePolicySummary
readList :: ReadS [CachePolicySummary]
$creadList :: ReadS [CachePolicySummary]
readsPrec :: Int -> ReadS CachePolicySummary
$creadsPrec :: Int -> ReadS CachePolicySummary
Prelude.Read, Int -> CachePolicySummary -> ShowS
[CachePolicySummary] -> ShowS
CachePolicySummary -> String
(Int -> CachePolicySummary -> ShowS)
-> (CachePolicySummary -> String)
-> ([CachePolicySummary] -> ShowS)
-> Show CachePolicySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CachePolicySummary] -> ShowS
$cshowList :: [CachePolicySummary] -> ShowS
show :: CachePolicySummary -> String
$cshow :: CachePolicySummary -> String
showsPrec :: Int -> CachePolicySummary -> ShowS
$cshowsPrec :: Int -> CachePolicySummary -> ShowS
Prelude.Show, (forall x. CachePolicySummary -> Rep CachePolicySummary x)
-> (forall x. Rep CachePolicySummary x -> CachePolicySummary)
-> Generic CachePolicySummary
forall x. Rep CachePolicySummary x -> CachePolicySummary
forall x. CachePolicySummary -> Rep CachePolicySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CachePolicySummary x -> CachePolicySummary
$cfrom :: forall x. CachePolicySummary -> Rep CachePolicySummary x
Prelude.Generic)
newCachePolicySummary ::
CachePolicyType ->
CachePolicy ->
CachePolicySummary
newCachePolicySummary :: CachePolicyType -> CachePolicy -> CachePolicySummary
newCachePolicySummary CachePolicyType
pType_ CachePolicy
pCachePolicy_ =
CachePolicySummary' :: CachePolicyType -> CachePolicy -> CachePolicySummary
CachePolicySummary'
{ $sel:type':CachePolicySummary' :: CachePolicyType
type' = CachePolicyType
pType_,
$sel:cachePolicy:CachePolicySummary' :: CachePolicy
cachePolicy = CachePolicy
pCachePolicy_
}
cachePolicySummary_type :: Lens.Lens' CachePolicySummary CachePolicyType
cachePolicySummary_type :: (CachePolicyType -> f CachePolicyType)
-> CachePolicySummary -> f CachePolicySummary
cachePolicySummary_type = (CachePolicySummary -> CachePolicyType)
-> (CachePolicySummary -> CachePolicyType -> CachePolicySummary)
-> Lens
CachePolicySummary
CachePolicySummary
CachePolicyType
CachePolicyType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicySummary' {CachePolicyType
type' :: CachePolicyType
$sel:type':CachePolicySummary' :: CachePolicySummary -> CachePolicyType
type'} -> CachePolicyType
type') (\s :: CachePolicySummary
s@CachePolicySummary' {} CachePolicyType
a -> CachePolicySummary
s {$sel:type':CachePolicySummary' :: CachePolicyType
type' = CachePolicyType
a} :: CachePolicySummary)
cachePolicySummary_cachePolicy :: Lens.Lens' CachePolicySummary CachePolicy
cachePolicySummary_cachePolicy :: (CachePolicy -> f CachePolicy)
-> CachePolicySummary -> f CachePolicySummary
cachePolicySummary_cachePolicy = (CachePolicySummary -> CachePolicy)
-> (CachePolicySummary -> CachePolicy -> CachePolicySummary)
-> Lens
CachePolicySummary CachePolicySummary CachePolicy CachePolicy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CachePolicySummary' {CachePolicy
cachePolicy :: CachePolicy
$sel:cachePolicy:CachePolicySummary' :: CachePolicySummary -> CachePolicy
cachePolicy} -> CachePolicy
cachePolicy) (\s :: CachePolicySummary
s@CachePolicySummary' {} CachePolicy
a -> CachePolicySummary
s {$sel:cachePolicy:CachePolicySummary' :: CachePolicy
cachePolicy = CachePolicy
a} :: CachePolicySummary)
instance Core.FromXML CachePolicySummary where
parseXML :: [Node] -> Either String CachePolicySummary
parseXML [Node]
x =
CachePolicyType -> CachePolicy -> CachePolicySummary
CachePolicySummary'
(CachePolicyType -> CachePolicy -> CachePolicySummary)
-> Either String CachePolicyType
-> Either String (CachePolicy -> CachePolicySummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String CachePolicyType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Type")
Either String (CachePolicy -> CachePolicySummary)
-> Either String CachePolicy -> Either String CachePolicySummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String CachePolicy
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CachePolicy")
instance Prelude.Hashable CachePolicySummary
instance Prelude.NFData CachePolicySummary