{-# 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.AppRunner.Types.SourceConfiguration where
import Amazonka.AppRunner.Types.AuthenticationConfiguration
import Amazonka.AppRunner.Types.CodeRepository
import Amazonka.AppRunner.Types.ImageRepository
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 SourceConfiguration = SourceConfiguration'
{
SourceConfiguration -> Maybe AuthenticationConfiguration
authenticationConfiguration :: Prelude.Maybe AuthenticationConfiguration,
SourceConfiguration -> Maybe Bool
autoDeploymentsEnabled :: Prelude.Maybe Prelude.Bool,
SourceConfiguration -> Maybe CodeRepository
codeRepository :: Prelude.Maybe CodeRepository,
SourceConfiguration -> Maybe ImageRepository
imageRepository :: Prelude.Maybe ImageRepository
}
deriving (SourceConfiguration -> SourceConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceConfiguration -> SourceConfiguration -> Bool
$c/= :: SourceConfiguration -> SourceConfiguration -> Bool
== :: SourceConfiguration -> SourceConfiguration -> Bool
$c== :: SourceConfiguration -> SourceConfiguration -> Bool
Prelude.Eq, Int -> SourceConfiguration -> ShowS
[SourceConfiguration] -> ShowS
SourceConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceConfiguration] -> ShowS
$cshowList :: [SourceConfiguration] -> ShowS
show :: SourceConfiguration -> String
$cshow :: SourceConfiguration -> String
showsPrec :: Int -> SourceConfiguration -> ShowS
$cshowsPrec :: Int -> SourceConfiguration -> ShowS
Prelude.Show, forall x. Rep SourceConfiguration x -> SourceConfiguration
forall x. SourceConfiguration -> Rep SourceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceConfiguration x -> SourceConfiguration
$cfrom :: forall x. SourceConfiguration -> Rep SourceConfiguration x
Prelude.Generic)
newSourceConfiguration ::
SourceConfiguration
newSourceConfiguration :: SourceConfiguration
newSourceConfiguration =
SourceConfiguration'
{ $sel:authenticationConfiguration:SourceConfiguration' :: Maybe AuthenticationConfiguration
authenticationConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:autoDeploymentsEnabled:SourceConfiguration' :: Maybe Bool
autoDeploymentsEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:codeRepository:SourceConfiguration' :: Maybe CodeRepository
codeRepository = forall a. Maybe a
Prelude.Nothing,
$sel:imageRepository:SourceConfiguration' :: Maybe ImageRepository
imageRepository = forall a. Maybe a
Prelude.Nothing
}
sourceConfiguration_authenticationConfiguration :: Lens.Lens' SourceConfiguration (Prelude.Maybe AuthenticationConfiguration)
sourceConfiguration_authenticationConfiguration :: Lens' SourceConfiguration (Maybe AuthenticationConfiguration)
sourceConfiguration_authenticationConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConfiguration' {Maybe AuthenticationConfiguration
authenticationConfiguration :: Maybe AuthenticationConfiguration
$sel:authenticationConfiguration:SourceConfiguration' :: SourceConfiguration -> Maybe AuthenticationConfiguration
authenticationConfiguration} -> Maybe AuthenticationConfiguration
authenticationConfiguration) (\s :: SourceConfiguration
s@SourceConfiguration' {} Maybe AuthenticationConfiguration
a -> SourceConfiguration
s {$sel:authenticationConfiguration:SourceConfiguration' :: Maybe AuthenticationConfiguration
authenticationConfiguration = Maybe AuthenticationConfiguration
a} :: SourceConfiguration)
sourceConfiguration_autoDeploymentsEnabled :: Lens.Lens' SourceConfiguration (Prelude.Maybe Prelude.Bool)
sourceConfiguration_autoDeploymentsEnabled :: Lens' SourceConfiguration (Maybe Bool)
sourceConfiguration_autoDeploymentsEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConfiguration' {Maybe Bool
autoDeploymentsEnabled :: Maybe Bool
$sel:autoDeploymentsEnabled:SourceConfiguration' :: SourceConfiguration -> Maybe Bool
autoDeploymentsEnabled} -> Maybe Bool
autoDeploymentsEnabled) (\s :: SourceConfiguration
s@SourceConfiguration' {} Maybe Bool
a -> SourceConfiguration
s {$sel:autoDeploymentsEnabled:SourceConfiguration' :: Maybe Bool
autoDeploymentsEnabled = Maybe Bool
a} :: SourceConfiguration)
sourceConfiguration_codeRepository :: Lens.Lens' SourceConfiguration (Prelude.Maybe CodeRepository)
sourceConfiguration_codeRepository :: Lens' SourceConfiguration (Maybe CodeRepository)
sourceConfiguration_codeRepository = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConfiguration' {Maybe CodeRepository
codeRepository :: Maybe CodeRepository
$sel:codeRepository:SourceConfiguration' :: SourceConfiguration -> Maybe CodeRepository
codeRepository} -> Maybe CodeRepository
codeRepository) (\s :: SourceConfiguration
s@SourceConfiguration' {} Maybe CodeRepository
a -> SourceConfiguration
s {$sel:codeRepository:SourceConfiguration' :: Maybe CodeRepository
codeRepository = Maybe CodeRepository
a} :: SourceConfiguration)
sourceConfiguration_imageRepository :: Lens.Lens' SourceConfiguration (Prelude.Maybe ImageRepository)
sourceConfiguration_imageRepository :: Lens' SourceConfiguration (Maybe ImageRepository)
sourceConfiguration_imageRepository = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConfiguration' {Maybe ImageRepository
imageRepository :: Maybe ImageRepository
$sel:imageRepository:SourceConfiguration' :: SourceConfiguration -> Maybe ImageRepository
imageRepository} -> Maybe ImageRepository
imageRepository) (\s :: SourceConfiguration
s@SourceConfiguration' {} Maybe ImageRepository
a -> SourceConfiguration
s {$sel:imageRepository:SourceConfiguration' :: Maybe ImageRepository
imageRepository = Maybe ImageRepository
a} :: SourceConfiguration)
instance Data.FromJSON SourceConfiguration where
parseJSON :: Value -> Parser SourceConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SourceConfiguration"
( \Object
x ->
Maybe AuthenticationConfiguration
-> Maybe Bool
-> Maybe CodeRepository
-> Maybe ImageRepository
-> SourceConfiguration
SourceConfiguration'
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
"AuthenticationConfiguration")
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
"AutoDeploymentsEnabled")
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
"CodeRepository")
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
"ImageRepository")
)
instance Prelude.Hashable SourceConfiguration where
hashWithSalt :: Int -> SourceConfiguration -> Int
hashWithSalt Int
_salt SourceConfiguration' {Maybe Bool
Maybe AuthenticationConfiguration
Maybe ImageRepository
Maybe CodeRepository
imageRepository :: Maybe ImageRepository
codeRepository :: Maybe CodeRepository
autoDeploymentsEnabled :: Maybe Bool
authenticationConfiguration :: Maybe AuthenticationConfiguration
$sel:imageRepository:SourceConfiguration' :: SourceConfiguration -> Maybe ImageRepository
$sel:codeRepository:SourceConfiguration' :: SourceConfiguration -> Maybe CodeRepository
$sel:autoDeploymentsEnabled:SourceConfiguration' :: SourceConfiguration -> Maybe Bool
$sel:authenticationConfiguration:SourceConfiguration' :: SourceConfiguration -> Maybe AuthenticationConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthenticationConfiguration
authenticationConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoDeploymentsEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CodeRepository
codeRepository
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImageRepository
imageRepository
instance Prelude.NFData SourceConfiguration where
rnf :: SourceConfiguration -> ()
rnf SourceConfiguration' {Maybe Bool
Maybe AuthenticationConfiguration
Maybe ImageRepository
Maybe CodeRepository
imageRepository :: Maybe ImageRepository
codeRepository :: Maybe CodeRepository
autoDeploymentsEnabled :: Maybe Bool
authenticationConfiguration :: Maybe AuthenticationConfiguration
$sel:imageRepository:SourceConfiguration' :: SourceConfiguration -> Maybe ImageRepository
$sel:codeRepository:SourceConfiguration' :: SourceConfiguration -> Maybe CodeRepository
$sel:autoDeploymentsEnabled:SourceConfiguration' :: SourceConfiguration -> Maybe Bool
$sel:authenticationConfiguration:SourceConfiguration' :: SourceConfiguration -> Maybe AuthenticationConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthenticationConfiguration
authenticationConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoDeploymentsEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CodeRepository
codeRepository
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImageRepository
imageRepository
instance Data.ToJSON SourceConfiguration where
toJSON :: SourceConfiguration -> Value
toJSON SourceConfiguration' {Maybe Bool
Maybe AuthenticationConfiguration
Maybe ImageRepository
Maybe CodeRepository
imageRepository :: Maybe ImageRepository
codeRepository :: Maybe CodeRepository
autoDeploymentsEnabled :: Maybe Bool
authenticationConfiguration :: Maybe AuthenticationConfiguration
$sel:imageRepository:SourceConfiguration' :: SourceConfiguration -> Maybe ImageRepository
$sel:codeRepository:SourceConfiguration' :: SourceConfiguration -> Maybe CodeRepository
$sel:autoDeploymentsEnabled:SourceConfiguration' :: SourceConfiguration -> Maybe Bool
$sel:authenticationConfiguration:SourceConfiguration' :: SourceConfiguration -> Maybe AuthenticationConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AuthenticationConfiguration" 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 AuthenticationConfiguration
authenticationConfiguration,
(Key
"AutoDeploymentsEnabled" 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 Bool
autoDeploymentsEnabled,
(Key
"CodeRepository" 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 CodeRepository
codeRepository,
(Key
"ImageRepository" 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 ImageRepository
imageRepository
]
)