{-# 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.AlexaBusiness.Types.DeviceStatusDetail where
import Amazonka.AlexaBusiness.Types.DeviceStatusDetailCode
import Amazonka.AlexaBusiness.Types.Feature
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 DeviceStatusDetail = DeviceStatusDetail'
{
DeviceStatusDetail -> Maybe DeviceStatusDetailCode
code :: Prelude.Maybe DeviceStatusDetailCode,
DeviceStatusDetail -> Maybe Feature
feature :: Prelude.Maybe Feature
}
deriving (DeviceStatusDetail -> DeviceStatusDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceStatusDetail -> DeviceStatusDetail -> Bool
$c/= :: DeviceStatusDetail -> DeviceStatusDetail -> Bool
== :: DeviceStatusDetail -> DeviceStatusDetail -> Bool
$c== :: DeviceStatusDetail -> DeviceStatusDetail -> Bool
Prelude.Eq, ReadPrec [DeviceStatusDetail]
ReadPrec DeviceStatusDetail
Int -> ReadS DeviceStatusDetail
ReadS [DeviceStatusDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceStatusDetail]
$creadListPrec :: ReadPrec [DeviceStatusDetail]
readPrec :: ReadPrec DeviceStatusDetail
$creadPrec :: ReadPrec DeviceStatusDetail
readList :: ReadS [DeviceStatusDetail]
$creadList :: ReadS [DeviceStatusDetail]
readsPrec :: Int -> ReadS DeviceStatusDetail
$creadsPrec :: Int -> ReadS DeviceStatusDetail
Prelude.Read, Int -> DeviceStatusDetail -> ShowS
[DeviceStatusDetail] -> ShowS
DeviceStatusDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceStatusDetail] -> ShowS
$cshowList :: [DeviceStatusDetail] -> ShowS
show :: DeviceStatusDetail -> String
$cshow :: DeviceStatusDetail -> String
showsPrec :: Int -> DeviceStatusDetail -> ShowS
$cshowsPrec :: Int -> DeviceStatusDetail -> ShowS
Prelude.Show, forall x. Rep DeviceStatusDetail x -> DeviceStatusDetail
forall x. DeviceStatusDetail -> Rep DeviceStatusDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceStatusDetail x -> DeviceStatusDetail
$cfrom :: forall x. DeviceStatusDetail -> Rep DeviceStatusDetail x
Prelude.Generic)
newDeviceStatusDetail ::
DeviceStatusDetail
newDeviceStatusDetail :: DeviceStatusDetail
newDeviceStatusDetail =
DeviceStatusDetail'
{ $sel:code:DeviceStatusDetail' :: Maybe DeviceStatusDetailCode
code = forall a. Maybe a
Prelude.Nothing,
$sel:feature:DeviceStatusDetail' :: Maybe Feature
feature = forall a. Maybe a
Prelude.Nothing
}
deviceStatusDetail_code :: Lens.Lens' DeviceStatusDetail (Prelude.Maybe DeviceStatusDetailCode)
deviceStatusDetail_code :: Lens' DeviceStatusDetail (Maybe DeviceStatusDetailCode)
deviceStatusDetail_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceStatusDetail' {Maybe DeviceStatusDetailCode
code :: Maybe DeviceStatusDetailCode
$sel:code:DeviceStatusDetail' :: DeviceStatusDetail -> Maybe DeviceStatusDetailCode
code} -> Maybe DeviceStatusDetailCode
code) (\s :: DeviceStatusDetail
s@DeviceStatusDetail' {} Maybe DeviceStatusDetailCode
a -> DeviceStatusDetail
s {$sel:code:DeviceStatusDetail' :: Maybe DeviceStatusDetailCode
code = Maybe DeviceStatusDetailCode
a} :: DeviceStatusDetail)
deviceStatusDetail_feature :: Lens.Lens' DeviceStatusDetail (Prelude.Maybe Feature)
deviceStatusDetail_feature :: Lens' DeviceStatusDetail (Maybe Feature)
deviceStatusDetail_feature = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceStatusDetail' {Maybe Feature
feature :: Maybe Feature
$sel:feature:DeviceStatusDetail' :: DeviceStatusDetail -> Maybe Feature
feature} -> Maybe Feature
feature) (\s :: DeviceStatusDetail
s@DeviceStatusDetail' {} Maybe Feature
a -> DeviceStatusDetail
s {$sel:feature:DeviceStatusDetail' :: Maybe Feature
feature = Maybe Feature
a} :: DeviceStatusDetail)
instance Data.FromJSON DeviceStatusDetail where
parseJSON :: Value -> Parser DeviceStatusDetail
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeviceStatusDetail"
( \Object
x ->
Maybe DeviceStatusDetailCode -> Maybe Feature -> DeviceStatusDetail
DeviceStatusDetail'
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
"Code")
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
"Feature")
)
instance Prelude.Hashable DeviceStatusDetail where
hashWithSalt :: Int -> DeviceStatusDetail -> Int
hashWithSalt Int
_salt DeviceStatusDetail' {Maybe DeviceStatusDetailCode
Maybe Feature
feature :: Maybe Feature
code :: Maybe DeviceStatusDetailCode
$sel:feature:DeviceStatusDetail' :: DeviceStatusDetail -> Maybe Feature
$sel:code:DeviceStatusDetail' :: DeviceStatusDetail -> Maybe DeviceStatusDetailCode
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeviceStatusDetailCode
code
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Feature
feature
instance Prelude.NFData DeviceStatusDetail where
rnf :: DeviceStatusDetail -> ()
rnf DeviceStatusDetail' {Maybe DeviceStatusDetailCode
Maybe Feature
feature :: Maybe Feature
code :: Maybe DeviceStatusDetailCode
$sel:feature:DeviceStatusDetail' :: DeviceStatusDetail -> Maybe Feature
$sel:code:DeviceStatusDetail' :: DeviceStatusDetail -> Maybe DeviceStatusDetailCode
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DeviceStatusDetailCode
code seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Feature
feature