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