{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:commentId:DeleteCommentContent' :: Text
commentId = Text
pCommentId_}
deleteCommentContent_commentId :: Lens.Lens' DeleteCommentContent Prelude.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 :: (Service -> Service)
-> DeleteCommentContent -> Request DeleteCommentContent
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 DeleteCommentContent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCommentContent)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Comment -> Int -> DeleteCommentContentResponse
DeleteCommentContentResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"comment")
forall (f :: * -> *) a b. Applicative f => 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 DeleteCommentContent where
hashWithSalt :: Int -> DeleteCommentContent -> Int
hashWithSalt Int
_salt DeleteCommentContent' {Text
commentId :: Text
$sel:commentId:DeleteCommentContent' :: DeleteCommentContent -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
commentId
instance Prelude.NFData DeleteCommentContent where
rnf :: DeleteCommentContent -> ()
rnf DeleteCommentContent' {Text
commentId :: Text
$sel:commentId:DeleteCommentContent' :: DeleteCommentContent -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
commentId
instance Data.ToHeaders DeleteCommentContent where
toHeaders :: DeleteCommentContent -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeCommit_20150413.DeleteCommentContent" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteCommentContent where
toJSON :: DeleteCommentContent -> Value
toJSON DeleteCommentContent' {Text
commentId :: Text
$sel:commentId:DeleteCommentContent' :: DeleteCommentContent -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"commentId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
commentId)]
)
instance Data.ToPath DeleteCommentContent where
toPath :: DeleteCommentContent -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteCommentContent where
toQuery :: DeleteCommentContent -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data =
{
:: Prelude.Maybe Comment,
:: Prelude.Int
}
deriving (DeleteCommentContentResponse
-> DeleteCommentContentResponse -> Bool
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]
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
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.
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'
{ $sel:comment:DeleteCommentContentResponse' :: Maybe Comment
comment =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteCommentContentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteCommentContentResponse_comment :: Lens.Lens' DeleteCommentContentResponse (Prelude.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
= 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 where
rnf :: DeleteCommentContentResponse -> ()
rnf DeleteCommentContentResponse' {Int
Maybe Comment
httpStatus :: Int
comment :: Maybe Comment
$sel:httpStatus:DeleteCommentContentResponse' :: DeleteCommentContentResponse -> Int
$sel:comment:DeleteCommentContentResponse' :: DeleteCommentContentResponse -> Maybe Comment
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Comment
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus