{-# 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.PinpointSMSVoice.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 -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
KinesisFirehoseDestination -> Maybe Text
deliveryStreamArn :: Prelude.Maybe 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 ::
KinesisFirehoseDestination
newKinesisFirehoseDestination :: KinesisFirehoseDestination
newKinesisFirehoseDestination =
KinesisFirehoseDestination' :: Maybe Text -> Maybe Text -> KinesisFirehoseDestination
KinesisFirehoseDestination'
{ $sel:iamRoleArn:KinesisFirehoseDestination' :: Maybe Text
iamRoleArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deliveryStreamArn:KinesisFirehoseDestination' :: Maybe Text
deliveryStreamArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
kinesisFirehoseDestination_iamRoleArn :: Lens.Lens' KinesisFirehoseDestination (Prelude.Maybe Prelude.Text)
kinesisFirehoseDestination_iamRoleArn :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseDestination -> f KinesisFirehoseDestination
kinesisFirehoseDestination_iamRoleArn = (KinesisFirehoseDestination -> Maybe Text)
-> (KinesisFirehoseDestination
-> Maybe Text -> KinesisFirehoseDestination)
-> Lens
KinesisFirehoseDestination
KinesisFirehoseDestination
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseDestination' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:KinesisFirehoseDestination' :: KinesisFirehoseDestination -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: KinesisFirehoseDestination
s@KinesisFirehoseDestination' {} Maybe Text
a -> KinesisFirehoseDestination
s {$sel:iamRoleArn:KinesisFirehoseDestination' :: Maybe Text
iamRoleArn = Maybe Text
a} :: KinesisFirehoseDestination)
kinesisFirehoseDestination_deliveryStreamArn :: Lens.Lens' KinesisFirehoseDestination (Prelude.Maybe Prelude.Text)
kinesisFirehoseDestination_deliveryStreamArn :: (Maybe Text -> f (Maybe Text))
-> KinesisFirehoseDestination -> f KinesisFirehoseDestination
kinesisFirehoseDestination_deliveryStreamArn = (KinesisFirehoseDestination -> Maybe Text)
-> (KinesisFirehoseDestination
-> Maybe Text -> KinesisFirehoseDestination)
-> Lens
KinesisFirehoseDestination
KinesisFirehoseDestination
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisFirehoseDestination' {Maybe Text
deliveryStreamArn :: Maybe Text
$sel:deliveryStreamArn:KinesisFirehoseDestination' :: KinesisFirehoseDestination -> Maybe Text
deliveryStreamArn} -> Maybe Text
deliveryStreamArn) (\s :: KinesisFirehoseDestination
s@KinesisFirehoseDestination' {} Maybe Text
a -> KinesisFirehoseDestination
s {$sel:deliveryStreamArn:KinesisFirehoseDestination' :: Maybe Text
deliveryStreamArn = Maybe 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 ->
Maybe Text -> Maybe Text -> KinesisFirehoseDestination
KinesisFirehoseDestination'
(Maybe Text -> Maybe Text -> KinesisFirehoseDestination)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> KinesisFirehoseDestination)
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
"IamRoleArn")
Parser (Maybe Text -> KinesisFirehoseDestination)
-> Parser (Maybe Text) -> Parser KinesisFirehoseDestination
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
"DeliveryStreamArn")
)
instance Prelude.Hashable KinesisFirehoseDestination
instance Prelude.NFData KinesisFirehoseDestination
instance Core.ToJSON KinesisFirehoseDestination where
toJSON :: KinesisFirehoseDestination -> Value
toJSON KinesisFirehoseDestination' {Maybe Text
deliveryStreamArn :: Maybe Text
iamRoleArn :: Maybe Text
$sel:deliveryStreamArn:KinesisFirehoseDestination' :: KinesisFirehoseDestination -> Maybe Text
$sel:iamRoleArn:KinesisFirehoseDestination' :: KinesisFirehoseDestination -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IamRoleArn" 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
iamRoleArn,
(Text
"DeliveryStreamArn" 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
deliveryStreamArn
]
)