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

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

-- | Summary of details about the application.
--
-- /See:/ 'newApplicationSummary' smart constructor.
data ApplicationSummary = ApplicationSummary'
  { -- | The date and time this resource was created.
    ApplicationSummary -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | A URL with more information about the application, for example the
    -- location of your GitHub repository for the application.
    ApplicationSummary -> Maybe Text
homePageUrl :: Prelude.Maybe Prelude.Text,
    -- | Labels to improve discovery of apps in search results.
    --
    -- Minimum length=1. Maximum length=127. Maximum number of labels: 10
    --
    -- Pattern: \"^[a-zA-Z0-9+\\\\-_:\\\\\/\@]+$\";
    ApplicationSummary -> Maybe [Text]
labels :: Prelude.Maybe [Prelude.Text],
    -- | A valid identifier from <https://spdx.org/licenses/>.
    ApplicationSummary -> Maybe Text
spdxLicenseId :: Prelude.Maybe Prelude.Text,
    -- | The description of the application.
    --
    -- Minimum length=1. Maximum length=256
    ApplicationSummary -> Text
description :: Prelude.Text,
    -- | The name of the author publishing the app.
    --
    -- Minimum length=1. Maximum length=127.
    --
    -- Pattern \"^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$\";
    ApplicationSummary -> Text
author :: Prelude.Text,
    -- | The application Amazon Resource Name (ARN).
    ApplicationSummary -> Text
applicationId :: Prelude.Text,
    -- | The name of the application.
    --
    -- Minimum length=1. Maximum length=140
    --
    -- Pattern: \"[a-zA-Z0-9\\\\-]+\";
    ApplicationSummary -> Text
name :: Prelude.Text
  }
  deriving (ApplicationSummary -> ApplicationSummary -> Bool
(ApplicationSummary -> ApplicationSummary -> Bool)
-> (ApplicationSummary -> ApplicationSummary -> Bool)
-> Eq ApplicationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationSummary -> ApplicationSummary -> Bool
$c/= :: ApplicationSummary -> ApplicationSummary -> Bool
== :: ApplicationSummary -> ApplicationSummary -> Bool
$c== :: ApplicationSummary -> ApplicationSummary -> Bool
Prelude.Eq, ReadPrec [ApplicationSummary]
ReadPrec ApplicationSummary
Int -> ReadS ApplicationSummary
ReadS [ApplicationSummary]
(Int -> ReadS ApplicationSummary)
-> ReadS [ApplicationSummary]
-> ReadPrec ApplicationSummary
-> ReadPrec [ApplicationSummary]
-> Read ApplicationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationSummary]
$creadListPrec :: ReadPrec [ApplicationSummary]
readPrec :: ReadPrec ApplicationSummary
$creadPrec :: ReadPrec ApplicationSummary
readList :: ReadS [ApplicationSummary]
$creadList :: ReadS [ApplicationSummary]
readsPrec :: Int -> ReadS ApplicationSummary
$creadsPrec :: Int -> ReadS ApplicationSummary
Prelude.Read, Int -> ApplicationSummary -> ShowS
[ApplicationSummary] -> ShowS
ApplicationSummary -> String
(Int -> ApplicationSummary -> ShowS)
-> (ApplicationSummary -> String)
-> ([ApplicationSummary] -> ShowS)
-> Show ApplicationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationSummary] -> ShowS
$cshowList :: [ApplicationSummary] -> ShowS
show :: ApplicationSummary -> String
$cshow :: ApplicationSummary -> String
showsPrec :: Int -> ApplicationSummary -> ShowS
$cshowsPrec :: Int -> ApplicationSummary -> ShowS
Prelude.Show, (forall x. ApplicationSummary -> Rep ApplicationSummary x)
-> (forall x. Rep ApplicationSummary x -> ApplicationSummary)
-> Generic ApplicationSummary
forall x. Rep ApplicationSummary x -> ApplicationSummary
forall x. ApplicationSummary -> Rep ApplicationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApplicationSummary x -> ApplicationSummary
$cfrom :: forall x. ApplicationSummary -> Rep ApplicationSummary x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationSummary' 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:
--
-- 'creationTime', 'applicationSummary_creationTime' - The date and time this resource was created.
--
-- 'homePageUrl', 'applicationSummary_homePageUrl' - A URL with more information about the application, for example the
-- location of your GitHub repository for the application.
--
-- 'labels', 'applicationSummary_labels' - Labels to improve discovery of apps in search results.
--
-- Minimum length=1. Maximum length=127. Maximum number of labels: 10
--
-- Pattern: \"^[a-zA-Z0-9+\\\\-_:\\\\\/\@]+$\";
--
-- 'spdxLicenseId', 'applicationSummary_spdxLicenseId' - A valid identifier from <https://spdx.org/licenses/>.
--
-- 'description', 'applicationSummary_description' - The description of the application.
--
-- Minimum length=1. Maximum length=256
--
-- 'author', 'applicationSummary_author' - The name of the author publishing the app.
--
-- Minimum length=1. Maximum length=127.
--
-- Pattern \"^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$\";
--
-- 'applicationId', 'applicationSummary_applicationId' - The application Amazon Resource Name (ARN).
--
-- 'name', 'applicationSummary_name' - The name of the application.
--
-- Minimum length=1. Maximum length=140
--
-- Pattern: \"[a-zA-Z0-9\\\\-]+\";
newApplicationSummary ::
  -- | 'description'
  Prelude.Text ->
  -- | 'author'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ApplicationSummary
