{-# 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.HttpPackageConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaTailor.Types.Type
import qualified Amazonka.Prelude as Prelude
data HttpPackageConfiguration = HttpPackageConfiguration'
{
HttpPackageConfiguration -> Text
path :: Prelude.Text,
HttpPackageConfiguration -> Type
type' :: Type,
HttpPackageConfiguration -> Text
sourceGroup :: Prelude.Text
}
deriving (HttpPackageConfiguration -> HttpPackageConfiguration -> Bool
(HttpPackageConfiguration -> HttpPackageConfiguration -> Bool)
-> (HttpPackageConfiguration -> HttpPackageConfiguration -> Bool)
-> Eq HttpPackageConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpPackageConfiguration -> HttpPackageConfiguration -> Bool
$c/= :: HttpPackageConfiguration -> HttpPackageConfiguration -> Bool
== :: HttpPackageConfiguration -> HttpPackageConfiguration -> Bool
$c== :: HttpPackageConfiguration -> HttpPackageConfiguration -> Bool
Prelude.Eq, ReadPrec [HttpPackageConfiguration]
ReadPrec HttpPackageConfiguration
Int -> ReadS HttpPackageConfiguration
ReadS [HttpPackageConfiguration]
(Int -> ReadS HttpPackageConfiguration)
-> ReadS [HttpPackageConfiguration]
-> ReadPrec HttpPackageConfiguration
-> ReadPrec [HttpPackageConfiguration]
-> Read HttpPackageConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HttpPackageConfiguration]
$creadListPrec :: ReadPrec [HttpPackageConfiguration]
readPrec :: ReadPrec HttpPackageConfiguration
$creadPrec :: ReadPrec HttpPackageConfiguration
readList :: ReadS [HttpPackageConfiguration]
$creadList :: ReadS [HttpPackageConfiguration]
readsPrec :: Int -> ReadS HttpPackageConfiguration
$creadsPrec :: Int -> ReadS HttpPackageConfiguration
Prelude.Read, Int -> HttpPackageConfiguration -> ShowS
[HttpPackageConfiguration] -> ShowS
HttpPackageConfiguration -> String
(Int -> HttpPackageConfiguration -> ShowS)
-> (HttpPackageConfiguration -> String)
-> ([HttpPackageConfiguration] -> ShowS)
-> Show HttpPackageConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpPackageConfiguration] -> ShowS
$cshowList :: [HttpPackageConfiguration] -> ShowS
show :: HttpPackageConfiguration -> String
$cshow :: HttpPackageConfiguration -> String
showsPrec :: Int -> HttpPackageConfiguration -> ShowS
$cshowsPrec :: Int -> HttpPackageConfiguration -> ShowS
Prelude.Show, (forall x.
HttpPackageConfiguration -> Rep HttpPackageConfiguration x)
-> (forall x.
Rep HttpPackageConfiguration x -> HttpPackageConfiguration)
-> Generic HttpPackageConfiguration
forall x.
Rep HttpPackageConfiguration x -> HttpPackageConfiguration
forall x.
HttpPackageConfiguration -> Rep HttpPackageConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HttpPackageConfiguration x -> HttpPackageConfiguration
$cfrom :: forall x.
HttpPackageConfiguration -> Rep HttpPackageConfiguration x
Prelude.Generic)
newHttpPackageConfiguration ::
Prelude.Text ->
Type ->
Prelude.Text ->
HttpPackageConfiguration
newHttpPackageConfiguration :: Text -> Type -> Text -> HttpPackageConfiguration
newHttpPackageConfiguration
Text
pPath_
Type
pType_
Text
pSourceGroup_ =
HttpPackageConfiguration' :: Text -> Type -> Text -> HttpPackageConfiguration
HttpPackageConfiguration'
{ $sel:path:HttpPackageConfiguration' :: Text
path = Text
pPath_,
$sel:type':HttpPackageConfiguration' :: Type
type' = Type
pType_,
$sel:sourceGroup:HttpPackageConfiguration' :: Text
sourceGroup = Text
pSourceGroup_
}
httpPackageConfiguration_path :: Lens.Lens' HttpPackageConfiguration Prelude.Text
httpPackageConfiguration_path :: (Text -> f Text)
-> HttpPackageConfiguration -> f HttpPackageConfiguration
httpPackageConfiguration_path = (HttpPackageConfiguration -> Text)
-> (HttpPackageConfiguration -> Text -> HttpPackageConfiguration)
-> Lens HttpPackageConfiguration HttpPackageConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpPackageConfiguration' {Text
path :: Text
$sel:path:HttpPackageConfiguration' :: HttpPackageConfiguration -> Text
path} -> Text
path) (\s :: HttpPackageConfiguration
s@HttpPackageConfiguration' {} Text
a -> HttpPackageConfiguration
s {$sel:path:HttpPackageConfiguration' :: Text
path = Text
a} :: HttpPackageConfiguration)
httpPackageConfiguration_type :: Lens.Lens' HttpPackageConfiguration Type
httpPackageConfiguration_type :: (Type -> f Type)
-> HttpPackageConfiguration -> f HttpPackageConfiguration
httpPackageConfiguration_type = (HttpPackageConfiguration -> Type)
-> (HttpPackageConfiguration -> Type -> HttpPackageConfiguration)
-> Lens HttpPackageConfiguration HttpPackageConfiguration Type Type
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpPackageConfiguration' {Type
type' :: Type
$sel:type':HttpPackageConfiguration' :: HttpPackageConfiguration -> Type
type'} -> Type
type') (\s :: HttpPackageConfiguration
s@HttpPackageConfiguration' {} Type
a -> HttpPackageConfiguration
s {$sel:type':HttpPackageConfiguration' :: Type
type' = Type
a} :: HttpPackageConfiguration)
httpPackageConfiguration_sourceGroup :: Lens.Lens' HttpPackageConfiguration Prelude.Text
httpPackageConfiguration_sourceGroup :: (Text -> f Text)
-> HttpPackageConfiguration -> f HttpPackageConfiguration
httpPackageConfiguration_sourceGroup = (HttpPackageConfiguration -> Text)
-> (HttpPackageConfiguration -> Text -> HttpPackageConfiguration)
-> Lens HttpPackageConfiguration HttpPackageConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpPackageConfiguration' {Text
sourceGroup :: Text
$sel:sourceGroup:HttpPackageConfiguration' :: HttpPackageConfiguration -> Text
sourceGroup} -> Text
sourceGroup) (\s :: HttpPackageConfiguration
s@HttpPackageConfiguration' {} Text
a -> HttpPackageConfiguration
s {$sel:sourceGroup:HttpPackageConfiguration' :: Text
sourceGroup = Text
a} :: HttpPackageConfiguration)
instance Core.FromJSON HttpPackageConfiguration where
parseJSON :: Value -> Parser HttpPackageConfiguration
parseJSON =
String
-> (Object -> Parser HttpPackageConfiguration)
-> Value
-> Parser HttpPackageConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HttpPackageConfiguration"
( \Object
x ->
Text -> Type -> Text -> HttpPackageConfiguration
HttpPackageConfiguration'
(Text -> Type -> Text -> HttpPackageConfiguration)
-> Parser Text -> Parser (Type -> Text -> HttpPackageConfiguration)
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
"Path")
Parser (Type -> Text -> HttpPackageConfiguration)
-> Parser Type -> Parser (Text -> HttpPackageConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Type
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
Parser (Text -> HttpPackageConfiguration)
-> Parser Text -> Parser HttpPackageConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceGroup")
)
instance Prelude.Hashable HttpPackageConfiguration
instance Prelude.NFData HttpPackageConfiguration
instance Core.ToJSON HttpPackageConfiguration where
toJSON :: HttpPackageConfiguration -> Value
toJSON HttpPackageConfiguration' {Text
Type
sourceGroup :: Text
type' :: Type
path :: Text
$sel:sourceGroup:HttpPackageConfiguration' :: HttpPackageConfiguration -> Text
$sel:type':HttpPackageConfiguration' :: HttpPackageConfiguration -> Type
$sel:path:HttpPackageConfiguration' :: HttpPackageConfiguration -> 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
"Path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
path),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> Type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Type
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SourceGroup" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceGroup)
]
)