{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeCommit.MergeBranchesByFastForward
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Merges two branches using the fast-forward merge strategy.
module Amazonka.CodeCommit.MergeBranchesByFastForward
  ( -- * Creating a Request
    MergeBranchesByFastForward (..),
    newMergeBranchesByFastForward,

    -- * Request Lenses
    mergeBranchesByFastForward_targetBranch,
    mergeBranchesByFastForward_repositoryName,
    mergeBranchesByFastForward_sourceCommitSpecifier,
    mergeBranchesByFastForward_destinationCommitSpecifier,

    -- * Destructuring the Response
    MergeBranchesByFastForwardResponse (..),
    newMergeBranchesByFastForwardResponse,

    -- * Response Lenses
    mergeBranchesByFastForwardResponse_commitId,
    mergeBranchesByFastForwardResponse_treeId,
    mergeBranchesByFastForwardResponse_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

-- | /See:/ 'newMergeBranchesByFastForward' smart constructor.
data MergeBranchesByFastForward = MergeBranchesByFastForward'
  { -- | The branch where the merge is applied.
    MergeBranchesByFastForward -> Maybe Text
targetBranch :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository where you want to merge two branches.
    MergeBranchesByFastForward -> Text
repositoryName :: Prelude.Text,
    -- | The branch, tag, HEAD, or other fully qualified reference used to
    -- identify a commit (for example, a branch name or a full commit ID).
    MergeBranchesByFastForward -> Text
sourceCommitSpecifier :: Prelude.Text,
    -- | The branch, tag, HEAD, or other fully qualified reference used to
    -- identify a commit (for example, a branch name or a full commit ID).
    MergeBranchesByFastForward -> Text
destinationCommitSpecifier :: Prelude.Text
  }
  deriving (MergeBranchesByFastForward -> MergeBranchesByFastForward -> Bool
(MergeBranchesByFastForward -> MergeBranchesByFastForward -> Bool)
-> (MergeBranchesByFastForward
    -> MergeBranchesByFastForward -> Bool)
-> Eq MergeBranchesByFastForward
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeBranchesByFastForward -> MergeBranchesByFastForward -> Bool
$c/= :: MergeBranchesByFastForward -> MergeBranchesByFastForward -> Bool
== :: MergeBranchesByFastForward -> MergeBranchesByFastForward -> Bool
$c== :: MergeBranchesByFastForward -> MergeBranchesByFastForward -> Bool
Prelude.Eq, ReadPrec [MergeBranchesByFastForward]
ReadPrec MergeBranchesByFastForward
Int -> ReadS MergeBranchesByFastForward
ReadS [MergeBranchesByFastForward]
(Int -> ReadS MergeBranchesByFastForward)
-> ReadS [MergeBranchesByFastForward]
-> ReadPrec MergeBranchesByFastForward
-> ReadPrec [MergeBranchesByFastForward]
-> Read MergeBranchesByFastForward
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeBranchesByFastForward]
$creadListPrec :: ReadPrec [MergeBranchesByFastForward]
readPrec :: ReadPrec MergeBranchesByFastForward
$creadPrec :: ReadPrec MergeBranchesByFastForward
readList :: ReadS [MergeBranchesByFastForward]
$creadList :: ReadS [MergeBranchesByFastForward]
readsPrec :: Int -> ReadS MergeBranchesByFastForward
$creadsPrec :: Int -> ReadS MergeBranchesByFastForward
Prelude.Read, Int -> MergeBranchesByFastForward -> ShowS
[MergeBranchesByFastForward] -> ShowS
MergeBranchesByFastForward -> String
(Int -> MergeBranchesByFastForward -> ShowS)
-> (MergeBranchesByFastForward -> String)
-> ([MergeBranchesByFastForward] -> ShowS)
-> Show MergeBranchesByFastForward
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeBranchesByFastForward] -> ShowS
$cshowList :: [MergeBranchesByFastForward] -> ShowS
show :: MergeBranchesByFastForward -> String
$cshow :: MergeBranchesByFastForward -> String
showsPrec :: Int -> MergeBranchesByFastForward -> ShowS
$cshowsPrec :: Int -> MergeBranchesByFastForward -> ShowS
Prelude.Show, (forall x.
 MergeBranchesByFastForward -> Rep MergeBranchesByFastForward x)
-> (forall x.
    Rep MergeBranchesByFastForward x -> MergeBranchesByFastForward)
-> Generic MergeBranchesByFastForward
forall x.
Rep MergeBranchesByFastForward x -> MergeBranchesByFastForward
forall x.
MergeBranchesByFastForward -> Rep MergeBranchesByFastForward x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MergeBranchesByFastForward x -> MergeBranchesByFastForward
$cfrom :: forall x.
MergeBranchesByFastForward -> Rep MergeBranchesByFastForward x
Prelude.Generic)