newApplicationSummary :: Text -> Text -> Text -> Text -> ApplicationSummary
newApplicationSummary
  Text
pDescription_
  Text
pAuthor_
  Text
pApplicationId_
  Text
pName_ =
    ApplicationSummary' :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> ApplicationSummary
ApplicationSummary'
      { $sel:creationTime:ApplicationSummary' :: Maybe Text
creationTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:homePageUrl:ApplicationSummary' :: Maybe Text
homePageUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:labels:ApplicationSummary' :: Maybe [Text]
labels = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:spdxLicenseId:ApplicationSummary' :: Maybe Text
spdxLicenseId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:ApplicationSummary' :: Text
description = Text
pDescription_,
        $sel:author:ApplicationSummary' :: Text
author = Text
pAuthor_,
        $sel:applicationId:ApplicationSummary' :: Text
applicationId = Text
pApplicationId_,
        $sel:name:ApplicationSummary' :: Text
name = Text
pName_
      }

-- | The date and time this resource was created.
applicationSummary_creationTime :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_creationTime :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_creationTime = (ApplicationSummary -> Maybe Text)
-> (ApplicationSummary -> Maybe Text -> ApplicationSummary)
-> Lens
     ApplicationSummary ApplicationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Text
creationTime :: Maybe Text
$sel:creationTime:ApplicationSummary' :: ApplicationSummary -> Maybe Text
creationTime} -> Maybe Text
creationTime) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:creationTime:ApplicationSummary' :: Maybe Text
creationTime = Maybe Text
a} :: ApplicationSummary)

-- | A URL with more information about the application, for example the
-- location of your GitHub repository for the application.
applicationSummary_homePageUrl :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_homePageUrl :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_homePageUrl = (ApplicationSummary -> Maybe Text)
-> (ApplicationSummary -> Maybe Text -> ApplicationSummary)
-> Lens
     ApplicationSummary ApplicationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Text
homePageUrl :: Maybe Text
$sel:homePageUrl:ApplicationSummary' :: ApplicationSummary -> Maybe Text
homePageUrl} -> Maybe Text
homePageUrl) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:homePageUrl:ApplicationSummary' :: Maybe Text
homePageUrl = Maybe Text
a} :: ApplicationSummary)

