{-# 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.GetMergeOptions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about the merge options available for merging two
-- specified branches. For details about why a merge option is not
-- available, use GetMergeConflicts or DescribeMergeConflicts.
module Amazonka.CodeCommit.GetMergeOptions
  ( -- * Creating a Request
    GetMergeOptions (..),
    newGetMergeOptions,

    -- * Request Lenses
    getMergeOptions_conflictDetailLevel,
    getMergeOptions_conflictResolutionStrategy,
    getMergeOptions_repositoryName,
    getMergeOptions_sourceCommitSpecifier,
    getMergeOptions_destinationCommitSpecifier,

    -- * Destructuring the Response
    GetMergeOptionsResponse (..),
    newGetMergeOptionsResponse,

    -- * Response Lenses
    getMergeOptionsResponse_httpStatus,
    getMergeOptionsResponse_mergeOptions,
    getMergeOptionsResponse_sourceCommitId,
    getMergeOptionsResponse_destinationCommitId,
    getMergeOptionsResponse_baseCommitId,
  )
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

-- | /See:/ 'newGetMergeOptions' smart constructor.
data GetMergeOptions = GetMergeOptions'
  { -- | The level of conflict detail to use. If unspecified, the default
    -- FILE_LEVEL is used, which returns a not-mergeable result if the same
    -- file has differences in both branches. If LINE_LEVEL is specified, a
    -- conflict is considered not mergeable if the same file in both branches
    -- has differences on the same line.
    GetMergeOptions -> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel :: Prelude.Maybe ConflictDetailLevelTypeEnum,
    -- | Specifies which branch to use when resolving conflicts, or whether to
    -- attempt automatically merging two versions of a file. The default is
    -- NONE, which requires any conflicts to be resolved manually before the
    -- merge operation is successful.
    GetMergeOptions -> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy :: Prelude.Maybe ConflictResolutionStrategyTypeEnum,
    -- | The name of the repository that contains the commits about which you
    -- want to get merge options.
    GetMergeOptions -> 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).
    GetMergeOptions -> 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).
    GetMergeOptions -> Text
destinationCommitSpecifier :: Prelude.Text
  }
  deriving (GetMergeOptions -> GetMergeOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMergeOptions -> GetMergeOptions -> Bool
$c/= :: GetMergeOptions -> GetMergeOptions -> Bool
== :: GetMergeOptions -> GetMergeOptions -> Bool
$c== :: GetMergeOptions -> GetMergeOptions -> Bool
Prelude.Eq, ReadPrec [GetMergeOptions]
ReadPrec GetMergeOptions
Int -> ReadS GetMergeOptions
ReadS [GetMergeOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMergeOptions]
$creadListPrec :: ReadPrec [GetMergeOptions]
readPrec :: ReadPrec GetMergeOptions
$creadPrec :: ReadPrec GetMergeOptions
readList :: ReadS [GetMergeOptions]
$creadList :: ReadS [GetMergeOptions]
readsPrec :: Int -> ReadS GetMergeOptions
$creadsPrec :: Int -> ReadS GetMergeOptions
Prelude.Read, Int -> GetMergeOptions -> ShowS
[GetMergeOptions] -> ShowS
GetMergeOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMergeOptions] -> ShowS
$cshowList :: [GetMergeOptions] -> ShowS
show :: GetMergeOptions -> String
$cshow :: GetMergeOptions -> String
showsPrec :: Int -> GetMergeOptions -> ShowS
$cshowsPrec :: Int -> GetMergeOptions -> ShowS
Prelude.Show, forall x. Rep GetMergeOptions x -> GetMergeOptions
forall x. GetMergeOptions -> Rep GetMergeOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMergeOptions x -> GetMergeOptions
$cfrom :: forall x. GetMergeOptions -> Rep GetMergeOptions x
Prelude.Generic)

