{-# 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.ServerlessApplicationRepository.Types.Version where
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
import Amazonka.ServerlessApplicationRepository.Types.Capability
import Amazonka.ServerlessApplicationRepository.Types.ParameterDefinition
data Version = Version'
{
Version -> Maybe Text
sourceCodeArchiveUrl :: Prelude.Maybe Prelude.Text,
Version -> Maybe Text
sourceCodeUrl :: Prelude.Maybe Prelude.Text,
Version -> Text
templateUrl :: Prelude.Text,
Version -> [ParameterDefinition]
parameterDefinitions :: [ParameterDefinition],
Version -> Bool
resourcesSupported :: Prelude.Bool,
Version -> Text
creationTime :: Prelude.Text,
Version -> [Capability]
requiredCapabilities :: [Capability],
Version -> Text
applicationId :: Prelude.Text,
Version -> Text
semanticVersion :: Prelude.Text
}
deriving (Version -> Version -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Version -> Version -> Bool
$c/= :: Version -> Version -> Bool
== :: Version -> Version -> Bool
$c== :: Version -> Version -> Bool
Prelude.Eq, ReadPrec [Version]
ReadPrec Version
Int -> ReadS Version
ReadS [Version]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Version]
$creadListPrec :: ReadPrec [Version]
readPrec :: ReadPrec Version
$creadPrec :: ReadPrec Version
readList :: ReadS [Version]
$creadList :: ReadS [Version]
readsPrec :: Int -> ReadS Version
$creadsPrec :: Int -> ReadS Version
Prelude.Read, Int -> Version -> ShowS
[Version] -> ShowS
Version -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Version] -> ShowS
$cshowList :: [Version] -> ShowS
show :: Version -> String
$cshow :: Version -> String
showsPrec :: Int -> Version -> ShowS
$cshowsPrec :: Int -> Version -> ShowS
Prelude.Show, forall x. Rep Version x -> Version
forall x. Version -> Rep Version x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Version x -> Version
$cfrom :: forall x. Version -> Rep Version x
Prelude.Generic)
newVersion ::
Prelude.Text ->
Prelude.Bool ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Version
newVersion :: Text -> Bool -> Text -> Text -> Text -> Version
newVersion
Text
pTemplateUrl_
Bool
pResourcesSupported_
Text
pCreationTime_
Text
pApplicationId_
Text
pSemanticVersion_ =
Version'
{ $sel:sourceCodeArchiveUrl:Version' :: Maybe Text
sourceCodeArchiveUrl = forall a. Maybe a
Prelude.Nothing,
$sel:sourceCodeUrl:Version' :: Maybe Text
sourceCodeUrl = forall a. Maybe a
Prelude.Nothing,
$sel:templateUrl:Version' :: Text
templateUrl = Text
pTemplateUrl_,
$sel:parameterDefinitions:Version' :: [ParameterDefinition]
parameterDefinitions = forall a. Monoid a => a
Prelude.mempty,
$sel:resourcesSupported:Version' :: Bool
resourcesSupported = Bool
pResourcesSupported_,
$sel:creationTime:Version' :: Text
creationTime = Text
pCreationTime_,
$sel:requiredCapabilities:Version' :: [Capability]
requiredCapabilities = forall a. Monoid a => a
Prelude.mempty,
$sel:applicationId:Version' :: Text
applicationId = Text
pApplicationId_,
$sel:semanticVersion:Version' :: Text
semanticVersion = Text
pSemanticVersion_
}
version_sourceCodeArchiveUrl :: Lens.Lens' Version (Prelude.Maybe Prelude.Text)
version_sourceCodeArchiveUrl :: Lens' Version (Maybe Text)
version_sourceCodeArchiveUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Maybe Text
sourceCodeArchiveUrl :: Maybe Text
$sel:sourceCodeArchiveUrl:Version' :: Version -> Maybe Text
sourceCodeArchiveUrl} -> Maybe Text
sourceCodeArchiveUrl) (\s :: Version
s@Version' {} Maybe Text
a -> Version
s {$sel:sourceCodeArchiveUrl:Version' :: Maybe Text
sourceCodeArchiveUrl = Maybe Text
a} :: Version)
version_sourceCodeUrl :: Lens.Lens' Version (Prelude.Maybe Prelude.Text)
version_sourceCodeUrl :: Lens' Version (Maybe Text)
version_sourceCodeUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Maybe Text
sourceCodeUrl :: Maybe Text
$sel:sourceCodeUrl:Version' :: Version -> Maybe Text
sourceCodeUrl} -> Maybe Text
sourceCodeUrl) (\s :: Version
s@Version' {} Maybe Text
a -> Version
s {$sel:sourceCodeUrl:Version' :: Maybe Text
sourceCodeUrl = Maybe Text
a} :: Version)
version_templateUrl :: Lens.Lens' Version Prelude.Text
version_templateUrl :: Lens' Version Text
version_templateUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Text
templateUrl :: Text
$sel:templateUrl:Version' :: Version -> Text
templateUrl} -> Text
templateUrl) (\s :: Version
s@Version' {} Text
a -> Version
s {$sel:templateUrl:Version' :: Text
templateUrl = Text
a} :: Version)
version_parameterDefinitions :: Lens.Lens' Version [ParameterDefinition]
version_parameterDefinitions :: Lens' Version [ParameterDefinition]
version_parameterDefinitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {[ParameterDefinition]
parameterDefinitions :: [ParameterDefinition]
$sel:parameterDefinitions:Version' :: Version -> [ParameterDefinition]
parameterDefinitions} -> [ParameterDefinition]
parameterDefinitions) (\s :: Version
s@Version' {} [ParameterDefinition]
a -> Version
s {$sel:parameterDefinitions:Version' :: [ParameterDefinition]
parameterDefinitions = [ParameterDefinition]
a} :: Version) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
version_resourcesSupported :: Lens.Lens' Version Prelude.Bool
version_resourcesSupported :: Lens' Version Bool
version_resourcesSupported = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Bool
resourcesSupported :: Bool
$sel:resourcesSupported:Version' :: Version -> Bool
resourcesSupported} -> Bool
resourcesSupported) (\s :: Version
s@Version' {} Bool
a -> Version
s {$sel:resourcesSupported:Version' :: Bool
resourcesSupported = Bool
a} :: Version)
version_creationTime :: Lens.Lens' Version Prelude.Text
version_creationTime :: Lens' Version Text
version_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Text
creationTime :: Text
$sel:creationTime:Version' :: Version -> Text
creationTime} -> Text
creationTime) (\s :: Version
s@Version' {} Text
a -> Version
s {$sel:creationTime:Version' :: Text
creationTime = Text
a} :: Version)
version_requiredCapabilities :: Lens.Lens' Version [Capability]
version_requiredCapabilities :: Lens' Version [Capability]
version_requiredCapabilities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {[Capability]
requiredCapabilities :: [Capability]
$sel:requiredCapabilities:Version' :: Version -> [Capability]
requiredCapabilities} -> [Capability]
requiredCapabilities) (\s :: Version
s@Version' {} [Capability]
a -> Version
s {$sel:requiredCapabilities:Version' :: [Capability]
requiredCapabilities = [Capability]
a} :: Version) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
version_applicationId :: Lens.Lens' Version Prelude.Text
version_applicationId :: Lens' Version Text
version_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Text
applicationId :: Text
$sel:applicationId:Version' :: Version -> Text
applicationId} -> Text
applicationId) (\s :: Version
s@Version' {} Text
a -> Version
s {$sel:applicationId:Version' :: Text
applicationId = Text
a} :: Version)
version_semanticVersion :: Lens.Lens' Version Prelude.Text
version_semanticVersion :: Lens' Version Text
version_semanticVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Version' {Text
semanticVersion :: Text
$sel:semanticVersion:Version' :: Version -> Text
semanticVersion} -> Text
semanticVersion) (\s :: Version
s@Version' {} Text
a -> Version
s {$sel:semanticVersion:Version' :: Text
semanticVersion = Text
a} :: Version)
instance Data.FromJSON Version where
parseJSON :: Value -> Parser Version
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Version"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version
Version'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sourceCodeArchiveUrl")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sourceCodeUrl")
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
"templateUrl")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"parameterDefinitions"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"resourcesSupported")
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
"creationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"requiredCapabilities"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"applicationId")
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
"semanticVersion")
)
instance Prelude.Hashable Version where
hashWithSalt :: Int -> Version -> Int
hashWithSalt Int
_salt Version' {Bool
[Capability]
[ParameterDefinition]
Maybe Text
Text
semanticVersion :: Text
applicationId :: Text
requiredCapabilities :: [Capability]
creationTime :: Text
resourcesSupported :: Bool
parameterDefinitions :: [ParameterDefinition]
templateUrl :: Text
sourceCodeUrl :: Maybe Text
sourceCodeArchiveUrl :: Maybe Text
$sel:semanticVersion:Version' :: Version -> Text
$sel:applicationId:Version' :: Version -> Text
$sel:requiredCapabilities:Version' :: Version -> [Capability]
$sel:creationTime:Version' :: Version -> Text
$sel:resourcesSupported:Version' :: Version -> Bool
$sel:parameterDefinitions:Version' :: Version -> [ParameterDefinition]
$sel:templateUrl:Version' :: Version -> Text
$sel:sourceCodeUrl:Version' :: Version -> Maybe Text
$sel:sourceCodeArchiveUrl:Version' :: Version -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceCodeArchiveUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceCodeUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ParameterDefinition]
parameterDefinitions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
resourcesSupported
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Capability]
requiredCapabilities
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
semanticVersion
instance Prelude.NFData Version where
rnf :: Version -> ()
rnf Version' {Bool
[Capability]
[ParameterDefinition]
Maybe Text
Text
semanticVersion :: Text
applicationId :: Text
requiredCapabilities :: [Capability]
creationTime :: Text
resourcesSupported :: Bool
parameterDefinitions :: [ParameterDefinition]
templateUrl :: Text
sourceCodeUrl :: Maybe Text
sourceCodeArchiveUrl :: Maybe Text
$sel:semanticVersion:Version' :: Version -> Text
$sel:applicationId:Version' :: Version -> Text
$sel:requiredCapabilities:Version' :: Version -> [Capability]
$sel:creationTime:Version' :: Version -> Text
$sel:resourcesSupported:Version' :: Version -> Bool
$sel:parameterDefinitions:Version' :: Version -> [ParameterDefinition]
$sel:templateUrl:Version' :: Version -> Text
$sel:sourceCodeUrl:Version' :: Version -> Maybe Text
$sel:sourceCodeArchiveUrl:Version' :: Version -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceCodeArchiveUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceCodeUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ParameterDefinition]
parameterDefinitions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
resourcesSupported
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Capability]
requiredCapabilities
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
semanticVersion