{-# 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.EventStream where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventStream = EventStream'
{
EventStream -> Maybe Text
lastUpdatedBy :: Prelude.Maybe Prelude.Text,
EventStream -> Maybe Text
lastModifiedDate :: Prelude.Maybe Prelude.Text,
EventStream -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
EventStream -> Text
applicationId :: Prelude.Text,
EventStream -> Text
roleArn :: Prelude.Text,
EventStream -> Text
destinationStreamArn :: Prelude.Text
}
deriving (EventStream -> EventStream -> Bool
(EventStream -> EventStream -> Bool)
-> (EventStream -> EventStream -> Bool) -> Eq EventStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventStream -> EventStream -> Bool
$c/= :: EventStream -> EventStream -> Bool
== :: EventStream -> EventStream -> Bool
$c== :: EventStream -> EventStream -> Bool
Prelude.Eq, ReadPrec [EventStream]
ReadPrec EventStream
Int -> ReadS EventStream
ReadS [EventStream]
(Int -> ReadS EventStream)
-> ReadS [EventStream]
-> ReadPrec EventStream
-> ReadPrec [EventStream]
-> Read EventStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventStream]
$creadListPrec :: ReadPrec [EventStream]
readPrec :: ReadPrec EventStream
$creadPrec :: ReadPrec EventStream
readList :: ReadS [EventStream]
$creadList :: ReadS [EventStream]
readsPrec :: Int -> ReadS EventStream
$creadsPrec :: Int -> ReadS EventStream
Prelude.Read, Int -> EventStream -> ShowS
[EventStream] -> ShowS
EventStream -> String
(Int -> EventStream -> ShowS)
-> (EventStream -> String)
-> ([EventStream] -> ShowS)
-> Show EventStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventStream] -> ShowS
$cshowList :: [EventStream] -> ShowS
show :: EventStream -> String
$cshow :: EventStream -> String
showsPrec :: Int -> EventStream -> ShowS
$cshowsPrec :: Int -> EventStream -> ShowS
Prelude.Show, (forall x. EventStream -> Rep EventStream x)
-> (forall x. Rep EventStream x -> EventStream)
-> Generic EventStream
forall x. Rep EventStream x -> EventStream
forall x. EventStream -> Rep EventStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventStream x -> EventStream
$cfrom :: forall x. EventStream -> Rep EventStream x
Prelude.Generic)
newEventStream ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
EventStream
newEventStream :: Text -> Text -> Text -> EventStream
newEventStream
Text
pApplicationId_
Text
pRoleArn_
Text
pDestinationStreamArn_ =
EventStream' :: Maybe Text
-> Maybe Text -> Maybe Text -> Text -> Text -> Text -> EventStream
EventStream'
{ $sel:lastUpdatedBy:EventStream' :: Maybe Text
lastUpdatedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedDate:EventStream' :: Maybe Text
lastModifiedDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:externalId:EventStream' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:applicationId:EventStream' :: Text
applicationId = Text
pApplicationId_,
$sel:roleArn:EventStream' :: Text
roleArn = Text
pRoleArn_,
$sel:destinationStreamArn:EventStream' :: Text
destinationStreamArn = Text
pDestinationStreamArn_
}
eventStream_lastUpdatedBy :: Lens.Lens' EventStream (Prelude.Maybe Prelude.Text)
eventStream_lastUpdatedBy :: (Maybe Text -> f (Maybe Text)) -> EventStream -> f EventStream
eventStream_lastUpdatedBy = (EventStream -> Maybe Text)
-> (EventStream -> Maybe Text -> EventStream)
-> Lens EventStream EventStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventStream' {Maybe Text
lastUpdatedBy :: Maybe Text
$sel:lastUpdatedBy:EventStream' :: EventStream -> Maybe Text
lastUpdatedBy} -> Maybe Text
lastUpdatedBy) (\s :: EventStream
s@EventStream' {} Maybe Text
a -> EventStream
s {$sel:lastUpdatedBy:EventStream' :: Maybe Text
lastUpdatedBy = Maybe Text
a} :: EventStream)
eventStream_lastModifiedDate :: Lens.Lens' EventStream (Prelude.Maybe Prelude.Text)
eventStream_lastModifiedDate :: (Maybe Text -> f (Maybe Text)) -> EventStream -> f EventStream
eventStream_lastModifiedDate = (EventStream -> Maybe Text)
-> (EventStream -> Maybe Text -> EventStream)
-> Lens EventStream EventStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventStream' {Maybe Text
lastModifiedDate :: Maybe Text
$sel:lastModifiedDate:EventStream' :: EventStream -> Maybe Text
lastModifiedDate} -> Maybe Text
lastModifiedDate) (\s :: EventStream
s@EventStream' {} Maybe Text
a -> EventStream
s {$sel:lastModifiedDate:EventStream' :: Maybe Text
lastModifiedDate = Maybe Text
a} :: EventStream)
eventStream_externalId :: Lens.Lens' EventStream (Prelude.Maybe Prelude.Text)
eventStream_externalId :: (Maybe Text -> f (Maybe Text)) -> EventStream -> f EventStream
eventStream_externalId = (EventStream -> Maybe Text)
-> (EventStream -> Maybe Text -> EventStream)
-> Lens EventStream EventStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventStream' {Maybe Text
externalId :: Maybe Text
$sel:externalId:EventStream' :: EventStream -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: EventStream
s@EventStream' {} Maybe Text
a -> EventStream
s {$sel:externalId:EventStream' :: Maybe Text
externalId = Maybe Text
a} :: EventStream)
eventStream_applicationId :: Lens.Lens' EventStream Prelude.Text
eventStream_applicationId :: (Text -> f Text) -> EventStream -> f EventStream
eventStream_applicationId = (EventStream -> Text)
-> (EventStream -> Text -> EventStream)
-> Lens EventStream EventStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventStream' {Text
applicationId :: Text
$sel:applicationId:EventStream' :: EventStream -> Text
applicationId} -> Text
applicationId) (\s :: EventStream
s@EventStream' {} Text
a -> EventStream
s {$sel:applicationId:EventStream' :: Text
applicationId = Text
a} :: EventStream)
eventStream_roleArn :: Lens.Lens' EventStream Prelude.Text
eventStream_roleArn :: (Text -> f Text) -> EventStream -> f EventStream
eventStream_roleArn = (EventStream -> Text)
-> (EventStream -> Text -> EventStream)
-> Lens EventStream EventStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventStream' {Text
roleArn :: Text
$sel:roleArn:EventStream' :: EventStream -> Text
roleArn} -> Text
roleArn) (\s :: EventStream
s@EventStream' {} Text
a -> EventStream
s {$sel:roleArn:EventStream' :: Text
roleArn = Text
a} :: EventStream)
eventStream_destinationStreamArn :: Lens.Lens' EventStream Prelude.Text
eventStream_destinationStreamArn :: (Text -> f Text) -> EventStream -> f EventStream
eventStream_destinationStreamArn = (EventStream -> Text)
-> (EventStream -> Text -> EventStream)
-> Lens EventStream EventStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventStream' {Text
destinationStreamArn :: Text
$sel:destinationStreamArn:EventStream' :: EventStream -> Text
destinationStreamArn} -> Text
destinationStreamArn) (\s :: EventStream
s@EventStream' {} Text
a -> EventStream
s {$sel:destinationStreamArn:EventStream' :: Text
destinationStreamArn = Text
a} :: EventStream)
instance Core.FromJSON EventStream where
parseJSON :: Value -> Parser EventStream
parseJSON =
String
-> (Object -> Parser EventStream) -> Value -> Parser EventStream
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventStream"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Text -> Text -> Text -> EventStream
EventStream'
(Maybe Text
-> Maybe Text -> Maybe Text -> Text -> Text -> Text -> EventStream)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Text -> Text -> Text -> EventStream)
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
"LastUpdatedBy")
Parser
(Maybe Text -> Maybe Text -> Text -> Text -> Text -> EventStream)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> Text -> Text -> EventStream)
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
"LastModifiedDate")
Parser (Maybe Text -> Text -> Text -> Text -> EventStream)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> Text -> EventStream)
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
"ExternalId")
Parser (Text -> Text -> Text -> EventStream)
-> Parser Text -> Parser (Text -> Text -> EventStream)
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
"ApplicationId")
Parser (Text -> Text -> EventStream)
-> Parser Text -> Parser (Text -> EventStream)
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
"RoleArn")
Parser (Text -> EventStream) -> Parser Text -> Parser EventStream
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
"DestinationStreamArn")
)
instance Prelude.Hashable EventStream
instance Prelude.NFData EventStream