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