{-# 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.BatchDetachObject 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 BatchDetachObject = BatchDetachObject'
{
BatchDetachObject -> Maybe Text
batchReferenceName :: Prelude.Maybe Prelude.Text,
BatchDetachObject -> ObjectReference
parentReference :: ObjectReference,
BatchDetachObject -> Text
linkName :: Prelude.Text
}
deriving (BatchDetachObject -> BatchDetachObject -> Bool
(BatchDetachObject -> BatchDetachObject -> Bool)
-> (BatchDetachObject -> BatchDetachObject -> Bool)
-> Eq BatchDetachObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetachObject -> BatchDetachObject -> Bool
$c/= :: BatchDetachObject -> BatchDetachObject -> Bool
== :: BatchDetachObject -> BatchDetachObject -> Bool
$c== :: BatchDetachObject -> BatchDetachObject -> Bool
Prelude.Eq, ReadPrec [BatchDetachObject]
ReadPrec BatchDetachObject
Int -> ReadS BatchDetachObject
ReadS [BatchDetachObject]
(Int -> ReadS BatchDetachObject)
-> ReadS [BatchDetachObject]
-> ReadPrec BatchDetachObject
-> ReadPrec [BatchDetachObject]
-> Read BatchDetachObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDetachObject]
$creadListPrec :: ReadPrec [BatchDetachObject]
readPrec :: ReadPrec BatchDetachObject
$creadPrec :: ReadPrec BatchDetachObject
readList :: ReadS [BatchDetachObject]
$creadList :: ReadS [BatchDetachObject]
readsPrec :: Int -> ReadS BatchDetachObject
$creadsPrec :: Int -> ReadS BatchDetachObject
Prelude.Read, Int -> BatchDetachObject -> ShowS
[BatchDetachObject] -> ShowS
BatchDetachObject -> String
(Int -> BatchDetachObject -> ShowS)
-> (BatchDetachObject -> String)
-> ([BatchDetachObject] -> ShowS)
-> Show BatchDetachObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetachObject] -> ShowS
$cshowList :: [BatchDetachObject] -> ShowS
show :: BatchDetachObject -> String
$cshow :: BatchDetachObject -> String
showsPrec :: Int -> BatchDetachObject -> ShowS
$cshowsPrec :: Int -> BatchDetachObject -> ShowS
Prelude.Show, (forall x. BatchDetachObject -> Rep BatchDetachObject x)
-> (forall x. Rep BatchDetachObject x -> BatchDetachObject)
-> Generic BatchDetachObject
forall x. Rep BatchDetachObject x -> BatchDetachObject
forall x. BatchDetachObject -> Rep BatchDetachObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDetachObject x -> BatchDetachObject
$cfrom :: forall x. BatchDetachObject -> Rep BatchDetachObject x
Prelude.Generic)
newBatchDetachObject ::
ObjectReference ->
Prelude.Text ->
BatchDetachObject
newBatchDetachObject :: ObjectReference -> Text -> BatchDetachObject
newBatchDetachObject ObjectReference
pParentReference_ Text
pLinkName_ =
BatchDetachObject' :: Maybe Text -> ObjectReference -> Text -> BatchDetachObject
BatchDetachObject'
{ $sel:batchReferenceName:BatchDetachObject' :: Maybe Text
batchReferenceName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parentReference:BatchDetachObject' :: ObjectReference
parentReference = ObjectReference
pParentReference_,
$sel:linkName:BatchDetachObject' :: Text
linkName = Text
pLinkName_
}
batchDetachObject_batchReferenceName :: Lens.Lens' BatchDetachObject (Prelude.Maybe Prelude.Text)
batchDetachObject_batchReferenceName :: (Maybe Text -> f (Maybe Text))
-> BatchDetachObject -> f BatchDetachObject
batchDetachObject_batchReferenceName = (BatchDetachObject -> Maybe Text)
-> (BatchDetachObject -> Maybe Text -> BatchDetachObject)
-> Lens
BatchDetachObject BatchDetachObject (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetachObject' {Maybe Text
batchReferenceName :: Maybe Text
$sel:batchReferenceName:BatchDetachObject' :: BatchDetachObject -> Maybe Text
batchReferenceName} -> Maybe Text
batchReferenceName) (\s :: BatchDetachObject
s@BatchDetachObject' {} Maybe Text
a -> BatchDetachObject
s {$sel:batchReferenceName:BatchDetachObject' :: Maybe Text
batchReferenceName = Maybe Text
a} :: BatchDetachObject)
batchDetachObject_parentReference :: Lens.Lens' BatchDetachObject ObjectReference
batchDetachObject_parentReference :: (ObjectReference -> f ObjectReference)
-> BatchDetachObject -> f BatchDetachObject
batchDetachObject_parentReference = (BatchDetachObject -> ObjectReference)
-> (BatchDetachObject -> ObjectReference -> BatchDetachObject)
-> Lens
BatchDetachObject BatchDetachObject ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetachObject' {ObjectReference
parentReference :: ObjectReference
$sel:parentReference:BatchDetachObject' :: BatchDetachObject -> ObjectReference
parentReference} -> ObjectReference
parentReference) (\s :: BatchDetachObject
s@BatchDetachObject' {} ObjectReference
a -> BatchDetachObject
s {$sel:parentReference:BatchDetachObject' :: ObjectReference
parentReference = ObjectReference
a} :: BatchDetachObject)
batchDetachObject_linkName :: Lens.Lens' BatchDetachObject Prelude.Text
batchDetachObject_linkName :: (Text -> f Text) -> BatchDetachObject -> f BatchDetachObject
batchDetachObject_linkName = (BatchDetachObject -> Text)
-> (BatchDetachObject -> Text -> BatchDetachObject)
-> Lens BatchDetachObject BatchDetachObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetachObject' {Text
linkName :: Text
$sel:linkName:BatchDetachObject' :: BatchDetachObject -> Text
linkName} -> Text
linkName) (\s :: BatchDetachObject
s@BatchDetachObject' {} Text
a -> BatchDetachObject
s {$sel:linkName:BatchDetachObject' :: Text
linkName = Text
a} :: BatchDetachObject)
instance Prelude.Hashable BatchDetachObject
instance Prelude.NFData BatchDetachObject
instance Core.ToJSON BatchDetachObject where
toJSON :: BatchDetachObject -> Value
toJSON BatchDetachObject' {Maybe Text
Text
ObjectReference
linkName :: Text
parentReference :: ObjectReference
batchReferenceName :: Maybe Text
$sel:linkName:BatchDetachObject' :: BatchDetachObject -> Text
$sel:parentReference:BatchDetachObject' :: BatchDetachObject -> ObjectReference
$sel:batchReferenceName:BatchDetachObject' :: BatchDetachObject -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"BatchReferenceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
batchReferenceName,
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
"LinkName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
linkName)
]
)