{-# 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.SourceCodeVersion where
import Amazonka.AppRunner.Types.SourceCodeVersionType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceCodeVersion = SourceCodeVersion'
{
SourceCodeVersion -> SourceCodeVersionType
type' :: SourceCodeVersionType,
SourceCodeVersion -> Text
value :: Prelude.Text
}
deriving (SourceCodeVersion -> SourceCodeVersion -> Bool
(SourceCodeVersion -> SourceCodeVersion -> Bool)
-> (SourceCodeVersion -> SourceCodeVersion -> Bool)
-> Eq SourceCodeVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceCodeVersion -> SourceCodeVersion -> Bool
$c/= :: SourceCodeVersion -> SourceCodeVersion -> Bool
== :: SourceCodeVersion -> SourceCodeVersion -> Bool
$c== :: SourceCodeVersion -> SourceCodeVersion -> Bool
Prelude.Eq, ReadPrec [SourceCodeVersion]
ReadPrec SourceCodeVersion
Int -> ReadS SourceCodeVersion
ReadS [SourceCodeVersion]
(Int -> ReadS SourceCodeVersion)
-> ReadS [SourceCodeVersion]
-> ReadPrec SourceCodeVersion
-> ReadPrec [SourceCodeVersion]
-> Read SourceCodeVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceCodeVersion]
$creadListPrec :: ReadPrec [SourceCodeVersion]
readPrec :: ReadPrec SourceCodeVersion
$creadPrec :: ReadPrec SourceCodeVersion
readList :: ReadS [SourceCodeVersion]
$creadList :: ReadS [SourceCodeVersion]
readsPrec :: Int -> ReadS SourceCodeVersion
$creadsPrec :: Int -> ReadS SourceCodeVersion
Prelude.Read, Int -> SourceCodeVersion -> ShowS
[SourceCodeVersion] -> ShowS
SourceCodeVersion -> String
(Int -> SourceCodeVersion -> ShowS)
-> (SourceCodeVersion -> String)
-> ([SourceCodeVersion] -> ShowS)
-> Show SourceCodeVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceCodeVersion] -> ShowS
$cshowList :: [SourceCodeVersion] -> ShowS
show :: SourceCodeVersion -> String
$cshow :: SourceCodeVersion -> String
showsPrec :: Int -> SourceCodeVersion -> ShowS
$cshowsPrec :: Int -> SourceCodeVersion -> ShowS
Prelude.Show, (forall x. SourceCodeVersion -> Rep SourceCodeVersion x)
-> (forall x. Rep SourceCodeVersion x -> SourceCodeVersion)
-> Generic SourceCodeVersion
forall x. Rep SourceCodeVersion x -> SourceCodeVersion
forall x. SourceCodeVersion -> Rep SourceCodeVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceCodeVersion x -> SourceCodeVersion
$cfrom :: forall x. SourceCodeVersion -> Rep SourceCodeVersion x
Prelude.Generic)
newSourceCodeVersion ::
SourceCodeVersionType ->
Prelude.Text ->
SourceCodeVersion
newSourceCodeVersion :: SourceCodeVersionType -> Text -> SourceCodeVersion
newSourceCodeVersion SourceCodeVersionType
pType_ Text
pValue_ =
SourceCodeVersion' :: SourceCodeVersionType -> Text -> SourceCodeVersion
SourceCodeVersion' {$sel:type':SourceCodeVersion' :: SourceCodeVersionType
type' = SourceCodeVersionType
pType_, $sel:value:SourceCodeVersion' :: Text
value = Text
pValue_}
sourceCodeVersion_type :: Lens.Lens' SourceCodeVersion SourceCodeVersionType
sourceCodeVersion_type :: (SourceCodeVersionType -> f SourceCodeVersionType)
-> SourceCodeVersion -> f SourceCodeVersion
sourceCodeVersion_type = (SourceCodeVersion -> SourceCodeVersionType)
-> (SourceCodeVersion
-> SourceCodeVersionType -> SourceCodeVersion)
-> Lens
SourceCodeVersion
SourceCodeVersion
SourceCodeVersionType
SourceCodeVersionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCodeVersion' {SourceCodeVersionType
type' :: SourceCodeVersionType
$sel:type':SourceCodeVersion' :: SourceCodeVersion -> SourceCodeVersionType
type'} -> SourceCodeVersionType
type') (\s :: SourceCodeVersion
s@SourceCodeVersion' {} SourceCodeVersionType
a -> SourceCodeVersion
s {$sel:type':SourceCodeVersion' :: SourceCodeVersionType
type' = SourceCodeVersionType
a} :: SourceCodeVersion)
sourceCodeVersion_value :: Lens.Lens' SourceCodeVersion Prelude.Text
sourceCodeVersion_value :: (Text -> f Text) -> SourceCodeVersion -> f SourceCodeVersion
sourceCodeVersion_value = (SourceCodeVersion -> Text)
-> (SourceCodeVersion -> Text -> SourceCodeVersion)
-> Lens SourceCodeVersion SourceCodeVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCodeVersion' {Text
value :: Text
$sel:value:SourceCodeVersion' :: SourceCodeVersion -> Text
value} -> Text
value) (\s :: SourceCodeVersion
s@SourceCodeVersion' {} Text
a -> SourceCodeVersion
s {$sel:value:SourceCodeVersion' :: Text
value = Text
a} :: SourceCodeVersion)
instance Core.FromJSON SourceCodeVersion where
parseJSON :: Value -> Parser SourceCodeVersion
parseJSON =
String
-> (Object -> Parser SourceCodeVersion)
-> Value
-> Parser SourceCodeVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceCodeVersion"
( \Object
x ->
SourceCodeVersionType -> Text -> SourceCodeVersion
SourceCodeVersion'
(SourceCodeVersionType -> Text -> SourceCodeVersion)
-> Parser SourceCodeVersionType
-> Parser (Text -> SourceCodeVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser SourceCodeVersionType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type") Parser (Text -> SourceCodeVersion)
-> Parser Text -> Parser SourceCodeVersion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Value")
)
instance Prelude.Hashable SourceCodeVersion
instance Prelude.NFData SourceCodeVersion
instance Core.ToJSON SourceCodeVersion where
toJSON :: SourceCodeVersion -> Value
toJSON SourceCodeVersion' {Text
SourceCodeVersionType
value :: Text
type' :: SourceCodeVersionType
$sel:value:SourceCodeVersion' :: SourceCodeVersion -> Text
$sel:type':SourceCodeVersion' :: SourceCodeVersion -> SourceCodeVersionType
..} =
[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
"Type" Text -> SourceCodeVersionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SourceCodeVersionType
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
value)
]
)