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