-- |
-- Create a value of 'MergeBranchesByFastForward' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'targetBranch', 'mergeBranchesByFastForward_targetBranch' - The branch where the merge is applied.
--
-- 'repositoryName', 'mergeBranchesByFastForward_repositoryName' - The name of the repository where you want to merge two branches.
--
-- 'sourceCommitSpecifier', 'mergeBranchesByFastForward_sourceCommitSpecifier' - The branch, tag, HEAD, or other fully qualified reference used to
-- identify a commit (for example, a branch name or a full commit ID).
--
-- 'destinationCommitSpecifier', 'mergeBranchesByFastForward_destinationCommitSpecifier' - The branch, tag, HEAD, or other fully qualified reference used to
-- identify a commit (for example, a branch name or a full commit ID).
newMergeBranchesByFastForward ::
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'sourceCommitSpecifier'
  Prelude.Text ->
  -- | 'destinationCommitSpecifier'
  Prelude.Text ->
  MergeBranchesByFastForward
newMergeBranchesByFastForward :: Text -> Text -> Text -> MergeBranchesByFastForward
newMergeBranchesByFastForward
  Text
pRepositoryName_
  Text
pSourceCommitSpecifier_
  Text
pDestinationCommitSpecifier_ =
    MergeBranchesByFastForward' :: Maybe Text -> Text -> Text -> Text -> MergeBranchesByFastForward
MergeBranchesByFastForward'
      { $sel:targetBranch:MergeBranchesByFastForward' :: Maybe Text
targetBranch =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:repositoryName:MergeBranchesByFastForward' :: Text
repositoryName = Text
pRepositoryName_,
        $sel:sourceCommitSpecifier:MergeBranchesByFastForward' :: Text
sourceCommitSpecifier = Text
pSourceCommitSpecifier_,
        $sel:destinationCommitSpecifier:MergeBranchesByFastForward' :: Text
destinationCommitSpecifier =
          Text
pDestinationCommitSpecifier_
      }

-- | The branch where the merge is applied.
mergeBranchesByFastForward_targetBranch :: Lens.Lens' MergeBranchesByFastForward (Prelude.Maybe Prelude.Text)
mergeBranchesByFastForward_targetBranch :: (Maybe Text -> f (Maybe Text))
-> MergeBranchesByFastForward -> f MergeBranchesByFastForward
mergeBranchesByFastForward_targetBranch = (MergeBranchesByFastForward -> Maybe Text)
-> (MergeBranchesByFastForward
    -> Maybe Text -> MergeBranchesByFastForward)
-> Lens
     MergeBranchesByFastForward
     MergeBranchesByFastForward
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForward' {Maybe Text
targetBranch :: Maybe Text
$sel:targetBranch:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Maybe Text
targetBranch} -> Maybe Text
targetBranch) (\s :: MergeBranchesByFastForward
s@MergeBranchesByFastForward' {} Maybe Text
a -> MergeBranchesByFastForward
s {$sel:targetBranch:MergeBranchesByFastForward' :: Maybe Text
targetBranch = Maybe Text
a} :: MergeBranchesByFastForward)

