{-# 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.OAM.DeleteLink
(
DeleteLink (..),
newDeleteLink,
deleteLink_identifier,
DeleteLinkResponse (..),
newDeleteLinkResponse,
deleteLinkResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteLink = DeleteLink'
{
DeleteLink -> Text
identifier :: Prelude.Text
}
deriving (DeleteLink -> DeleteLink -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLink -> DeleteLink -> Bool
$c/= :: DeleteLink -> DeleteLink -> Bool
== :: DeleteLink -> DeleteLink -> Bool
$c== :: DeleteLink -> DeleteLink -> Bool
Prelude.Eq, ReadPrec [DeleteLink]
ReadPrec DeleteLink
Int -> ReadS DeleteLink
ReadS [DeleteLink]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLink]
$creadListPrec :: ReadPrec [DeleteLink]
readPrec :: ReadPrec DeleteLink
$creadPrec :: ReadPrec DeleteLink
readList :: ReadS [DeleteLink]
$creadList :: ReadS [DeleteLink]
readsPrec :: Int -> ReadS DeleteLink
$creadsPrec :: Int -> ReadS DeleteLink
Prelude.Read, Int -> DeleteLink -> ShowS
[DeleteLink] -> ShowS
DeleteLink -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLink] -> ShowS
$cshowList :: [DeleteLink] -> ShowS
show :: DeleteLink -> String
$cshow :: DeleteLink -> String
showsPrec :: Int -> DeleteLink -> ShowS
$cshowsPrec :: Int -> DeleteLink -> ShowS
Prelude.Show, forall x. Rep DeleteLink x -> DeleteLink
forall x. DeleteLink -> Rep DeleteLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLink x -> DeleteLink
$cfrom :: forall x. DeleteLink -> Rep DeleteLink x
Prelude.Generic)
newDeleteLink ::
Prelude.Text ->
DeleteLink
newDeleteLink :: Text -> DeleteLink
newDeleteLink Text
pIdentifier_ =
DeleteLink' {$sel:identifier:DeleteLink' :: Text
identifier = Text
pIdentifier_}
deleteLink_identifier :: Lens.Lens' DeleteLink Prelude.Text
deleteLink_identifier :: Lens' DeleteLink Text
deleteLink_identifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLink' {Text
identifier :: Text
$sel:identifier:DeleteLink' :: DeleteLink -> Text
identifier} -> Text
identifier) (\s :: DeleteLink
s@DeleteLink' {} Text
a -> DeleteLink
s {$sel:identifier:DeleteLink' :: Text
identifier = Text
a} :: DeleteLink)
instance Core.AWSRequest DeleteLink where
type AWSResponse DeleteLink = DeleteLinkResponse
request :: (Service -> Service) -> DeleteLink -> Request DeleteLink
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteLink)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteLinkResponse
DeleteLinkResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteLink where
hashWithSalt :: Int -> DeleteLink -> Int
hashWithSalt Int
_salt DeleteLink' {Text
identifier :: Text
$sel:identifier:DeleteLink' :: DeleteLink -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identifier
instance Prelude.NFData DeleteLink where
rnf :: DeleteLink -> ()
rnf DeleteLink' {Text
identifier :: Text
$sel:identifier:DeleteLink' :: DeleteLink -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
identifier
instance Data.ToHeaders DeleteLink where
toHeaders :: DeleteLink -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteLink where
toJSON :: DeleteLink -> Value
toJSON DeleteLink' {Text
identifier :: Text
$sel:identifier:DeleteLink' :: DeleteLink -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Identifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
identifier)]
)
instance Data.ToPath DeleteLink where
toPath :: DeleteLink -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/DeleteLink"
instance Data.ToQuery DeleteLink where
toQuery :: DeleteLink -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteLinkResponse = DeleteLinkResponse'
{
DeleteLinkResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteLinkResponse -> DeleteLinkResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLinkResponse -> DeleteLinkResponse -> Bool
$c/= :: DeleteLinkResponse -> DeleteLinkResponse -> Bool
== :: DeleteLinkResponse -> DeleteLinkResponse -> Bool
$c== :: DeleteLinkResponse -> DeleteLinkResponse -> Bool
Prelude.Eq, ReadPrec [DeleteLinkResponse]
ReadPrec DeleteLinkResponse
Int -> ReadS DeleteLinkResponse
ReadS [DeleteLinkResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLinkResponse]
$creadListPrec :: ReadPrec [DeleteLinkResponse]
readPrec :: ReadPrec DeleteLinkResponse
$creadPrec :: ReadPrec DeleteLinkResponse
readList :: ReadS [DeleteLinkResponse]
$creadList :: ReadS [DeleteLinkResponse]
readsPrec :: Int -> ReadS DeleteLinkResponse
$creadsPrec :: Int -> ReadS DeleteLinkResponse
Prelude.Read, Int -> DeleteLinkResponse -> ShowS
[DeleteLinkResponse] -> ShowS
DeleteLinkResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLinkResponse] -> ShowS
$cshowList :: [DeleteLinkResponse] -> ShowS
show :: DeleteLinkResponse -> String
$cshow :: DeleteLinkResponse -> String
showsPrec :: Int -> DeleteLinkResponse -> ShowS
$cshowsPrec :: Int -> DeleteLinkResponse -> ShowS
Prelude.Show, forall x. Rep DeleteLinkResponse x -> DeleteLinkResponse
forall x. DeleteLinkResponse -> Rep DeleteLinkResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLinkResponse x -> DeleteLinkResponse
$cfrom :: forall x. DeleteLinkResponse -> Rep DeleteLinkResponse x
Prelude.Generic)
newDeleteLinkResponse ::
Prelude.Int ->
DeleteLinkResponse
newDeleteLinkResponse :: Int -> DeleteLinkResponse
newDeleteLinkResponse Int
pHttpStatus_ =
DeleteLinkResponse' {$sel:httpStatus:DeleteLinkResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteLinkResponse_httpStatus :: Lens.Lens' DeleteLinkResponse Prelude.Int
deleteLinkResponse_httpStatus :: Lens' DeleteLinkResponse Int
deleteLinkResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLinkResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteLinkResponse' :: DeleteLinkResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteLinkResponse
s@DeleteLinkResponse' {} Int
a -> DeleteLinkResponse
s {$sel:httpStatus:DeleteLinkResponse' :: Int
httpStatus = Int
a} :: DeleteLinkResponse)
instance Prelude.NFData DeleteLinkResponse where
rnf :: DeleteLinkResponse -> ()
rnf DeleteLinkResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteLinkResponse' :: DeleteLinkResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus