{-# 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.ContentTypeProfileConfig where
import Amazonka.CloudFront.Types.ContentTypeProfiles
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContentTypeProfileConfig = ContentTypeProfileConfig'
{
ContentTypeProfileConfig -> Maybe ContentTypeProfiles
contentTypeProfiles :: Prelude.Maybe ContentTypeProfiles,
ContentTypeProfileConfig -> Bool
forwardWhenContentTypeIsUnknown :: Prelude.Bool
}
deriving (ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool
(ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool)
-> (ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool)
-> Eq ContentTypeProfileConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool
$c/= :: ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool
== :: ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool
$c== :: ContentTypeProfileConfig -> ContentTypeProfileConfig -> Bool
Prelude.Eq, ReadPrec [ContentTypeProfileConfig]
ReadPrec ContentTypeProfileConfig
Int -> ReadS ContentTypeProfileConfig
ReadS [ContentTypeProfileConfig]
(Int -> ReadS ContentTypeProfileConfig)
-> ReadS [ContentTypeProfileConfig]
-> ReadPrec ContentTypeProfileConfig
-> ReadPrec [ContentTypeProfileConfig]
-> Read ContentTypeProfileConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContentTypeProfileConfig]
$creadListPrec :: ReadPrec [ContentTypeProfileConfig]
readPrec :: ReadPrec ContentTypeProfileConfig
$creadPrec :: ReadPrec ContentTypeProfileConfig
readList :: ReadS [ContentTypeProfileConfig]
$creadList :: ReadS [ContentTypeProfileConfig]
readsPrec :: Int -> ReadS ContentTypeProfileConfig
$creadsPrec :: Int -> ReadS ContentTypeProfileConfig
Prelude.Read, Int -> ContentTypeProfileConfig -> ShowS
[ContentTypeProfileConfig] -> ShowS
ContentTypeProfileConfig -> String
(Int -> ContentTypeProfileConfig -> ShowS)
-> (ContentTypeProfileConfig -> String)
-> ([ContentTypeProfileConfig] -> ShowS)
-> Show ContentTypeProfileConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContentTypeProfileConfig] -> ShowS
$cshowList :: [ContentTypeProfileConfig] -> ShowS
show :: ContentTypeProfileConfig -> String
$cshow :: ContentTypeProfileConfig -> String
showsPrec :: Int -> ContentTypeProfileConfig -> ShowS
$cshowsPrec :: Int -> ContentTypeProfileConfig -> ShowS
Prelude.Show, (forall x.
ContentTypeProfileConfig -> Rep ContentTypeProfileConfig x)
-> (forall x.
Rep ContentTypeProfileConfig x -> ContentTypeProfileConfig)
-> Generic ContentTypeProfileConfig
forall x.
Rep ContentTypeProfileConfig x -> ContentTypeProfileConfig
forall x.
ContentTypeProfileConfig -> Rep ContentTypeProfileConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContentTypeProfileConfig x -> ContentTypeProfileConfig
$cfrom :: forall x.
ContentTypeProfileConfig -> Rep ContentTypeProfileConfig x
Prelude.Generic)
newContentTypeProfileConfig ::
Prelude.Bool ->
ContentTypeProfileConfig
newContentTypeProfileConfig :: Bool -> ContentTypeProfileConfig
newContentTypeProfileConfig
Bool
pForwardWhenContentTypeIsUnknown_ =
ContentTypeProfileConfig' :: Maybe ContentTypeProfiles -> Bool -> ContentTypeProfileConfig
ContentTypeProfileConfig'
{ $sel:contentTypeProfiles:ContentTypeProfileConfig' :: Maybe ContentTypeProfiles
contentTypeProfiles =
Maybe ContentTypeProfiles
forall a. Maybe a
Prelude.Nothing,
$sel:forwardWhenContentTypeIsUnknown:ContentTypeProfileConfig' :: Bool
forwardWhenContentTypeIsUnknown =
Bool
pForwardWhenContentTypeIsUnknown_
}
contentTypeProfileConfig_contentTypeProfiles :: Lens.Lens' ContentTypeProfileConfig (Prelude.Maybe ContentTypeProfiles)
contentTypeProfileConfig_contentTypeProfiles :: (Maybe ContentTypeProfiles -> f (Maybe ContentTypeProfiles))
-> ContentTypeProfileConfig -> f ContentTypeProfileConfig
contentTypeProfileConfig_contentTypeProfiles = (ContentTypeProfileConfig -> Maybe ContentTypeProfiles)
-> (ContentTypeProfileConfig
-> Maybe ContentTypeProfiles -> ContentTypeProfileConfig)
-> Lens
ContentTypeProfileConfig
ContentTypeProfileConfig
(Maybe ContentTypeProfiles)
(Maybe ContentTypeProfiles)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentTypeProfileConfig' {Maybe ContentTypeProfiles
contentTypeProfiles :: Maybe ContentTypeProfiles
$sel:contentTypeProfiles:ContentTypeProfileConfig' :: ContentTypeProfileConfig -> Maybe ContentTypeProfiles
contentTypeProfiles} -> Maybe ContentTypeProfiles
contentTypeProfiles) (\s :: ContentTypeProfileConfig
s@ContentTypeProfileConfig' {} Maybe ContentTypeProfiles
a -> ContentTypeProfileConfig
s {$sel:contentTypeProfiles:ContentTypeProfileConfig' :: Maybe ContentTypeProfiles
contentTypeProfiles = Maybe ContentTypeProfiles
a} :: ContentTypeProfileConfig)
contentTypeProfileConfig_forwardWhenContentTypeIsUnknown :: Lens.Lens' ContentTypeProfileConfig Prelude.Bool
contentTypeProfileConfig_forwardWhenContentTypeIsUnknown :: (Bool -> f Bool)
-> ContentTypeProfileConfig -> f ContentTypeProfileConfig
contentTypeProfileConfig_forwardWhenContentTypeIsUnknown = (ContentTypeProfileConfig -> Bool)
-> (ContentTypeProfileConfig -> Bool -> ContentTypeProfileConfig)
-> Lens ContentTypeProfileConfig ContentTypeProfileConfig Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContentTypeProfileConfig' {Bool
forwardWhenContentTypeIsUnknown :: Bool
$sel:forwardWhenContentTypeIsUnknown:ContentTypeProfileConfig' :: ContentTypeProfileConfig -> Bool
forwardWhenContentTypeIsUnknown} -> Bool
forwardWhenContentTypeIsUnknown) (\s :: ContentTypeProfileConfig
s@ContentTypeProfileConfig' {} Bool
a -> ContentTypeProfileConfig
s {$sel:forwardWhenContentTypeIsUnknown:ContentTypeProfileConfig' :: Bool
forwardWhenContentTypeIsUnknown = Bool
a} :: ContentTypeProfileConfig)
instance Core.FromXML ContentTypeProfileConfig where
parseXML :: [Node] -> Either String ContentTypeProfileConfig
parseXML [Node]
x =
Maybe ContentTypeProfiles -> Bool -> ContentTypeProfileConfig
ContentTypeProfileConfig'
(Maybe ContentTypeProfiles -> Bool -> ContentTypeProfileConfig)
-> Either String (Maybe ContentTypeProfiles)
-> Either String (Bool -> ContentTypeProfileConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ContentTypeProfiles)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ContentTypeProfiles")
Either String (Bool -> ContentTypeProfileConfig)
-> Either String Bool -> Either String ContentTypeProfileConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ForwardWhenContentTypeIsUnknown")
instance Prelude.Hashable ContentTypeProfileConfig
instance Prelude.NFData ContentTypeProfileConfig
instance Core.ToXML ContentTypeProfileConfig where
toXML :: ContentTypeProfileConfig -> XML
toXML ContentTypeProfileConfig' {Bool
Maybe ContentTypeProfiles
forwardWhenContentTypeIsUnknown :: Bool
contentTypeProfiles :: Maybe ContentTypeProfiles
$sel:forwardWhenContentTypeIsUnknown:ContentTypeProfileConfig' :: ContentTypeProfileConfig -> Bool
$sel:contentTypeProfiles:ContentTypeProfileConfig' :: ContentTypeProfileConfig -> Maybe ContentTypeProfiles
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"ContentTypeProfiles" Name -> Maybe ContentTypeProfiles -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe ContentTypeProfiles
contentTypeProfiles,
Name
"ForwardWhenContentTypeIsUnknown"
Name -> Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Bool
forwardWhenContentTypeIsUnknown
]