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