{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ServerlessApplicationRepository.Types.Version
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Application version details.
--
-- /See:/ 'newVersion' smart constructor.
data Version = Version'
  { -- | A link to a public repository for the source code of your application,
    -- for example the URL of a specific GitHub commit.
    Version -> Maybe Text
sourceCodeUrl :: Prelude.Maybe Prelude.Text,
    -- | A link to the S3 object that contains the ZIP archive of the source code
    -- for this version of your application.
    --
    -- Maximum size 50 MB
    Version -> Maybe Text
sourceCodeArchiveUrl :: Prelude.Maybe Prelude.Text,
    -- | A link to the packaged AWS SAM template of your application.
    Version -> Text
templateUrl :: Prelude.Text,
    -- | An array of parameter types supported by the application.
    Version -> [ParameterDefinition]
parameterDefinitions :: [ParameterDefinition],
    -- | Whether all of the AWS resources contained in this application are
    -- supported in the region in which it is being retrieved.
    Version -> Bool
resourcesSupported :: Prelude.Bool,
    -- | The date and time this resource was created.
    Version -> Text
creationTime :: Prelude.Text,
    -- | A list of values that you must specify before you can deploy certain
    -- applications. Some applications might include resources that can affect
    -- permissions in your AWS account, for example, by creating new AWS
    -- Identity and Access Management (IAM) users. For those applications, you
    -- must explicitly acknowledge their capabilities by specifying this
    -- parameter.
    --
    -- The only valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM,
    -- CAPABILITY_RESOURCE_POLICY, and CAPABILITY_AUTO_EXPAND.
    --
    -- The following resources require you to specify CAPABILITY_IAM or
    -- CAPABILITY_NAMED_IAM:
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>,
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>,
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html AWS::IAM::Policy>,
    -- and
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>.
    -- If the application contains IAM resources, you can specify either
    -- CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM
    -- resources with custom names, you must specify CAPABILITY_NAMED_IAM.
    --
    -- The following resources require you to specify
    -- CAPABILITY_RESOURCE_POLICY:
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html AWS::Lambda::Permission>,
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html AWS::IAM:Policy>,
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html AWS::ApplicationAutoScaling::ScalingPolicy>,
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html AWS::S3::BucketPolicy>,
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html AWS::SQS::QueuePolicy>,
    -- and
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html AWS::SNS::TopicPolicy>.
    --
    -- Applications that contain one or more nested applications require you to
    -- specify CAPABILITY_AUTO_EXPAND.
    --
    -- If your application template contains any of the above resources, we
    -- recommend that you review all permissions associated with the
    -- application before deploying. If you don\'t specify this parameter for
    -- an application that requires capabilities, the call will fail.
    Version -> [Capability]
requiredCapabilities :: [Capability],
    -- | The application Amazon Resource Name (ARN).
    Version -> Text
applicationId :: Prelude.Text,
    -- | The semantic version of the application:
    --
    -- <https://semver.org/>
    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)

-- |
-- Create a value of 'Version' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sourceCodeUrl', 'version_sourceCodeUrl' - A link to a public repository for the source code of your application,
-- for example the URL of a specific GitHub commit.
--
-- 'sourceCodeArchiveUrl', 'version_sourceCodeArchiveUrl' - A link to the S3 object that contains the ZIP archive of the source code
-- for this version of your application.
--
-- Maximum size 50 MB
--
-- 'templateUrl', 'version_templateUrl' - A link to the packaged AWS SAM template of your application.
--
-- 'parameterDefinitions', 'version_parameterDefinitions' - An array of parameter types supported by the application.
--
-- 'resourcesSupported', 'version_resourcesSupported' - Whether all of the AWS resources contained in this application are
-- supported in the region in which it is being retrieved.
--
-- 'creationTime', 'version_creationTime' - The date and time this resource was created.
--
-- 'requiredCapabilities', 'version_requiredCapabilities' - A list of values that you must specify before you can deploy certain
-- applications. Some applications might include resources that can affect
-- permissions in your AWS account, for example, by creating new AWS
-- Identity and Access Management (IAM) users. For those applications, you
-- must explicitly acknowledge their capabilities by specifying this
-- parameter.
--
-- The only valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM,
-- CAPABILITY_RESOURCE_POLICY, and CAPABILITY_AUTO_EXPAND.
--
-- The following resources require you to specify CAPABILITY_IAM or
-- CAPABILITY_NAMED_IAM:
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html AWS::IAM::Policy>,
-- and
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>.
-- If the application contains IAM resources, you can specify either
-- CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM
-- resources with custom names, you must specify CAPABILITY_NAMED_IAM.
--
-- The following resources require you to specify
-- CAPABILITY_RESOURCE_POLICY:
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html AWS::Lambda::Permission>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html AWS::IAM:Policy>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html AWS::ApplicationAutoScaling::ScalingPolicy>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html AWS::S3::BucketPolicy>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html AWS::SQS::QueuePolicy>,
-- and
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html AWS::SNS::TopicPolicy>.
--
-- Applications that contain one or more nested applications require you to
-- specify CAPABILITY_AUTO_EXPAND.
--
-- If your application template contains any of the above resources, we
-- recommend that you review all permissions associated with the
-- application before deploying. If you don\'t specify this parameter for
-- an application that requires capabilities, the call will fail.
--
-- 'applicationId', 'version_applicationId' - The application Amazon Resource Name (ARN).
--
-- 'semanticVersion', 'version_semanticVersion' - The semantic version of the application:
--
-- <https://semver.org/>
newVersion ::
  -- | 'templateUrl'
  Prelude.Text ->
  -- | 'resourcesSupported'
  Prelude.Bool ->
  -- | 'creationTime'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'semanticVersion'
  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_
      }

