{-# 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.IoTAnalytics.Types.IotEventsDestinationConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IotEventsDestinationConfiguration = IotEventsDestinationConfiguration'
{
IotEventsDestinationConfiguration -> Text
inputName :: Prelude.Text,
IotEventsDestinationConfiguration -> Text
roleArn :: Prelude.Text
}
deriving (IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool
(IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool)
-> (IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool)
-> Eq IotEventsDestinationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool
$c/= :: IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool
== :: IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool
$c== :: IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool
Prelude.Eq, ReadPrec [IotEventsDestinationConfiguration]
ReadPrec IotEventsDestinationConfiguration
Int -> ReadS IotEventsDestinationConfiguration
ReadS [IotEventsDestinationConfiguration]
(Int -> ReadS IotEventsDestinationConfiguration)
-> ReadS [IotEventsDestinationConfiguration]
-> ReadPrec IotEventsDestinationConfiguration
-> ReadPrec [IotEventsDestinationConfiguration]
-> Read IotEventsDestinationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IotEventsDestinationConfiguration]
$creadListPrec :: ReadPrec [IotEventsDestinationConfiguration]
readPrec :: ReadPrec IotEventsDestinationConfiguration
$creadPrec :: ReadPrec IotEventsDestinationConfiguration
readList :: ReadS [IotEventsDestinationConfiguration]
$creadList :: ReadS [IotEventsDestinationConfiguration]
readsPrec :: Int -> ReadS IotEventsDestinationConfiguration
$creadsPrec :: Int -> ReadS IotEventsDestinationConfiguration
Prelude.Read, Int -> IotEventsDestinationConfiguration -> ShowS
[IotEventsDestinationConfiguration] -> ShowS
IotEventsDestinationConfiguration -> String
(Int -> IotEventsDestinationConfiguration -> ShowS)
-> (IotEventsDestinationConfiguration -> String)
-> ([IotEventsDestinationConfiguration] -> ShowS)
-> Show IotEventsDestinationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IotEventsDestinationConfiguration] -> ShowS
$cshowList :: [IotEventsDestinationConfiguration] -> ShowS
show :: IotEventsDestinationConfiguration -> String
$cshow :: IotEventsDestinationConfiguration -> String
showsPrec :: Int -> IotEventsDestinationConfiguration -> ShowS
$cshowsPrec :: Int -> IotEventsDestinationConfiguration -> ShowS
Prelude.Show, (forall x.
IotEventsDestinationConfiguration
-> Rep IotEventsDestinationConfiguration x)
-> (forall x.
Rep IotEventsDestinationConfiguration x
-> IotEventsDestinationConfiguration)
-> Generic IotEventsDestinationConfiguration
forall x.
Rep IotEventsDestinationConfiguration x
-> IotEventsDestinationConfiguration
forall x.
IotEventsDestinationConfiguration
-> Rep IotEventsDestinationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IotEventsDestinationConfiguration x
-> IotEventsDestinationConfiguration
$cfrom :: forall x.
IotEventsDestinationConfiguration
-> Rep IotEventsDestinationConfiguration x
Prelude.Generic)
newIotEventsDestinationConfiguration ::
Prelude.Text ->
Prelude.Text ->
IotEventsDestinationConfiguration
newIotEventsDestinationConfiguration :: Text -> Text -> IotEventsDestinationConfiguration
newIotEventsDestinationConfiguration
Text
pInputName_
Text
pRoleArn_ =
IotEventsDestinationConfiguration' :: Text -> Text -> IotEventsDestinationConfiguration
IotEventsDestinationConfiguration'
{ $sel:inputName:IotEventsDestinationConfiguration' :: Text
inputName =
Text
pInputName_,
$sel:roleArn:IotEventsDestinationConfiguration' :: Text
roleArn = Text
pRoleArn_
}
iotEventsDestinationConfiguration_inputName :: Lens.Lens' IotEventsDestinationConfiguration Prelude.Text
iotEventsDestinationConfiguration_inputName :: (Text -> f Text)
-> IotEventsDestinationConfiguration
-> f IotEventsDestinationConfiguration
iotEventsDestinationConfiguration_inputName = (IotEventsDestinationConfiguration -> Text)
-> (IotEventsDestinationConfiguration
-> Text -> IotEventsDestinationConfiguration)
-> Lens
IotEventsDestinationConfiguration
IotEventsDestinationConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotEventsDestinationConfiguration' {Text
inputName :: Text
$sel:inputName:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
inputName} -> Text
inputName) (\s :: IotEventsDestinationConfiguration
s@IotEventsDestinationConfiguration' {} Text
a -> IotEventsDestinationConfiguration
s {$sel:inputName:IotEventsDestinationConfiguration' :: Text
inputName = Text
a} :: IotEventsDestinationConfiguration)
iotEventsDestinationConfiguration_roleArn :: Lens.Lens' IotEventsDestinationConfiguration Prelude.Text
iotEventsDestinationConfiguration_roleArn :: (Text -> f Text)
-> IotEventsDestinationConfiguration
-> f IotEventsDestinationConfiguration
iotEventsDestinationConfiguration_roleArn = (IotEventsDestinationConfiguration -> Text)
-> (IotEventsDestinationConfiguration
-> Text -> IotEventsDestinationConfiguration)
-> Lens
IotEventsDestinationConfiguration
IotEventsDestinationConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotEventsDestinationConfiguration' {Text
roleArn :: Text
$sel:roleArn:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
roleArn} -> Text
roleArn) (\s :: IotEventsDestinationConfiguration
s@IotEventsDestinationConfiguration' {} Text
a -> IotEventsDestinationConfiguration
s {$sel:roleArn:IotEventsDestinationConfiguration' :: Text
roleArn = Text
a} :: IotEventsDestinationConfiguration)
instance
Core.FromJSON
IotEventsDestinationConfiguration
where
parseJSON :: Value -> Parser IotEventsDestinationConfiguration
parseJSON =
String
-> (Object -> Parser IotEventsDestinationConfiguration)
-> Value
-> Parser IotEventsDestinationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IotEventsDestinationConfiguration"
( \Object
x ->
Text -> Text -> IotEventsDestinationConfiguration
IotEventsDestinationConfiguration'
(Text -> Text -> IotEventsDestinationConfiguration)
-> Parser Text
-> Parser (Text -> IotEventsDestinationConfiguration)
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
"inputName")
Parser (Text -> IotEventsDestinationConfiguration)
-> Parser Text -> Parser IotEventsDestinationConfiguration
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")
)
instance
Prelude.Hashable
IotEventsDestinationConfiguration
instance
Prelude.NFData
IotEventsDestinationConfiguration
instance
Core.ToJSON
IotEventsDestinationConfiguration
where
toJSON :: IotEventsDestinationConfiguration -> Value
toJSON IotEventsDestinationConfiguration' {Text
roleArn :: Text
inputName :: Text
$sel:roleArn:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
$sel:inputName:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> 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
"inputName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
inputName),
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)
]
)