-- | The name of the repository where you want to merge two branches.
mergeBranchesByFastForward_repositoryName :: Lens.Lens' MergeBranchesByFastForward Prelude.Text
mergeBranchesByFastForward_repositoryName :: (Text -> f Text)
-> MergeBranchesByFastForward -> f MergeBranchesByFastForward
mergeBranchesByFastForward_repositoryName = (MergeBranchesByFastForward -> Text)
-> (MergeBranchesByFastForward
    -> Text -> MergeBranchesByFastForward)
-> Lens
     MergeBranchesByFastForward MergeBranchesByFastForward Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForward' {Text
repositoryName :: Text
$sel:repositoryName:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Text
repositoryName} -> Text
repositoryName) (\s :: MergeBranchesByFastForward
s@MergeBranchesByFastForward' {} Text
a -> MergeBranchesByFastForward
s {$sel:repositoryName:MergeBranchesByFastForward' :: Text
repositoryName = Text
a} :: MergeBranchesByFastForward)

-- | The branch, tag, HEAD, or other fully qualified reference used to
-- identify a commit (for example, a branch name or a full commit ID).
mergeBranchesByFastForward_sourceCommitSpecifier :: Lens.Lens' MergeBranchesByFastForward Prelude.Text
mergeBranchesByFastForward_sourceCommitSpecifier :: (Text -> f Text)
-> MergeBranchesByFastForward -> f MergeBranchesByFastForward
mergeBranchesByFastForward_sourceCommitSpecifier = (MergeBranchesByFastForward -> Text)
-> (MergeBranchesByFastForward
    -> Text -> MergeBranchesByFastForward)
-> Lens
     MergeBranchesByFastForward MergeBranchesByFastForward Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForward' {Text
sourceCommitSpecifier :: Text
$sel:sourceCommitSpecifier:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Text
sourceCommitSpecifier} -> Text
sourceCommitSpecifier) (\s :: MergeBranchesByFastForward
s@MergeBranchesByFastForward' {} Text
a -> MergeBranchesByFastForward
s {$sel:sourceCommitSpecifier:MergeBranchesByFastForward' :: Text
sourceCommitSpecifier = Text
a} :: MergeBranchesByFastForward)

-- | The branch, tag, HEAD, or other fully qualified reference used to
-- identify a commit (for example, a branch name or a full commit ID).
mergeBranchesByFastForward_destinationCommitSpecifier :: Lens.Lens' MergeBranchesByFastForward Prelude.Text
mergeBranchesByFastForward_destinationCommitSpecifier :: (Text -> f Text)
-> MergeBranchesByFastForward -> f MergeBranchesByFastForward
mergeBranchesByFastForward_destinationCommitSpecifier = (MergeBranchesByFastForward -> Text)
-> (MergeBranchesByFastForward
    -> Text -> MergeBranchesByFastForward)
-> Lens
     MergeBranchesByFastForward MergeBranchesByFastForward Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForward' {Text
destinationCommitSpecifier :: Text
$sel:destinationCommitSpecifier:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Text
destinationCommitSpecifier} -> Text
destinationCommitSpecifier) (\s :: MergeBranchesByFastForward
s@MergeBranchesByFastForward' {} Text
a -> MergeBranchesByFastForward
s {$sel:destinationCommitSpecifier:MergeBranchesByFastForward' :: Text
destinationCommitSpecifier = Text
a} :: MergeBranchesByFastForward)

instance Core.AWSRequest MergeBranchesByFastForward where
  type
    AWSResponse MergeBranchesByFastForward =
      MergeBranchesByFastForwardResponse
  request :: MergeBranchesByFastForward -> Request MergeBranchesByFastForward