-- |
-- Create a value of 'GetMergeOptions' 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:
--
-- 'conflictDetailLevel', 'getMergeOptions_conflictDetailLevel' - The level of conflict detail to use. If unspecified, the default
-- FILE_LEVEL is used, which returns a not-mergeable result if the same
-- file has differences in both branches. If LINE_LEVEL is specified, a
-- conflict is considered not mergeable if the same file in both branches
-- has differences on the same line.
--
-- 'conflictResolutionStrategy', 'getMergeOptions_conflictResolutionStrategy' - Specifies which branch to use when resolving conflicts, or whether to
-- attempt automatically merging two versions of a file. The default is
-- NONE, which requires any conflicts to be resolved manually before the
-- merge operation is successful.
--
-- 'repositoryName', 'getMergeOptions_repositoryName' - The name of the repository that contains the commits about which you
-- want to get merge options.
--
-- 'sourceCommitSpecifier', 'getMergeOptions_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', 'getMergeOptions_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).
newGetMergeOptions ::
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'sourceCommitSpecifier'
  Prelude.Text ->
  -- | 'destinationCommitSpecifier'
  Prelude.Text ->
  GetMergeOptions
newGetMergeOptions :: Text -> Text -> Text -> GetMergeOptions
newGetMergeOptions
  Text
pRepositoryName_
  Text
pSourceCommitSpecifier_
  Text
pDestinationCommitSpecifier_ =
    GetMergeOptions'
      { $sel:conflictDetailLevel:GetMergeOptions' :: Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel =
          forall a. Maybe a
Prelude.Nothing,
        $sel:conflictResolutionStrategy:GetMergeOptions' :: Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy = forall a. Maybe a
Prelude.Nothing,
        $sel:repositoryName:GetMergeOptions' :: Text
repositoryName = Text
pRepositoryName_,
        $sel:sourceCommitSpecifier:GetMergeOptions' :: Text
sourceCommitSpecifier = Text
pSourceCommitSpecifier_,
        $sel:destinationCommitSpecifier:GetMergeOptions' :: Text
destinationCommitSpecifier =
          Text
pDestinationCommitSpecifier_
      }

-- | The level of conflict detail to use. If unspecified, the default
-- FILE_LEVEL is used, which returns a not-mergeable result if the same
-- file has differences in both branches. If LINE_LEVEL is specified, a
-- conflict is considered not mergeable if the same file in both branches
-- has differences on the same line.
getMergeOptions_conflictDetailLevel :: Lens.Lens' GetMergeOptions (Prelude.Maybe ConflictDetailLevelTypeEnum)
getMergeOptions_conflictDetailLevel :: Lens' GetMergeOptions (Maybe ConflictDetailLevelTypeEnum)
getMergeOptions_conflictDetailLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptions' {Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel :: Maybe ConflictDetailLevelTypeEnum
$sel:conflictDetailLevel:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel} -> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel) (\s :: GetMergeOptions
s@GetMergeOptions' {} Maybe ConflictDetailLevelTypeEnum
a -> GetMergeOptions
s {$sel:conflictDetailLevel:GetMergeOptions' :: Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel = Maybe ConflictDetailLevelTypeEnum
a} :: GetMergeOptions)

-- | Specifies which branch to use when resolving conflicts, or whether to
-- attempt automatically merging two versions of a file. The default is
-- NONE, which requires any conflicts to be resolved manually before the
-- merge operation is successful.
getMergeOptions_conflictResolutionStrategy :: Lens.Lens' GetMergeOptions (Prelude.Maybe ConflictResolutionStrategyTypeEnum)
getMergeOptions_conflictResolutionStrategy :: Lens' GetMergeOptions (Maybe ConflictResolutionStrategyTypeEnum)
getMergeOptions_conflictResolutionStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptions' {Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy :: Maybe ConflictResolutionStrategyTypeEnum
$sel:conflictResolutionStrategy:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy} -> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy) (\s :: GetMergeOptions
s@GetMergeOptions' {} Maybe ConflictResolutionStrategyTypeEnum
a -> GetMergeOptions
s {$sel:conflictResolutionStrategy:GetMergeOptions' :: Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy = Maybe ConflictResolutionStrategyTypeEnum
a} :: GetMergeOptions)

-- | The name of the repository that contains the commits about which you
-- want to get merge options.
getMergeOptions_repositoryName :: Lens.Lens' GetMergeOptions Prelude.Text
getMergeOptions_repositoryName :: Lens' GetMergeOptions Text
getMergeOptions_repositoryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptions' {Text
repositoryName :: Text
$sel:repositoryName:GetMergeOptions' :: GetMergeOptions -> Text
repositoryName} -> Text
repositoryName) (\s :: GetMergeOptions
s@GetMergeOptions' {} Text
a -> GetMergeOptions
s {$sel:repositoryName:GetMergeOptions' :: Text
repositoryName = Text
a} :: GetMergeOptions)

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

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

