{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SourceCodeVersion = SourceCodeVersion'
{
SourceCodeVersion -> SourceCodeVersionType
type' :: SourceCodeVersionType,
SourceCodeVersion -> Text
value :: Prelude.Text
}
deriving (SourceCodeVersion -> SourceCodeVersion -> Bool
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]
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
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. 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' {$sel:type':SourceCodeVersion' :: SourceCodeVersionType
type' = SourceCodeVersionType
pType_, $sel:value:SourceCodeVersion' :: Text
value = Text
pValue_}
sourceCodeVersion_type :: Lens.Lens' SourceCodeVersion SourceCodeVersionType
sourceCodeVersion_type :: Lens' SourceCodeVersion SourceCodeVersionType
sourceCodeVersion_type = 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 :: Lens' SourceCodeVersion Text
sourceCodeVersion_value = 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 Data.FromJSON SourceCodeVersion where
parseJSON :: Value -> Parser SourceCodeVersion
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SourceCodeVersion"
( \Object
x ->
SourceCodeVersionType -> Text -> SourceCodeVersion
SourceCodeVersion'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Value")
)
instance Prelude.Hashable SourceCodeVersion where
hashWithSalt :: Int -> SourceCodeVersion -> Int
hashWithSalt Int
_salt SourceCodeVersion' {Text
SourceCodeVersionType
value :: Text
type' :: SourceCodeVersionType
$sel:value:SourceCodeVersion' :: SourceCodeVersion -> Text
$sel:type':SourceCodeVersion' :: SourceCodeVersion -> SourceCodeVersionType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SourceCodeVersionType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
value
instance Prelude.NFData SourceCodeVersion where
rnf :: SourceCodeVersion -> ()
rnf SourceCodeVersion' {Text
SourceCodeVersionType
value :: Text
type' :: SourceCodeVersionType
$sel:value:SourceCodeVersion' :: SourceCodeVersion -> Text
$sel:type':SourceCodeVersion' :: SourceCodeVersion -> SourceCodeVersionType
..} =
forall a. NFData a => a -> ()
Prelude.rnf SourceCodeVersionType
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
value
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SourceCodeVersionType
type'),
forall a. a -> Maybe a
Prelude.Just (Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
value)
]
)