{-# 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.CloudFront.Types.KinesisStreamConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data KinesisStreamConfig = KinesisStreamConfig'
{
KinesisStreamConfig -> Text
roleARN :: Prelude.Text,
KinesisStreamConfig -> Text
streamARN :: Prelude.Text
}
deriving (KinesisStreamConfig -> KinesisStreamConfig -> Bool
(KinesisStreamConfig -> KinesisStreamConfig -> Bool)
-> (KinesisStreamConfig -> KinesisStreamConfig -> Bool)
-> Eq KinesisStreamConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
$c/= :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
== :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
$c== :: KinesisStreamConfig -> KinesisStreamConfig -> Bool
Prelude.Eq, ReadPrec [KinesisStreamConfig]
ReadPrec KinesisStreamConfig
Int -> ReadS KinesisStreamConfig
ReadS [KinesisStreamConfig]
(Int -> ReadS KinesisStreamConfig)
-> ReadS [KinesisStreamConfig]
-> ReadPrec KinesisStreamConfig
-> ReadPrec [KinesisStreamConfig]
-> Read KinesisStreamConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KinesisStreamConfig]
$creadListPrec :: ReadPrec [KinesisStreamConfig]
readPrec :: ReadPrec KinesisStreamConfig
$creadPrec :: ReadPrec KinesisStreamConfig
readList :: ReadS [KinesisStreamConfig]
$creadList :: ReadS [KinesisStreamConfig]
readsPrec :: Int -> ReadS KinesisStreamConfig
$creadsPrec :: Int -> ReadS KinesisStreamConfig
Prelude.Read, Int -> KinesisStreamConfig -> ShowS
[KinesisStreamConfig] -> ShowS
KinesisStreamConfig -> String
(Int -> KinesisStreamConfig -> ShowS)
-> (KinesisStreamConfig -> String)
-> ([KinesisStreamConfig] -> ShowS)
-> Show KinesisStreamConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KinesisStreamConfig] -> ShowS
$cshowList :: [KinesisStreamConfig] -> ShowS
show :: KinesisStreamConfig -> String
$cshow :: KinesisStreamConfig -> String
showsPrec :: Int -> KinesisStreamConfig -> ShowS
$cshowsPrec :: Int -> KinesisStreamConfig -> ShowS
Prelude.Show, (forall x. KinesisStreamConfig -> Rep KinesisStreamConfig x)
-> (forall x. Rep KinesisStreamConfig x -> KinesisStreamConfig)
-> Generic KinesisStreamConfig
forall x. Rep KinesisStreamConfig x -> KinesisStreamConfig
forall x. KinesisStreamConfig -> Rep KinesisStreamConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KinesisStreamConfig x -> KinesisStreamConfig
$cfrom :: forall x. KinesisStreamConfig -> Rep KinesisStreamConfig x
Prelude.Generic)
newKinesisStreamConfig ::
Prelude.Text ->
Prelude.Text ->
KinesisStreamConfig
newKinesisStreamConfig :: Text -> Text -> KinesisStreamConfig
newKinesisStreamConfig Text
pRoleARN_ Text
pStreamARN_ =
KinesisStreamConfig' :: Text -> Text -> KinesisStreamConfig
KinesisStreamConfig'
{ $sel:roleARN:KinesisStreamConfig' :: Text
roleARN = Text
pRoleARN_,
$sel:streamARN:KinesisStreamConfig' :: Text
streamARN = Text
pStreamARN_
}
kinesisStreamConfig_roleARN :: Lens.Lens' KinesisStreamConfig Prelude.Text
kinesisStreamConfig_roleARN :: (Text -> f Text) -> KinesisStreamConfig -> f KinesisStreamConfig
kinesisStreamConfig_roleARN = (KinesisStreamConfig -> Text)
-> (KinesisStreamConfig -> Text -> KinesisStreamConfig)
-> Lens KinesisStreamConfig KinesisStreamConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamConfig' {Text
roleARN :: Text
$sel:roleARN:KinesisStreamConfig' :: KinesisStreamConfig -> Text
roleARN} -> Text
roleARN) (\s :: KinesisStreamConfig
s@KinesisStreamConfig' {} Text
a -> KinesisStreamConfig
s {$sel:roleARN:KinesisStreamConfig' :: Text
roleARN = Text
a} :: KinesisStreamConfig)
kinesisStreamConfig_streamARN :: Lens.Lens' KinesisStreamConfig Prelude.Text
kinesisStreamConfig_streamARN :: (Text -> f Text) -> KinesisStreamConfig -> f KinesisStreamConfig
kinesisStreamConfig_streamARN = (KinesisStreamConfig -> Text)
-> (KinesisStreamConfig -> Text -> KinesisStreamConfig)
-> Lens KinesisStreamConfig KinesisStreamConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KinesisStreamConfig' {Text
streamARN :: Text
$sel:streamARN:KinesisStreamConfig' :: KinesisStreamConfig -> Text
streamARN} -> Text
streamARN) (\s :: KinesisStreamConfig
s@KinesisStreamConfig' {} Text
a -> KinesisStreamConfig
s {$sel:streamARN:KinesisStreamConfig' :: Text
streamARN = Text
a} :: KinesisStreamConfig)
instance Core.FromXML KinesisStreamConfig where
parseXML :: [Node] -> Either String KinesisStreamConfig
parseXML [Node]
x =
Text -> Text -> KinesisStreamConfig
KinesisStreamConfig'
(Text -> Text -> KinesisStreamConfig)
-> Either String Text
-> Either String (Text -> KinesisStreamConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"RoleARN")
Either String (Text -> KinesisStreamConfig)
-> Either String Text -> Either String KinesisStreamConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"StreamARN")
instance Prelude.Hashable KinesisStreamConfig
instance Prelude.NFData KinesisStreamConfig
instance Core.ToXML KinesisStreamConfig where
toXML :: KinesisStreamConfig -> XML
toXML KinesisStreamConfig' {Text
streamARN :: Text
roleARN :: Text
$sel:streamARN:KinesisStreamConfig' :: KinesisStreamConfig -> Text
$sel:roleARN:KinesisStreamConfig' :: KinesisStreamConfig -> Text
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"RoleARN" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
roleARN,
Name
"StreamARN" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
streamARN
]