{-# 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.ToolchainSource 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 ToolchainSource = ToolchainSource'
{
ToolchainSource -> S3Location
s3 :: S3Location
}
deriving (ToolchainSource -> ToolchainSource -> Bool
(ToolchainSource -> ToolchainSource -> Bool)
-> (ToolchainSource -> ToolchainSource -> Bool)
-> Eq ToolchainSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ToolchainSource -> ToolchainSource -> Bool
$c/= :: ToolchainSource -> ToolchainSource -> Bool
== :: ToolchainSource -> ToolchainSource -> Bool
$c== :: ToolchainSource -> ToolchainSource -> Bool
Prelude.Eq, ReadPrec [ToolchainSource]
ReadPrec ToolchainSource
Int -> ReadS ToolchainSource
ReadS [ToolchainSource]
(Int -> ReadS ToolchainSource)
-> ReadS [ToolchainSource]
-> ReadPrec ToolchainSource
-> ReadPrec [ToolchainSource]
-> Read ToolchainSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ToolchainSource]
$creadListPrec :: ReadPrec [ToolchainSource]
readPrec :: ReadPrec ToolchainSource
$creadPrec :: ReadPrec ToolchainSource
readList :: ReadS [ToolchainSource]
$creadList :: ReadS [ToolchainSource]
readsPrec :: Int -> ReadS ToolchainSource
$creadsPrec :: Int -> ReadS ToolchainSource
Prelude.Read, Int -> ToolchainSource -> ShowS
[ToolchainSource] -> ShowS
ToolchainSource -> String
(Int -> ToolchainSource -> ShowS)
-> (ToolchainSource -> String)
-> ([ToolchainSource] -> ShowS)
-> Show ToolchainSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ToolchainSource] -> ShowS
$cshowList :: [ToolchainSource] -> ShowS
show :: ToolchainSource -> String
$cshow :: ToolchainSource -> String
showsPrec :: Int -> ToolchainSource -> ShowS
$cshowsPrec :: Int -> ToolchainSource -> ShowS
Prelude.Show, (forall x. ToolchainSource -> Rep ToolchainSource x)
-> (forall x. Rep ToolchainSource x -> ToolchainSource)
-> Generic ToolchainSource
forall x. Rep ToolchainSource x -> ToolchainSource
forall x. ToolchainSource -> Rep ToolchainSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ToolchainSource x -> ToolchainSource
$cfrom :: forall x. ToolchainSource -> Rep ToolchainSource x
Prelude.Generic)
newToolchainSource ::
S3Location ->
ToolchainSource
newToolchainSource :: S3Location -> ToolchainSource
newToolchainSource S3Location
pS3_ = ToolchainSource' :: S3Location -> ToolchainSource
ToolchainSource' {$sel:s3:ToolchainSource' :: S3Location
s3 = S3Location
pS3_}
toolchainSource_s3 :: Lens.Lens' ToolchainSource S3Location
toolchainSource_s3 :: (S3Location -> f S3Location)
-> ToolchainSource -> f ToolchainSource
toolchainSource_s3 = (ToolchainSource -> S3Location)
-> (ToolchainSource -> S3Location -> ToolchainSource)
-> Lens ToolchainSource ToolchainSource S3Location S3Location
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ToolchainSource' {S3Location
s3 :: S3Location
$sel:s3:ToolchainSource' :: ToolchainSource -> S3Location
s3} -> S3Location
s3) (\s :: ToolchainSource
s@ToolchainSource' {} S3Location
a -> ToolchainSource
s {$sel:s3:ToolchainSource' :: S3Location
s3 = S3Location
a} :: ToolchainSource)
instance Prelude.Hashable ToolchainSource
instance Prelude.NFData ToolchainSource
instance Core.ToJSON ToolchainSource where
toJSON :: ToolchainSource -> Value
toJSON ToolchainSource' {S3Location
s3 :: S3Location
$sel:s3:ToolchainSource' :: ToolchainSource -> 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)])