request = Service
-> MergeBranchesByFastForward -> Request MergeBranchesByFastForward
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy MergeBranchesByFastForward
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse MergeBranchesByFastForward)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse MergeBranchesByFastForward))
-> Logger
-> Service
-> Proxy MergeBranchesByFastForward
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse MergeBranchesByFastForward)))
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 Text
-> Maybe Text -> Int -> MergeBranchesByFastForwardResponse
MergeBranchesByFastForwardResponse'
            (Maybe Text
 -> Maybe Text -> Int -> MergeBranchesByFastForwardResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> MergeBranchesByFastForwardResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"commitId")
            Either
  String (Maybe Text -> Int -> MergeBranchesByFastForwardResponse)
-> Either String (Maybe Text)
-> Either String (Int -> MergeBranchesByFastForwardResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"treeId")
            Either String (Int -> MergeBranchesByFastForwardResponse)
-> Either String Int
-> Either String MergeBranchesByFastForwardResponse
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 MergeBranchesByFastForward

instance Prelude.NFData MergeBranchesByFastForward

instance Core.ToHeaders MergeBranchesByFastForward where
  toHeaders :: MergeBranchesByFastForward -> ResponseHeaders
toHeaders =
    ResponseHeaders -> MergeBranchesByFastForward -> 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.MergeBranchesByFastForward" ::
                          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 MergeBranchesByFastForward where
  toJSON :: MergeBranchesByFastForward -> Value
toJSON MergeBranchesByFastForward' {Maybe Text
Text
destinationCommitSpecifier :: Text
sourceCommitSpecifier :: Text
repositoryName :: Text
targetBranch :: Maybe Text
$sel:destinationCommitSpecifier:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Text
$sel:sourceCommitSpecifier:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Text
$sel:repositoryName:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Text
$sel:targetBranch:MergeBranchesByFastForward' :: MergeBranchesByFastForward -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"targetBranch" 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
targetBranch,
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"sourceCommitSpecifier"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceCommitSpecifier
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"destinationCommitSpecifier"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationCommitSpecifier
              )
          ]
      )

instance Core.ToPath MergeBranchesByFastForward where
  toPath :: MergeBranchesByFastForward -> ByteString
toPath = ByteString -> MergeBranchesByFastForward -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery MergeBranchesByFastForward where
  toQuery :: MergeBranchesByFastForward -> QueryString
