{-# 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.SecurityHub.Types.AwsCodeBuildProjectSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsCodeBuildProjectSource = AwsCodeBuildProjectSource'
{
AwsCodeBuildProjectSource -> Maybe Bool
insecureSsl :: Prelude.Maybe Prelude.Bool,
AwsCodeBuildProjectSource -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
AwsCodeBuildProjectSource -> Maybe Int
gitCloneDepth :: Prelude.Maybe Prelude.Int,
AwsCodeBuildProjectSource -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool
(AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool)
-> (AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool)
-> Eq AwsCodeBuildProjectSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool
$c/= :: AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool
== :: AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool
$c== :: AwsCodeBuildProjectSource -> AwsCodeBuildProjectSource -> Bool
Prelude.Eq, ReadPrec [AwsCodeBuildProjectSource]
ReadPrec AwsCodeBuildProjectSource
Int -> ReadS AwsCodeBuildProjectSource
ReadS [AwsCodeBuildProjectSource]
(Int -> ReadS AwsCodeBuildProjectSource)
-> ReadS [AwsCodeBuildProjectSource]
-> ReadPrec AwsCodeBuildProjectSource
-> ReadPrec [AwsCodeBuildProjectSource]
-> Read AwsCodeBuildProjectSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCodeBuildProjectSource]
$creadListPrec :: ReadPrec [AwsCodeBuildProjectSource]
readPrec :: ReadPrec AwsCodeBuildProjectSource
$creadPrec :: ReadPrec AwsCodeBuildProjectSource
readList :: ReadS [AwsCodeBuildProjectSource]
$creadList :: ReadS [AwsCodeBuildProjectSource]
readsPrec :: Int -> ReadS AwsCodeBuildProjectSource
$creadsPrec :: Int -> ReadS AwsCodeBuildProjectSource
Prelude.Read, Int -> AwsCodeBuildProjectSource -> ShowS
[AwsCodeBuildProjectSource] -> ShowS
AwsCodeBuildProjectSource -> String
(Int -> AwsCodeBuildProjectSource -> ShowS)
-> (AwsCodeBuildProjectSource -> String)
-> ([AwsCodeBuildProjectSource] -> ShowS)
-> Show AwsCodeBuildProjectSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCodeBuildProjectSource] -> ShowS
$cshowList :: [AwsCodeBuildProjectSource] -> ShowS
show :: AwsCodeBuildProjectSource -> String
$cshow :: AwsCodeBuildProjectSource -> String
showsPrec :: Int -> AwsCodeBuildProjectSource -> ShowS
$cshowsPrec :: Int -> AwsCodeBuildProjectSource -> ShowS
Prelude.Show, (forall x.
AwsCodeBuildProjectSource -> Rep AwsCodeBuildProjectSource x)
-> (forall x.
Rep AwsCodeBuildProjectSource x -> AwsCodeBuildProjectSource)
-> Generic AwsCodeBuildProjectSource
forall x.
Rep AwsCodeBuildProjectSource x -> AwsCodeBuildProjectSource
forall x.
AwsCodeBuildProjectSource -> Rep AwsCodeBuildProjectSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCodeBuildProjectSource x -> AwsCodeBuildProjectSource
$cfrom :: forall x.
AwsCodeBuildProjectSource -> Rep AwsCodeBuildProjectSource x
Prelude.Generic)
newAwsCodeBuildProjectSource ::
AwsCodeBuildProjectSource
newAwsCodeBuildProjectSource :: AwsCodeBuildProjectSource
newAwsCodeBuildProjectSource =
AwsCodeBuildProjectSource' :: Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> AwsCodeBuildProjectSource
AwsCodeBuildProjectSource'
{ $sel:insecureSsl:AwsCodeBuildProjectSource' :: Maybe Bool
insecureSsl =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:location:AwsCodeBuildProjectSource' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gitCloneDepth:AwsCodeBuildProjectSource' :: Maybe Int
gitCloneDepth = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:type':AwsCodeBuildProjectSource' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsCodeBuildProjectSource_insecureSsl :: Lens.Lens' AwsCodeBuildProjectSource (Prelude.Maybe Prelude.Bool)
awsCodeBuildProjectSource_insecureSsl :: (Maybe Bool -> f (Maybe Bool))
-> AwsCodeBuildProjectSource -> f AwsCodeBuildProjectSource
awsCodeBuildProjectSource_insecureSsl = (AwsCodeBuildProjectSource -> Maybe Bool)
-> (AwsCodeBuildProjectSource
-> Maybe Bool -> AwsCodeBuildProjectSource)
-> Lens
AwsCodeBuildProjectSource
AwsCodeBuildProjectSource
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectSource' {Maybe Bool
insecureSsl :: Maybe Bool
$sel:insecureSsl:AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Bool
insecureSsl} -> Maybe Bool
insecureSsl) (\s :: AwsCodeBuildProjectSource
s@AwsCodeBuildProjectSource' {} Maybe Bool
a -> AwsCodeBuildProjectSource
s {$sel:insecureSsl:AwsCodeBuildProjectSource' :: Maybe Bool
insecureSsl = Maybe Bool
a} :: AwsCodeBuildProjectSource)
awsCodeBuildProjectSource_location :: Lens.Lens' AwsCodeBuildProjectSource (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectSource_location :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectSource -> f AwsCodeBuildProjectSource
awsCodeBuildProjectSource_location = (AwsCodeBuildProjectSource -> Maybe Text)
-> (AwsCodeBuildProjectSource
-> Maybe Text -> AwsCodeBuildProjectSource)
-> Lens
AwsCodeBuildProjectSource
AwsCodeBuildProjectSource
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectSource' {Maybe Text
location :: Maybe Text
$sel:location:AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Text
location} -> Maybe Text
location) (\s :: AwsCodeBuildProjectSource
s@AwsCodeBuildProjectSource' {} Maybe Text
a -> AwsCodeBuildProjectSource
s {$sel:location:AwsCodeBuildProjectSource' :: Maybe Text
location = Maybe Text
a} :: AwsCodeBuildProjectSource)
awsCodeBuildProjectSource_gitCloneDepth :: Lens.Lens' AwsCodeBuildProjectSource (Prelude.Maybe Prelude.Int)
awsCodeBuildProjectSource_gitCloneDepth :: (Maybe Int -> f (Maybe Int))
-> AwsCodeBuildProjectSource -> f AwsCodeBuildProjectSource
awsCodeBuildProjectSource_gitCloneDepth = (AwsCodeBuildProjectSource -> Maybe Int)
-> (AwsCodeBuildProjectSource
-> Maybe Int -> AwsCodeBuildProjectSource)
-> Lens
AwsCodeBuildProjectSource
AwsCodeBuildProjectSource
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectSource' {Maybe Int
gitCloneDepth :: Maybe Int
$sel:gitCloneDepth:AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Int
gitCloneDepth} -> Maybe Int
gitCloneDepth) (\s :: AwsCodeBuildProjectSource
s@AwsCodeBuildProjectSource' {} Maybe Int
a -> AwsCodeBuildProjectSource
s {$sel:gitCloneDepth:AwsCodeBuildProjectSource' :: Maybe Int
gitCloneDepth = Maybe Int
a} :: AwsCodeBuildProjectSource)
awsCodeBuildProjectSource_type :: Lens.Lens' AwsCodeBuildProjectSource (Prelude.Maybe Prelude.Text)
awsCodeBuildProjectSource_type :: (Maybe Text -> f (Maybe Text))
-> AwsCodeBuildProjectSource -> f AwsCodeBuildProjectSource
awsCodeBuildProjectSource_type = (AwsCodeBuildProjectSource -> Maybe Text)
-> (AwsCodeBuildProjectSource
-> Maybe Text -> AwsCodeBuildProjectSource)
-> Lens
AwsCodeBuildProjectSource
AwsCodeBuildProjectSource
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCodeBuildProjectSource' {Maybe Text
type' :: Maybe Text
$sel:type':AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsCodeBuildProjectSource
s@AwsCodeBuildProjectSource' {} Maybe Text
a -> AwsCodeBuildProjectSource
s {$sel:type':AwsCodeBuildProjectSource' :: Maybe Text
type' = Maybe Text
a} :: AwsCodeBuildProjectSource)
instance Core.FromJSON AwsCodeBuildProjectSource where
parseJSON :: Value -> Parser AwsCodeBuildProjectSource
parseJSON =
String
-> (Object -> Parser AwsCodeBuildProjectSource)
-> Value
-> Parser AwsCodeBuildProjectSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsCodeBuildProjectSource"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> AwsCodeBuildProjectSource
AwsCodeBuildProjectSource'
(Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> AwsCodeBuildProjectSource)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> AwsCodeBuildProjectSource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InsecureSsl")
Parser
(Maybe Text
-> Maybe Int -> Maybe Text -> AwsCodeBuildProjectSource)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> AwsCodeBuildProjectSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Location")
Parser (Maybe Int -> Maybe Text -> AwsCodeBuildProjectSource)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> AwsCodeBuildProjectSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GitCloneDepth")
Parser (Maybe Text -> AwsCodeBuildProjectSource)
-> Parser (Maybe Text) -> Parser AwsCodeBuildProjectSource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
)
instance Prelude.Hashable AwsCodeBuildProjectSource
instance Prelude.NFData AwsCodeBuildProjectSource
instance Core.ToJSON AwsCodeBuildProjectSource where
toJSON :: AwsCodeBuildProjectSource -> Value
toJSON AwsCodeBuildProjectSource' {Maybe Bool
Maybe Int
Maybe Text
type' :: Maybe Text
gitCloneDepth :: Maybe Int
location :: Maybe Text
insecureSsl :: Maybe Bool
$sel:type':AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Text
$sel:gitCloneDepth:AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Int
$sel:location:AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Text
$sel:insecureSsl:AwsCodeBuildProjectSource' :: AwsCodeBuildProjectSource -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InsecureSsl" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
insecureSsl,
(Text
"Location" 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
location,
(Text
"GitCloneDepth" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
gitCloneDepth,
(Text
"Type" 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
type'
]
)