{-# 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.BatchUpdateLinkAttributes where
import Amazonka.CloudDirectory.Types.LinkAttributeUpdate
import Amazonka.CloudDirectory.Types.TypedLinkSpecifier
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchUpdateLinkAttributes = BatchUpdateLinkAttributes'
{
BatchUpdateLinkAttributes -> TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier,
BatchUpdateLinkAttributes -> [LinkAttributeUpdate]
attributeUpdates :: [LinkAttributeUpdate]
}
deriving (BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool
(BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool)
-> (BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool)
-> Eq BatchUpdateLinkAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool
$c/= :: BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool
== :: BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool
$c== :: BatchUpdateLinkAttributes -> BatchUpdateLinkAttributes -> Bool
Prelude.Eq, ReadPrec [BatchUpdateLinkAttributes]
ReadPrec BatchUpdateLinkAttributes
Int -> ReadS BatchUpdateLinkAttributes
ReadS [BatchUpdateLinkAttributes]
(Int -> ReadS BatchUpdateLinkAttributes)
-> ReadS [BatchUpdateLinkAttributes]
-> ReadPrec BatchUpdateLinkAttributes
-> ReadPrec [BatchUpdateLinkAttributes]
-> Read BatchUpdateLinkAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdateLinkAttributes]
$creadListPrec :: ReadPrec [BatchUpdateLinkAttributes]
readPrec :: ReadPrec BatchUpdateLinkAttributes
$creadPrec :: ReadPrec BatchUpdateLinkAttributes
readList :: ReadS [BatchUpdateLinkAttributes]
$creadList :: ReadS [BatchUpdateLinkAttributes]
readsPrec :: Int -> ReadS BatchUpdateLinkAttributes
$creadsPrec :: Int -> ReadS BatchUpdateLinkAttributes
Prelude.Read, Int -> BatchUpdateLinkAttributes -> ShowS
[BatchUpdateLinkAttributes] -> ShowS
BatchUpdateLinkAttributes -> String
(Int -> BatchUpdateLinkAttributes -> ShowS)
-> (BatchUpdateLinkAttributes -> String)
-> ([BatchUpdateLinkAttributes] -> ShowS)
-> Show BatchUpdateLinkAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdateLinkAttributes] -> ShowS
$cshowList :: [BatchUpdateLinkAttributes] -> ShowS
show :: BatchUpdateLinkAttributes -> String
$cshow :: BatchUpdateLinkAttributes -> String
showsPrec :: Int -> BatchUpdateLinkAttributes -> ShowS
$cshowsPrec :: Int -> BatchUpdateLinkAttributes -> ShowS
Prelude.Show, (forall x.
BatchUpdateLinkAttributes -> Rep BatchUpdateLinkAttributes x)
-> (forall x.
Rep BatchUpdateLinkAttributes x -> BatchUpdateLinkAttributes)
-> Generic BatchUpdateLinkAttributes
forall x.
Rep BatchUpdateLinkAttributes x -> BatchUpdateLinkAttributes
forall x.
BatchUpdateLinkAttributes -> Rep BatchUpdateLinkAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchUpdateLinkAttributes x -> BatchUpdateLinkAttributes
$cfrom :: forall x.
BatchUpdateLinkAttributes -> Rep BatchUpdateLinkAttributes x
Prelude.Generic)
newBatchUpdateLinkAttributes ::
TypedLinkSpecifier ->
BatchUpdateLinkAttributes
newBatchUpdateLinkAttributes :: TypedLinkSpecifier -> BatchUpdateLinkAttributes
newBatchUpdateLinkAttributes TypedLinkSpecifier
pTypedLinkSpecifier_ =
BatchUpdateLinkAttributes' :: TypedLinkSpecifier
-> [LinkAttributeUpdate] -> BatchUpdateLinkAttributes
BatchUpdateLinkAttributes'
{ $sel:typedLinkSpecifier:BatchUpdateLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier =
TypedLinkSpecifier
pTypedLinkSpecifier_,
$sel:attributeUpdates:BatchUpdateLinkAttributes' :: [LinkAttributeUpdate]
attributeUpdates = [LinkAttributeUpdate]
forall a. Monoid a => a
Prelude.mempty
}
batchUpdateLinkAttributes_typedLinkSpecifier :: Lens.Lens' BatchUpdateLinkAttributes TypedLinkSpecifier
batchUpdateLinkAttributes_typedLinkSpecifier :: (TypedLinkSpecifier -> f TypedLinkSpecifier)
-> BatchUpdateLinkAttributes -> f BatchUpdateLinkAttributes
batchUpdateLinkAttributes_typedLinkSpecifier = (BatchUpdateLinkAttributes -> TypedLinkSpecifier)
-> (BatchUpdateLinkAttributes
-> TypedLinkSpecifier -> BatchUpdateLinkAttributes)
-> Lens
BatchUpdateLinkAttributes
BatchUpdateLinkAttributes
TypedLinkSpecifier
TypedLinkSpecifier
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateLinkAttributes' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:BatchUpdateLinkAttributes' :: BatchUpdateLinkAttributes -> TypedLinkSpecifier
typedLinkSpecifier} -> TypedLinkSpecifier
typedLinkSpecifier) (\s :: BatchUpdateLinkAttributes
s@BatchUpdateLinkAttributes' {} TypedLinkSpecifier
a -> BatchUpdateLinkAttributes
s {$sel:typedLinkSpecifier:BatchUpdateLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
a} :: BatchUpdateLinkAttributes)
batchUpdateLinkAttributes_attributeUpdates :: Lens.Lens' BatchUpdateLinkAttributes [LinkAttributeUpdate]
batchUpdateLinkAttributes_attributeUpdates :: ([LinkAttributeUpdate] -> f [LinkAttributeUpdate])
-> BatchUpdateLinkAttributes -> f BatchUpdateLinkAttributes
batchUpdateLinkAttributes_attributeUpdates = (BatchUpdateLinkAttributes -> [LinkAttributeUpdate])
-> (BatchUpdateLinkAttributes
-> [LinkAttributeUpdate] -> BatchUpdateLinkAttributes)
-> Lens
BatchUpdateLinkAttributes
BatchUpdateLinkAttributes
[LinkAttributeUpdate]
[LinkAttributeUpdate]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateLinkAttributes' {[LinkAttributeUpdate]
attributeUpdates :: [LinkAttributeUpdate]
$sel:attributeUpdates:BatchUpdateLinkAttributes' :: BatchUpdateLinkAttributes -> [LinkAttributeUpdate]
attributeUpdates} -> [LinkAttributeUpdate]
attributeUpdates) (\s :: BatchUpdateLinkAttributes
s@BatchUpdateLinkAttributes' {} [LinkAttributeUpdate]
a -> BatchUpdateLinkAttributes
s {$sel:attributeUpdates:BatchUpdateLinkAttributes' :: [LinkAttributeUpdate]
attributeUpdates = [LinkAttributeUpdate]
a} :: BatchUpdateLinkAttributes) (([LinkAttributeUpdate] -> f [LinkAttributeUpdate])
-> BatchUpdateLinkAttributes -> f BatchUpdateLinkAttributes)
-> (([LinkAttributeUpdate] -> f [LinkAttributeUpdate])
-> [LinkAttributeUpdate] -> f [LinkAttributeUpdate])
-> ([LinkAttributeUpdate] -> f [LinkAttributeUpdate])
-> BatchUpdateLinkAttributes
-> f BatchUpdateLinkAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([LinkAttributeUpdate] -> f [LinkAttributeUpdate])
-> [LinkAttributeUpdate] -> f [LinkAttributeUpdate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable BatchUpdateLinkAttributes
instance Prelude.NFData BatchUpdateLinkAttributes
instance Core.ToJSON BatchUpdateLinkAttributes where
toJSON :: BatchUpdateLinkAttributes -> Value
toJSON BatchUpdateLinkAttributes' {[LinkAttributeUpdate]
TypedLinkSpecifier
attributeUpdates :: [LinkAttributeUpdate]
typedLinkSpecifier :: TypedLinkSpecifier
$sel:attributeUpdates:BatchUpdateLinkAttributes' :: BatchUpdateLinkAttributes -> [LinkAttributeUpdate]
$sel:typedLinkSpecifier:BatchUpdateLinkAttributes' :: BatchUpdateLinkAttributes -> TypedLinkSpecifier
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"TypedLinkSpecifier" Text -> TypedLinkSpecifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TypedLinkSpecifier
typedLinkSpecifier),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AttributeUpdates" Text -> [LinkAttributeUpdate] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [LinkAttributeUpdate]
attributeUpdates)
]
)