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