-- | Labels to improve discovery of apps in search results.
--
-- Minimum length=1. Maximum length=127. Maximum number of labels: 10
--
-- Pattern: \"^[a-zA-Z0-9+\\\\-_:\\\\\/\@]+$\";
applicationSummary_labels :: Lens.Lens' ApplicationSummary (Prelude.Maybe [Prelude.Text])
applicationSummary_labels :: (Maybe [Text] -> f (Maybe [Text]))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_labels = (ApplicationSummary -> Maybe [Text])
-> (ApplicationSummary -> Maybe [Text] -> ApplicationSummary)
-> Lens
     ApplicationSummary ApplicationSummary (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe [Text]
labels :: Maybe [Text]
$sel:labels:ApplicationSummary' :: ApplicationSummary -> Maybe [Text]
labels} -> Maybe [Text]
labels) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe [Text]
a -> ApplicationSummary
s {$sel:labels:ApplicationSummary' :: Maybe [Text]
labels = Maybe [Text]
a} :: ApplicationSummary) ((Maybe [Text] -> f (Maybe [Text]))
 -> ApplicationSummary -> f ApplicationSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ApplicationSummary
-> f ApplicationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A valid identifier from <https://spdx.org/licenses/>.
applicationSummary_spdxLicenseId :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_spdxLicenseId :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_spdxLicenseId = (ApplicationSummary -> Maybe Text)
-> (ApplicationSummary -> Maybe Text -> ApplicationSummary)
-> Lens
     ApplicationSummary ApplicationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe Text
spdxLicenseId :: Maybe Text
$sel:spdxLicenseId:ApplicationSummary' :: ApplicationSummary -> Maybe Text
spdxLicenseId} -> Maybe Text
spdxLicenseId) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:spdxLicenseId:ApplicationSummary' :: Maybe Text
spdxLicenseId = Maybe Text
a} :: ApplicationSummary)

-- | The description of the application.
--
-- Minimum length=1. Maximum length=256
applicationSummary_description :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_description :: (Text -> f Text) -> ApplicationSummary -> f ApplicationSummary
applicationSummary_description = (ApplicationSummary -> Text)
-> (ApplicationSummary -> Text -> ApplicationSummary)
-> Lens ApplicationSummary ApplicationSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
description :: Text
$sel:description:ApplicationSummary' :: ApplicationSummary -> Text
description} -> Text
description) (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:description:ApplicationSummary' :: Text
description = Text
a} :: ApplicationSummary)

-- | The name of the author publishing the app.
--
-- Minimum length=1. Maximum length=127.
--
-- Pattern \"^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$\";
applicationSummary_author :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_author :: (Text -> f Text) -> ApplicationSummary -> f ApplicationSummary
applicationSummary_author = (ApplicationSummary -> Text)
-> (ApplicationSummary -> Text -> ApplicationSummary)
-> Lens ApplicationSummary ApplicationSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
author :: Text
$sel:author:ApplicationSummary' :: ApplicationSummary -> Text
author} -> Text
author) (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:author:ApplicationSummary' :: Text
author = Text
a} :: ApplicationSummary)

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

-- | The name of the application.
--
-- Minimum length=1. Maximum length=140
--
-- Pattern: \"[a-zA-Z0-9\\\\-]+\";
applicationSummary_name :: Lens.Lens' ApplicationSummary Prelude.Text
applicationSummary_name :: (Text -> f Text) -> ApplicationSummary -> f ApplicationSummary
applicationSummary_name = (ApplicationSummary -> Text)
-> (ApplicationSummary -> Text -> ApplicationSummary)
-> Lens ApplicationSummary ApplicationSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Text
name :: Text
$sel:name:ApplicationSummary' :: ApplicationSummary -> Text
name} -> Text
name) (\s :: ApplicationSummary
s@ApplicationSummary' {} Text
a -> ApplicationSummary
s {$sel:name:ApplicationSummary' :: Text
name = Text
a} :: ApplicationSummary)

instance Core.FromJSON ApplicationSummary where
  parseJSON :: Value -> Parser ApplicationSummary
parseJSON =
    String
-> (Object -> Parser ApplicationSummary)
-> Value
-> Parser ApplicationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> ApplicationSummary
ApplicationSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> ApplicationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ApplicationSummary)
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
"creationTime")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ApplicationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ApplicationSummary)
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
"homePageUrl")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ApplicationSummary)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text -> Text -> Text -> Text -> Text -> ApplicationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"labels" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text -> Text -> Text -> Text -> Text -> ApplicationSummary)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> Text -> Text -> ApplicationSummary)
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
"spdxLicenseId")
            Parser (Text -> Text -> Text -> Text -> ApplicationSummary)
-> Parser Text
-> Parser (Text -> Text -> Text -> ApplicationSummary)
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
"description")
            Parser (Text -> Text -> Text -> ApplicationSummary)
-> Parser Text -> Parser (Text -> Text -> ApplicationSummary)
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
"author")
            Parser (Text -> Text -> ApplicationSummary)
-> Parser Text -> Parser (Text -> ApplicationSummary)
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 -> ApplicationSummary)
-> Parser Text -> Parser ApplicationSummary
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
"name")
      )

instance Prelude.Hashable ApplicationSummary

instance Prelude.NFData ApplicationSummary