instance Core.AWSRequest GetMergeOptions where
  type
    AWSResponse GetMergeOptions =
      GetMergeOptionsResponse
  request :: (Service -> Service) -> GetMergeOptions -> Request GetMergeOptions
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 GetMergeOptions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMergeOptions)))
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 ->
          Int
-> [MergeOptionTypeEnum]
-> Text
-> Text
-> Text
-> GetMergeOptionsResponse
GetMergeOptionsResponse'
            forall (f :: * -> *) a b. Functor 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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"mergeOptions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"sourceCommitId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"destinationCommitId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"baseCommitId")
      )

instance Prelude.Hashable GetMergeOptions where
  hashWithSalt :: Int -> GetMergeOptions -> Int
hashWithSalt Int
_salt GetMergeOptions' {Maybe ConflictDetailLevelTypeEnum
Maybe ConflictResolutionStrategyTypeEnum
Text
destinationCommitSpecifier :: Text
sourceCommitSpecifier :: Text
repositoryName :: Text
conflictResolutionStrategy :: Maybe ConflictResolutionStrategyTypeEnum
conflictDetailLevel :: Maybe ConflictDetailLevelTypeEnum
$sel:destinationCommitSpecifier:GetMergeOptions' :: GetMergeOptions -> Text
$sel:sourceCommitSpecifier:GetMergeOptions' :: GetMergeOptions -> Text
$sel:repositoryName:GetMergeOptions' :: GetMergeOptions -> Text
$sel:conflictResolutionStrategy:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictResolutionStrategyTypeEnum
$sel:conflictDetailLevel:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictDetailLevelTypeEnum
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repositoryName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceCommitSpecifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationCommitSpecifier

instance Prelude.NFData GetMergeOptions where
  rnf :: GetMergeOptions -> ()
rnf GetMergeOptions' {Maybe ConflictDetailLevelTypeEnum
Maybe ConflictResolutionStrategyTypeEnum
Text
destinationCommitSpecifier :: Text
sourceCommitSpecifier :: Text
repositoryName :: Text
conflictResolutionStrategy :: Maybe ConflictResolutionStrategyTypeEnum
conflictDetailLevel :: Maybe ConflictDetailLevelTypeEnum
$sel:destinationCommitSpecifier:GetMergeOptions' :: GetMergeOptions -> Text
$sel:sourceCommitSpecifier:GetMergeOptions' :: GetMergeOptions -> Text
$sel:repositoryName:GetMergeOptions' :: GetMergeOptions -> Text
$sel:conflictResolutionStrategy:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictResolutionStrategyTypeEnum
$sel:conflictDetailLevel:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictDetailLevelTypeEnum
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
repositoryName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceCommitSpecifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationCommitSpecifier

instance Data.ToHeaders GetMergeOptions where
  toHeaders :: GetMergeOptions -> 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.GetMergeOptions" ::
                          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 GetMergeOptions where
  toJSON :: GetMergeOptions -> Value
toJSON GetMergeOptions' {Maybe ConflictDetailLevelTypeEnum
Maybe ConflictResolutionStrategyTypeEnum
Text
destinationCommitSpecifier :: Text
sourceCommitSpecifier :: Text
repositoryName :: Text
conflictResolutionStrategy :: Maybe ConflictResolutionStrategyTypeEnum
conflictDetailLevel :: Maybe ConflictDetailLevelTypeEnum
$sel:destinationCommitSpecifier:GetMergeOptions' :: GetMergeOptions -> Text
$sel:sourceCommitSpecifier:GetMergeOptions' :: GetMergeOptions -> Text
$sel:repositoryName:GetMergeOptions' :: GetMergeOptions -> Text
$sel:conflictResolutionStrategy:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictResolutionStrategyTypeEnum
$sel:conflictDetailLevel:GetMergeOptions' :: GetMergeOptions -> Maybe ConflictDetailLevelTypeEnum
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"conflictDetailLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConflictDetailLevelTypeEnum
conflictDetailLevel,
            (Key
"conflictResolutionStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConflictResolutionStrategyTypeEnum
conflictResolutionStrategy,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"repositoryName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
repositoryName),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"sourceCommitSpecifier"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sourceCommitSpecifier
              ),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"destinationCommitSpecifier"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
destinationCommitSpecifier
              )
          ]
      )

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

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

