{-# 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.CodeCommit.DeleteCommentContent
(
DeleteCommentContent (..),
newDeleteCommentContent,
deleteCommentContent_commentId,
DeleteCommentContentResponse (..),
newDeleteCommentContentResponse,
deleteCommentContentResponse_comment,
deleteCommentContentResponse_httpStatus,
)
where
import Amazonka.CodeCommit.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 =
{
:: Prelude.Text
}
deriving (DeleteCommentContent -> DeleteCommentContent -> Bool
(DeleteCommentContent -> DeleteCommentContent -> Bool)
-> (DeleteCommentContent -> DeleteCommentContent -> Bool)
-> Eq DeleteCommentContent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCommentContent -> DeleteCommentContent -> Bool
$c/= :: DeleteCommentContent -> DeleteCommentContent -> Bool
== :: DeleteCommentContent -> DeleteCommentContent -> Bool
$c== :: DeleteCommentContent -> DeleteCommentContent -> Bool
Prelude.Eq, ReadPrec [DeleteCommentContent]
ReadPrec DeleteCommentContent
Int -> ReadS DeleteCommentContent
ReadS [DeleteCommentContent]
(Int -> ReadS DeleteCommentContent)
-> ReadS [DeleteCommentContent]
-> ReadPrec DeleteCommentContent
-> ReadPrec [DeleteCommentContent]
-> Read DeleteCommentContent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCommentContent]
$creadListPrec :: ReadPrec [DeleteCommentContent]
readPrec :: ReadPrec DeleteCommentContent
$creadPrec :: ReadPrec DeleteCommentContent
readList :: ReadS [DeleteCommentContent]
$creadList :: ReadS [DeleteCommentContent]
readsPrec :: Int -> ReadS DeleteCommentContent
$creadsPrec :: Int -> ReadS DeleteCommentContent
Prelude.Read, Int -> DeleteCommentContent -> ShowS
[DeleteCommentContent] -> ShowS
DeleteCommentContent -> String
(Int -> DeleteCommentContent -> ShowS)
-> (DeleteCommentContent -> String)
-> ([DeleteCommentContent] -> ShowS)
-> Show DeleteCommentContent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCommentContent] -> ShowS
$cshowList :: [DeleteCommentContent] -> ShowS
show :: DeleteCommentContent -> String
$cshow :: DeleteCommentContent -> String
showsPrec :: Int -> DeleteCommentContent -> ShowS
$cshowsPrec :: Int -> DeleteCommentContent -> ShowS
Prelude.Show, (forall x. DeleteCommentContent -> Rep DeleteCommentContent x)
-> (forall x. Rep DeleteCommentContent x -> DeleteCommentContent)
-> Generic DeleteCommentContent
forall x. Rep DeleteCommentContent x -> DeleteCommentContent
forall x. DeleteCommentContent -> Rep DeleteCommentContent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCommentContent x -> DeleteCommentContent
$cfrom :: forall x. DeleteCommentContent -> Rep DeleteCommentContent x
Prelude.Generic)
newDeleteCommentContent ::
Prelude.Text ->
DeleteCommentContent
Text
pCommentId_ =
DeleteCommentContent' :: Text -> DeleteCommentContent
DeleteCommentContent' {$sel:commentId:DeleteCommentContent' :: Text
commentId = Text
pCommentId_}
deleteCommentContent_commentId :: Lens.Lens' DeleteCommentContent Prelude.Text
= (DeleteCommentContent -> Text)
-> (DeleteCommentContent -> Text -> DeleteCommentContent)
-> Lens DeleteCommentContent DeleteCommentContent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCommentContent' {Text
commentId :: Text
$sel:commentId:DeleteCommentContent' :: DeleteCommentContent -> Text
commentId} -> Text
commentId) (\s :: DeleteCommentContent
s@DeleteCommentContent' {} Text
a -> DeleteCommentContent
s {$sel:commentId:DeleteCommentContent' :: Text
commentId = Text
a} :: DeleteCommentContent)
instance Core.AWSRequest DeleteCommentContent where
type
AWSResponse DeleteCommentContent =
DeleteCommentContentResponse
request :: DeleteCommentContent -> Request DeleteCommentContent
request = Service -> DeleteCommentContent -> Request DeleteCommentContent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteCommentContent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCommentContent)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteCommentContent))
-> Logger
-> Service
-> Proxy DeleteCommentContent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCommentContent)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Comment -> Int -> DeleteCommentContentResponse
DeleteCommentContentResponse'
(Maybe Comment -> Int -> DeleteCommentContentResponse)
-> Either String (Maybe Comment)
-> Either String (Int -> DeleteCommentContentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Comment)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"comment")
Either String (Int -> DeleteCommentContentResponse)
-> Either String Int -> Either String DeleteCommentContentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteCommentContent
instance Prelude.NFData DeleteCommentContent
instance Core.ToHeaders DeleteCommentContent where
toHeaders :: DeleteCommentContent -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteCommentContent -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeCommit_20150413.DeleteCommentContent" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteCommentContent where
toJSON :: DeleteCommentContent -> Value
toJSON DeleteCommentContent' {Text
commentId :: Text
$sel:commentId:DeleteCommentContent' :: DeleteCommentContent -> 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
"commentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
commentId)]
)
instance Core.ToPath DeleteCommentContent where
toPath :: DeleteCommentContent -> ByteString
toPath = ByteString -> DeleteCommentContent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteCommentContent where
toQuery :: DeleteCommentContent -> QueryString
toQuery = QueryString -> DeleteCommentContent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data =
{
:: Prelude.Maybe Comment,
:: Prelude.Int
}
deriving (DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool
(DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool)
-> (DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool)
-> Eq DeleteCommentContentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool
$c/= :: DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool
== :: DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool
$c== :: DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCommentContentResponse]
ReadPrec DeleteCommentContentResponse
Int -> ReadS DeleteCommentContentResponse
ReadS [DeleteCommentContentResponse]
(Int -> ReadS DeleteCommentContentResponse)
-> ReadS [DeleteCommentContentResponse]
-> ReadPrec DeleteCommentContentResponse
-> ReadPrec [DeleteCommentContentResponse]
-> Read DeleteCommentContentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCommentContentResponse]
$creadListPrec :: ReadPrec [DeleteCommentContentResponse]
readPrec :: ReadPrec DeleteCommentContentResponse
$creadPrec :: ReadPrec DeleteCommentContentResponse
readList :: ReadS [DeleteCommentContentResponse]
$creadList :: ReadS [DeleteCommentContentResponse]
readsPrec :: Int -> ReadS DeleteCommentContentResponse
$creadsPrec :: Int -> ReadS DeleteCommentContentResponse
Prelude.Read, Int -> DeleteCommentContentResponse -> ShowS
[DeleteCommentContentResponse] -> ShowS
DeleteCommentContentResponse -> String
(Int -> DeleteCommentContentResponse -> ShowS)
-> (DeleteCommentContentResponse -> String)
-> ([DeleteCommentContentResponse] -> ShowS)
-> Show DeleteCommentContentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCommentContentResponse] -> ShowS
$cshowList :: [DeleteCommentContentResponse] -> ShowS
show :: DeleteCommentContentResponse -> String
$cshow :: DeleteCommentContentResponse -> String
showsPrec :: Int -> DeleteCommentContentResponse -> ShowS
$cshowsPrec :: Int -> DeleteCommentContentResponse -> ShowS
Prelude.Show, (forall x.
DeleteCommentContentResponse -> Rep DeleteCommentContentResponse x)
-> (forall x.
Rep DeleteCommentContentResponse x -> DeleteCommentContentResponse)
-> Generic DeleteCommentContentResponse
forall x.
Rep DeleteCommentContentResponse x -> DeleteCommentContentResponse
forall x.
DeleteCommentContentResponse -> Rep DeleteCommentContentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCommentContentResponse x -> DeleteCommentContentResponse
$cfrom :: forall x.
DeleteCommentContentResponse -> Rep DeleteCommentContentResponse x
Prelude.Generic)
newDeleteCommentContentResponse ::
Prelude.Int ->
DeleteCommentContentResponse
Int
pHttpStatus_ =
DeleteCommentContentResponse' :: Maybe Comment -> Int -> DeleteCommentContentResponse
DeleteCommentContentResponse'
{ $sel:comment:DeleteCommentContentResponse' :: Maybe Comment
comment =
Maybe Comment
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteCommentContentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteCommentContentResponse_comment :: Lens.Lens' DeleteCommentContentResponse (Prelude.Maybe Comment)
= (DeleteCommentContentResponse -> Maybe Comment)
-> (DeleteCommentContentResponse
-> Maybe Comment -> DeleteCommentContentResponse)
-> Lens
DeleteCommentContentResponse
DeleteCommentContentResponse
(Maybe Comment)
(Maybe Comment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCommentContentResponse' {Maybe Comment
comment :: Maybe Comment
$sel:comment:DeleteCommentContentResponse' :: DeleteCommentContentResponse -> Maybe Comment
comment} -> Maybe Comment
comment) (\s :: DeleteCommentContentResponse
s@DeleteCommentContentResponse' {} Maybe Comment
a -> DeleteCommentContentResponse
s {$sel:comment:DeleteCommentContentResponse' :: Maybe Comment
comment = Maybe Comment
a} :: DeleteCommentContentResponse)
deleteCommentContentResponse_httpStatus :: Lens.Lens' DeleteCommentContentResponse Prelude.Int
= (DeleteCommentContentResponse -> Int)
-> (DeleteCommentContentResponse
-> Int -> DeleteCommentContentResponse)
-> Lens
DeleteCommentContentResponse DeleteCommentContentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCommentContentResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCommentContentResponse' :: DeleteCommentContentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCommentContentResponse
s@DeleteCommentContentResponse' {} Int
a -> DeleteCommentContentResponse
s {$sel:httpStatus:DeleteCommentContentResponse' :: Int
httpStatus = Int
a} :: DeleteCommentContentResponse)
instance Prelude.NFData DeleteCommentContentResponse