-- | A link to a public repository for the source code of your application,
-- for example the URL of a specific GitHub commit.
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)

-- | A link to the S3 object that contains the ZIP archive of the source code
-- for this version of your application.
--
-- Maximum size 50 MB
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)

-- | A link to the packaged AWS SAM template of your application.
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)

-- | An array of parameter types supported by the application.
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

-- | Whether all of the AWS resources contained in this application are
-- supported in the region in which it is being retrieved.
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)

-- | The date and time this resource was created.
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)

-- | A list of values that you must specify before you can deploy certain
-- applications. Some applications might include resources that can affect
-- permissions in your AWS account, for example, by creating new AWS
-- Identity and Access Management (IAM) users. For those applications, you
-- must explicitly acknowledge their capabilities by specifying this
-- parameter.
--
-- The only valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM,
-- CAPABILITY_RESOURCE_POLICY, and CAPABILITY_AUTO_EXPAND.
--
-- The following resources require you to specify CAPABILITY_IAM or
-- CAPABILITY_NAMED_IAM:
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html AWS::IAM::Group>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html AWS::IAM::InstanceProfile>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html AWS::IAM::Policy>,
-- and
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html AWS::IAM::Role>.
-- If the application contains IAM resources, you can specify either
-- CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM
-- resources with custom names, you must specify CAPABILITY_NAMED_IAM.
--
-- The following resources require you to specify
-- CAPABILITY_RESOURCE_POLICY:
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html AWS::Lambda::Permission>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html AWS::IAM:Policy>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html AWS::ApplicationAutoScaling::ScalingPolicy>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html AWS::S3::BucketPolicy>,
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html AWS::SQS::QueuePolicy>,
-- and
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html AWS::SNS::TopicPolicy>.
--
-- Applications that contain one or more nested applications require you to
-- specify CAPABILITY_AUTO_EXPAND.
--
-- If your application template contains any of the above resources, we
-- recommend that you review all permissions associated with the
-- application before deploying. If you don\'t specify this parameter for
-- an application that requires capabilities, the call will fail.
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

-- | The application Amazon Resource Name (ARN).
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)

-- | The semantic version of the application:
--
-- <https://semver.org/>
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