-- | /See:/ 'newGetMergeOptionsResponse' smart constructor.
data GetMergeOptionsResponse = GetMergeOptionsResponse'
  { -- | The response's http status code.
    GetMergeOptionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The merge option or strategy used to merge the code.
    GetMergeOptionsResponse -> [MergeOptionTypeEnum]
mergeOptions :: [MergeOptionTypeEnum],
    -- | The commit ID of the source commit specifier that was used in the merge
    -- evaluation.
    GetMergeOptionsResponse -> Text
sourceCommitId :: Prelude.Text,
    -- | The commit ID of the destination commit specifier that was used in the
    -- merge evaluation.
    GetMergeOptionsResponse -> Text
destinationCommitId :: Prelude.Text,
    -- | The commit ID of the merge base.
    GetMergeOptionsResponse -> Text
baseCommitId :: Prelude.Text
  }
  deriving (GetMergeOptionsResponse -> GetMergeOptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMergeOptionsResponse -> GetMergeOptionsResponse -> Bool
$c/= :: GetMergeOptionsResponse -> GetMergeOptionsResponse -> Bool
== :: GetMergeOptionsResponse -> GetMergeOptionsResponse -> Bool
$c== :: GetMergeOptionsResponse -> GetMergeOptionsResponse -> Bool
Prelude.Eq, ReadPrec [GetMergeOptionsResponse]
ReadPrec GetMergeOptionsResponse
Int -> ReadS GetMergeOptionsResponse
ReadS [GetMergeOptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMergeOptionsResponse]
$creadListPrec :: ReadPrec [GetMergeOptionsResponse]
readPrec :: ReadPrec GetMergeOptionsResponse
$creadPrec :: ReadPrec GetMergeOptionsResponse
readList :: ReadS [GetMergeOptionsResponse]
$creadList :: ReadS [GetMergeOptionsResponse]
readsPrec :: Int -> ReadS GetMergeOptionsResponse
$creadsPrec :: Int -> ReadS GetMergeOptionsResponse
Prelude.Read, Int -> GetMergeOptionsResponse -> ShowS
[GetMergeOptionsResponse] -> ShowS
GetMergeOptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMergeOptionsResponse] -> ShowS
$cshowList :: [GetMergeOptionsResponse] -> ShowS
show :: GetMergeOptionsResponse -> String
$cshow :: GetMergeOptionsResponse -> String
showsPrec :: Int -> GetMergeOptionsResponse -> ShowS
$cshowsPrec :: Int -> GetMergeOptionsResponse -> ShowS
Prelude.Show, forall x. Rep GetMergeOptionsResponse x -> GetMergeOptionsResponse
forall x. GetMergeOptionsResponse -> Rep GetMergeOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMergeOptionsResponse x -> GetMergeOptionsResponse
$cfrom :: forall x. GetMergeOptionsResponse -> Rep GetMergeOptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMergeOptionsResponse' 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:
--
-- 'httpStatus', 'getMergeOptionsResponse_httpStatus' - The response's http status code.
--
-- 'mergeOptions', 'getMergeOptionsResponse_mergeOptions' - The merge option or strategy used to merge the code.
--
-- 'sourceCommitId', 'getMergeOptionsResponse_sourceCommitId' - The commit ID of the source commit specifier that was used in the merge
-- evaluation.
--
-- 'destinationCommitId', 'getMergeOptionsResponse_destinationCommitId' - The commit ID of the destination commit specifier that was used in the
-- merge evaluation.
--
-- 'baseCommitId', 'getMergeOptionsResponse_baseCommitId' - The commit ID of the merge base.
newGetMergeOptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'sourceCommitId'
  Prelude.Text ->
  -- | 'destinationCommitId'
  Prelude.Text ->
  -- | 'baseCommitId'
  Prelude.Text ->
  GetMergeOptionsResponse
newGetMergeOptionsResponse :: Int -> Text -> Text -> Text -> GetMergeOptionsResponse
newGetMergeOptionsResponse
  Int
pHttpStatus_
  Text
pSourceCommitId_
  Text
pDestinationCommitId_
  Text
pBaseCommitId_ =
    GetMergeOptionsResponse'
      { $sel:httpStatus:GetMergeOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:mergeOptions:GetMergeOptionsResponse' :: [MergeOptionTypeEnum]
mergeOptions = forall a. Monoid a => a
Prelude.mempty,
        $sel:sourceCommitId:GetMergeOptionsResponse' :: Text
sourceCommitId = Text
pSourceCommitId_,
        $sel:destinationCommitId:GetMergeOptionsResponse' :: Text
destinationCommitId = Text
pDestinationCommitId_,
        $sel:baseCommitId:GetMergeOptionsResponse' :: Text
baseCommitId = Text
pBaseCommitId_
      }

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

