{-# 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 #-}
module Amazonka.SageMaker.Types.GitConfig 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
data GitConfig = GitConfig'
{
GitConfig -> Maybe Text
branch :: Prelude.Maybe Prelude.Text,
GitConfig -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
GitConfig -> Text
repositoryUrl :: Prelude.Text
}
deriving (GitConfig -> GitConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GitConfig -> GitConfig -> Bool
$c/= :: GitConfig -> GitConfig -> Bool
== :: GitConfig -> GitConfig -> Bool
$c== :: GitConfig -> GitConfig -> Bool
Prelude.Eq, ReadPrec [GitConfig]
ReadPrec GitConfig
Int -> ReadS GitConfig
ReadS [GitConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GitConfig]
$creadListPrec :: ReadPrec [GitConfig]
readPrec :: ReadPrec GitConfig
$creadPrec :: ReadPrec GitConfig
readList :: ReadS [GitConfig]
$creadList :: ReadS [GitConfig]
readsPrec :: Int -> ReadS GitConfig
$creadsPrec :: Int -> ReadS GitConfig
Prelude.Read, Int -> GitConfig -> ShowS
[GitConfig] -> ShowS
GitConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GitConfig] -> ShowS
$cshowList :: [GitConfig] -> ShowS
show :: GitConfig -> String
$cshow :: GitConfig -> String
showsPrec :: Int -> GitConfig -> ShowS
$cshowsPrec :: Int -> GitConfig -> ShowS
Prelude.Show, forall x. Rep GitConfig x -> GitConfig
forall x. GitConfig -> Rep GitConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GitConfig x -> GitConfig
$cfrom :: forall x. GitConfig -> Rep GitConfig x
Prelude.Generic)
newGitConfig ::
Prelude.Text ->
GitConfig
newGitConfig :: Text -> GitConfig
newGitConfig Text
pRepositoryUrl_ =
GitConfig'
{ $sel:branch:GitConfig' :: Maybe Text
branch = forall a. Maybe a
Prelude.Nothing,
$sel:secretArn:GitConfig' :: Maybe Text
secretArn = forall a. Maybe a
Prelude.Nothing,
$sel:repositoryUrl:GitConfig' :: Text
repositoryUrl = Text
pRepositoryUrl_
}
gitConfig_branch :: Lens.Lens' GitConfig (Prelude.Maybe Prelude.Text)
gitConfig_branch :: Lens' GitConfig (Maybe Text)
gitConfig_branch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitConfig' {Maybe Text
branch :: Maybe Text
$sel:branch:GitConfig' :: GitConfig -> Maybe Text
branch} -> Maybe Text
branch) (\s :: GitConfig
s@GitConfig' {} Maybe Text
a -> GitConfig
s {$sel:branch:GitConfig' :: Maybe Text
branch = Maybe Text
a} :: GitConfig)
gitConfig_secretArn :: Lens.Lens' GitConfig (Prelude.Maybe Prelude.Text)
gitConfig_secretArn :: Lens' GitConfig (Maybe Text)
gitConfig_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitConfig' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:GitConfig' :: GitConfig -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: GitConfig
s@GitConfig' {} Maybe Text
a -> GitConfig
s {$sel:secretArn:GitConfig' :: Maybe Text
secretArn = Maybe Text
a} :: GitConfig)
gitConfig_repositoryUrl :: Lens.Lens' GitConfig Prelude.Text
gitConfig_repositoryUrl :: Lens' GitConfig Text
gitConfig_repositoryUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GitConfig' {Text
repositoryUrl :: Text
$sel:repositoryUrl:GitConfig' :: GitConfig -> Text
repositoryUrl} -> Text
repositoryUrl) (\s :: GitConfig
s@GitConfig' {} Text
a -> GitConfig
s {$sel:repositoryUrl:GitConfig' :: Text
repositoryUrl = Text
a} :: GitConfig)
instance Data.FromJSON GitConfig where
parseJSON :: Value -> Parser GitConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GitConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> GitConfig
GitConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Branch")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecretArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RepositoryUrl")
)
instance Prelude.Hashable GitConfig where
hashWithSalt :: Int -> GitConfig -> Int
hashWithSalt Int
_salt GitConfig' {Maybe Text
Text
repositoryUrl :: Text
secretArn :: Maybe Text
branch :: Maybe Text
$sel:repositoryUrl:GitConfig' :: GitConfig -> Text
$sel:secretArn:GitConfig' :: GitConfig -> Maybe Text
$sel:branch:GitConfig' :: GitConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
branch
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repositoryUrl
instance Prelude.NFData GitConfig where
rnf :: GitConfig -> ()
rnf GitConfig' {Maybe Text
Text
repositoryUrl :: Text
secretArn :: Maybe Text
branch :: Maybe Text
$sel:repositoryUrl:GitConfig' :: GitConfig -> Text
$sel:secretArn:GitConfig' :: GitConfig -> Maybe Text
$sel:branch:GitConfig' :: GitConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
branch
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
repositoryUrl
instance Data.ToJSON GitConfig where
toJSON :: GitConfig -> Value
toJSON GitConfig' {Maybe Text
Text
repositoryUrl :: Text
secretArn :: Maybe Text
branch :: Maybe Text
$sel:repositoryUrl:GitConfig' :: GitConfig -> Text
$sel:secretArn:GitConfig' :: GitConfig -> Maybe Text
$sel:branch:GitConfig' :: GitConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Branch" 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
branch,
(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,
forall a. a -> Maybe a
Prelude.Just
(Key
"RepositoryUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
repositoryUrl)
]
)