{-# 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.BatchAttachObject 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 BatchAttachObject = BatchAttachObject'
{
BatchAttachObject -> ObjectReference
parentReference :: ObjectReference,
BatchAttachObject -> ObjectReference
childReference :: ObjectReference,
BatchAttachObject -> Text
linkName :: Prelude.Text
}
deriving (BatchAttachObject -> BatchAttachObject -> Bool
(BatchAttachObject -> BatchAttachObject -> Bool)
-> (BatchAttachObject -> BatchAttachObject -> Bool)
-> Eq BatchAttachObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchAttachObject -> BatchAttachObject -> Bool
$c/= :: BatchAttachObject -> BatchAttachObject -> Bool
== :: BatchAttachObject -> BatchAttachObject -> Bool
$c== :: BatchAttachObject -> BatchAttachObject -> Bool
Prelude.Eq, ReadPrec [BatchAttachObject]
ReadPrec BatchAttachObject
Int -> ReadS BatchAttachObject
ReadS [BatchAttachObject]
(Int -> ReadS BatchAttachObject)
-> ReadS [BatchAttachObject]
-> ReadPrec BatchAttachObject
-> ReadPrec [BatchAttachObject]
-> Read BatchAttachObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchAttachObject]
$creadListPrec :: ReadPrec [BatchAttachObject]
readPrec :: ReadPrec BatchAttachObject
$creadPrec :: ReadPrec BatchAttachObject
readList :: ReadS [BatchAttachObject]
$creadList :: ReadS [BatchAttachObject]
readsPrec :: Int -> ReadS BatchAttachObject
$creadsPrec :: Int -> ReadS BatchAttachObject
Prelude.Read, Int -> BatchAttachObject -> ShowS
[BatchAttachObject] -> ShowS
BatchAttachObject -> String
(Int -> BatchAttachObject -> ShowS)
-> (BatchAttachObject -> String)
-> ([BatchAttachObject] -> ShowS)
-> Show BatchAttachObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchAttachObject] -> ShowS
$cshowList :: [BatchAttachObject] -> ShowS
show :: BatchAttachObject -> String
$cshow :: BatchAttachObject -> String
showsPrec :: Int -> BatchAttachObject -> ShowS
$cshowsPrec :: Int -> BatchAttachObject -> ShowS
Prelude.Show, (forall x. BatchAttachObject -> Rep BatchAttachObject x)
-> (forall x. Rep BatchAttachObject x -> BatchAttachObject)
-> Generic BatchAttachObject
forall x. Rep BatchAttachObject x -> BatchAttachObject
forall x. BatchAttachObject -> Rep BatchAttachObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchAttachObject x -> BatchAttachObject
$cfrom :: forall x. BatchAttachObject -> Rep BatchAttachObject x
Prelude.Generic)
newBatchAttachObject ::
ObjectReference ->
ObjectReference ->
Prelude.Text ->
BatchAttachObject
newBatchAttachObject :: ObjectReference -> ObjectReference -> Text -> BatchAttachObject
newBatchAttachObject
ObjectReference
pParentReference_
ObjectReference
pChildReference_
Text
pLinkName_ =
BatchAttachObject' :: ObjectReference -> ObjectReference -> Text -> BatchAttachObject
BatchAttachObject'
{ $sel:parentReference:BatchAttachObject' :: ObjectReference
parentReference =
ObjectReference
pParentReference_,
$sel:childReference:BatchAttachObject' :: ObjectReference
childReference = ObjectReference
pChildReference_,
$sel:linkName:BatchAttachObject' :: Text
linkName = Text
pLinkName_
}
batchAttachObject_parentReference :: Lens.Lens' BatchAttachObject ObjectReference
batchAttachObject_parentReference :: (ObjectReference -> f ObjectReference)
-> BatchAttachObject -> f BatchAttachObject
batchAttachObject_parentReference = (BatchAttachObject -> ObjectReference)
-> (BatchAttachObject -> ObjectReference -> BatchAttachObject)
-> Lens
BatchAttachObject BatchAttachObject ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachObject' {ObjectReference
parentReference :: ObjectReference
$sel:parentReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
parentReference} -> ObjectReference
parentReference) (\s :: BatchAttachObject
s@BatchAttachObject' {} ObjectReference
a -> BatchAttachObject
s {$sel:parentReference:BatchAttachObject' :: ObjectReference
parentReference = ObjectReference
a} :: BatchAttachObject)
batchAttachObject_childReference :: Lens.Lens' BatchAttachObject ObjectReference
batchAttachObject_childReference :: (ObjectReference -> f ObjectReference)
-> BatchAttachObject -> f BatchAttachObject
batchAttachObject_childReference = (BatchAttachObject -> ObjectReference)
-> (BatchAttachObject -> ObjectReference -> BatchAttachObject)
-> Lens
BatchAttachObject BatchAttachObject ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachObject' {ObjectReference
childReference :: ObjectReference
$sel:childReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
childReference} -> ObjectReference
childReference) (\s :: BatchAttachObject
s@BatchAttachObject' {} ObjectReference
a -> BatchAttachObject
s {$sel:childReference:BatchAttachObject' :: ObjectReference
childReference = ObjectReference
a} :: BatchAttachObject)
batchAttachObject_linkName :: Lens.Lens' BatchAttachObject Prelude.Text
batchAttachObject_linkName :: (Text -> f Text) -> BatchAttachObject -> f BatchAttachObject
batchAttachObject_linkName = (BatchAttachObject -> Text)
-> (BatchAttachObject -> Text -> BatchAttachObject)
-> Lens BatchAttachObject BatchAttachObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchAttachObject' {Text
linkName :: Text
$sel:linkName:BatchAttachObject' :: BatchAttachObject -> Text
linkName} -> Text
linkName) (\s :: BatchAttachObject
s@BatchAttachObject' {} Text
a -> BatchAttachObject
s {$sel:linkName:BatchAttachObject' :: Text
linkName = Text
a} :: BatchAttachObject)
instance Prelude.Hashable BatchAttachObject
instance Prelude.NFData BatchAttachObject
instance Core.ToJSON BatchAttachObject where
toJSON :: BatchAttachObject -> Value
toJSON BatchAttachObject' {Text
ObjectReference
linkName :: Text
childReference :: ObjectReference
parentReference :: ObjectReference
$sel:linkName:BatchAttachObject' :: BatchAttachObject -> Text
$sel:childReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
$sel:parentReference:BatchAttachObject' :: BatchAttachObject -> 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
"ParentReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
parentReference),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ChildReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
childReference),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LinkName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
linkName)
]
)