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