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