{-# 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.BatchDetachPolicy 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 BatchDetachPolicy = BatchDetachPolicy'
{
BatchDetachPolicy -> ObjectReference
policyReference :: ObjectReference,
BatchDetachPolicy -> ObjectReference
objectReference :: ObjectReference
}
deriving (BatchDetachPolicy -> BatchDetachPolicy -> Bool
(BatchDetachPolicy -> BatchDetachPolicy -> Bool)
-> (BatchDetachPolicy -> BatchDetachPolicy -> Bool)
-> Eq BatchDetachPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDetachPolicy -> BatchDetachPolicy -> Bool
$c/= :: BatchDetachPolicy -> BatchDetachPolicy -> Bool
== :: BatchDetachPolicy -> BatchDetachPolicy -> Bool
$c== :: BatchDetachPolicy -> BatchDetachPolicy -> Bool
Prelude.Eq, ReadPrec [BatchDetachPolicy]
ReadPrec BatchDetachPolicy
Int -> ReadS BatchDetachPolicy
ReadS [BatchDetachPolicy]
(Int -> ReadS BatchDetachPolicy)
-> ReadS [BatchDetachPolicy]
-> ReadPrec BatchDetachPolicy
-> ReadPrec [BatchDetachPolicy]
-> Read BatchDetachPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDetachPolicy]
$creadListPrec :: ReadPrec [BatchDetachPolicy]
readPrec :: ReadPrec BatchDetachPolicy
$creadPrec :: ReadPrec BatchDetachPolicy
readList :: ReadS [BatchDetachPolicy]
$creadList :: ReadS [BatchDetachPolicy]
readsPrec :: Int -> ReadS BatchDetachPolicy
$creadsPrec :: Int -> ReadS BatchDetachPolicy
Prelude.Read, Int -> BatchDetachPolicy -> ShowS
[BatchDetachPolicy] -> ShowS
BatchDetachPolicy -> String
(Int -> BatchDetachPolicy -> ShowS)
-> (BatchDetachPolicy -> String)
-> ([BatchDetachPolicy] -> ShowS)
-> Show BatchDetachPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDetachPolicy] -> ShowS
$cshowList :: [BatchDetachPolicy] -> ShowS
show :: BatchDetachPolicy -> String
$cshow :: BatchDetachPolicy -> String
showsPrec :: Int -> BatchDetachPolicy -> ShowS
$cshowsPrec :: Int -> BatchDetachPolicy -> ShowS
Prelude.Show, (forall x. BatchDetachPolicy -> Rep BatchDetachPolicy x)
-> (forall x. Rep BatchDetachPolicy x -> BatchDetachPolicy)
-> Generic BatchDetachPolicy
forall x. Rep BatchDetachPolicy x -> BatchDetachPolicy
forall x. BatchDetachPolicy -> Rep BatchDetachPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchDetachPolicy x -> BatchDetachPolicy
$cfrom :: forall x. BatchDetachPolicy -> Rep BatchDetachPolicy x
Prelude.Generic)
newBatchDetachPolicy ::
ObjectReference ->
ObjectReference ->
BatchDetachPolicy
newBatchDetachPolicy :: ObjectReference -> ObjectReference -> BatchDetachPolicy
newBatchDetachPolicy
ObjectReference
pPolicyReference_
ObjectReference
pObjectReference_ =
BatchDetachPolicy' :: ObjectReference -> ObjectReference -> BatchDetachPolicy
BatchDetachPolicy'
{ $sel:policyReference:BatchDetachPolicy' :: ObjectReference
policyReference =
ObjectReference
pPolicyReference_,
$sel:objectReference:BatchDetachPolicy' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
}
batchDetachPolicy_policyReference :: Lens.Lens' BatchDetachPolicy ObjectReference
batchDetachPolicy_policyReference :: (ObjectReference -> f ObjectReference)
-> BatchDetachPolicy -> f BatchDetachPolicy
batchDetachPolicy_policyReference = (BatchDetachPolicy -> ObjectReference)
-> (BatchDetachPolicy -> ObjectReference -> BatchDetachPolicy)
-> Lens
BatchDetachPolicy BatchDetachPolicy ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetachPolicy' {ObjectReference
policyReference :: ObjectReference
$sel:policyReference:BatchDetachPolicy' :: BatchDetachPolicy -> ObjectReference
policyReference} -> ObjectReference
policyReference) (\s :: BatchDetachPolicy
s@BatchDetachPolicy' {} ObjectReference
a -> BatchDetachPolicy
s {$sel:policyReference:BatchDetachPolicy' :: ObjectReference
policyReference = ObjectReference
a} :: BatchDetachPolicy)
batchDetachPolicy_objectReference :: Lens.Lens' BatchDetachPolicy ObjectReference
batchDetachPolicy_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchDetachPolicy -> f BatchDetachPolicy
batchDetachPolicy_objectReference = (BatchDetachPolicy -> ObjectReference)
-> (BatchDetachPolicy -> ObjectReference -> BatchDetachPolicy)
-> Lens
BatchDetachPolicy BatchDetachPolicy ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDetachPolicy' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchDetachPolicy' :: BatchDetachPolicy -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchDetachPolicy
s@BatchDetachPolicy' {} ObjectReference
a -> BatchDetachPolicy
s {$sel:objectReference:BatchDetachPolicy' :: ObjectReference
objectReference = ObjectReference
a} :: BatchDetachPolicy)
instance Prelude.Hashable BatchDetachPolicy
instance Prelude.NFData BatchDetachPolicy
instance Core.ToJSON BatchDetachPolicy where
toJSON :: BatchDetachPolicy -> Value
toJSON BatchDetachPolicy' {ObjectReference
objectReference :: ObjectReference
policyReference :: ObjectReference
$sel:objectReference:BatchDetachPolicy' :: BatchDetachPolicy -> ObjectReference
$sel:policyReference:BatchDetachPolicy' :: BatchDetachPolicy -> 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
"PolicyReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
policyReference),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ObjectReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
objectReference)
]
)