{-# 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.IoTSiteWise.Types.PortalStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types.MonitorErrorDetails
import Amazonka.IoTSiteWise.Types.PortalState
import qualified Amazonka.Prelude as Prelude
data PortalStatus = PortalStatus'
{
PortalStatus -> Maybe MonitorErrorDetails
error :: Prelude.Maybe MonitorErrorDetails,
PortalStatus -> PortalState
state :: PortalState
}
deriving (PortalStatus -> PortalStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PortalStatus -> PortalStatus -> Bool
$c/= :: PortalStatus -> PortalStatus -> Bool
== :: PortalStatus -> PortalStatus -> Bool
$c== :: PortalStatus -> PortalStatus -> Bool
Prelude.Eq, ReadPrec [PortalStatus]
ReadPrec PortalStatus
Int -> ReadS PortalStatus
ReadS [PortalStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PortalStatus]
$creadListPrec :: ReadPrec [PortalStatus]
readPrec :: ReadPrec PortalStatus
$creadPrec :: ReadPrec PortalStatus
readList :: ReadS [PortalStatus]
$creadList :: ReadS [PortalStatus]
readsPrec :: Int -> ReadS PortalStatus
$creadsPrec :: Int -> ReadS PortalStatus
Prelude.Read, Int -> PortalStatus -> ShowS
[PortalStatus] -> ShowS
PortalStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PortalStatus] -> ShowS
$cshowList :: [PortalStatus] -> ShowS
show :: PortalStatus -> String
$cshow :: PortalStatus -> String
showsPrec :: Int -> PortalStatus -> ShowS
$cshowsPrec :: Int -> PortalStatus -> ShowS
Prelude.Show, forall x. Rep PortalStatus x -> PortalStatus
forall x. PortalStatus -> Rep PortalStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PortalStatus x -> PortalStatus
$cfrom :: forall x. PortalStatus -> Rep PortalStatus x
Prelude.Generic)
newPortalStatus ::
PortalState ->
PortalStatus
newPortalStatus :: PortalState -> PortalStatus
newPortalStatus PortalState
pState_ =
PortalStatus'
{ $sel:error:PortalStatus' :: Maybe MonitorErrorDetails
error = forall a. Maybe a
Prelude.Nothing,
$sel:state:PortalStatus' :: PortalState
state = PortalState
pState_
}
portalStatus_error :: Lens.Lens' PortalStatus (Prelude.Maybe MonitorErrorDetails)
portalStatus_error :: Lens' PortalStatus (Maybe MonitorErrorDetails)
portalStatus_error = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortalStatus' {Maybe MonitorErrorDetails
error :: Maybe MonitorErrorDetails
$sel:error:PortalStatus' :: PortalStatus -> Maybe MonitorErrorDetails
error} -> Maybe MonitorErrorDetails
error) (\s :: PortalStatus
s@PortalStatus' {} Maybe MonitorErrorDetails
a -> PortalStatus
s {$sel:error:PortalStatus' :: Maybe MonitorErrorDetails
error = Maybe MonitorErrorDetails
a} :: PortalStatus)
portalStatus_state :: Lens.Lens' PortalStatus PortalState
portalStatus_state :: Lens' PortalStatus PortalState
portalStatus_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PortalStatus' {PortalState
state :: PortalState
$sel:state:PortalStatus' :: PortalStatus -> PortalState
state} -> PortalState
state) (\s :: PortalStatus
s@PortalStatus' {} PortalState
a -> PortalStatus
s {$sel:state:PortalStatus' :: PortalState
state = PortalState
a} :: PortalStatus)
instance Data.FromJSON PortalStatus where
parseJSON :: Value -> Parser PortalStatus
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PortalStatus"
( \Object
x ->
Maybe MonitorErrorDetails -> PortalState -> PortalStatus
PortalStatus'
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
"error")
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
"state")
)
instance Prelude.Hashable PortalStatus where
hashWithSalt :: Int -> PortalStatus -> Int
hashWithSalt Int
_salt PortalStatus' {Maybe MonitorErrorDetails
PortalState
state :: PortalState
error :: Maybe MonitorErrorDetails
$sel:state:PortalStatus' :: PortalStatus -> PortalState
$sel:error:PortalStatus' :: PortalStatus -> Maybe MonitorErrorDetails
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MonitorErrorDetails
error
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PortalState
state
instance Prelude.NFData PortalStatus where
rnf :: PortalStatus -> ()
rnf PortalStatus' {Maybe MonitorErrorDetails
PortalState
state :: PortalState
error :: Maybe MonitorErrorDetails
$sel:state:PortalStatus' :: PortalStatus -> PortalState
$sel:error:PortalStatus' :: PortalStatus -> Maybe MonitorErrorDetails
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe MonitorErrorDetails
error seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PortalState
state