{-# 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.MergePullRequestBySquash
(
MergePullRequestBySquash (..),
newMergePullRequestBySquash,
mergePullRequestBySquash_email,
mergePullRequestBySquash_authorName,
mergePullRequestBySquash_conflictDetailLevel,
mergePullRequestBySquash_commitMessage,
mergePullRequestBySquash_conflictResolution,
mergePullRequestBySquash_conflictResolutionStrategy,
mergePullRequestBySquash_keepEmptyFolders,
mergePullRequestBySquash_sourceCommitId,
mergePullRequestBySquash_pullRequestId,
mergePullRequestBySquash_repositoryName,
MergePullRequestBySquashResponse (..),
newMergePullRequestBySquashResponse,
mergePullRequestBySquashResponse_pullRequest,
mergePullRequestBySquashResponse_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 MergePullRequestBySquash = MergePullRequestBySquash'
{
MergePullRequestBySquash -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
MergePullRequestBySquash -> Maybe Text
authorName :: Prelude.Maybe Prelude.Text,
MergePullRequestBySquash -> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel :: Prelude.Maybe ConflictDetailLevelTypeEnum,
MergePullRequestBySquash -> Maybe Text
commitMessage :: Prelude.Maybe Prelude.Text,
MergePullRequestBySquash -> Maybe ConflictResolution
conflictResolution :: Prelude.Maybe ConflictResolution,
MergePullRequestBySquash
-> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy :: Prelude.Maybe ConflictResolutionStrategyTypeEnum,
MergePullRequestBySquash -> Maybe Bool
keepEmptyFolders :: Prelude.Maybe Prelude.Bool,
MergePullRequestBySquash -> Maybe Text
sourceCommitId :: Prelude.Maybe Prelude.Text,
MergePullRequestBySquash -> Text
pullRequestId :: Prelude.Text,
MergePullRequestBySquash -> Text
repositoryName :: Prelude.Text
}
deriving (MergePullRequestBySquash -> MergePullRequestBySquash -> Bool
(MergePullRequestBySquash -> MergePullRequestBySquash -> Bool)
-> (MergePullRequestBySquash -> MergePullRequestBySquash -> Bool)
-> Eq MergePullRequestBySquash
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergePullRequestBySquash -> MergePullRequestBySquash -> Bool
$c/= :: MergePullRequestBySquash -> MergePullRequestBySquash -> Bool
== :: MergePullRequestBySquash -> MergePullRequestBySquash -> Bool
$c== :: MergePullRequestBySquash -> MergePullRequestBySquash -> Bool
Prelude.Eq, ReadPrec [MergePullRequestBySquash]
ReadPrec MergePullRequestBySquash
Int -> ReadS MergePullRequestBySquash
ReadS [MergePullRequestBySquash]
(Int -> ReadS MergePullRequestBySquash)
-> ReadS [MergePullRequestBySquash]
-> ReadPrec MergePullRequestBySquash
-> ReadPrec [MergePullRequestBySquash]
-> Read MergePullRequestBySquash
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergePullRequestBySquash]
$creadListPrec :: ReadPrec [MergePullRequestBySquash]
readPrec :: ReadPrec MergePullRequestBySquash
$creadPrec :: ReadPrec MergePullRequestBySquash
readList :: ReadS [MergePullRequestBySquash]
$creadList :: ReadS [MergePullRequestBySquash]
readsPrec :: Int -> ReadS MergePullRequestBySquash
$creadsPrec :: Int -> ReadS MergePullRequestBySquash
Prelude.Read, Int -> MergePullRequestBySquash -> ShowS
[MergePullRequestBySquash] -> ShowS
MergePullRequestBySquash -> String
(Int -> MergePullRequestBySquash -> ShowS)
-> (MergePullRequestBySquash -> String)
-> ([MergePullRequestBySquash] -> ShowS)
-> Show MergePullRequestBySquash
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergePullRequestBySquash] -> ShowS
$cshowList :: [MergePullRequestBySquash] -> ShowS
show :: MergePullRequestBySquash -> String
$cshow :: MergePullRequestBySquash -> String
showsPrec :: Int -> MergePullRequestBySquash -> ShowS
$cshowsPrec :: Int -> MergePullRequestBySquash -> ShowS
Prelude.Show, (forall x.
MergePullRequestBySquash -> Rep MergePullRequestBySquash x)
-> (forall x.
Rep MergePullRequestBySquash x -> MergePullRequestBySquash)
-> Generic MergePullRequestBySquash
forall x.
Rep MergePullRequestBySquash x -> MergePullRequestBySquash
forall x.
MergePullRequestBySquash -> Rep MergePullRequestBySquash x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MergePullRequestBySquash x -> MergePullRequestBySquash
$cfrom :: forall x.
MergePullRequestBySquash -> Rep MergePullRequestBySquash x
Prelude.Generic)
newMergePullRequestBySquash ::
Prelude.Text ->
Prelude.Text ->
MergePullRequestBySquash
newMergePullRequestBySquash :: Text -> Text -> MergePullRequestBySquash
newMergePullRequestBySquash
Text
pPullRequestId_
Text
pRepositoryName_ =
MergePullRequestBySquash' :: Maybe Text
-> Maybe Text
-> Maybe ConflictDetailLevelTypeEnum
-> Maybe Text
-> Maybe ConflictResolution
-> Maybe ConflictResolutionStrategyTypeEnum
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> MergePullRequestBySquash
MergePullRequestBySquash'
{ $sel:email:MergePullRequestBySquash' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:authorName:MergePullRequestBySquash' :: Maybe Text
authorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:conflictDetailLevel:MergePullRequestBySquash' :: Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel = Maybe ConflictDetailLevelTypeEnum
forall a. Maybe a
Prelude.Nothing,
$sel:commitMessage:MergePullRequestBySquash' :: Maybe Text
commitMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:conflictResolution:MergePullRequestBySquash' :: Maybe ConflictResolution
conflictResolution = Maybe ConflictResolution
forall a. Maybe a
Prelude.Nothing,
$sel:conflictResolutionStrategy:MergePullRequestBySquash' :: Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy = Maybe ConflictResolutionStrategyTypeEnum
forall a. Maybe a
Prelude.Nothing,
$sel:keepEmptyFolders:MergePullRequestBySquash' :: Maybe Bool
keepEmptyFolders = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sourceCommitId:MergePullRequestBySquash' :: Maybe Text
sourceCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pullRequestId:MergePullRequestBySquash' :: Text
pullRequestId = Text
pPullRequestId_,
$sel:repositoryName:MergePullRequestBySquash' :: Text
repositoryName = Text
pRepositoryName_
}
mergePullRequestBySquash_email :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe Prelude.Text)
mergePullRequestBySquash_email :: (Maybe Text -> f (Maybe Text))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_email = (MergePullRequestBySquash -> Maybe Text)
-> (MergePullRequestBySquash
-> Maybe Text -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe Text
email :: Maybe Text
$sel:email:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
email} -> Maybe Text
email) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe Text
a -> MergePullRequestBySquash
s {$sel:email:MergePullRequestBySquash' :: Maybe Text
email = Maybe Text
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_authorName :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe Prelude.Text)
mergePullRequestBySquash_authorName :: (Maybe Text -> f (Maybe Text))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_authorName = (MergePullRequestBySquash -> Maybe Text)
-> (MergePullRequestBySquash
-> Maybe Text -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe Text
authorName :: Maybe Text
$sel:authorName:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
authorName} -> Maybe Text
authorName) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe Text
a -> MergePullRequestBySquash
s {$sel:authorName:MergePullRequestBySquash' :: Maybe Text
authorName = Maybe Text
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_conflictDetailLevel :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe ConflictDetailLevelTypeEnum)
mergePullRequestBySquash_conflictDetailLevel :: (Maybe ConflictDetailLevelTypeEnum
-> f (Maybe ConflictDetailLevelTypeEnum))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_conflictDetailLevel = (MergePullRequestBySquash -> Maybe ConflictDetailLevelTypeEnum)
-> (MergePullRequestBySquash
-> Maybe ConflictDetailLevelTypeEnum -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe ConflictDetailLevelTypeEnum)
(Maybe ConflictDetailLevelTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel :: Maybe ConflictDetailLevelTypeEnum
$sel:conflictDetailLevel:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel} -> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe ConflictDetailLevelTypeEnum
a -> MergePullRequestBySquash
s {$sel:conflictDetailLevel:MergePullRequestBySquash' :: Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel = Maybe ConflictDetailLevelTypeEnum
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_commitMessage :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe Prelude.Text)
mergePullRequestBySquash_commitMessage :: (Maybe Text -> f (Maybe Text))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_commitMessage = (MergePullRequestBySquash -> Maybe Text)
-> (MergePullRequestBySquash
-> Maybe Text -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe Text
commitMessage :: Maybe Text
$sel:commitMessage:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
commitMessage} -> Maybe Text
commitMessage) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe Text
a -> MergePullRequestBySquash
s {$sel:commitMessage:MergePullRequestBySquash' :: Maybe Text
commitMessage = Maybe Text
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_conflictResolution :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe ConflictResolution)
mergePullRequestBySquash_conflictResolution :: (Maybe ConflictResolution -> f (Maybe ConflictResolution))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_conflictResolution = (MergePullRequestBySquash -> Maybe ConflictResolution)
-> (MergePullRequestBySquash
-> Maybe ConflictResolution -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe ConflictResolution)
(Maybe ConflictResolution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe ConflictResolution
conflictResolution :: Maybe ConflictResolution
$sel:conflictResolution:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe ConflictResolution
conflictResolution} -> Maybe ConflictResolution
conflictResolution) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe ConflictResolution
a -> MergePullRequestBySquash
s {$sel:conflictResolution:MergePullRequestBySquash' :: Maybe ConflictResolution
conflictResolution = Maybe ConflictResolution
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_conflictResolutionStrategy :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe ConflictResolutionStrategyTypeEnum)
mergePullRequestBySquash_conflictResolutionStrategy :: (Maybe ConflictResolutionStrategyTypeEnum
-> f (Maybe ConflictResolutionStrategyTypeEnum))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_conflictResolutionStrategy = (MergePullRequestBySquash
-> Maybe ConflictResolutionStrategyTypeEnum)
-> (MergePullRequestBySquash
-> Maybe ConflictResolutionStrategyTypeEnum
-> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe ConflictResolutionStrategyTypeEnum)
(Maybe ConflictResolutionStrategyTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy :: Maybe ConflictResolutionStrategyTypeEnum
$sel:conflictResolutionStrategy:MergePullRequestBySquash' :: MergePullRequestBySquash
-> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy} -> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe ConflictResolutionStrategyTypeEnum
a -> MergePullRequestBySquash
s {$sel:conflictResolutionStrategy:MergePullRequestBySquash' :: Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy = Maybe ConflictResolutionStrategyTypeEnum
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_keepEmptyFolders :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe Prelude.Bool)
mergePullRequestBySquash_keepEmptyFolders :: (Maybe Bool -> f (Maybe Bool))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_keepEmptyFolders = (MergePullRequestBySquash -> Maybe Bool)
-> (MergePullRequestBySquash
-> Maybe Bool -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe Bool
keepEmptyFolders :: Maybe Bool
$sel:keepEmptyFolders:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Bool
keepEmptyFolders} -> Maybe Bool
keepEmptyFolders) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe Bool
a -> MergePullRequestBySquash
s {$sel:keepEmptyFolders:MergePullRequestBySquash' :: Maybe Bool
keepEmptyFolders = Maybe Bool
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_sourceCommitId :: Lens.Lens' MergePullRequestBySquash (Prelude.Maybe Prelude.Text)
mergePullRequestBySquash_sourceCommitId :: (Maybe Text -> f (Maybe Text))
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_sourceCommitId = (MergePullRequestBySquash -> Maybe Text)
-> (MergePullRequestBySquash
-> Maybe Text -> MergePullRequestBySquash)
-> Lens
MergePullRequestBySquash
MergePullRequestBySquash
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Maybe Text
sourceCommitId :: Maybe Text
$sel:sourceCommitId:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
sourceCommitId} -> Maybe Text
sourceCommitId) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Maybe Text
a -> MergePullRequestBySquash
s {$sel:sourceCommitId:MergePullRequestBySquash' :: Maybe Text
sourceCommitId = Maybe Text
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_pullRequestId :: Lens.Lens' MergePullRequestBySquash Prelude.Text
mergePullRequestBySquash_pullRequestId :: (Text -> f Text)
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_pullRequestId = (MergePullRequestBySquash -> Text)
-> (MergePullRequestBySquash -> Text -> MergePullRequestBySquash)
-> Lens MergePullRequestBySquash MergePullRequestBySquash Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Text
pullRequestId :: Text
$sel:pullRequestId:MergePullRequestBySquash' :: MergePullRequestBySquash -> Text
pullRequestId} -> Text
pullRequestId) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Text
a -> MergePullRequestBySquash
s {$sel:pullRequestId:MergePullRequestBySquash' :: Text
pullRequestId = Text
a} :: MergePullRequestBySquash)
mergePullRequestBySquash_repositoryName :: Lens.Lens' MergePullRequestBySquash Prelude.Text
mergePullRequestBySquash_repositoryName :: (Text -> f Text)
-> MergePullRequestBySquash -> f MergePullRequestBySquash
mergePullRequestBySquash_repositoryName = (MergePullRequestBySquash -> Text)
-> (MergePullRequestBySquash -> Text -> MergePullRequestBySquash)
-> Lens MergePullRequestBySquash MergePullRequestBySquash Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquash' {Text
repositoryName :: Text
$sel:repositoryName:MergePullRequestBySquash' :: MergePullRequestBySquash -> Text
repositoryName} -> Text
repositoryName) (\s :: MergePullRequestBySquash
s@MergePullRequestBySquash' {} Text
a -> MergePullRequestBySquash
s {$sel:repositoryName:MergePullRequestBySquash' :: Text
repositoryName = Text
a} :: MergePullRequestBySquash)
instance Core.AWSRequest MergePullRequestBySquash where
type
AWSResponse MergePullRequestBySquash =
MergePullRequestBySquashResponse
request :: MergePullRequestBySquash -> Request MergePullRequestBySquash
request = Service
-> MergePullRequestBySquash -> Request MergePullRequestBySquash
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy MergePullRequestBySquash
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse MergePullRequestBySquash)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse MergePullRequestBySquash))
-> Logger
-> Service
-> Proxy MergePullRequestBySquash
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse MergePullRequestBySquash)))
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 PullRequest -> Int -> MergePullRequestBySquashResponse
MergePullRequestBySquashResponse'
(Maybe PullRequest -> Int -> MergePullRequestBySquashResponse)
-> Either String (Maybe PullRequest)
-> Either String (Int -> MergePullRequestBySquashResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe PullRequest)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"pullRequest")
Either String (Int -> MergePullRequestBySquashResponse)
-> Either String Int
-> Either String MergePullRequestBySquashResponse
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 MergePullRequestBySquash
instance Prelude.NFData MergePullRequestBySquash
instance Core.ToHeaders MergePullRequestBySquash where
toHeaders :: MergePullRequestBySquash -> ResponseHeaders
toHeaders =
ResponseHeaders -> MergePullRequestBySquash -> 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.MergePullRequestBySquash" ::
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 MergePullRequestBySquash where
toJSON :: MergePullRequestBySquash -> Value
toJSON MergePullRequestBySquash' {Maybe Bool
Maybe Text
Maybe ConflictDetailLevelTypeEnum
Maybe ConflictResolutionStrategyTypeEnum
Maybe ConflictResolution
Text
repositoryName :: Text
pullRequestId :: Text
sourceCommitId :: Maybe Text
keepEmptyFolders :: Maybe Bool
conflictResolutionStrategy :: Maybe ConflictResolutionStrategyTypeEnum
conflictResolution :: Maybe ConflictResolution
commitMessage :: Maybe Text
conflictDetailLevel :: Maybe ConflictDetailLevelTypeEnum
authorName :: Maybe Text
email :: Maybe Text
$sel:repositoryName:MergePullRequestBySquash' :: MergePullRequestBySquash -> Text
$sel:pullRequestId:MergePullRequestBySquash' :: MergePullRequestBySquash -> Text
$sel:sourceCommitId:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
$sel:keepEmptyFolders:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Bool
$sel:conflictResolutionStrategy:MergePullRequestBySquash' :: MergePullRequestBySquash
-> Maybe ConflictResolutionStrategyTypeEnum
$sel:conflictResolution:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe ConflictResolution
$sel:commitMessage:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
$sel:conflictDetailLevel:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe ConflictDetailLevelTypeEnum
$sel:authorName:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
$sel:email:MergePullRequestBySquash' :: MergePullRequestBySquash -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"email" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
email,
(Text
"authorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authorName,
(Text
"conflictDetailLevel" Text -> ConflictDetailLevelTypeEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConflictDetailLevelTypeEnum -> Pair)
-> Maybe ConflictDetailLevelTypeEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel,
(Text
"commitMessage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
commitMessage,
(Text
"conflictResolution" Text -> ConflictResolution -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConflictResolution -> Pair)
-> Maybe ConflictResolution -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConflictResolution
conflictResolution,
(Text
"conflictResolutionStrategy" Text -> ConflictResolutionStrategyTypeEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConflictResolutionStrategyTypeEnum -> Pair)
-> Maybe ConflictResolutionStrategyTypeEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy,
(Text
"keepEmptyFolders" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
keepEmptyFolders,
(Text
"sourceCommitId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceCommitId,
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
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName)
]
)
instance Core.ToPath MergePullRequestBySquash where
toPath :: MergePullRequestBySquash -> ByteString
toPath = ByteString -> MergePullRequestBySquash -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery MergePullRequestBySquash where
toQuery :: MergePullRequestBySquash -> QueryString
toQuery = QueryString -> MergePullRequestBySquash -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data MergePullRequestBySquashResponse = MergePullRequestBySquashResponse'
{ MergePullRequestBySquashResponse -> Maybe PullRequest
pullRequest :: Prelude.Maybe PullRequest,
MergePullRequestBySquashResponse -> Int
httpStatus :: Prelude.Int
}
deriving (MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool
(MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool)
-> (MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool)
-> Eq MergePullRequestBySquashResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool
$c/= :: MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool
== :: MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool
$c== :: MergePullRequestBySquashResponse
-> MergePullRequestBySquashResponse -> Bool
Prelude.Eq, ReadPrec [MergePullRequestBySquashResponse]
ReadPrec MergePullRequestBySquashResponse
Int -> ReadS MergePullRequestBySquashResponse
ReadS [MergePullRequestBySquashResponse]
(Int -> ReadS MergePullRequestBySquashResponse)
-> ReadS [MergePullRequestBySquashResponse]
-> ReadPrec MergePullRequestBySquashResponse
-> ReadPrec [MergePullRequestBySquashResponse]
-> Read MergePullRequestBySquashResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergePullRequestBySquashResponse]
$creadListPrec :: ReadPrec [MergePullRequestBySquashResponse]
readPrec :: ReadPrec MergePullRequestBySquashResponse
$creadPrec :: ReadPrec MergePullRequestBySquashResponse
readList :: ReadS [MergePullRequestBySquashResponse]
$creadList :: ReadS [MergePullRequestBySquashResponse]
readsPrec :: Int -> ReadS MergePullRequestBySquashResponse
$creadsPrec :: Int -> ReadS MergePullRequestBySquashResponse
Prelude.Read, Int -> MergePullRequestBySquashResponse -> ShowS
[MergePullRequestBySquashResponse] -> ShowS
MergePullRequestBySquashResponse -> String
(Int -> MergePullRequestBySquashResponse -> ShowS)
-> (MergePullRequestBySquashResponse -> String)
-> ([MergePullRequestBySquashResponse] -> ShowS)
-> Show MergePullRequestBySquashResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergePullRequestBySquashResponse] -> ShowS
$cshowList :: [MergePullRequestBySquashResponse] -> ShowS
show :: MergePullRequestBySquashResponse -> String
$cshow :: MergePullRequestBySquashResponse -> String
showsPrec :: Int -> MergePullRequestBySquashResponse -> ShowS
$cshowsPrec :: Int -> MergePullRequestBySquashResponse -> ShowS
Prelude.Show, (forall x.
MergePullRequestBySquashResponse
-> Rep MergePullRequestBySquashResponse x)
-> (forall x.
Rep MergePullRequestBySquashResponse x
-> MergePullRequestBySquashResponse)
-> Generic MergePullRequestBySquashResponse
forall x.
Rep MergePullRequestBySquashResponse x
-> MergePullRequestBySquashResponse
forall x.
MergePullRequestBySquashResponse
-> Rep MergePullRequestBySquashResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MergePullRequestBySquashResponse x
-> MergePullRequestBySquashResponse
$cfrom :: forall x.
MergePullRequestBySquashResponse
-> Rep MergePullRequestBySquashResponse x
Prelude.Generic)
newMergePullRequestBySquashResponse ::
Prelude.Int ->
MergePullRequestBySquashResponse
newMergePullRequestBySquashResponse :: Int -> MergePullRequestBySquashResponse
newMergePullRequestBySquashResponse Int
pHttpStatus_ =
MergePullRequestBySquashResponse' :: Maybe PullRequest -> Int -> MergePullRequestBySquashResponse
MergePullRequestBySquashResponse'
{ $sel:pullRequest:MergePullRequestBySquashResponse' :: Maybe PullRequest
pullRequest =
Maybe PullRequest
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:MergePullRequestBySquashResponse' :: Int
httpStatus = Int
pHttpStatus_
}
mergePullRequestBySquashResponse_pullRequest :: Lens.Lens' MergePullRequestBySquashResponse (Prelude.Maybe PullRequest)
mergePullRequestBySquashResponse_pullRequest :: (Maybe PullRequest -> f (Maybe PullRequest))
-> MergePullRequestBySquashResponse
-> f MergePullRequestBySquashResponse
mergePullRequestBySquashResponse_pullRequest = (MergePullRequestBySquashResponse -> Maybe PullRequest)
-> (MergePullRequestBySquashResponse
-> Maybe PullRequest -> MergePullRequestBySquashResponse)
-> Lens
MergePullRequestBySquashResponse
MergePullRequestBySquashResponse
(Maybe PullRequest)
(Maybe PullRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquashResponse' {Maybe PullRequest
pullRequest :: Maybe PullRequest
$sel:pullRequest:MergePullRequestBySquashResponse' :: MergePullRequestBySquashResponse -> Maybe PullRequest
pullRequest} -> Maybe PullRequest
pullRequest) (\s :: MergePullRequestBySquashResponse
s@MergePullRequestBySquashResponse' {} Maybe PullRequest
a -> MergePullRequestBySquashResponse
s {$sel:pullRequest:MergePullRequestBySquashResponse' :: Maybe PullRequest
pullRequest = Maybe PullRequest
a} :: MergePullRequestBySquashResponse)
mergePullRequestBySquashResponse_httpStatus :: Lens.Lens' MergePullRequestBySquashResponse Prelude.Int
mergePullRequestBySquashResponse_httpStatus :: (Int -> f Int)
-> MergePullRequestBySquashResponse
-> f MergePullRequestBySquashResponse
mergePullRequestBySquashResponse_httpStatus = (MergePullRequestBySquashResponse -> Int)
-> (MergePullRequestBySquashResponse
-> Int -> MergePullRequestBySquashResponse)
-> Lens
MergePullRequestBySquashResponse
MergePullRequestBySquashResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergePullRequestBySquashResponse' {Int
httpStatus :: Int
$sel:httpStatus:MergePullRequestBySquashResponse' :: MergePullRequestBySquashResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: MergePullRequestBySquashResponse
s@MergePullRequestBySquashResponse' {} Int
a -> MergePullRequestBySquashResponse
s {$sel:httpStatus:MergePullRequestBySquashResponse' :: Int
httpStatus = Int
a} :: MergePullRequestBySquashResponse)
instance
Prelude.NFData
MergePullRequestBySquashResponse