{-# 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.SageMaker.Types.Device where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Device = Device'
{
Device -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Device -> Maybe Text
iotThingName :: Prelude.Maybe Prelude.Text,
Device -> Text
deviceName :: Prelude.Text
}
deriving (Device -> Device -> Bool
(Device -> Device -> Bool)
-> (Device -> Device -> Bool) -> Eq Device
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Device -> Device -> Bool
$c/= :: Device -> Device -> Bool
== :: Device -> Device -> Bool
$c== :: Device -> Device -> Bool
Prelude.Eq, ReadPrec [Device]
ReadPrec Device
Int -> ReadS Device
ReadS [Device]
(Int -> ReadS Device)
-> ReadS [Device]
-> ReadPrec Device
-> ReadPrec [Device]
-> Read Device
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Device]
$creadListPrec :: ReadPrec [Device]
readPrec :: ReadPrec Device
$creadPrec :: ReadPrec Device
readList :: ReadS [Device]
$creadList :: ReadS [Device]
readsPrec :: Int -> ReadS Device
$creadsPrec :: Int -> ReadS Device
Prelude.Read, Int -> Device -> ShowS
[Device] -> ShowS
Device -> String
(Int -> Device -> ShowS)
-> (Device -> String) -> ([Device] -> ShowS) -> Show Device
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Device] -> ShowS
$cshowList :: [Device] -> ShowS
show :: Device -> String
$cshow :: Device -> String
showsPrec :: Int -> Device -> ShowS
$cshowsPrec :: Int -> Device -> ShowS
Prelude.Show, (forall x. Device -> Rep Device x)
-> (forall x. Rep Device x -> Device) -> Generic Device
forall x. Rep Device x -> Device
forall x. Device -> Rep Device x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Device x -> Device
$cfrom :: forall x. Device -> Rep Device x
Prelude.Generic)
newDevice ::
Prelude.Text ->
Device
newDevice :: Text -> Device
newDevice Text
pDeviceName_ =
Device' :: Maybe Text -> Maybe Text -> Text -> Device
Device'
{ $sel:description:Device' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iotThingName:Device' :: Maybe Text
iotThingName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:Device' :: Text
deviceName = Text
pDeviceName_
}
device_description :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_description :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_description = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
description :: Maybe Text
$sel:description:Device' :: Device -> Maybe Text
description} -> Maybe Text
description) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:description:Device' :: Maybe Text
description = Maybe Text
a} :: Device)
device_iotThingName :: Lens.Lens' Device (Prelude.Maybe Prelude.Text)
device_iotThingName :: (Maybe Text -> f (Maybe Text)) -> Device -> f Device
device_iotThingName = (Device -> Maybe Text)
-> (Device -> Maybe Text -> Device)
-> Lens Device Device (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Maybe Text
iotThingName :: Maybe Text
$sel:iotThingName:Device' :: Device -> Maybe Text
iotThingName} -> Maybe Text
iotThingName) (\s :: Device
s@Device' {} Maybe Text
a -> Device
s {$sel:iotThingName:Device' :: Maybe Text
iotThingName = Maybe Text
a} :: Device)
device_deviceName :: Lens.Lens' Device Prelude.Text
device_deviceName :: (Text -> f Text) -> Device -> f Device
device_deviceName = (Device -> Text)
-> (Device -> Text -> Device) -> Lens Device Device Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Device' {Text
deviceName :: Text
$sel:deviceName:Device' :: Device -> Text
deviceName} -> Text
deviceName) (\s :: Device
s@Device' {} Text
a -> Device
s {$sel:deviceName:Device' :: Text
deviceName = Text
a} :: Device)
instance Prelude.Hashable Device
instance Prelude.NFData Device
instance Core.ToJSON Device where
toJSON :: Device -> Value
toJSON Device' {Maybe Text
Text
deviceName :: Text
iotThingName :: Maybe Text
description :: Maybe Text
$sel:deviceName:Device' :: Device -> Text
$sel:iotThingName:Device' :: Device -> Maybe Text
$sel:description:Device' :: Device -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
(Text
"IotThingName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
iotThingName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceName)
]
)