{-# 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.ApplicationDependencySummary
-- 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.ApplicationDependencySummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A nested application summary.
--
-- /See:/ 'newApplicationDependencySummary' smart constructor.
data ApplicationDependencySummary = ApplicationDependencySummary'
  { -- | The Amazon Resource Name (ARN) of the nested application.
    ApplicationDependencySummary -> Text
applicationId :: Prelude.Text,
    -- | The semantic version of the nested application.
    ApplicationDependencySummary -> Text
semanticVersion :: Prelude.Text
  }
  deriving (ApplicationDependencySummary
-> ApplicationDependencySummary -> Bool
(ApplicationDependencySummary
 -> ApplicationDependencySummary -> Bool)
-> (ApplicationDependencySummary
    -> ApplicationDependencySummary -> Bool)
-> Eq ApplicationDependencySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationDependencySummary
-> ApplicationDependencySummary -> Bool
$c/= :: ApplicationDependencySummary
-> ApplicationDependencySummary -> Bool
== :: ApplicationDependencySummary
-> ApplicationDependencySummary -> Bool
$c== :: ApplicationDependencySummary
-> ApplicationDependencySummary -> Bool
Prelude.Eq, ReadPrec [ApplicationDependencySummary]
ReadPrec ApplicationDependencySummary
Int -> ReadS ApplicationDependencySummary
ReadS [ApplicationDependencySummary]
(Int -> ReadS ApplicationDependencySummary)
-> ReadS [ApplicationDependencySummary]
-> ReadPrec ApplicationDependencySummary
-> ReadPrec [ApplicationDependencySummary]
-> Read ApplicationDependencySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationDependencySummary]
$creadListPrec :: ReadPrec [ApplicationDependencySummary]
readPrec :: ReadPrec ApplicationDependencySummary
$creadPrec :: ReadPrec ApplicationDependencySummary
readList :: ReadS [ApplicationDependencySummary]
$creadList :: ReadS [ApplicationDependencySummary]
readsPrec :: Int -> ReadS ApplicationDependencySummary
$creadsPrec :: Int -> ReadS ApplicationDependencySummary
Prelude.Read, Int -> ApplicationDependencySummary -> ShowS
[ApplicationDependencySummary] -> ShowS
ApplicationDependencySummary -> String
(Int -> ApplicationDependencySummary -> ShowS)
-> (ApplicationDependencySummary -> String)
-> ([ApplicationDependencySummary] -> ShowS)
-> Show ApplicationDependencySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationDependencySummary] -> ShowS
$cshowList :: [ApplicationDependencySummary] -> ShowS
show :: ApplicationDependencySummary -> String
$cshow :: ApplicationDependencySummary -> String
showsPrec :: Int -> ApplicationDependencySummary -> ShowS
$cshowsPrec :: Int -> ApplicationDependencySummary -> ShowS
Prelude.Show, (forall x.
 ApplicationDependencySummary -> Rep ApplicationDependencySummary x)
-> (forall x.
    Rep ApplicationDependencySummary x -> ApplicationDependencySummary)
-> Generic ApplicationDependencySummary
forall x.
Rep ApplicationDependencySummary x -> ApplicationDependencySummary
forall x.
ApplicationDependencySummary -> Rep ApplicationDependencySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationDependencySummary x -> ApplicationDependencySummary
$cfrom :: forall x.
ApplicationDependencySummary -> Rep ApplicationDependencySummary x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationDependencySummary' 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:
--
-- 'applicationId', 'applicationDependencySummary_applicationId' - The Amazon Resource Name (ARN) of the nested application.
--
-- 'semanticVersion', 'applicationDependencySummary_semanticVersion' - The semantic version of the nested application.
newApplicationDependencySummary ::
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'semanticVersion'
  Prelude.Text ->
  ApplicationDependencySummary
newApplicationDependencySummary :: Text -> Text -> ApplicationDependencySummary
newApplicationDependencySummary
  Text
pApplicationId_
  Text
pSemanticVersion_ =
    ApplicationDependencySummary' :: Text -> Text -> ApplicationDependencySummary
ApplicationDependencySummary'
      { $sel:applicationId:ApplicationDependencySummary' :: Text
applicationId =
          Text
pApplicationId_,
        $sel:semanticVersion:ApplicationDependencySummary' :: Text
semanticVersion = Text
pSemanticVersion_
      }

-- | The Amazon Resource Name (ARN) of the nested application.
applicationDependencySummary_applicationId :: Lens.Lens' ApplicationDependencySummary Prelude.Text
applicationDependencySummary_applicationId :: (Text -> f Text)
-> ApplicationDependencySummary -> f ApplicationDependencySummary
applicationDependencySummary_applicationId = (ApplicationDependencySummary -> Text)
-> (ApplicationDependencySummary
    -> Text -> ApplicationDependencySummary)
-> Lens
     ApplicationDependencySummary ApplicationDependencySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationDependencySummary' {Text
applicationId :: Text
$sel:applicationId:ApplicationDependencySummary' :: ApplicationDependencySummary -> Text
applicationId} -> Text
applicationId) (\s :: ApplicationDependencySummary
s@ApplicationDependencySummary' {} Text
a -> ApplicationDependencySummary
s {$sel:applicationId:ApplicationDependencySummary' :: Text
applicationId = Text
a} :: ApplicationDependencySummary)

-- | The semantic version of the nested application.
applicationDependencySummary_semanticVersion :: Lens.Lens' ApplicationDependencySummary Prelude.Text
applicationDependencySummary_semanticVersion :: (Text -> f Text)
-> ApplicationDependencySummary -> f ApplicationDependencySummary
applicationDependencySummary_semanticVersion = (ApplicationDependencySummary -> Text)
-> (ApplicationDependencySummary
    -> Text -> ApplicationDependencySummary)
-> Lens
     ApplicationDependencySummary ApplicationDependencySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationDependencySummary' {Text
semanticVersion :: Text
$sel:semanticVersion:ApplicationDependencySummary' :: ApplicationDependencySummary -> Text
semanticVersion} -> Text
semanticVersion) (\s :: ApplicationDependencySummary
s@ApplicationDependencySummary' {} Text
a -> ApplicationDependencySummary
s {$sel:semanticVersion:ApplicationDependencySummary' :: Text
semanticVersion = Text
a} :: ApplicationDependencySummary)

instance Core.FromJSON ApplicationDependencySummary where
  parseJSON :: Value -> Parser ApplicationDependencySummary
parseJSON =
    String
-> (Object -> Parser ApplicationDependencySummary)
-> Value
-> Parser ApplicationDependencySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationDependencySummary"
      ( \Object
x ->
          Text -> Text -> ApplicationDependencySummary
ApplicationDependencySummary'
            (Text -> Text -> ApplicationDependencySummary)
-> Parser Text -> Parser (Text -> ApplicationDependencySummary)
forall (f :: * -> *) a b. Functor 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 -> ApplicationDependencySummary)
-> Parser Text -> Parser ApplicationDependencySummary
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
    ApplicationDependencySummary

instance Prelude.NFData ApplicationDependencySummary