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