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