{-# 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.CodeStar.Types.CodeSource where
import Amazonka.CodeStar.Types.S3Location
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CodeSource = CodeSource'
{
CodeSource -> S3Location
s3 :: S3Location
}
deriving (CodeSource -> CodeSource -> Bool
(CodeSource -> CodeSource -> Bool)
-> (CodeSource -> CodeSource -> Bool) -> Eq CodeSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeSource -> CodeSource -> Bool
$c/= :: CodeSource -> CodeSource -> Bool
== :: CodeSource -> CodeSource -> Bool
$c== :: CodeSource -> CodeSource -> Bool
Prelude.Eq, ReadPrec [CodeSource]
ReadPrec CodeSource
Int -> ReadS CodeSource
ReadS [CodeSource]
(Int -> ReadS CodeSource)
-> ReadS [CodeSource]
-> ReadPrec CodeSource
-> ReadPrec [CodeSource]
-> Read CodeSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CodeSource]
$creadListPrec :: ReadPrec [CodeSource]
readPrec :: ReadPrec CodeSource
$creadPrec :: ReadPrec CodeSource
readList :: ReadS [CodeSource]
$creadList :: ReadS [CodeSource]
readsPrec :: Int -> ReadS CodeSource
$creadsPrec :: Int -> ReadS CodeSource
Prelude.Read, Int -> CodeSource -> ShowS
[CodeSource] -> ShowS
CodeSource -> String
(Int -> CodeSource -> ShowS)
-> (CodeSource -> String)
-> ([CodeSource] -> ShowS)
-> Show CodeSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeSource] -> ShowS
$cshowList :: [CodeSource] -> ShowS
show :: CodeSource -> String
$cshow :: CodeSource -> String
showsPrec :: Int -> CodeSource -> ShowS
$cshowsPrec :: Int -> CodeSource -> ShowS
Prelude.Show, (forall x. CodeSource -> Rep CodeSource x)
-> (forall x. Rep CodeSource x -> CodeSource) -> Generic CodeSource
forall x. Rep CodeSource x -> CodeSource
forall x. CodeSource -> Rep CodeSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeSource x -> CodeSource
$cfrom :: forall x. CodeSource -> Rep CodeSource x
Prelude.Generic)
newCodeSource ::
S3Location ->
CodeSource
newCodeSource :: S3Location -> CodeSource
newCodeSource S3Location
pS3_ = CodeSource' :: S3Location -> CodeSource
CodeSource' {$sel:s3:CodeSource' :: S3Location
s3 = S3Location
pS3_}
codeSource_s3 :: Lens.Lens' CodeSource S3Location
codeSource_s3 :: (S3Location -> f S3Location) -> CodeSource -> f CodeSource
codeSource_s3 = (CodeSource -> S3Location)
-> (CodeSource -> S3Location -> CodeSource)
-> Lens CodeSource CodeSource S3Location S3Location
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeSource' {S3Location
s3 :: S3Location
$sel:s3:CodeSource' :: CodeSource -> S3Location
s3} -> S3Location
s3) (\s :: CodeSource
s@CodeSource' {} S3Location
a -> CodeSource
s {$sel:s3:CodeSource' :: S3Location
s3 = S3Location
a} :: CodeSource)
instance Prelude.Hashable CodeSource
instance Prelude.NFData CodeSource
instance Core.ToJSON CodeSource where
toJSON :: CodeSource -> Value
toJSON CodeSource' {S3Location
s3 :: S3Location
$sel:s3:CodeSource' :: CodeSource -> S3Location
..} =
[Pair] -> Value
Core.object
([Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"s3" Text -> S3Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3Location
s3)])