toQuery = QueryString -> MergeBranchesByFastForward -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newMergeBranchesByFastForwardResponse' smart constructor.
data MergeBranchesByFastForwardResponse = MergeBranchesByFastForwardResponse'
  { -- | The commit ID of the merge in the destination or target branch.
    MergeBranchesByFastForwardResponse -> Maybe Text
commitId :: Prelude.Maybe Prelude.Text,
    -- | The tree ID of the merge in the destination or target branch.
    MergeBranchesByFastForwardResponse -> Maybe Text
treeId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    MergeBranchesByFastForwardResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (MergeBranchesByFastForwardResponse
-> MergeBranchesByFastForwardResponse -> Bool
(MergeBranchesByFastForwardResponse
 -> MergeBranchesByFastForwardResponse -> Bool)
-> (MergeBranchesByFastForwardResponse
    -> MergeBranchesByFastForwardResponse -> Bool)
-> Eq MergeBranchesByFastForwardResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeBranchesByFastForwardResponse
-> MergeBranchesByFastForwardResponse -> Bool
$c/= :: MergeBranchesByFastForwardResponse
-> MergeBranchesByFastForwardResponse -> Bool
== :: MergeBranchesByFastForwardResponse
-> MergeBranchesByFastForwardResponse -> Bool
$c== :: MergeBranchesByFastForwardResponse
-> MergeBranchesByFastForwardResponse -> Bool
Prelude.Eq, ReadPrec [MergeBranchesByFastForwardResponse]
ReadPrec MergeBranchesByFastForwardResponse
Int -> ReadS MergeBranchesByFastForwardResponse
ReadS [MergeBranchesByFastForwardResponse]
(Int -> ReadS MergeBranchesByFastForwardResponse)
-> ReadS [MergeBranchesByFastForwardResponse]
-> ReadPrec MergeBranchesByFastForwardResponse
-> ReadPrec [MergeBranchesByFastForwardResponse]
-> Read MergeBranchesByFastForwardResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeBranchesByFastForwardResponse]
$creadListPrec :: ReadPrec [MergeBranchesByFastForwardResponse]
readPrec :: ReadPrec MergeBranchesByFastForwardResponse
$creadPrec :: ReadPrec MergeBranchesByFastForwardResponse
readList :: ReadS [MergeBranchesByFastForwardResponse]
$creadList :: ReadS [MergeBranchesByFastForwardResponse]
readsPrec :: Int -> ReadS MergeBranchesByFastForwardResponse
$creadsPrec :: Int -> ReadS MergeBranchesByFastForwardResponse
Prelude.Read, Int -> MergeBranchesByFastForwardResponse -> ShowS
[MergeBranchesByFastForwardResponse] -> ShowS
MergeBranchesByFastForwardResponse -> String
(Int -> MergeBranchesByFastForwardResponse -> ShowS)
-> (MergeBranchesByFastForwardResponse -> String)
-> ([MergeBranchesByFastForwardResponse] -> ShowS)
-> Show MergeBranchesByFastForwardResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeBranchesByFastForwardResponse] -> ShowS
$cshowList :: [MergeBranchesByFastForwardResponse] -> ShowS
show :: MergeBranchesByFastForwardResponse -> String
$cshow :: MergeBranchesByFastForwardResponse -> String
showsPrec :: Int -> MergeBranchesByFastForwardResponse -> ShowS
$cshowsPrec :: Int -> MergeBranchesByFastForwardResponse -> ShowS
Prelude.Show, (forall x.
 MergeBranchesByFastForwardResponse
 -> Rep MergeBranchesByFastForwardResponse x)
-> (forall x.
    Rep MergeBranchesByFastForwardResponse x
    -> MergeBranchesByFastForwardResponse)
-> Generic MergeBranchesByFastForwardResponse
forall x.
Rep MergeBranchesByFastForwardResponse x
-> MergeBranchesByFastForwardResponse
forall x.
MergeBranchesByFastForwardResponse
-> Rep MergeBranchesByFastForwardResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MergeBranchesByFastForwardResponse x
-> MergeBranchesByFastForwardResponse
$cfrom :: forall x.
MergeBranchesByFastForwardResponse
-> Rep MergeBranchesByFastForwardResponse x
Prelude.Generic)

-- |
-- Create a value of 'MergeBranchesByFastForwardResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'commitId', 'mergeBranchesByFastForwardResponse_commitId' - The commit ID of the merge in the destination or target branch.
--
-- 'treeId', 'mergeBranchesByFastForwardResponse_treeId' - The tree ID of the merge in the destination or target branch.
--
-- 'httpStatus', 'mergeBranchesByFastForwardResponse_httpStatus' - The response's http status code.
newMergeBranchesByFastForwardResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  MergeBranchesByFastForwardResponse
newMergeBranchesByFastForwardResponse :: Int -> MergeBranchesByFastForwardResponse
newMergeBranchesByFastForwardResponse Int
pHttpStatus_ =
  MergeBranchesByFastForwardResponse' :: Maybe Text
