{-# 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.MediaTailor.Types.CdnConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CdnConfiguration = CdnConfiguration'
{
CdnConfiguration -> Maybe Text
adSegmentUrlPrefix :: Prelude.Maybe Prelude.Text,
CdnConfiguration -> Maybe Text
contentSegmentUrlPrefix :: Prelude.Maybe Prelude.Text
}
deriving (CdnConfiguration -> CdnConfiguration -> Bool
(CdnConfiguration -> CdnConfiguration -> Bool)
-> (CdnConfiguration -> CdnConfiguration -> Bool)
-> Eq CdnConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CdnConfiguration -> CdnConfiguration -> Bool
$c/= :: CdnConfiguration -> CdnConfiguration -> Bool
== :: CdnConfiguration -> CdnConfiguration -> Bool
$c== :: CdnConfiguration -> CdnConfiguration -> Bool
Prelude.Eq, ReadPrec [CdnConfiguration]
ReadPrec CdnConfiguration
Int -> ReadS CdnConfiguration
ReadS [CdnConfiguration]
(Int -> ReadS CdnConfiguration)
-> ReadS [CdnConfiguration]
-> ReadPrec CdnConfiguration
-> ReadPrec [CdnConfiguration]
-> Read CdnConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CdnConfiguration]
$creadListPrec :: ReadPrec [CdnConfiguration]
readPrec :: ReadPrec CdnConfiguration
$creadPrec :: ReadPrec CdnConfiguration
readList :: ReadS [CdnConfiguration]
$creadList :: ReadS [CdnConfiguration]
readsPrec :: Int -> ReadS CdnConfiguration
$creadsPrec :: Int -> ReadS CdnConfiguration
Prelude.Read, Int -> CdnConfiguration -> ShowS
[CdnConfiguration] -> ShowS
CdnConfiguration -> String
(Int -> CdnConfiguration -> ShowS)
-> (CdnConfiguration -> String)
-> ([CdnConfiguration] -> ShowS)
-> Show CdnConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CdnConfiguration] -> ShowS
$cshowList :: [CdnConfiguration] -> ShowS
show :: CdnConfiguration -> String
$cshow :: CdnConfiguration -> String
showsPrec :: Int -> CdnConfiguration -> ShowS
$cshowsPrec :: Int -> CdnConfiguration -> ShowS
Prelude.Show, (forall x. CdnConfiguration -> Rep CdnConfiguration x)
-> (forall x. Rep CdnConfiguration x -> CdnConfiguration)
-> Generic CdnConfiguration
forall x. Rep CdnConfiguration x -> CdnConfiguration
forall x. CdnConfiguration -> Rep CdnConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CdnConfiguration x -> CdnConfiguration
$cfrom :: forall x. CdnConfiguration -> Rep CdnConfiguration x
Prelude.Generic)
newCdnConfiguration ::
CdnConfiguration
newCdnConfiguration :: CdnConfiguration
newCdnConfiguration =
CdnConfiguration' :: Maybe Text -> Maybe Text -> CdnConfiguration
CdnConfiguration'
{ $sel:adSegmentUrlPrefix:CdnConfiguration' :: Maybe Text
adSegmentUrlPrefix =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentSegmentUrlPrefix:CdnConfiguration' :: Maybe Text
contentSegmentUrlPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cdnConfiguration_adSegmentUrlPrefix :: Lens.Lens' CdnConfiguration (Prelude.Maybe Prelude.Text)
cdnConfiguration_adSegmentUrlPrefix :: (Maybe Text -> f (Maybe Text))
-> CdnConfiguration -> f CdnConfiguration
cdnConfiguration_adSegmentUrlPrefix = (CdnConfiguration -> Maybe Text)
-> (CdnConfiguration -> Maybe Text -> CdnConfiguration)
-> Lens CdnConfiguration CdnConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdnConfiguration' {Maybe Text
adSegmentUrlPrefix :: Maybe Text
$sel:adSegmentUrlPrefix:CdnConfiguration' :: CdnConfiguration -> Maybe Text
adSegmentUrlPrefix} -> Maybe Text
adSegmentUrlPrefix) (\s :: CdnConfiguration
s@CdnConfiguration' {} Maybe Text
a -> CdnConfiguration
s {$sel:adSegmentUrlPrefix:CdnConfiguration' :: Maybe Text
adSegmentUrlPrefix = Maybe Text
a} :: CdnConfiguration)
cdnConfiguration_contentSegmentUrlPrefix :: Lens.Lens' CdnConfiguration (Prelude.Maybe Prelude.Text)
cdnConfiguration_contentSegmentUrlPrefix :: (Maybe Text -> f (Maybe Text))
-> CdnConfiguration -> f CdnConfiguration
cdnConfiguration_contentSegmentUrlPrefix = (CdnConfiguration -> Maybe Text)
-> (CdnConfiguration -> Maybe Text -> CdnConfiguration)
-> Lens CdnConfiguration CdnConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CdnConfiguration' {Maybe Text
contentSegmentUrlPrefix :: Maybe Text
$sel:contentSegmentUrlPrefix:CdnConfiguration' :: CdnConfiguration -> Maybe Text
contentSegmentUrlPrefix} -> Maybe Text
contentSegmentUrlPrefix) (\s :: CdnConfiguration
s@CdnConfiguration' {} Maybe Text
a -> CdnConfiguration
s {$sel:contentSegmentUrlPrefix:CdnConfiguration' :: Maybe Text
contentSegmentUrlPrefix = Maybe Text
a} :: CdnConfiguration)
instance Core.FromJSON CdnConfiguration where
parseJSON :: Value -> Parser CdnConfiguration
parseJSON =
String
-> (Object -> Parser CdnConfiguration)
-> Value
-> Parser CdnConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CdnConfiguration"
( \Object
x ->
Maybe Text -> Maybe Text -> CdnConfiguration
CdnConfiguration'
(Maybe Text -> Maybe Text -> CdnConfiguration)
-> Parser (Maybe Text) -> Parser (Maybe Text -> CdnConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AdSegmentUrlPrefix")
Parser (Maybe Text -> CdnConfiguration)
-> Parser (Maybe Text) -> Parser CdnConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContentSegmentUrlPrefix")
)
instance Prelude.Hashable CdnConfiguration
instance Prelude.NFData CdnConfiguration
instance Core.ToJSON CdnConfiguration where
toJSON :: CdnConfiguration -> Value
toJSON CdnConfiguration' {Maybe Text
contentSegmentUrlPrefix :: Maybe Text
adSegmentUrlPrefix :: Maybe Text
$sel:contentSegmentUrlPrefix:CdnConfiguration' :: CdnConfiguration -> Maybe Text
$sel:adSegmentUrlPrefix:CdnConfiguration' :: CdnConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AdSegmentUrlPrefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
adSegmentUrlPrefix,
(Text
"ContentSegmentUrlPrefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
contentSegmentUrlPrefix
]
)