{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServerlessApplicationRepository.Types.Capability
import Amazonka.ServerlessApplicationRepository.Types.ParameterDefinition
data Version = Version'
{
Version -> Maybe Text
sourceCodeUrl :: Prelude.Maybe Prelude.Text,
Version -> Maybe Text
sourceCodeArchiveUrl :: 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
(Version -> Version -> Bool)
-> (Version -> Version -> Bool) -> Eq Version
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]
(Int -> ReadS Version)
-> ReadS [Version]
-> ReadPrec Version
-> ReadPrec [Version]
-> Read 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
(Int -> Version -> ShowS)
-> (Version -> String) -> ([Version] -> ShowS) -> Show Version
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. Version -> Rep Version x)
-> (forall x. Rep Version x -> Version) -> Generic Version
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' :: Maybe Text
-> Maybe Text
-> Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version
Version'
{ $sel:sourceCodeUrl:Version' :: Maybe Text
sourceCodeUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceCodeArchiveUrl:Version' :: Maybe Text
sourceCodeArchiveUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateUrl:Version' :: Text
templateUrl = Text
pTemplateUrl_,
$sel:parameterDefinitions:Version' :: [ParameterDefinition]
parameterDefinitions = [ParameterDefinition]
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 = [Capability]
forall a. Monoid a => a
Prelude.mempty,
$sel:applicationId:Version' :: Text
applicationId = Text
pApplicationId_,
$sel:semanticVersion:Version' :: Text
semanticVersion = Text
pSemanticVersion_
}
version_sourceCodeUrl :: Lens.Lens' Version (Prelude.Maybe Prelude.Text)
version_sourceCodeUrl :: (Maybe Text -> f (Maybe Text)) -> Version -> f Version
version_sourceCodeUrl = (Version -> Maybe Text)
-> (Version -> Maybe Text -> Version)
-> Lens Version Version (Maybe Text) (Maybe Text)
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_sourceCodeArchiveUrl :: Lens.Lens' Version (Prelude.Maybe Prelude.Text)
version_sourceCodeArchiveUrl :: (Maybe Text -> f (Maybe Text)) -> Version -> f Version
version_sourceCodeArchiveUrl = (Version -> Maybe Text)
-> (Version -> Maybe Text -> Version)
-> Lens Version Version (Maybe Text) (Maybe Text)
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_templateUrl :: Lens.Lens' Version Prelude.Text
version_templateUrl :: (Text -> f Text) -> Version -> f Version
version_templateUrl = (Version -> Text)
-> (Version -> Text -> Version) -> Lens Version Version Text Text
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 :: ([ParameterDefinition] -> f [ParameterDefinition])
-> Version -> f Version
version_parameterDefinitions = (Version -> [ParameterDefinition])
-> (Version -> [ParameterDefinition] -> Version)
-> Lens Version Version [ParameterDefinition] [ParameterDefinition]
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) (([ParameterDefinition] -> f [ParameterDefinition])
-> Version -> f Version)
-> (([ParameterDefinition] -> f [ParameterDefinition])
-> [ParameterDefinition] -> f [ParameterDefinition])
-> ([ParameterDefinition] -> f [ParameterDefinition])
-> Version
-> f Version
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ParameterDefinition] -> f [ParameterDefinition])
-> [ParameterDefinition] -> f [ParameterDefinition]
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 :: (Bool -> f Bool) -> Version -> f Version
version_resourcesSupported = (Version -> Bool)
-> (Version -> Bool -> Version) -> Lens Version Version Bool Bool
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 :: (Text -> f Text) -> Version -> f Version
version_creationTime = (Version -> Text)
-> (Version -> Text -> Version) -> Lens Version Version Text Text
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 :: ([Capability] -> f [Capability]) -> Version -> f Version
version_requiredCapabilities = (Version -> [Capability])
-> (Version -> [Capability] -> Version)
-> Lens Version Version [Capability] [Capability]
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) (([Capability] -> f [Capability]) -> Version -> f Version)
-> (([Capability] -> f [Capability])
-> [Capability] -> f [Capability])
-> ([Capability] -> f [Capability])
-> Version
-> f Version
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Capability] -> f [Capability]) -> [Capability] -> f [Capability]
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 :: (Text -> f Text) -> Version -> f Version
version_applicationId = (Version -> Text)
-> (Version -> Text -> Version) -> Lens Version Version Text Text
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 :: (Text -> f Text) -> Version -> f Version
version_semanticVersion = (Version -> Text)
-> (Version -> Text -> Version) -> Lens Version Version Text Text
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 Core.FromJSON Version where
parseJSON :: Value -> Parser Version
parseJSON =
String -> (Object -> Parser Version) -> Value -> Parser Version
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Version"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version
Version'
(Maybe Text
-> Maybe Text
-> Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceCodeUrl")
Parser
(Maybe Text
-> Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version)
-> Parser (Maybe Text)
-> Parser
(Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceCodeArchiveUrl")
Parser
(Text
-> [ParameterDefinition]
-> Bool
-> Text
-> [Capability]
-> Text
-> Text
-> Version)
-> Parser Text
-> Parser
([ParameterDefinition]
-> Bool -> Text -> [Capability] -> Text -> Text -> Version)
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
"templateUrl")
Parser
([ParameterDefinition]
-> Bool -> Text -> [Capability] -> Text -> Text -> Version)
-> Parser [ParameterDefinition]
-> Parser (Bool -> Text -> [Capability] -> Text -> Text -> Version)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [ParameterDefinition])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"parameterDefinitions"
Parser (Maybe [ParameterDefinition])
-> [ParameterDefinition] -> Parser [ParameterDefinition]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [ParameterDefinition]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Bool -> Text -> [Capability] -> Text -> Text -> Version)
-> Parser Bool
-> Parser (Text -> [Capability] -> Text -> Text -> Version)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourcesSupported")
Parser (Text -> [Capability] -> Text -> Text -> Version)
-> Parser Text -> Parser ([Capability] -> Text -> Text -> Version)
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
"creationTime")
Parser ([Capability] -> Text -> Text -> Version)
-> Parser [Capability] -> Parser (Text -> Text -> Version)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [Capability])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"requiredCapabilities"
Parser (Maybe [Capability]) -> [Capability] -> Parser [Capability]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Capability]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Text -> Text -> Version)
-> Parser Text -> Parser (Text -> Version)
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
"applicationId")
Parser (Text -> Version) -> Parser Text -> Parser Version
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
"semanticVersion")
)
instance Prelude.Hashable Version
instance Prelude.NFData Version