-> Maybe Text -> Int -> MergeBranchesByFastForwardResponse
MergeBranchesByFastForwardResponse'
    { $sel:commitId:MergeBranchesByFastForwardResponse' :: Maybe Text
commitId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:treeId:MergeBranchesByFastForwardResponse' :: Maybe Text
treeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:MergeBranchesByFastForwardResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The commit ID of the merge in the destination or target branch.
mergeBranchesByFastForwardResponse_commitId :: Lens.Lens' MergeBranchesByFastForwardResponse (Prelude.Maybe Prelude.Text)
mergeBranchesByFastForwardResponse_commitId :: (Maybe Text -> f (Maybe Text))
-> MergeBranchesByFastForwardResponse
-> f MergeBranchesByFastForwardResponse
mergeBranchesByFastForwardResponse_commitId = (MergeBranchesByFastForwardResponse -> Maybe Text)
-> (MergeBranchesByFastForwardResponse
    -> Maybe Text -> MergeBranchesByFastForwardResponse)
-> Lens
     MergeBranchesByFastForwardResponse
     MergeBranchesByFastForwardResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForwardResponse' {Maybe Text
commitId :: Maybe Text
$sel:commitId:MergeBranchesByFastForwardResponse' :: MergeBranchesByFastForwardResponse -> Maybe Text
commitId} -> Maybe Text
commitId) (\s :: MergeBranchesByFastForwardResponse
s@MergeBranchesByFastForwardResponse' {} Maybe Text
a -> MergeBranchesByFastForwardResponse
s {$sel:commitId:MergeBranchesByFastForwardResponse' :: Maybe Text
commitId = Maybe Text
a} :: MergeBranchesByFastForwardResponse)

-- | The tree ID of the merge in the destination or target branch.
mergeBranchesByFastForwardResponse_treeId :: Lens.Lens' MergeBranchesByFastForwardResponse (Prelude.Maybe Prelude.Text)
mergeBranchesByFastForwardResponse_treeId :: (Maybe Text -> f (Maybe Text))
-> MergeBranchesByFastForwardResponse
-> f MergeBranchesByFastForwardResponse
mergeBranchesByFastForwardResponse_treeId = (MergeBranchesByFastForwardResponse -> Maybe Text)
-> (MergeBranchesByFastForwardResponse
    -> Maybe Text -> MergeBranchesByFastForwardResponse)
-> Lens
     MergeBranchesByFastForwardResponse
     MergeBranchesByFastForwardResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForwardResponse' {Maybe Text
treeId :: Maybe Text
$sel:treeId:MergeBranchesByFastForwardResponse' :: MergeBranchesByFastForwardResponse -> Maybe Text
treeId} -> Maybe Text
treeId) (\s :: MergeBranchesByFastForwardResponse
s@MergeBranchesByFastForwardResponse' {} Maybe Text
a -> MergeBranchesByFastForwardResponse
s {$sel:treeId:MergeBranchesByFastForwardResponse' :: Maybe Text
treeId = Maybe Text
a} :: MergeBranchesByFastForwardResponse)

-- | The response's http status code.
mergeBranchesByFastForwardResponse_httpStatus :: Lens.Lens' MergeBranchesByFastForwardResponse Prelude.Int
mergeBranchesByFastForwardResponse_httpStatus :: (Int -> f Int)
-> MergeBranchesByFastForwardResponse
-> f MergeBranchesByFastForwardResponse
mergeBranchesByFastForwardResponse_httpStatus = (MergeBranchesByFastForwardResponse -> Int)
-> (MergeBranchesByFastForwardResponse
    -> Int -> MergeBranchesByFastForwardResponse)
-> Lens
     MergeBranchesByFastForwardResponse
     MergeBranchesByFastForwardResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeBranchesByFastForwardResponse' {Int
httpStatus :: Int
$sel:httpStatus:MergeBranchesByFastForwardResponse' :: MergeBranchesByFastForwardResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: MergeBranchesByFastForwardResponse
s@MergeBranchesByFastForwardResponse' {} Int
a -> MergeBranchesByFastForwardResponse
s {$sel:httpStatus:MergeBranchesByFastForwardResponse' :: Int
httpStatus = Int
a} :: MergeBranchesByFastForwardResponse)

instance
  Prelude.NFData
    MergeBranchesByFastForwardResponse