{-# 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-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)
module Amazonka.SageMaker.Types.GitConfigForUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(GitConfigForUpdate -> GitConfigForUpdate -> Bool)
-> (GitConfigForUpdate -> GitConfigForUpdate -> Bool)
-> Eq GitConfigForUpdate
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]
(Int -> ReadS GitConfigForUpdate)
-> ReadS [GitConfigForUpdate]
-> ReadPrec GitConfigForUpdate
-> ReadPrec [GitConfigForUpdate]
-> Read 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
(Int -> GitConfigForUpdate -> ShowS)
-> (GitConfigForUpdate -> String)
-> ([GitConfigForUpdate] -> ShowS)
-> Show GitConfigForUpdate
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. GitConfigForUpdate -> Rep GitConfigForUpdate x)
-> (forall x. Rep GitConfigForUpdate x -> GitConfigForUpdate)
-> Generic GitConfigForUpdate
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' :: Maybe Text -> GitConfigForUpdate
GitConfigForUpdate' {$sel:secretArn:GitConfigForUpdate' :: Maybe Text
secretArn = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> GitConfigForUpdate -> f GitConfigForUpdate
gitConfigForUpdate_secretArn = (GitConfigForUpdate -> Maybe Text)
-> (GitConfigForUpdate -> Maybe Text -> GitConfigForUpdate)
-> Lens
     GitConfigForUpdate GitConfigForUpdate (Maybe Text) (Maybe Text)
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

instance Prelude.NFData GitConfigForUpdate

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