{-# 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.DeletePullRequestApprovalRule
(
DeletePullRequestApprovalRule (..),
newDeletePullRequestApprovalRule,
deletePullRequestApprovalRule_pullRequestId,
deletePullRequestApprovalRule_approvalRuleName,
DeletePullRequestApprovalRuleResponse (..),
newDeletePullRequestApprovalRuleResponse,
deletePullRequestApprovalRuleResponse_httpStatus,
deletePullRequestApprovalRuleResponse_approvalRuleId,
)
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 DeletePullRequestApprovalRule = DeletePullRequestApprovalRule'
{
DeletePullRequestApprovalRule -> Text
pullRequestId :: Prelude.Text,
DeletePullRequestApprovalRule -> Text
approvalRuleName :: Prelude.Text
}
deriving (DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool
(DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool)
-> (DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool)
-> Eq DeletePullRequestApprovalRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool
$c/= :: DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool
== :: DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool
$c== :: DeletePullRequestApprovalRule
-> DeletePullRequestApprovalRule -> Bool
Prelude.Eq, ReadPrec [DeletePullRequestApprovalRule]
ReadPrec DeletePullRequestApprovalRule
Int -> ReadS DeletePullRequestApprovalRule
ReadS [DeletePullRequestApprovalRule]
(Int -> ReadS DeletePullRequestApprovalRule)
-> ReadS [DeletePullRequestApprovalRule]
-> ReadPrec DeletePullRequestApprovalRule
-> ReadPrec [DeletePullRequestApprovalRule]
-> Read DeletePullRequestApprovalRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePullRequestApprovalRule]
$creadListPrec :: ReadPrec [DeletePullRequestApprovalRule]
readPrec :: ReadPrec DeletePullRequestApprovalRule
$creadPrec :: ReadPrec DeletePullRequestApprovalRule
readList :: ReadS [DeletePullRequestApprovalRule]
$creadList :: ReadS [DeletePullRequestApprovalRule]
readsPrec :: Int -> ReadS DeletePullRequestApprovalRule
$creadsPrec :: Int -> ReadS DeletePullRequestApprovalRule
Prelude.Read, Int -> DeletePullRequestApprovalRule -> ShowS
[DeletePullRequestApprovalRule] -> ShowS
DeletePullRequestApprovalRule -> String
(Int -> DeletePullRequestApprovalRule -> ShowS)
-> (DeletePullRequestApprovalRule -> String)
-> ([DeletePullRequestApprovalRule] -> ShowS)
-> Show DeletePullRequestApprovalRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePullRequestApprovalRule] -> ShowS
$cshowList :: [DeletePullRequestApprovalRule] -> ShowS
show :: DeletePullRequestApprovalRule -> String
$cshow :: DeletePullRequestApprovalRule -> String
showsPrec :: Int -> DeletePullRequestApprovalRule -> ShowS
$cshowsPrec :: Int -> DeletePullRequestApprovalRule -> ShowS
Prelude.Show, (forall x.
DeletePullRequestApprovalRule
-> Rep DeletePullRequestApprovalRule x)
-> (forall x.
Rep DeletePullRequestApprovalRule x
-> DeletePullRequestApprovalRule)
-> Generic DeletePullRequestApprovalRule
forall x.
Rep DeletePullRequestApprovalRule x
-> DeletePullRequestApprovalRule
forall x.
DeletePullRequestApprovalRule
-> Rep DeletePullRequestApprovalRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePullRequestApprovalRule x
-> DeletePullRequestApprovalRule
$cfrom :: forall x.
DeletePullRequestApprovalRule
-> Rep DeletePullRequestApprovalRule x
Prelude.Generic)
newDeletePullRequestApprovalRule ::
Prelude.Text ->
Prelude.Text ->
DeletePullRequestApprovalRule
newDeletePullRequestApprovalRule :: Text -> Text -> DeletePullRequestApprovalRule
newDeletePullRequestApprovalRule
Text
pPullRequestId_
Text
pApprovalRuleName_ =
DeletePullRequestApprovalRule' :: Text -> Text -> DeletePullRequestApprovalRule
DeletePullRequestApprovalRule'
{ $sel:pullRequestId:DeletePullRequestApprovalRule' :: Text
pullRequestId =
Text
pPullRequestId_,
$sel:approvalRuleName:DeletePullRequestApprovalRule' :: Text
approvalRuleName = Text
pApprovalRuleName_
}
deletePullRequestApprovalRule_pullRequestId :: Lens.Lens' DeletePullRequestApprovalRule Prelude.Text
deletePullRequestApprovalRule_pullRequestId :: (Text -> f Text)
-> DeletePullRequestApprovalRule -> f DeletePullRequestApprovalRule
deletePullRequestApprovalRule_pullRequestId = (DeletePullRequestApprovalRule -> Text)
-> (DeletePullRequestApprovalRule
-> Text -> DeletePullRequestApprovalRule)
-> Lens
DeletePullRequestApprovalRule
DeletePullRequestApprovalRule
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePullRequestApprovalRule' {Text
pullRequestId :: Text
$sel:pullRequestId:DeletePullRequestApprovalRule' :: DeletePullRequestApprovalRule -> Text
pullRequestId} -> Text
pullRequestId) (\s :: DeletePullRequestApprovalRule
s@DeletePullRequestApprovalRule' {} Text
a -> DeletePullRequestApprovalRule
s {$sel:pullRequestId:DeletePullRequestApprovalRule' :: Text
pullRequestId = Text
a} :: DeletePullRequestApprovalRule)
deletePullRequestApprovalRule_approvalRuleName :: Lens.Lens' DeletePullRequestApprovalRule Prelude.Text
deletePullRequestApprovalRule_approvalRuleName :: (Text -> f Text)
-> DeletePullRequestApprovalRule -> f DeletePullRequestApprovalRule
deletePullRequestApprovalRule_approvalRuleName = (DeletePullRequestApprovalRule -> Text)
-> (DeletePullRequestApprovalRule
-> Text -> DeletePullRequestApprovalRule)
-> Lens
DeletePullRequestApprovalRule
DeletePullRequestApprovalRule
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePullRequestApprovalRule' {Text
approvalRuleName :: Text
$sel:approvalRuleName:DeletePullRequestApprovalRule' :: DeletePullRequestApprovalRule -> Text
approvalRuleName} -> Text
approvalRuleName) (\s :: DeletePullRequestApprovalRule
s@DeletePullRequestApprovalRule' {} Text
a -> DeletePullRequestApprovalRule
s {$sel:approvalRuleName:DeletePullRequestApprovalRule' :: Text
approvalRuleName = Text
a} :: DeletePullRequestApprovalRule)
instance
Core.AWSRequest
DeletePullRequestApprovalRule
where
type
AWSResponse DeletePullRequestApprovalRule =
DeletePullRequestApprovalRuleResponse
request :: DeletePullRequestApprovalRule
-> Request DeletePullRequestApprovalRule
request = Service
-> DeletePullRequestApprovalRule
-> Request DeletePullRequestApprovalRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeletePullRequestApprovalRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeletePullRequestApprovalRule)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeletePullRequestApprovalRule))
-> Logger
-> Service
-> Proxy DeletePullRequestApprovalRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeletePullRequestApprovalRule)))
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 ->
Int -> Text -> DeletePullRequestApprovalRuleResponse
DeletePullRequestApprovalRuleResponse'
(Int -> Text -> DeletePullRequestApprovalRuleResponse)
-> Either String Int
-> Either String (Text -> DeletePullRequestApprovalRuleResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> DeletePullRequestApprovalRuleResponse)
-> Either String Text
-> Either String DeletePullRequestApprovalRuleResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"approvalRuleId")
)
instance
Prelude.Hashable
DeletePullRequestApprovalRule
instance Prelude.NFData DeletePullRequestApprovalRule
instance Core.ToHeaders DeletePullRequestApprovalRule where
toHeaders :: DeletePullRequestApprovalRule -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeletePullRequestApprovalRule -> 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.DeletePullRequestApprovalRule" ::
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 DeletePullRequestApprovalRule where
toJSON :: DeletePullRequestApprovalRule -> Value
toJSON DeletePullRequestApprovalRule' {Text
approvalRuleName :: Text
pullRequestId :: Text
$sel:approvalRuleName:DeletePullRequestApprovalRule' :: DeletePullRequestApprovalRule -> Text
$sel:pullRequestId:DeletePullRequestApprovalRule' :: DeletePullRequestApprovalRule -> 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
"pullRequestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pullRequestId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"approvalRuleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
approvalRuleName)
]
)
instance Core.ToPath DeletePullRequestApprovalRule where
toPath :: DeletePullRequestApprovalRule -> ByteString
toPath = ByteString -> DeletePullRequestApprovalRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeletePullRequestApprovalRule where
toQuery :: DeletePullRequestApprovalRule -> QueryString
toQuery = QueryString -> DeletePullRequestApprovalRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeletePullRequestApprovalRuleResponse = DeletePullRequestApprovalRuleResponse'
{
DeletePullRequestApprovalRuleResponse -> Int
httpStatus :: Prelude.Int,
DeletePullRequestApprovalRuleResponse -> Text
approvalRuleId :: Prelude.Text
}
deriving (DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool
(DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool)
-> (DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool)
-> Eq DeletePullRequestApprovalRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool
$c/= :: DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool
== :: DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool
$c== :: DeletePullRequestApprovalRuleResponse
-> DeletePullRequestApprovalRuleResponse -> Bool
Prelude.Eq, ReadPrec [DeletePullRequestApprovalRuleResponse]
ReadPrec DeletePullRequestApprovalRuleResponse
Int -> ReadS DeletePullRequestApprovalRuleResponse
ReadS [DeletePullRequestApprovalRuleResponse]
(Int -> ReadS DeletePullRequestApprovalRuleResponse)
-> ReadS [DeletePullRequestApprovalRuleResponse]
-> ReadPrec DeletePullRequestApprovalRuleResponse
-> ReadPrec [DeletePullRequestApprovalRuleResponse]
-> Read DeletePullRequestApprovalRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePullRequestApprovalRuleResponse]
$creadListPrec :: ReadPrec [DeletePullRequestApprovalRuleResponse]
readPrec :: ReadPrec DeletePullRequestApprovalRuleResponse
$creadPrec :: ReadPrec DeletePullRequestApprovalRuleResponse
readList :: ReadS [DeletePullRequestApprovalRuleResponse]
$creadList :: ReadS [DeletePullRequestApprovalRuleResponse]
readsPrec :: Int -> ReadS DeletePullRequestApprovalRuleResponse
$creadsPrec :: Int -> ReadS DeletePullRequestApprovalRuleResponse
Prelude.Read, Int -> DeletePullRequestApprovalRuleResponse -> ShowS
[DeletePullRequestApprovalRuleResponse] -> ShowS
DeletePullRequestApprovalRuleResponse -> String
(Int -> DeletePullRequestApprovalRuleResponse -> ShowS)
-> (DeletePullRequestApprovalRuleResponse -> String)
-> ([DeletePullRequestApprovalRuleResponse] -> ShowS)
-> Show DeletePullRequestApprovalRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePullRequestApprovalRuleResponse] -> ShowS
$cshowList :: [DeletePullRequestApprovalRuleResponse] -> ShowS
show :: DeletePullRequestApprovalRuleResponse -> String
$cshow :: DeletePullRequestApprovalRuleResponse -> String
showsPrec :: Int -> DeletePullRequestApprovalRuleResponse -> ShowS
$cshowsPrec :: Int -> DeletePullRequestApprovalRuleResponse -> ShowS
Prelude.Show, (forall x.
DeletePullRequestApprovalRuleResponse
-> Rep DeletePullRequestApprovalRuleResponse x)
-> (forall x.
Rep DeletePullRequestApprovalRuleResponse x
-> DeletePullRequestApprovalRuleResponse)
-> Generic DeletePullRequestApprovalRuleResponse
forall x.
Rep DeletePullRequestApprovalRuleResponse x
-> DeletePullRequestApprovalRuleResponse
forall x.
DeletePullRequestApprovalRuleResponse
-> Rep DeletePullRequestApprovalRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePullRequestApprovalRuleResponse x
-> DeletePullRequestApprovalRuleResponse
$cfrom :: forall x.
DeletePullRequestApprovalRuleResponse
-> Rep DeletePullRequestApprovalRuleResponse x
Prelude.Generic)
newDeletePullRequestApprovalRuleResponse ::
Prelude.Int ->
Prelude.Text ->
DeletePullRequestApprovalRuleResponse
newDeletePullRequestApprovalRuleResponse :: Int -> Text -> DeletePullRequestApprovalRuleResponse
newDeletePullRequestApprovalRuleResponse
Int
pHttpStatus_
Text
pApprovalRuleId_ =
DeletePullRequestApprovalRuleResponse' :: Int -> Text -> DeletePullRequestApprovalRuleResponse
DeletePullRequestApprovalRuleResponse'
{ $sel:httpStatus:DeletePullRequestApprovalRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:approvalRuleId:DeletePullRequestApprovalRuleResponse' :: Text
approvalRuleId = Text
pApprovalRuleId_
}
deletePullRequestApprovalRuleResponse_httpStatus :: Lens.Lens' DeletePullRequestApprovalRuleResponse Prelude.Int
deletePullRequestApprovalRuleResponse_httpStatus :: (Int -> f Int)
-> DeletePullRequestApprovalRuleResponse
-> f DeletePullRequestApprovalRuleResponse
deletePullRequestApprovalRuleResponse_httpStatus = (DeletePullRequestApprovalRuleResponse -> Int)
-> (DeletePullRequestApprovalRuleResponse
-> Int -> DeletePullRequestApprovalRuleResponse)
-> Lens
DeletePullRequestApprovalRuleResponse
DeletePullRequestApprovalRuleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePullRequestApprovalRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePullRequestApprovalRuleResponse' :: DeletePullRequestApprovalRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeletePullRequestApprovalRuleResponse
s@DeletePullRequestApprovalRuleResponse' {} Int
a -> DeletePullRequestApprovalRuleResponse
s {$sel:httpStatus:DeletePullRequestApprovalRuleResponse' :: Int
httpStatus = Int
a} :: DeletePullRequestApprovalRuleResponse)
deletePullRequestApprovalRuleResponse_approvalRuleId :: Lens.Lens' DeletePullRequestApprovalRuleResponse Prelude.Text
deletePullRequestApprovalRuleResponse_approvalRuleId :: (Text -> f Text)
-> DeletePullRequestApprovalRuleResponse
-> f DeletePullRequestApprovalRuleResponse
deletePullRequestApprovalRuleResponse_approvalRuleId = (DeletePullRequestApprovalRuleResponse -> Text)
-> (DeletePullRequestApprovalRuleResponse
-> Text -> DeletePullRequestApprovalRuleResponse)
-> Lens
DeletePullRequestApprovalRuleResponse
DeletePullRequestApprovalRuleResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePullRequestApprovalRuleResponse' {Text
approvalRuleId :: Text
$sel:approvalRuleId:DeletePullRequestApprovalRuleResponse' :: DeletePullRequestApprovalRuleResponse -> Text
approvalRuleId} -> Text
approvalRuleId) (\s :: DeletePullRequestApprovalRuleResponse
s@DeletePullRequestApprovalRuleResponse' {} Text
a -> DeletePullRequestApprovalRuleResponse
s {$sel:approvalRuleId:DeletePullRequestApprovalRuleResponse' :: Text
approvalRuleId = Text
a} :: DeletePullRequestApprovalRuleResponse)
instance
Prelude.NFData
DeletePullRequestApprovalRuleResponse