{-# 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.Braket.Types.DeviceConfig 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 DeviceConfig = DeviceConfig'
{
DeviceConfig -> Text
device :: Prelude.Text
}
deriving (DeviceConfig -> DeviceConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceConfig -> DeviceConfig -> Bool
$c/= :: DeviceConfig -> DeviceConfig -> Bool
== :: DeviceConfig -> DeviceConfig -> Bool
$c== :: DeviceConfig -> DeviceConfig -> Bool
Prelude.Eq, ReadPrec [DeviceConfig]
ReadPrec DeviceConfig
Int -> ReadS DeviceConfig
ReadS [DeviceConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceConfig]
$creadListPrec :: ReadPrec [DeviceConfig]
readPrec :: ReadPrec DeviceConfig
$creadPrec :: ReadPrec DeviceConfig
readList :: ReadS [DeviceConfig]
$creadList :: ReadS [DeviceConfig]
readsPrec :: Int -> ReadS DeviceConfig
$creadsPrec :: Int -> ReadS DeviceConfig
Prelude.Read, Int -> DeviceConfig -> ShowS
[DeviceConfig] -> ShowS
DeviceConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceConfig] -> ShowS
$cshowList :: [DeviceConfig] -> ShowS
show :: DeviceConfig -> String
$cshow :: DeviceConfig -> String
showsPrec :: Int -> DeviceConfig -> ShowS
$cshowsPrec :: Int -> DeviceConfig -> ShowS
Prelude.Show, forall x. Rep DeviceConfig x -> DeviceConfig
forall x. DeviceConfig -> Rep DeviceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceConfig x -> DeviceConfig
$cfrom :: forall x. DeviceConfig -> Rep DeviceConfig x
Prelude.Generic)
newDeviceConfig ::
Prelude.Text ->
DeviceConfig
newDeviceConfig :: Text -> DeviceConfig
newDeviceConfig Text
pDevice_ =
DeviceConfig' {$sel:device:DeviceConfig' :: Text
device = Text
pDevice_}
deviceConfig_device :: Lens.Lens' DeviceConfig Prelude.Text
deviceConfig_device :: Lens' DeviceConfig Text
deviceConfig_device = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceConfig' {Text
device :: Text
$sel:device:DeviceConfig' :: DeviceConfig -> Text
device} -> Text
device) (\s :: DeviceConfig
s@DeviceConfig' {} Text
a -> DeviceConfig
s {$sel:device:DeviceConfig' :: Text
device = Text
a} :: DeviceConfig)
instance Data.FromJSON DeviceConfig where
parseJSON :: Value -> Parser DeviceConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeviceConfig"
( \Object
x ->
Text -> DeviceConfig
DeviceConfig' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"device")
)
instance Prelude.Hashable DeviceConfig where
hashWithSalt :: Int -> DeviceConfig -> Int
hashWithSalt Int
_salt DeviceConfig' {Text
device :: Text
$sel:device:DeviceConfig' :: DeviceConfig -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
device
instance Prelude.NFData DeviceConfig where
rnf :: DeviceConfig -> ()
rnf DeviceConfig' {Text
device :: Text
$sel:device:DeviceConfig' :: DeviceConfig -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
device
instance Data.ToJSON DeviceConfig where
toJSON :: DeviceConfig -> Value
toJSON DeviceConfig' {Text
device :: Text
$sel:device:DeviceConfig' :: DeviceConfig -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"device" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
device)]
)