{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BatchAttachToIndex = BatchAttachToIndex'
{
BatchAttachToIndex -> ObjectReference
indexReference :: ObjectReference,
BatchAttachToIndex -> ObjectReference
targetReference :: ObjectReference
}
deriving (BatchAttachToIndex -> BatchAttachToIndex -> Bool
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]
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
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. 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'
{ $sel:indexReference:BatchAttachToIndex' :: ObjectReference
indexReference =
ObjectReference
pIndexReference_,
$sel:targetReference:BatchAttachToIndex' :: ObjectReference
targetReference = ObjectReference
pTargetReference_
}
batchAttachToIndex_indexReference :: Lens.Lens' BatchAttachToIndex ObjectReference
batchAttachToIndex_indexReference :: Lens' BatchAttachToIndex ObjectReference
batchAttachToIndex_indexReference = 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 :: Lens' BatchAttachToIndex ObjectReference
batchAttachToIndex_targetReference = 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 where
hashWithSalt :: Int -> BatchAttachToIndex -> Int
hashWithSalt Int
_salt BatchAttachToIndex' {ObjectReference
targetReference :: ObjectReference
indexReference :: ObjectReference
$sel:targetReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
$sel:indexReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
indexReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
targetReference
instance Prelude.NFData BatchAttachToIndex where
rnf :: BatchAttachToIndex -> ()
rnf BatchAttachToIndex' {ObjectReference
targetReference :: ObjectReference
indexReference :: ObjectReference
$sel:targetReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
$sel:indexReference:BatchAttachToIndex' :: BatchAttachToIndex -> ObjectReference
..} =
forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
indexReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
targetReference
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"IndexReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
indexReference),
forall a. a -> Maybe a
Prelude.Just
(Key
"TargetReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
targetReference)
]
)