{-# 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.CloudDirectory.Types.LinkAttributeUpdate where
import Amazonka.CloudDirectory.Types.AttributeKey
import Amazonka.CloudDirectory.Types.LinkAttributeAction
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 LinkAttributeUpdate = LinkAttributeUpdate'
{
LinkAttributeUpdate -> Maybe LinkAttributeAction
attributeAction :: Prelude.Maybe LinkAttributeAction,
LinkAttributeUpdate -> Maybe AttributeKey
attributeKey :: Prelude.Maybe AttributeKey
}
deriving (LinkAttributeUpdate -> LinkAttributeUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LinkAttributeUpdate -> LinkAttributeUpdate -> Bool
$c/= :: LinkAttributeUpdate -> LinkAttributeUpdate -> Bool
== :: LinkAttributeUpdate -> LinkAttributeUpdate -> Bool
$c== :: LinkAttributeUpdate -> LinkAttributeUpdate -> Bool
Prelude.Eq, ReadPrec [LinkAttributeUpdate]
ReadPrec LinkAttributeUpdate
Int -> ReadS LinkAttributeUpdate
ReadS [LinkAttributeUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LinkAttributeUpdate]
$creadListPrec :: ReadPrec [LinkAttributeUpdate]
readPrec :: ReadPrec LinkAttributeUpdate
$creadPrec :: ReadPrec LinkAttributeUpdate
readList :: ReadS [LinkAttributeUpdate]
$creadList :: ReadS [LinkAttributeUpdate]
readsPrec :: Int -> ReadS LinkAttributeUpdate
$creadsPrec :: Int -> ReadS LinkAttributeUpdate
Prelude.Read, Int -> LinkAttributeUpdate -> ShowS
[LinkAttributeUpdate] -> ShowS
LinkAttributeUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LinkAttributeUpdate] -> ShowS
$cshowList :: [LinkAttributeUpdate] -> ShowS
show :: LinkAttributeUpdate -> String
$cshow :: LinkAttributeUpdate -> String
showsPrec :: Int -> LinkAttributeUpdate -> ShowS
$cshowsPrec :: Int -> LinkAttributeUpdate -> ShowS
Prelude.Show, forall x. Rep LinkAttributeUpdate x -> LinkAttributeUpdate
forall x. LinkAttributeUpdate -> Rep LinkAttributeUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LinkAttributeUpdate x -> LinkAttributeUpdate
$cfrom :: forall x. LinkAttributeUpdate -> Rep LinkAttributeUpdate x
Prelude.Generic)
newLinkAttributeUpdate ::
LinkAttributeUpdate
newLinkAttributeUpdate :: LinkAttributeUpdate
newLinkAttributeUpdate =
LinkAttributeUpdate'
{ $sel:attributeAction:LinkAttributeUpdate' :: Maybe LinkAttributeAction
attributeAction =
forall a. Maybe a
Prelude.Nothing,
$sel:attributeKey:LinkAttributeUpdate' :: Maybe AttributeKey
attributeKey = forall a. Maybe a
Prelude.Nothing
}
linkAttributeUpdate_attributeAction :: Lens.Lens' LinkAttributeUpdate (Prelude.Maybe LinkAttributeAction)
linkAttributeUpdate_attributeAction :: Lens' LinkAttributeUpdate (Maybe LinkAttributeAction)
linkAttributeUpdate_attributeAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LinkAttributeUpdate' {Maybe LinkAttributeAction
attributeAction :: Maybe LinkAttributeAction
$sel:attributeAction:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe LinkAttributeAction
attributeAction} -> Maybe LinkAttributeAction
attributeAction) (\s :: LinkAttributeUpdate
s@LinkAttributeUpdate' {} Maybe LinkAttributeAction
a -> LinkAttributeUpdate
s {$sel:attributeAction:LinkAttributeUpdate' :: Maybe LinkAttributeAction
attributeAction = Maybe LinkAttributeAction
a} :: LinkAttributeUpdate)
linkAttributeUpdate_attributeKey :: Lens.Lens' LinkAttributeUpdate (Prelude.Maybe AttributeKey)
linkAttributeUpdate_attributeKey :: Lens' LinkAttributeUpdate (Maybe AttributeKey)
linkAttributeUpdate_attributeKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LinkAttributeUpdate' {Maybe AttributeKey
attributeKey :: Maybe AttributeKey
$sel:attributeKey:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe AttributeKey
attributeKey} -> Maybe AttributeKey
attributeKey) (\s :: LinkAttributeUpdate
s@LinkAttributeUpdate' {} Maybe AttributeKey
a -> LinkAttributeUpdate
s {$sel:attributeKey:LinkAttributeUpdate' :: Maybe AttributeKey
attributeKey = Maybe AttributeKey
a} :: LinkAttributeUpdate)
instance Prelude.Hashable LinkAttributeUpdate where
hashWithSalt :: Int -> LinkAttributeUpdate -> Int
hashWithSalt Int
_salt LinkAttributeUpdate' {Maybe AttributeKey
Maybe LinkAttributeAction
attributeKey :: Maybe AttributeKey
attributeAction :: Maybe LinkAttributeAction
$sel:attributeKey:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe AttributeKey
$sel:attributeAction:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe LinkAttributeAction
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LinkAttributeAction
attributeAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttributeKey
attributeKey
instance Prelude.NFData LinkAttributeUpdate where
rnf :: LinkAttributeUpdate -> ()
rnf LinkAttributeUpdate' {Maybe AttributeKey
Maybe LinkAttributeAction
attributeKey :: Maybe AttributeKey
attributeAction :: Maybe LinkAttributeAction
$sel:attributeKey:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe AttributeKey
$sel:attributeAction:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe LinkAttributeAction
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe LinkAttributeAction
attributeAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AttributeKey
attributeKey
instance Data.ToJSON LinkAttributeUpdate where
toJSON :: LinkAttributeUpdate -> Value
toJSON LinkAttributeUpdate' {Maybe AttributeKey
Maybe LinkAttributeAction
attributeKey :: Maybe AttributeKey
attributeAction :: Maybe LinkAttributeAction
$sel:attributeKey:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe AttributeKey
$sel:attributeAction:LinkAttributeUpdate' :: LinkAttributeUpdate -> Maybe LinkAttributeAction
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AttributeAction" 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 LinkAttributeAction
attributeAction,
(Key
"AttributeKey" 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 AttributeKey
attributeKey
]
)