-- | The merge option or strategy used to merge the code.
getMergeOptionsResponse_mergeOptions :: Lens.Lens' GetMergeOptionsResponse [MergeOptionTypeEnum]
getMergeOptionsResponse_mergeOptions :: Lens' GetMergeOptionsResponse [MergeOptionTypeEnum]
getMergeOptionsResponse_mergeOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptionsResponse' {[MergeOptionTypeEnum]
mergeOptions :: [MergeOptionTypeEnum]
$sel:mergeOptions:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> [MergeOptionTypeEnum]
mergeOptions} -> [MergeOptionTypeEnum]
mergeOptions) (\s :: GetMergeOptionsResponse
s@GetMergeOptionsResponse' {} [MergeOptionTypeEnum]
a -> GetMergeOptionsResponse
s {$sel:mergeOptions:GetMergeOptionsResponse' :: [MergeOptionTypeEnum]
mergeOptions = [MergeOptionTypeEnum]
a} :: GetMergeOptionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The commit ID of the source commit specifier that was used in the merge
-- evaluation.
getMergeOptionsResponse_sourceCommitId :: Lens.Lens' GetMergeOptionsResponse Prelude.Text
getMergeOptionsResponse_sourceCommitId :: Lens' GetMergeOptionsResponse Text
getMergeOptionsResponse_sourceCommitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptionsResponse' {Text
sourceCommitId :: Text
$sel:sourceCommitId:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Text
sourceCommitId} -> Text
sourceCommitId) (\s :: GetMergeOptionsResponse
s@GetMergeOptionsResponse' {} Text
a -> GetMergeOptionsResponse
s {$sel:sourceCommitId:GetMergeOptionsResponse' :: Text
sourceCommitId = Text
a} :: GetMergeOptionsResponse)

-- | The commit ID of the destination commit specifier that was used in the
-- merge evaluation.
getMergeOptionsResponse_destinationCommitId :: Lens.Lens' GetMergeOptionsResponse Prelude.Text
getMergeOptionsResponse_destinationCommitId :: Lens' GetMergeOptionsResponse Text
getMergeOptionsResponse_destinationCommitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptionsResponse' {Text
destinationCommitId :: Text
$sel:destinationCommitId:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Text
destinationCommitId} -> Text
destinationCommitId) (\s :: GetMergeOptionsResponse
s@GetMergeOptionsResponse' {} Text
a -> GetMergeOptionsResponse
s {$sel:destinationCommitId:GetMergeOptionsResponse' :: Text
destinationCommitId = Text
a} :: GetMergeOptionsResponse)

-- | The commit ID of the merge base.
getMergeOptionsResponse_baseCommitId :: Lens.Lens' GetMergeOptionsResponse Prelude.Text
getMergeOptionsResponse_baseCommitId :: Lens' GetMergeOptionsResponse Text
getMergeOptionsResponse_baseCommitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMergeOptionsResponse' {Text
baseCommitId :: Text
$sel:baseCommitId:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Text
baseCommitId} -> Text
baseCommitId) (\s :: GetMergeOptionsResponse
s@GetMergeOptionsResponse' {} Text
a -> GetMergeOptionsResponse
s {$sel:baseCommitId:GetMergeOptionsResponse' :: Text
baseCommitId = Text
a} :: GetMergeOptionsResponse)

instance Prelude.NFData GetMergeOptionsResponse where
  rnf :: GetMergeOptionsResponse -> ()
rnf GetMergeOptionsResponse' {Int
[MergeOptionTypeEnum]
Text
baseCommitId :: Text
destinationCommitId :: Text
sourceCommitId :: Text
mergeOptions :: [MergeOptionTypeEnum]
httpStatus :: Int
$sel:baseCommitId:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Text
$sel:destinationCommitId:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Text
$sel:sourceCommitId:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Text
$sel:mergeOptions:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> [MergeOptionTypeEnum]
$sel:httpStatus:GetMergeOptionsResponse' :: GetMergeOptionsResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [MergeOptionTypeEnum]
mergeOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceCommitId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationCommitId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
baseCommitId