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