{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.SageMaker.Types.GitConfigForUpdate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.GitConfigForUpdate where

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

-- | Specifies configuration details for a Git repository when the repository
-- is updated.
--
-- /See:/ 'newGitConfigForUpdate' smart constructor.
data GitConfigForUpdate = GitConfigForUpdate'
  { -- | The Amazon Resource Name (ARN) of the Amazon Web Services Secrets
    -- Manager secret that contains the credentials used to access the git
    -- repository. The secret must have a staging label of @AWSCURRENT@ and
    -- must be in the following format:
    --
    -- @{\"username\": @/@UserName@/@, \"password\": @/@Password@/@}@
    GitConfigForUpdate -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text
  }
  deriving (GitConfigForUpdate -> GitConfigForUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GitConfigForUpdate -> GitConfigForUpdate -> Bool
$c/= :: GitConfigForUpdate -> GitConfigForUpdate -> Bool
== :: GitConfigForUpdate -> GitConfigForUpdate -> Bool
$c== :: GitConfigForUpdate -> GitConfigForUpdate -> Bool
Prelude.Eq, ReadPrec [GitConfigForUpdate]
ReadPrec GitConfigForUpdate
Int -> ReadS GitConfigForUpdate
ReadS [GitConfigForUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GitConfigForUpdate]
$creadListPrec :: ReadPrec [GitConfigForUpdate]
readPrec :: ReadPrec GitConfigForUpdate
$creadPrec :: ReadPrec GitConfigForUpdate
readList :: ReadS [GitConfigForUpdate]
$creadList :: ReadS [GitConfigForUpdate]
readsPrec :: Int -> ReadS GitConfigForUpdate
$creadsPrec :: Int -> ReadS GitConfigForUpdate
Prelude.Read, Int -> GitConfigForUpdate -> ShowS
[GitConfigForUpdate] -> ShowS
GitConfigForUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GitConfigForUpdate] -> ShowS
$cshowList :: [GitConfigForUpdate] -> ShowS
show :: GitConfigForUpdate -> String
$cshow :: GitConfigForUpdate -> String
showsPrec :: Int -> GitConfigForUpdate -> ShowS
$cshowsPrec :: Int -> GitConfigForUpdate -> ShowS
Prelude.Show, forall x. Rep GitConfigForUpdate x -> GitConfigForUpdate
forall x. GitConfigForUpdate -> Rep GitConfigForUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GitConfigForUpdate x -> GitConfigForUpdate
$cfrom :: forall x. GitConfigForUpdate -> Rep GitConfigForUpdate x
Prelude.Generic)

-- |
-- Create a value of 'GitConfigForUpdate' 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:
--
-- 'secretArn', 'gitConfigForUpdate_secretArn' - The Amazon Resource Name (ARN) of the Amazon Web Services Secrets
-- Manager secret that contains the credentials used to access the git
-- repository. The secret must have a staging label of @AWSCURRENT@ and
-- must be in the following format:
--
-- @{\"username\": @/@UserName@/@, \"password\": @/@Password@/@}@
newGitConfigForUpdate ::
  GitConfigForUpdate
newGitConfigForUpdate :: GitConfigForUpdate
newGitConfigForUpdate =
  GitConfigForUpdate' {$sel:secretArn:GitConfigForUpdate' :: Maybe Text
secretArn = forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Resource Name (ARN) of the Amazon Web Services Secrets
-- Manager secret that contains the credentials used to access the git
-- repository. The secret must have a staging label of @AWSCURRENT@ and
-- must be in the following format:
--
-- @{\"username\": @/@UserName@/@, \"password\": @/@Password@/@}@
gitConfigForUpdate_secretArn :: Lens.Lens' GitConfigForUpdate (Prelude.Maybe Prelude.Text)
gitConfigForUpdate_secretArn :: Lens' GitConfigForUpdate (Maybe Text)
gitConfigForUpdate_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitConfigForUpdate' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:GitConfigForUpdate' :: GitConfigForUpdate -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: GitConfigForUpdate
s@GitConfigForUpdate' {} Maybe Text
a -> GitConfigForUpdate
s {$sel:secretArn:GitConfigForUpdate' :: Maybe Text
secretArn = Maybe Text
a} :: GitConfigForUpdate)

instance Prelude.Hashable GitConfigForUpdate where
  hashWithSalt :: Int -> GitConfigForUpdate -> Int
hashWithSalt Int
_salt GitConfigForUpdate' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:GitConfigForUpdate' :: GitConfigForUpdate -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretArn

instance Prelude.NFData GitConfigForUpdate where
  rnf :: GitConfigForUpdate -> ()
rnf GitConfigForUpdate' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:GitConfigForUpdate' :: GitConfigForUpdate -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretArn

instance Data.ToJSON GitConfigForUpdate where
  toJSON :: GitConfigForUpdate -> Value
toJSON GitConfigForUpdate' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:GitConfigForUpdate' :: GitConfigForUpdate -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"SecretArn" 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 Text
secretArn]
      )