{-# 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.TypedLinkFacetAttributeUpdate where
import Amazonka.CloudDirectory.Types.TypedLinkAttributeDefinition
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 TypedLinkFacetAttributeUpdate = TypedLinkFacetAttributeUpdate'
{
TypedLinkFacetAttributeUpdate -> TypedLinkAttributeDefinition
attribute :: TypedLinkAttributeDefinition,
TypedLinkFacetAttributeUpdate -> UpdateActionType
action :: UpdateActionType
}
deriving (TypedLinkFacetAttributeUpdate
-> TypedLinkFacetAttributeUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypedLinkFacetAttributeUpdate
-> TypedLinkFacetAttributeUpdate -> Bool
$c/= :: TypedLinkFacetAttributeUpdate
-> TypedLinkFacetAttributeUpdate -> Bool
== :: TypedLinkFacetAttributeUpdate
-> TypedLinkFacetAttributeUpdate -> Bool
$c== :: TypedLinkFacetAttributeUpdate
-> TypedLinkFacetAttributeUpdate -> Bool
Prelude.Eq, ReadPrec [TypedLinkFacetAttributeUpdate]
ReadPrec TypedLinkFacetAttributeUpdate
Int -> ReadS TypedLinkFacetAttributeUpdate
ReadS [TypedLinkFacetAttributeUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TypedLinkFacetAttributeUpdate]
$creadListPrec :: ReadPrec [TypedLinkFacetAttributeUpdate]
readPrec :: ReadPrec TypedLinkFacetAttributeUpdate
$creadPrec :: ReadPrec TypedLinkFacetAttributeUpdate
readList :: ReadS [TypedLinkFacetAttributeUpdate]
$creadList :: ReadS [TypedLinkFacetAttributeUpdate]
readsPrec :: Int -> ReadS TypedLinkFacetAttributeUpdate
$creadsPrec :: Int -> ReadS TypedLinkFacetAttributeUpdate
Prelude.Read, Int -> TypedLinkFacetAttributeUpdate -> ShowS
[TypedLinkFacetAttributeUpdate] -> ShowS
TypedLinkFacetAttributeUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypedLinkFacetAttributeUpdate] -> ShowS
$cshowList :: [TypedLinkFacetAttributeUpdate] -> ShowS
show :: TypedLinkFacetAttributeUpdate -> String
$cshow :: TypedLinkFacetAttributeUpdate -> String
showsPrec :: Int -> TypedLinkFacetAttributeUpdate -> ShowS
$cshowsPrec :: Int -> TypedLinkFacetAttributeUpdate -> ShowS
Prelude.Show, forall x.
Rep TypedLinkFacetAttributeUpdate x
-> TypedLinkFacetAttributeUpdate
forall x.
TypedLinkFacetAttributeUpdate
-> Rep TypedLinkFacetAttributeUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TypedLinkFacetAttributeUpdate x
-> TypedLinkFacetAttributeUpdate
$cfrom :: forall x.
TypedLinkFacetAttributeUpdate
-> Rep TypedLinkFacetAttributeUpdate x
Prelude.Generic)
newTypedLinkFacetAttributeUpdate ::
TypedLinkAttributeDefinition ->
UpdateActionType ->
TypedLinkFacetAttributeUpdate
newTypedLinkFacetAttributeUpdate :: TypedLinkAttributeDefinition
-> UpdateActionType -> TypedLinkFacetAttributeUpdate
newTypedLinkFacetAttributeUpdate TypedLinkAttributeDefinition
pAttribute_ UpdateActionType
pAction_ =
TypedLinkFacetAttributeUpdate'
{ $sel:attribute:TypedLinkFacetAttributeUpdate' :: TypedLinkAttributeDefinition
attribute =
TypedLinkAttributeDefinition
pAttribute_,
$sel:action:TypedLinkFacetAttributeUpdate' :: UpdateActionType
action = UpdateActionType
pAction_
}
typedLinkFacetAttributeUpdate_attribute :: Lens.Lens' TypedLinkFacetAttributeUpdate TypedLinkAttributeDefinition
typedLinkFacetAttributeUpdate_attribute :: Lens' TypedLinkFacetAttributeUpdate TypedLinkAttributeDefinition
typedLinkFacetAttributeUpdate_attribute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkFacetAttributeUpdate' {TypedLinkAttributeDefinition
attribute :: TypedLinkAttributeDefinition
$sel:attribute:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> TypedLinkAttributeDefinition
attribute} -> TypedLinkAttributeDefinition
attribute) (\s :: TypedLinkFacetAttributeUpdate
s@TypedLinkFacetAttributeUpdate' {} TypedLinkAttributeDefinition
a -> TypedLinkFacetAttributeUpdate
s {$sel:attribute:TypedLinkFacetAttributeUpdate' :: TypedLinkAttributeDefinition
attribute = TypedLinkAttributeDefinition
a} :: TypedLinkFacetAttributeUpdate)
typedLinkFacetAttributeUpdate_action :: Lens.Lens' TypedLinkFacetAttributeUpdate UpdateActionType
typedLinkFacetAttributeUpdate_action :: Lens' TypedLinkFacetAttributeUpdate UpdateActionType
typedLinkFacetAttributeUpdate_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypedLinkFacetAttributeUpdate' {UpdateActionType
action :: UpdateActionType
$sel:action:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> UpdateActionType
action} -> UpdateActionType
action) (\s :: TypedLinkFacetAttributeUpdate
s@TypedLinkFacetAttributeUpdate' {} UpdateActionType
a -> TypedLinkFacetAttributeUpdate
s {$sel:action:TypedLinkFacetAttributeUpdate' :: UpdateActionType
action = UpdateActionType
a} :: TypedLinkFacetAttributeUpdate)
instance
Prelude.Hashable
TypedLinkFacetAttributeUpdate
where
hashWithSalt :: Int -> TypedLinkFacetAttributeUpdate -> Int
hashWithSalt Int
_salt TypedLinkFacetAttributeUpdate' {TypedLinkAttributeDefinition
UpdateActionType
action :: UpdateActionType
attribute :: TypedLinkAttributeDefinition
$sel:action:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> UpdateActionType
$sel:attribute:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> TypedLinkAttributeDefinition
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TypedLinkAttributeDefinition
attribute
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UpdateActionType
action
instance Prelude.NFData TypedLinkFacetAttributeUpdate where
rnf :: TypedLinkFacetAttributeUpdate -> ()
rnf TypedLinkFacetAttributeUpdate' {TypedLinkAttributeDefinition
UpdateActionType
action :: UpdateActionType
attribute :: TypedLinkAttributeDefinition
$sel:action:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> UpdateActionType
$sel:attribute:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> TypedLinkAttributeDefinition
..} =
forall a. NFData a => a -> ()
Prelude.rnf TypedLinkAttributeDefinition
attribute
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UpdateActionType
action
instance Data.ToJSON TypedLinkFacetAttributeUpdate where
toJSON :: TypedLinkFacetAttributeUpdate -> Value
toJSON TypedLinkFacetAttributeUpdate' {TypedLinkAttributeDefinition
UpdateActionType
action :: UpdateActionType
attribute :: TypedLinkAttributeDefinition
$sel:action:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> UpdateActionType
$sel:attribute:TypedLinkFacetAttributeUpdate' :: TypedLinkFacetAttributeUpdate -> TypedLinkAttributeDefinition
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Attribute" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= TypedLinkAttributeDefinition
attribute),
forall a. a -> Maybe a
Prelude.Just (Key
"Action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UpdateActionType
action)
]
)