{-# 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.ECS.Types.PlatformDevice where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.PlatformDeviceType
import qualified Amazonka.Prelude as Prelude
data PlatformDevice = PlatformDevice'
{
PlatformDevice -> Text
id :: Prelude.Text,
PlatformDevice -> PlatformDeviceType
type' :: PlatformDeviceType
}
deriving (PlatformDevice -> PlatformDevice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlatformDevice -> PlatformDevice -> Bool
$c/= :: PlatformDevice -> PlatformDevice -> Bool
== :: PlatformDevice -> PlatformDevice -> Bool
$c== :: PlatformDevice -> PlatformDevice -> Bool
Prelude.Eq, ReadPrec [PlatformDevice]
ReadPrec PlatformDevice
Int -> ReadS PlatformDevice
ReadS [PlatformDevice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlatformDevice]
$creadListPrec :: ReadPrec [PlatformDevice]
readPrec :: ReadPrec PlatformDevice
$creadPrec :: ReadPrec PlatformDevice
readList :: ReadS [PlatformDevice]
$creadList :: ReadS [PlatformDevice]
readsPrec :: Int -> ReadS PlatformDevice
$creadsPrec :: Int -> ReadS PlatformDevice
Prelude.Read, Int -> PlatformDevice -> ShowS
[PlatformDevice] -> ShowS
PlatformDevice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlatformDevice] -> ShowS
$cshowList :: [PlatformDevice] -> ShowS
show :: PlatformDevice -> String
$cshow :: PlatformDevice -> String
showsPrec :: Int -> PlatformDevice -> ShowS
$cshowsPrec :: Int -> PlatformDevice -> ShowS
Prelude.Show, forall x. Rep PlatformDevice x -> PlatformDevice
forall x. PlatformDevice -> Rep PlatformDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlatformDevice x -> PlatformDevice
$cfrom :: forall x. PlatformDevice -> Rep PlatformDevice x
Prelude.Generic)
newPlatformDevice ::
Prelude.Text ->
PlatformDeviceType ->
PlatformDevice
newPlatformDevice :: Text -> PlatformDeviceType -> PlatformDevice
newPlatformDevice Text
pId_ PlatformDeviceType
pType_ =
PlatformDevice' {$sel:id:PlatformDevice' :: Text
id = Text
pId_, $sel:type':PlatformDevice' :: PlatformDeviceType
type' = PlatformDeviceType
pType_}
platformDevice_id :: Lens.Lens' PlatformDevice Prelude.Text
platformDevice_id :: Lens' PlatformDevice Text
platformDevice_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformDevice' {Text
id :: Text
$sel:id:PlatformDevice' :: PlatformDevice -> Text
id} -> Text
id) (\s :: PlatformDevice
s@PlatformDevice' {} Text
a -> PlatformDevice
s {$sel:id:PlatformDevice' :: Text
id = Text
a} :: PlatformDevice)
platformDevice_type :: Lens.Lens' PlatformDevice PlatformDeviceType
platformDevice_type :: Lens' PlatformDevice PlatformDeviceType
platformDevice_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformDevice' {PlatformDeviceType
type' :: PlatformDeviceType
$sel:type':PlatformDevice' :: PlatformDevice -> PlatformDeviceType
type'} -> PlatformDeviceType
type') (\s :: PlatformDevice
s@PlatformDevice' {} PlatformDeviceType
a -> PlatformDevice
s {$sel:type':PlatformDevice' :: PlatformDeviceType
type' = PlatformDeviceType
a} :: PlatformDevice)
instance Prelude.Hashable PlatformDevice where
hashWithSalt :: Int -> PlatformDevice -> Int
hashWithSalt Int
_salt PlatformDevice' {Text
PlatformDeviceType
type' :: PlatformDeviceType
id :: Text
$sel:type':PlatformDevice' :: PlatformDevice -> PlatformDeviceType
$sel:id:PlatformDevice' :: PlatformDevice -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PlatformDeviceType
type'
instance Prelude.NFData PlatformDevice where
rnf :: PlatformDevice -> ()
rnf PlatformDevice' {Text
PlatformDeviceType
type' :: PlatformDeviceType
id :: Text
$sel:type':PlatformDevice' :: PlatformDevice -> PlatformDeviceType
$sel:id:PlatformDevice' :: PlatformDevice -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PlatformDeviceType
type'
instance Data.ToJSON PlatformDevice where
toJSON :: PlatformDevice -> Value
toJSON PlatformDevice' {Text
PlatformDeviceType
type' :: PlatformDeviceType
id :: Text
$sel:type':PlatformDevice' :: PlatformDevice -> PlatformDeviceType
$sel:id:PlatformDevice' :: PlatformDevice -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id),
forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PlatformDeviceType
type')
]
)