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