{-# 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.Lens as Lens
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
(LinkAttributeAction -> LinkAttributeAction -> Bool)
-> (LinkAttributeAction -> LinkAttributeAction -> Bool)
-> Eq LinkAttributeAction
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]
(Int -> ReadS LinkAttributeAction)
-> ReadS [LinkAttributeAction]
-> ReadPrec LinkAttributeAction
-> ReadPrec [LinkAttributeAction]
-> Read 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
(Int -> LinkAttributeAction -> ShowS)
-> (LinkAttributeAction -> String)
-> ([LinkAttributeAction] -> ShowS)
-> Show LinkAttributeAction
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. LinkAttributeAction -> Rep LinkAttributeAction x)
-> (forall x. Rep LinkAttributeAction x -> LinkAttributeAction)
-> Generic LinkAttributeAction
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' :: Maybe UpdateActionType
-> Maybe TypedAttributeValue -> LinkAttributeAction
LinkAttributeAction'
{ $sel:attributeActionType:LinkAttributeAction' :: Maybe UpdateActionType
attributeActionType =
Maybe UpdateActionType
forall a. Maybe a
Prelude.Nothing,
$sel:attributeUpdateValue:LinkAttributeAction' :: Maybe TypedAttributeValue
attributeUpdateValue = Maybe TypedAttributeValue
forall a. Maybe a
Prelude.Nothing
}
linkAttributeAction_attributeActionType :: Lens.Lens' LinkAttributeAction (Prelude.Maybe UpdateActionType)
linkAttributeAction_attributeActionType :: (Maybe UpdateActionType -> f (Maybe UpdateActionType))
-> LinkAttributeAction -> f LinkAttributeAction
linkAttributeAction_attributeActionType = (LinkAttributeAction -> Maybe UpdateActionType)
-> (LinkAttributeAction
-> Maybe UpdateActionType -> LinkAttributeAction)
-> Lens
LinkAttributeAction
LinkAttributeAction
(Maybe UpdateActionType)
(Maybe UpdateActionType)
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 :: (Maybe TypedAttributeValue -> f (Maybe TypedAttributeValue))
-> LinkAttributeAction -> f LinkAttributeAction
linkAttributeAction_attributeUpdateValue = (LinkAttributeAction -> Maybe TypedAttributeValue)
-> (LinkAttributeAction
-> Maybe TypedAttributeValue -> LinkAttributeAction)
-> Lens
LinkAttributeAction
LinkAttributeAction
(Maybe TypedAttributeValue)
(Maybe TypedAttributeValue)
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
instance Prelude.NFData LinkAttributeAction
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AttributeActionType" Text -> UpdateActionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(UpdateActionType -> Pair) -> Maybe UpdateActionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateActionType
attributeActionType,
(Text
"AttributeUpdateValue" Text -> TypedAttributeValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TypedAttributeValue -> Pair)
-> Maybe TypedAttributeValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TypedAttributeValue
attributeUpdateValue
]
)