{-# 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.Pinpoint.Types.WriteEventStream where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WriteEventStream = WriteEventStream'
{
WriteEventStream -> Text
roleArn :: Prelude.Text,
WriteEventStream -> Text
destinationStreamArn :: Prelude.Text
}
deriving (WriteEventStream -> WriteEventStream -> Bool
(WriteEventStream -> WriteEventStream -> Bool)
-> (WriteEventStream -> WriteEventStream -> Bool)
-> Eq WriteEventStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WriteEventStream -> WriteEventStream -> Bool
$c/= :: WriteEventStream -> WriteEventStream -> Bool
== :: WriteEventStream -> WriteEventStream -> Bool
$c== :: WriteEventStream -> WriteEventStream -> Bool
Prelude.Eq, ReadPrec [WriteEventStream]
ReadPrec WriteEventStream
Int -> ReadS WriteEventStream
ReadS [WriteEventStream]
(Int -> ReadS WriteEventStream)
-> ReadS [WriteEventStream]
-> ReadPrec WriteEventStream
-> ReadPrec [WriteEventStream]
-> Read WriteEventStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WriteEventStream]
$creadListPrec :: ReadPrec [WriteEventStream]
readPrec :: ReadPrec WriteEventStream
$creadPrec :: ReadPrec WriteEventStream
readList :: ReadS [WriteEventStream]
$creadList :: ReadS [WriteEventStream]
readsPrec :: Int -> ReadS WriteEventStream
$creadsPrec :: Int -> ReadS WriteEventStream
Prelude.Read, Int -> WriteEventStream -> ShowS
[WriteEventStream] -> ShowS
WriteEventStream -> String
(Int -> WriteEventStream -> ShowS)
-> (WriteEventStream -> String)
-> ([WriteEventStream] -> ShowS)
-> Show WriteEventStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WriteEventStream] -> ShowS
$cshowList :: [WriteEventStream] -> ShowS
show :: WriteEventStream -> String
$cshow :: WriteEventStream -> String
showsPrec :: Int -> WriteEventStream -> ShowS
$cshowsPrec :: Int -> WriteEventStream -> ShowS
Prelude.Show, (forall x. WriteEventStream -> Rep WriteEventStream x)
-> (forall x. Rep WriteEventStream x -> WriteEventStream)
-> Generic WriteEventStream
forall x. Rep WriteEventStream x -> WriteEventStream
forall x. WriteEventStream -> Rep WriteEventStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WriteEventStream x -> WriteEventStream
$cfrom :: forall x. WriteEventStream -> Rep WriteEventStream x
Prelude.Generic)
newWriteEventStream ::
Prelude.Text ->
Prelude.Text ->
WriteEventStream
newWriteEventStream :: Text -> Text -> WriteEventStream
newWriteEventStream Text
pRoleArn_ Text
pDestinationStreamArn_ =
WriteEventStream' :: Text -> Text -> WriteEventStream
WriteEventStream'
{ $sel:roleArn:WriteEventStream' :: Text
roleArn = Text
pRoleArn_,
$sel:destinationStreamArn:WriteEventStream' :: Text
destinationStreamArn = Text
pDestinationStreamArn_
}
writeEventStream_roleArn :: Lens.Lens' WriteEventStream Prelude.Text
writeEventStream_roleArn :: (Text -> f Text) -> WriteEventStream -> f WriteEventStream
writeEventStream_roleArn = (WriteEventStream -> Text)
-> (WriteEventStream -> Text -> WriteEventStream)
-> Lens WriteEventStream WriteEventStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteEventStream' {Text
roleArn :: Text
$sel:roleArn:WriteEventStream' :: WriteEventStream -> Text
roleArn} -> Text
roleArn) (\s :: WriteEventStream
s@WriteEventStream' {} Text
a -> WriteEventStream
s {$sel:roleArn:WriteEventStream' :: Text
roleArn = Text
a} :: WriteEventStream)
writeEventStream_destinationStreamArn :: Lens.Lens' WriteEventStream Prelude.Text
writeEventStream_destinationStreamArn :: (Text -> f Text) -> WriteEventStream -> f WriteEventStream
writeEventStream_destinationStreamArn = (WriteEventStream -> Text)
-> (WriteEventStream -> Text -> WriteEventStream)
-> Lens WriteEventStream WriteEventStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WriteEventStream' {Text
destinationStreamArn :: Text
$sel:destinationStreamArn:WriteEventStream' :: WriteEventStream -> Text
destinationStreamArn} -> Text
destinationStreamArn) (\s :: WriteEventStream
s@WriteEventStream' {} Text
a -> WriteEventStream
s {$sel:destinationStreamArn:WriteEventStream' :: Text
destinationStreamArn = Text
a} :: WriteEventStream)
instance Prelude.Hashable WriteEventStream
instance Prelude.NFData WriteEventStream
instance Core.ToJSON WriteEventStream where
toJSON :: WriteEventStream -> Value
toJSON WriteEventStream' {Text
destinationStreamArn :: Text
roleArn :: Text
$sel:destinationStreamArn:WriteEventStream' :: WriteEventStream -> Text
$sel:roleArn:WriteEventStream' :: WriteEventStream -> 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
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DestinationStreamArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationStreamArn
)
]
)