{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudDirectory.DetachTypedLink
(
DetachTypedLink (..),
newDetachTypedLink,
detachTypedLink_directoryArn,
detachTypedLink_typedLinkSpecifier,
DetachTypedLinkResponse (..),
newDetachTypedLinkResponse,
)
where
import Amazonka.CloudDirectory.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DetachTypedLink = DetachTypedLink'
{
DetachTypedLink -> Text
directoryArn :: Prelude.Text,
DetachTypedLink -> TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
}
deriving (DetachTypedLink -> DetachTypedLink -> Bool
(DetachTypedLink -> DetachTypedLink -> Bool)
-> (DetachTypedLink -> DetachTypedLink -> Bool)
-> Eq DetachTypedLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachTypedLink -> DetachTypedLink -> Bool
$c/= :: DetachTypedLink -> DetachTypedLink -> Bool
== :: DetachTypedLink -> DetachTypedLink -> Bool
$c== :: DetachTypedLink -> DetachTypedLink -> Bool
Prelude.Eq, ReadPrec [DetachTypedLink]
ReadPrec DetachTypedLink
Int -> ReadS DetachTypedLink
ReadS [DetachTypedLink]
(Int -> ReadS DetachTypedLink)
-> ReadS [DetachTypedLink]
-> ReadPrec DetachTypedLink
-> ReadPrec [DetachTypedLink]
-> Read DetachTypedLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachTypedLink]
$creadListPrec :: ReadPrec [DetachTypedLink]
readPrec :: ReadPrec DetachTypedLink
$creadPrec :: ReadPrec DetachTypedLink
readList :: ReadS [DetachTypedLink]
$creadList :: ReadS [DetachTypedLink]
readsPrec :: Int -> ReadS DetachTypedLink
$creadsPrec :: Int -> ReadS DetachTypedLink
Prelude.Read, Int -> DetachTypedLink -> ShowS
[DetachTypedLink] -> ShowS
DetachTypedLink -> String
(Int -> DetachTypedLink -> ShowS)
-> (DetachTypedLink -> String)
-> ([DetachTypedLink] -> ShowS)
-> Show DetachTypedLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachTypedLink] -> ShowS
$cshowList :: [DetachTypedLink] -> ShowS
show :: DetachTypedLink -> String
$cshow :: DetachTypedLink -> String
showsPrec :: Int -> DetachTypedLink -> ShowS
$cshowsPrec :: Int -> DetachTypedLink -> ShowS
Prelude.Show, (forall x. DetachTypedLink -> Rep DetachTypedLink x)
-> (forall x. Rep DetachTypedLink x -> DetachTypedLink)
-> Generic DetachTypedLink
forall x. Rep DetachTypedLink x -> DetachTypedLink
forall x. DetachTypedLink -> Rep DetachTypedLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetachTypedLink x -> DetachTypedLink
$cfrom :: forall x. DetachTypedLink -> Rep DetachTypedLink x
Prelude.Generic)
newDetachTypedLink ::
Prelude.Text ->
TypedLinkSpecifier ->
DetachTypedLink
newDetachTypedLink :: Text -> TypedLinkSpecifier -> DetachTypedLink
newDetachTypedLink
Text
pDirectoryArn_
TypedLinkSpecifier
pTypedLinkSpecifier_ =
DetachTypedLink' :: Text -> TypedLinkSpecifier -> DetachTypedLink
DetachTypedLink'
{ $sel:directoryArn:DetachTypedLink' :: Text
directoryArn = Text
pDirectoryArn_,
$sel:typedLinkSpecifier:DetachTypedLink' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
pTypedLinkSpecifier_
}
detachTypedLink_directoryArn :: Lens.Lens' DetachTypedLink Prelude.Text
detachTypedLink_directoryArn :: (Text -> f Text) -> DetachTypedLink -> f DetachTypedLink
detachTypedLink_directoryArn = (DetachTypedLink -> Text)
-> (DetachTypedLink -> Text -> DetachTypedLink)
-> Lens DetachTypedLink DetachTypedLink Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachTypedLink' {Text
directoryArn :: Text
$sel:directoryArn:DetachTypedLink' :: DetachTypedLink -> Text
directoryArn} -> Text
directoryArn) (\s :: DetachTypedLink
s@DetachTypedLink' {} Text
a -> DetachTypedLink
s {$sel:directoryArn:DetachTypedLink' :: Text
directoryArn = Text
a} :: DetachTypedLink)
detachTypedLink_typedLinkSpecifier :: Lens.Lens' DetachTypedLink TypedLinkSpecifier
detachTypedLink_typedLinkSpecifier :: (TypedLinkSpecifier -> f TypedLinkSpecifier)
-> DetachTypedLink -> f DetachTypedLink
detachTypedLink_typedLinkSpecifier = (DetachTypedLink -> TypedLinkSpecifier)
-> (DetachTypedLink -> TypedLinkSpecifier -> DetachTypedLink)
-> Lens
DetachTypedLink
DetachTypedLink
TypedLinkSpecifier
TypedLinkSpecifier
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachTypedLink' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:DetachTypedLink' :: DetachTypedLink -> TypedLinkSpecifier
typedLinkSpecifier} -> TypedLinkSpecifier
typedLinkSpecifier) (\s :: DetachTypedLink
s@DetachTypedLink' {} TypedLinkSpecifier
a -> DetachTypedLink
s {$sel:typedLinkSpecifier:DetachTypedLink' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
a} :: DetachTypedLink)
instance Core.AWSRequest DetachTypedLink where
type
AWSResponse DetachTypedLink =
DetachTypedLinkResponse
request :: DetachTypedLink -> Request DetachTypedLink
request = Service -> DetachTypedLink -> Request DetachTypedLink
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DetachTypedLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetachTypedLink)))
response =
AWSResponse DetachTypedLink
-> Logger
-> Service
-> Proxy DetachTypedLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DetachTypedLink)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DetachTypedLink
DetachTypedLinkResponse
DetachTypedLinkResponse'
instance Prelude.Hashable DetachTypedLink
instance Prelude.NFData DetachTypedLink
instance Core.ToHeaders DetachTypedLink where
toHeaders :: DetachTypedLink -> [Header]
toHeaders DetachTypedLink' {Text
TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
directoryArn :: Text
$sel:typedLinkSpecifier:DetachTypedLink' :: DetachTypedLink -> TypedLinkSpecifier
$sel:directoryArn:DetachTypedLink' :: DetachTypedLink -> Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-data-partition" HeaderName -> Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Text
directoryArn]
instance Core.ToJSON DetachTypedLink where
toJSON :: DetachTypedLink -> Value
toJSON DetachTypedLink' {Text
TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
directoryArn :: Text
$sel:typedLinkSpecifier:DetachTypedLink' :: DetachTypedLink -> TypedLinkSpecifier
$sel:directoryArn:DetachTypedLink' :: DetachTypedLink -> 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
"TypedLinkSpecifier" Text -> TypedLinkSpecifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TypedLinkSpecifier
typedLinkSpecifier)
]
)
instance Core.ToPath DetachTypedLink where
toPath :: DetachTypedLink -> ByteString
toPath =
ByteString -> DetachTypedLink -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/amazonclouddirectory/2017-01-11/typedlink/detach"
instance Core.ToQuery DetachTypedLink where
toQuery :: DetachTypedLink -> QueryString
toQuery = QueryString -> DetachTypedLink -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DetachTypedLinkResponse = DetachTypedLinkResponse'
{
}
deriving (DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool
(DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool)
-> (DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool)
-> Eq DetachTypedLinkResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool
$c/= :: DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool
== :: DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool
$c== :: DetachTypedLinkResponse -> DetachTypedLinkResponse -> Bool
Prelude.Eq, ReadPrec [DetachTypedLinkResponse]
ReadPrec DetachTypedLinkResponse
Int -> ReadS DetachTypedLinkResponse
ReadS [DetachTypedLinkResponse]
(Int -> ReadS DetachTypedLinkResponse)
-> ReadS [DetachTypedLinkResponse]
-> ReadPrec DetachTypedLinkResponse
-> ReadPrec [DetachTypedLinkResponse]
-> Read DetachTypedLinkResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachTypedLinkResponse]
$creadListPrec :: ReadPrec [DetachTypedLinkResponse]
readPrec :: ReadPrec DetachTypedLinkResponse
$creadPrec :: ReadPrec DetachTypedLinkResponse
readList :: ReadS [DetachTypedLinkResponse]
$creadList :: ReadS [DetachTypedLinkResponse]
readsPrec :: Int -> ReadS DetachTypedLinkResponse
$creadsPrec :: Int -> ReadS DetachTypedLinkResponse
Prelude.Read, Int -> DetachTypedLinkResponse -> ShowS
[DetachTypedLinkResponse] -> ShowS
DetachTypedLinkResponse -> String
(Int -> DetachTypedLinkResponse -> ShowS)
-> (DetachTypedLinkResponse -> String)
-> ([DetachTypedLinkResponse] -> ShowS)
-> Show DetachTypedLinkResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachTypedLinkResponse] -> ShowS
$cshowList :: [DetachTypedLinkResponse] -> ShowS
show :: DetachTypedLinkResponse -> String
$cshow :: DetachTypedLinkResponse -> String
showsPrec :: Int -> DetachTypedLinkResponse -> ShowS
$cshowsPrec :: Int -> DetachTypedLinkResponse -> ShowS
Prelude.Show, (forall x.
DetachTypedLinkResponse -> Rep DetachTypedLinkResponse x)
-> (forall x.
Rep DetachTypedLinkResponse x -> DetachTypedLinkResponse)
-> Generic DetachTypedLinkResponse
forall x. Rep DetachTypedLinkResponse x -> DetachTypedLinkResponse
forall x. DetachTypedLinkResponse -> Rep DetachTypedLinkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetachTypedLinkResponse x -> DetachTypedLinkResponse
$cfrom :: forall x. DetachTypedLinkResponse -> Rep DetachTypedLinkResponse x
Prelude.Generic)
newDetachTypedLinkResponse ::
DetachTypedLinkResponse
newDetachTypedLinkResponse :: DetachTypedLinkResponse
newDetachTypedLinkResponse = DetachTypedLinkResponse
DetachTypedLinkResponse'
instance Prelude.NFData DetachTypedLinkResponse