{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServerlessApplicationRepository.Types.ApplicationSummary 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

-- | 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
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]
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
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. 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'
      { $sel:creationTime:ApplicationSummary' :: Maybe Text
creationTime = forall a. Maybe a
Prelude.Nothing,
        $sel:homePageUrl:ApplicationSummary' :: Maybe Text
homePageUrl = forall a. Maybe a
Prelude.Nothing,
        $sel:labels:ApplicationSummary' :: Maybe [Text]
labels = forall a. Maybe a
Prelude.Nothing,
        $sel:spdxLicenseId:ApplicationSummary' :: Maybe Text
spdxLicenseId = 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 :: Lens' ApplicationSummary (Maybe Text)
applicationSummary_creationTime = 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 :: Lens' ApplicationSummary (Maybe Text)
applicationSummary_homePageUrl = 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 :: Lens' ApplicationSummary (Maybe [Text])
applicationSummary_labels = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' ApplicationSummary (Maybe Text)
applicationSummary_spdxLicenseId = 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 :: Lens' ApplicationSummary Text
applicationSummary_description = 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 :: Lens' ApplicationSummary Text
applicationSummary_author = 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 :: Lens' ApplicationSummary Text
applicationSummary_applicationId = 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 :: Lens' ApplicationSummary Text
applicationSummary_name = 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 Data.FromJSON ApplicationSummary where
  parseJSON :: Value -> Parser ApplicationSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApplicationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> ApplicationSummary
ApplicationSummary'
            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
"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
"homePageUrl")
            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
"labels" 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 (Maybe a)
Data..:? Key
"spdxLicenseId")
            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
"description")
            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
"author")
            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
"name")
      )

instance Prelude.Hashable ApplicationSummary where
  hashWithSalt :: Int -> ApplicationSummary -> Int
hashWithSalt Int
_salt ApplicationSummary' {Maybe [Text]
Maybe Text
Text
name :: Text
applicationId :: Text
author :: Text
description :: Text
spdxLicenseId :: Maybe Text
labels :: Maybe [Text]
homePageUrl :: Maybe Text
creationTime :: Maybe Text
$sel:name:ApplicationSummary' :: ApplicationSummary -> Text
$sel:applicationId:ApplicationSummary' :: ApplicationSummary -> Text
$sel:author:ApplicationSummary' :: ApplicationSummary -> Text
$sel:description:ApplicationSummary' :: ApplicationSummary -> Text
$sel:spdxLicenseId:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:labels:ApplicationSummary' :: ApplicationSummary -> Maybe [Text]
$sel:homePageUrl:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:creationTime:ApplicationSummary' :: ApplicationSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
homePageUrl
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
labels
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
spdxLicenseId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
author
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ApplicationSummary where
  rnf :: ApplicationSummary -> ()
rnf ApplicationSummary' {Maybe [Text]
Maybe Text
Text
name :: Text
applicationId :: Text
author :: Text
description :: Text
spdxLicenseId :: Maybe Text
labels :: Maybe [Text]
homePageUrl :: Maybe Text
creationTime :: Maybe Text
$sel:name:ApplicationSummary' :: ApplicationSummary -> Text
$sel:applicationId:ApplicationSummary' :: ApplicationSummary -> Text
$sel:author:ApplicationSummary' :: ApplicationSummary -> Text
$sel:description:ApplicationSummary' :: ApplicationSummary -> Text
$sel:spdxLicenseId:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:labels:ApplicationSummary' :: ApplicationSummary -> Maybe [Text]
$sel:homePageUrl:ApplicationSummary' :: ApplicationSummary -> Maybe Text
$sel:creationTime:ApplicationSummary' :: ApplicationSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
homePageUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
labels
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
spdxLicenseId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
author
      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
name