{-# 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.BatchAttachToIndex where
import Amazonka.CloudDirectory.Types.ObjectReference
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchAttachToIndex = BatchAttachToIndex'
{
BatchAttachToIndex -> ObjectReference
indexReference :: ObjectReference,
BatchAttachToIndex -> ObjectReference
targetReference :: ObjectReference
}
deriving (BatchAttachToIndex -> BatchAttachToIndex -> Bool
(BatchAttachToIndex -> BatchAttachToIndex -> Bool)
-> (BatchAttachToIndex -> BatchAttachToIndex -> Bool)
-> Eq BatchAttachToIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAttachToIndex -> BatchAttachToIndex -> Bool
$c/= :: BatchAttachToIndex -> BatchAttachToIndex -> Bool
== :: BatchAttachToIndex -> BatchAttachToIndex -> Bool
$c== :: BatchAttachToIndex -> BatchAttachToIndex -> Bool
Prelude.Eq, ReadPrec [BatchAttachToIndex]
ReadPrec BatchAttachToIndex
Int -> ReadS BatchAttachToIndex
ReadS [BatchAttachToIndex]
(Int -> ReadS BatchAttachToIndex)
-> ReadS [BatchAttachToIndex]
-> ReadPrec BatchAttachToIndex
-> ReadPrec [BatchAttachToIndex]
-> Read BatchAttachToIndex
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAttachToIndex]
$creadListPrec :: ReadPrec [BatchAttachToIndex]
readPrec :: ReadPrec BatchAttachToIndex
$creadPrec :: ReadPrec BatchAttachToIndex
readList :: ReadS [BatchAttachToIndex]
$creadList :: ReadS [BatchAttachToIndex]
readsPrec :: Int -> ReadS BatchAttachToIndex
$creadsPrec :: Int -> ReadS BatchAttachToIndex
Prelude.Read, Int -> BatchAttachToIndex -> ShowS
[BatchAttachToIndex] -> ShowS
BatchAttachToIndex -> String
(Int -> BatchAttachToIndex -> ShowS)
-> (BatchAttachToIndex -> String)
-> ([BatchAttachToIndex] -> ShowS)
-> Show BatchAttachToIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAttachToIndex] -> ShowS
$cshowList :: [BatchAttachToIndex] -> ShowS
show :: BatchAttachToIndex -> String
$cshow :: BatchAttachToIndex -> String
showsPrec :: Int -> BatchAttachToIndex -> ShowS
$cshowsPrec :: Int -> BatchAttachToIndex -> ShowS
Prelude.Show, (forall x. BatchAttachToIndex -> Rep BatchAttachToIndex x)
-> (forall x. Rep BatchAttachToIndex x -> BatchAttachToIndex)
-> Generic BatchAttachToIndex
forall x. Rep BatchAttachToIndex x -> BatchAttachToIndex
forall x. BatchAttachToIndex -> Rep BatchAttachToIndex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchAttachToIndex x -> BatchAttachToIndex
$cfrom :: forall x. BatchAttachToIndex -> Rep BatchAttachToIndex x
Prelude.Generic)
newBatchAttachToIndex ::
ObjectReference ->
ObjectReference ->
BatchAttachToIndex
newBatchAttachToIndex :: ObjectReference -> ObjectReference -> BatchAttachToIndex
newBatchAttachToIndex
ObjectReference
pIndexReference_
ObjectReference
pTargetReference_ =
BatchAttachToIndex' :: ObjectReference -> ObjectReference -> BatchAttachToIndex
BatchAttachToIndex'
{ $sel:indexReference:BatchAttachToIndex' :: ObjectReference
indexReference =
ObjectReference
pIndexReference_,
$sel:targetReference:BatchAttachToIndex' :: ObjectReference
targetReference = ObjectReference
pTargetReference_
}
batchAttachToIndex_indexReference :: Lens.Lens' BatchAttachToIndex ObjectReference
batchAttachToIndex_indexReference :: (ObjectReference -> f ObjectReference)
-> BatchAttachToIndex -> f BatchAttachToIndex
batchAttachToIndex_indexReference = (BatchAttachToIndex -> ObjectReference)
-> (BatchAttachToIndex -> ObjectReference -> BatchAttachToIndex)
-> Lens
BatchAttachToIndex
BatchAttachToIndex
ObjectReference
ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachToIndex' {ObjectReference
indexReference :: ObjectReference
$sel:indexReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
indexReference} -> ObjectReference
indexReference) (\s :: BatchAttachToIndex
s@BatchAttachToIndex' {} ObjectReference
a -> BatchAttachToIndex
s {$sel:indexReference:BatchAttachToIndex' :: ObjectReference
indexReference = ObjectReference
a} :: BatchAttachToIndex)
batchAttachToIndex_targetReference :: Lens.Lens' BatchAttachToIndex ObjectReference
batchAttachToIndex_targetReference :: (ObjectReference -> f ObjectReference)
-> BatchAttachToIndex -> f BatchAttachToIndex
batchAttachToIndex_targetReference = (BatchAttachToIndex -> ObjectReference)
-> (BatchAttachToIndex -> ObjectReference -> BatchAttachToIndex)
-> Lens
BatchAttachToIndex
BatchAttachToIndex
ObjectReference
ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachToIndex' {ObjectReference
targetReference :: ObjectReference
$sel:targetReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
targetReference} -> ObjectReference
targetReference) (\s :: BatchAttachToIndex
s@BatchAttachToIndex' {} ObjectReference
a -> BatchAttachToIndex
s {$sel:targetReference:BatchAttachToIndex' :: ObjectReference
targetReference = ObjectReference
a} :: BatchAttachToIndex)
instance Prelude.Hashable BatchAttachToIndex
instance Prelude.NFData BatchAttachToIndex
instance Core.ToJSON BatchAttachToIndex where
toJSON :: BatchAttachToIndex -> Value
toJSON BatchAttachToIndex' {ObjectReference
targetReference :: ObjectReference
indexReference :: ObjectReference
$sel:targetReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
$sel:indexReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
..} =
[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
"IndexReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
indexReference),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"TargetReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
targetReference)
]
)