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