{-# 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.BatchUpdateObjectAttributes where
import Amazonka.CloudDirectory.Types.ObjectAttributeUpdate
import Amazonka.CloudDirectory.Types.ObjectReference
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 BatchUpdateObjectAttributes = BatchUpdateObjectAttributes'
{
BatchUpdateObjectAttributes -> ObjectReference
objectReference :: ObjectReference,
BatchUpdateObjectAttributes -> [ObjectAttributeUpdate]
attributeUpdates :: [ObjectAttributeUpdate]
}
deriving (BatchUpdateObjectAttributes -> BatchUpdateObjectAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchUpdateObjectAttributes -> BatchUpdateObjectAttributes -> Bool
$c/= :: BatchUpdateObjectAttributes -> BatchUpdateObjectAttributes -> Bool
== :: BatchUpdateObjectAttributes -> BatchUpdateObjectAttributes -> Bool
$c== :: BatchUpdateObjectAttributes -> BatchUpdateObjectAttributes -> Bool
Prelude.Eq, ReadPrec [BatchUpdateObjectAttributes]
ReadPrec BatchUpdateObjectAttributes
Int -> ReadS BatchUpdateObjectAttributes
ReadS [BatchUpdateObjectAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchUpdateObjectAttributes]
$creadListPrec :: ReadPrec [BatchUpdateObjectAttributes]
readPrec :: ReadPrec BatchUpdateObjectAttributes
$creadPrec :: ReadPrec BatchUpdateObjectAttributes
readList :: ReadS [BatchUpdateObjectAttributes]
$creadList :: ReadS [BatchUpdateObjectAttributes]
readsPrec :: Int -> ReadS BatchUpdateObjectAttributes
$creadsPrec :: Int -> ReadS BatchUpdateObjectAttributes
Prelude.Read, Int -> BatchUpdateObjectAttributes -> ShowS
[BatchUpdateObjectAttributes] -> ShowS
BatchUpdateObjectAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchUpdateObjectAttributes] -> ShowS
$cshowList :: [BatchUpdateObjectAttributes] -> ShowS
show :: BatchUpdateObjectAttributes -> String
$cshow :: BatchUpdateObjectAttributes -> String
showsPrec :: Int -> BatchUpdateObjectAttributes -> ShowS
$cshowsPrec :: Int -> BatchUpdateObjectAttributes -> ShowS
Prelude.Show, forall x.
Rep BatchUpdateObjectAttributes x -> BatchUpdateObjectAttributes
forall x.
BatchUpdateObjectAttributes -> Rep BatchUpdateObjectAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchUpdateObjectAttributes x -> BatchUpdateObjectAttributes
$cfrom :: forall x.
BatchUpdateObjectAttributes -> Rep BatchUpdateObjectAttributes x
Prelude.Generic)
newBatchUpdateObjectAttributes ::
ObjectReference ->
BatchUpdateObjectAttributes
newBatchUpdateObjectAttributes :: ObjectReference -> BatchUpdateObjectAttributes
newBatchUpdateObjectAttributes ObjectReference
pObjectReference_ =
BatchUpdateObjectAttributes'
{ $sel:objectReference:BatchUpdateObjectAttributes' :: ObjectReference
objectReference =
ObjectReference
pObjectReference_,
$sel:attributeUpdates:BatchUpdateObjectAttributes' :: [ObjectAttributeUpdate]
attributeUpdates = forall a. Monoid a => a
Prelude.mempty
}
batchUpdateObjectAttributes_objectReference :: Lens.Lens' BatchUpdateObjectAttributes ObjectReference
batchUpdateObjectAttributes_objectReference :: Lens' BatchUpdateObjectAttributes ObjectReference
batchUpdateObjectAttributes_objectReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateObjectAttributes' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchUpdateObjectAttributes
s@BatchUpdateObjectAttributes' {} ObjectReference
a -> BatchUpdateObjectAttributes
s {$sel:objectReference:BatchUpdateObjectAttributes' :: ObjectReference
objectReference = ObjectReference
a} :: BatchUpdateObjectAttributes)
batchUpdateObjectAttributes_attributeUpdates :: Lens.Lens' BatchUpdateObjectAttributes [ObjectAttributeUpdate]
batchUpdateObjectAttributes_attributeUpdates :: Lens' BatchUpdateObjectAttributes [ObjectAttributeUpdate]
batchUpdateObjectAttributes_attributeUpdates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchUpdateObjectAttributes' {[ObjectAttributeUpdate]
attributeUpdates :: [ObjectAttributeUpdate]
$sel:attributeUpdates:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> [ObjectAttributeUpdate]
attributeUpdates} -> [ObjectAttributeUpdate]
attributeUpdates) (\s :: BatchUpdateObjectAttributes
s@BatchUpdateObjectAttributes' {} [ObjectAttributeUpdate]
a -> BatchUpdateObjectAttributes
s {$sel:attributeUpdates:BatchUpdateObjectAttributes' :: [ObjectAttributeUpdate]
attributeUpdates = [ObjectAttributeUpdate]
a} :: BatchUpdateObjectAttributes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable BatchUpdateObjectAttributes where
hashWithSalt :: Int -> BatchUpdateObjectAttributes -> Int
hashWithSalt Int
_salt BatchUpdateObjectAttributes' {[ObjectAttributeUpdate]
ObjectReference
attributeUpdates :: [ObjectAttributeUpdate]
objectReference :: ObjectReference
$sel:attributeUpdates:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> [ObjectAttributeUpdate]
$sel:objectReference:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> ObjectReference
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
objectReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ObjectAttributeUpdate]
attributeUpdates
instance Prelude.NFData BatchUpdateObjectAttributes where
rnf :: BatchUpdateObjectAttributes -> ()
rnf BatchUpdateObjectAttributes' {[ObjectAttributeUpdate]
ObjectReference
attributeUpdates :: [ObjectAttributeUpdate]
objectReference :: ObjectReference
$sel:attributeUpdates:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> [ObjectAttributeUpdate]
$sel:objectReference:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> ObjectReference
..} =
forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
objectReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ObjectAttributeUpdate]
attributeUpdates
instance Data.ToJSON BatchUpdateObjectAttributes where
toJSON :: BatchUpdateObjectAttributes -> Value
toJSON BatchUpdateObjectAttributes' {[ObjectAttributeUpdate]
ObjectReference
attributeUpdates :: [ObjectAttributeUpdate]
objectReference :: ObjectReference
$sel:attributeUpdates:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> [ObjectAttributeUpdate]
$sel:objectReference:BatchUpdateObjectAttributes' :: BatchUpdateObjectAttributes -> ObjectReference
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ObjectReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
objectReference),
forall a. a -> Maybe a
Prelude.Just
(Key
"AttributeUpdates" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [ObjectAttributeUpdate]
attributeUpdates)
]
)