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