{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data IotEventsDestinationConfiguration = IotEventsDestinationConfiguration'
{
IotEventsDestinationConfiguration -> Text
inputName :: Prelude.Text,
IotEventsDestinationConfiguration -> Text
roleArn :: Prelude.Text
}
deriving (IotEventsDestinationConfiguration
-> IotEventsDestinationConfiguration -> Bool
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]
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
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.
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'
{ $sel:inputName:IotEventsDestinationConfiguration' :: Text
inputName =
Text
pInputName_,
$sel:roleArn:IotEventsDestinationConfiguration' :: Text
roleArn = Text
pRoleArn_
}
iotEventsDestinationConfiguration_inputName :: Lens.Lens' IotEventsDestinationConfiguration Prelude.Text
iotEventsDestinationConfiguration_inputName :: Lens' IotEventsDestinationConfiguration Text
iotEventsDestinationConfiguration_inputName = 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 :: Lens' IotEventsDestinationConfiguration Text
iotEventsDestinationConfiguration_roleArn = 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
Data.FromJSON
IotEventsDestinationConfiguration
where
parseJSON :: Value -> Parser IotEventsDestinationConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IotEventsDestinationConfiguration"
( \Object
x ->
Text -> Text -> IotEventsDestinationConfiguration
IotEventsDestinationConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"inputName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"roleArn")
)
instance
Prelude.Hashable
IotEventsDestinationConfiguration
where
hashWithSalt :: Int -> IotEventsDestinationConfiguration -> Int
hashWithSalt
Int
_salt
IotEventsDestinationConfiguration' {Text
roleArn :: Text
inputName :: Text
$sel:roleArn:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
$sel:inputName:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
inputName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance
Prelude.NFData
IotEventsDestinationConfiguration
where
rnf :: IotEventsDestinationConfiguration -> ()
rnf IotEventsDestinationConfiguration' {Text
roleArn :: Text
inputName :: Text
$sel:roleArn:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
$sel:inputName:IotEventsDestinationConfiguration' :: IotEventsDestinationConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
inputName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
instance
Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"inputName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
inputName),
forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
]
)