{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $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 :: Lens' BatchAttachObject ObjectReference
batchAttachObject_parentReference = 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 :: Lens' BatchAttachObject ObjectReference
batchAttachObject_childReference = 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 :: Lens' BatchAttachObject Text
batchAttachObject_linkName = 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 where
hashWithSalt :: Int -> BatchAttachObject -> Int
hashWithSalt Int
_salt BatchAttachObject' {Text
ObjectReference
linkName :: Text
childReference :: ObjectReference
parentReference :: ObjectReference
$sel:linkName:BatchAttachObject' :: BatchAttachObject -> Text
$sel:childReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
$sel:parentReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
parentReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
childReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
linkName
instance Prelude.NFData BatchAttachObject where
rnf :: BatchAttachObject -> ()
rnf BatchAttachObject' {Text
ObjectReference
linkName :: Text
childReference :: ObjectReference
parentReference :: ObjectReference
$sel:linkName:BatchAttachObject' :: BatchAttachObject -> Text
$sel:childReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
$sel:parentReference:BatchAttachObject' :: BatchAttachObject -> ObjectReference
..} =
forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
parentReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
childReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
linkName
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ParentReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
parentReference),
forall a. a -> Maybe a
Prelude.Just
(Key
"ChildReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
childReference),
forall a. a -> Maybe a
Prelude.Just (Key
"LinkName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
linkName)
]
)