{-# 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.DirectoryService.Types.UnshareTarget where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types.TargetType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UnshareTarget = UnshareTarget'
{
UnshareTarget -> Text
id :: Prelude.Text,
UnshareTarget -> TargetType
type' :: TargetType
}
deriving (UnshareTarget -> UnshareTarget -> Bool
(UnshareTarget -> UnshareTarget -> Bool)
-> (UnshareTarget -> UnshareTarget -> Bool) -> Eq UnshareTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnshareTarget -> UnshareTarget -> Bool
$c/= :: UnshareTarget -> UnshareTarget -> Bool
== :: UnshareTarget -> UnshareTarget -> Bool
$c== :: UnshareTarget -> UnshareTarget -> Bool
Prelude.Eq, ReadPrec [UnshareTarget]
ReadPrec UnshareTarget
Int -> ReadS UnshareTarget
ReadS [UnshareTarget]
(Int -> ReadS UnshareTarget)
-> ReadS [UnshareTarget]
-> ReadPrec UnshareTarget
-> ReadPrec [UnshareTarget]
-> Read UnshareTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnshareTarget]
$creadListPrec :: ReadPrec [UnshareTarget]
readPrec :: ReadPrec UnshareTarget
$creadPrec :: ReadPrec UnshareTarget
readList :: ReadS [UnshareTarget]
$creadList :: ReadS [UnshareTarget]
readsPrec :: Int -> ReadS UnshareTarget
$creadsPrec :: Int -> ReadS UnshareTarget
Prelude.Read, Int -> UnshareTarget -> ShowS
[UnshareTarget] -> ShowS
UnshareTarget -> String
(Int -> UnshareTarget -> ShowS)
-> (UnshareTarget -> String)
-> ([UnshareTarget] -> ShowS)
-> Show UnshareTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnshareTarget] -> ShowS
$cshowList :: [UnshareTarget] -> ShowS
show :: UnshareTarget -> String
$cshow :: UnshareTarget -> String
showsPrec :: Int -> UnshareTarget -> ShowS
$cshowsPrec :: Int -> UnshareTarget -> ShowS
Prelude.Show, (forall x. UnshareTarget -> Rep UnshareTarget x)
-> (forall x. Rep UnshareTarget x -> UnshareTarget)
-> Generic UnshareTarget
forall x. Rep UnshareTarget x -> UnshareTarget
forall x. UnshareTarget -> Rep UnshareTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnshareTarget x -> UnshareTarget
$cfrom :: forall x. UnshareTarget -> Rep UnshareTarget x
Prelude.Generic)
newUnshareTarget ::
Prelude.Text ->
TargetType ->
UnshareTarget
newUnshareTarget :: Text -> TargetType -> UnshareTarget
newUnshareTarget Text
pId_ TargetType
pType_ =
UnshareTarget' :: Text -> TargetType -> UnshareTarget
UnshareTarget' {$sel:id:UnshareTarget' :: Text
id = Text
pId_, $sel:type':UnshareTarget' :: TargetType
type' = TargetType
pType_}
unshareTarget_id :: Lens.Lens' UnshareTarget Prelude.Text
unshareTarget_id :: (Text -> f Text) -> UnshareTarget -> f UnshareTarget
unshareTarget_id = (UnshareTarget -> Text)
-> (UnshareTarget -> Text -> UnshareTarget)
-> Lens UnshareTarget UnshareTarget Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnshareTarget' {Text
id :: Text
$sel:id:UnshareTarget' :: UnshareTarget -> Text
id} -> Text
id) (\s :: UnshareTarget
s@UnshareTarget' {} Text
a -> UnshareTarget
s {$sel:id:UnshareTarget' :: Text
id = Text
a} :: UnshareTarget)
unshareTarget_type :: Lens.Lens' UnshareTarget TargetType
unshareTarget_type :: (TargetType -> f TargetType) -> UnshareTarget -> f UnshareTarget
unshareTarget_type = (UnshareTarget -> TargetType)
-> (UnshareTarget -> TargetType -> UnshareTarget)
-> Lens UnshareTarget UnshareTarget TargetType TargetType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnshareTarget' {TargetType
type' :: TargetType
$sel:type':UnshareTarget' :: UnshareTarget -> TargetType
type'} -> TargetType
type') (\s :: UnshareTarget
s@UnshareTarget' {} TargetType
a -> UnshareTarget
s {$sel:type':UnshareTarget' :: TargetType
type' = TargetType
a} :: UnshareTarget)
instance Prelude.Hashable UnshareTarget
instance Prelude.NFData UnshareTarget
instance Core.ToJSON UnshareTarget where
toJSON :: UnshareTarget -> Value
toJSON UnshareTarget' {Text
TargetType
type' :: TargetType
id :: Text
$sel:type':UnshareTarget' :: UnshareTarget -> TargetType
$sel:id:UnshareTarget' :: UnshareTarget -> Text
..} =
[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
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> TargetType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TargetType
type')
]
)