{-# 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.IoT.Types.ThingConnectivity 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 ThingConnectivity = ThingConnectivity'
{
ThingConnectivity -> Maybe Bool
connected :: Prelude.Maybe Prelude.Bool,
ThingConnectivity -> Maybe Text
disconnectReason :: Prelude.Maybe Prelude.Text,
ThingConnectivity -> Maybe Integer
timestamp :: Prelude.Maybe Prelude.Integer
}
deriving (ThingConnectivity -> ThingConnectivity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThingConnectivity -> ThingConnectivity -> Bool
$c/= :: ThingConnectivity -> ThingConnectivity -> Bool
== :: ThingConnectivity -> ThingConnectivity -> Bool
$c== :: ThingConnectivity -> ThingConnectivity -> Bool
Prelude.Eq, ReadPrec [ThingConnectivity]
ReadPrec ThingConnectivity
Int -> ReadS ThingConnectivity
ReadS [ThingConnectivity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThingConnectivity]
$creadListPrec :: ReadPrec [ThingConnectivity]
readPrec :: ReadPrec ThingConnectivity
$creadPrec :: ReadPrec ThingConnectivity
readList :: ReadS [ThingConnectivity]
$creadList :: ReadS [ThingConnectivity]
readsPrec :: Int -> ReadS ThingConnectivity
$creadsPrec :: Int -> ReadS ThingConnectivity
Prelude.Read, Int -> ThingConnectivity -> ShowS
[ThingConnectivity] -> ShowS
ThingConnectivity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThingConnectivity] -> ShowS
$cshowList :: [ThingConnectivity] -> ShowS
show :: ThingConnectivity -> String
$cshow :: ThingConnectivity -> String
showsPrec :: Int -> ThingConnectivity -> ShowS
$cshowsPrec :: Int -> ThingConnectivity -> ShowS
Prelude.Show, forall x. Rep ThingConnectivity x -> ThingConnectivity
forall x. ThingConnectivity -> Rep ThingConnectivity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThingConnectivity x -> ThingConnectivity
$cfrom :: forall x. ThingConnectivity -> Rep ThingConnectivity x
Prelude.Generic)
newThingConnectivity ::
ThingConnectivity
newThingConnectivity :: ThingConnectivity
newThingConnectivity =
ThingConnectivity'
{ $sel:connected:ThingConnectivity' :: Maybe Bool
connected = forall a. Maybe a
Prelude.Nothing,
$sel:disconnectReason:ThingConnectivity' :: Maybe Text
disconnectReason = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:ThingConnectivity' :: Maybe Integer
timestamp = forall a. Maybe a
Prelude.Nothing
}
thingConnectivity_connected :: Lens.Lens' ThingConnectivity (Prelude.Maybe Prelude.Bool)
thingConnectivity_connected :: Lens' ThingConnectivity (Maybe Bool)
thingConnectivity_connected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingConnectivity' {Maybe Bool
connected :: Maybe Bool
$sel:connected:ThingConnectivity' :: ThingConnectivity -> Maybe Bool
connected} -> Maybe Bool
connected) (\s :: ThingConnectivity
s@ThingConnectivity' {} Maybe Bool
a -> ThingConnectivity
s {$sel:connected:ThingConnectivity' :: Maybe Bool
connected = Maybe Bool
a} :: ThingConnectivity)
thingConnectivity_disconnectReason :: Lens.Lens' ThingConnectivity (Prelude.Maybe Prelude.Text)
thingConnectivity_disconnectReason :: Lens' ThingConnectivity (Maybe Text)
thingConnectivity_disconnectReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingConnectivity' {Maybe Text
disconnectReason :: Maybe Text
$sel:disconnectReason:ThingConnectivity' :: ThingConnectivity -> Maybe Text
disconnectReason} -> Maybe Text
disconnectReason) (\s :: ThingConnectivity
s@ThingConnectivity' {} Maybe Text
a -> ThingConnectivity
s {$sel:disconnectReason:ThingConnectivity' :: Maybe Text
disconnectReason = Maybe Text
a} :: ThingConnectivity)
thingConnectivity_timestamp :: Lens.Lens' ThingConnectivity (Prelude.Maybe Prelude.Integer)
thingConnectivity_timestamp :: Lens' ThingConnectivity (Maybe Integer)
thingConnectivity_timestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingConnectivity' {Maybe Integer
timestamp :: Maybe Integer
$sel:timestamp:ThingConnectivity' :: ThingConnectivity -> Maybe Integer
timestamp} -> Maybe Integer
timestamp) (\s :: ThingConnectivity
s@ThingConnectivity' {} Maybe Integer
a -> ThingConnectivity
s {$sel:timestamp:ThingConnectivity' :: Maybe Integer
timestamp = Maybe Integer
a} :: ThingConnectivity)
instance Data.FromJSON ThingConnectivity where
parseJSON :: Value -> Parser ThingConnectivity
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ThingConnectivity"
( \Object
x ->
Maybe Bool -> Maybe Text -> Maybe Integer -> ThingConnectivity
ThingConnectivity'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"connected")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"disconnectReason")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"timestamp")
)
instance Prelude.Hashable ThingConnectivity where
hashWithSalt :: Int -> ThingConnectivity -> Int
hashWithSalt Int
_salt ThingConnectivity' {Maybe Bool
Maybe Integer
Maybe Text
timestamp :: Maybe Integer
disconnectReason :: Maybe Text
connected :: Maybe Bool
$sel:timestamp:ThingConnectivity' :: ThingConnectivity -> Maybe Integer
$sel:disconnectReason:ThingConnectivity' :: ThingConnectivity -> Maybe Text
$sel:connected:ThingConnectivity' :: ThingConnectivity -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
connected
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
disconnectReason
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
timestamp
instance Prelude.NFData ThingConnectivity where
rnf :: ThingConnectivity -> ()
rnf ThingConnectivity' {Maybe Bool
Maybe Integer
Maybe Text
timestamp :: Maybe Integer
disconnectReason :: Maybe Text
connected :: Maybe Bool
$sel:timestamp:ThingConnectivity' :: ThingConnectivity -> Maybe Integer
$sel:disconnectReason:ThingConnectivity' :: ThingConnectivity -> Maybe Text
$sel:connected:ThingConnectivity' :: ThingConnectivity -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
connected
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
disconnectReason
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
timestamp