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

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

-- | Summary of a Amazon Web Services Service Catalog AppRegistry
-- application.
--
-- /See:/ 'newApplicationSummary' smart constructor.
data ApplicationSummary = ApplicationSummary'
  { -- | The ISO-8601 formatted timestamp of the moment when the application was
    -- created.
    ApplicationSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon resource name (ARN) that specifies the application across
    -- services.
    ApplicationSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the application. The name must be unique in the region in
    -- which you are creating the application.
    ApplicationSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the application.
    ApplicationSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The ISO-8601 formatted timestamp of the moment when the application was
    -- last updated.
    ApplicationSummary -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
    -- | The description of the application.
    ApplicationSummary -> Maybe Text
description :: Prelude.Maybe 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 ISO-8601 formatted timestamp of the moment when the application was
-- created.
--
-- 'arn', 'applicationSummary_arn' - The Amazon resource name (ARN) that specifies the application across
-- services.
--
-- 'name', 'applicationSummary_name' - The name of the application. The name must be unique in the region in
-- which you are creating the application.
--
-- 'id', 'applicationSummary_id' - The identifier of the application.
--
-- 'lastUpdateTime', 'applicationSummary_lastUpdateTime' - The ISO-8601 formatted timestamp of the moment when the application was
-- last updated.
--
-- 'description', 'applicationSummary_description' - The description of the application.
newApplicationSummary ::
  ApplicationSummary
newApplicationSummary :: ApplicationSummary
newApplicationSummary =
  ApplicationSummary' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> ApplicationSummary
ApplicationSummary'
    { $sel:creationTime:ApplicationSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ApplicationSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ApplicationSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ApplicationSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:ApplicationSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ApplicationSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ISO-8601 formatted timestamp of the moment when the application was
-- created.
applicationSummary_creationTime :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.UTCTime)
applicationSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_creationTime = (ApplicationSummary -> Maybe POSIX)
-> (ApplicationSummary -> Maybe POSIX -> ApplicationSummary)
-> Lens
     ApplicationSummary ApplicationSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ApplicationSummary' :: ApplicationSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe POSIX
a -> ApplicationSummary
s {$sel:creationTime:ApplicationSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ApplicationSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ApplicationSummary -> f ApplicationSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ApplicationSummary
-> f ApplicationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon resource name (ARN) that specifies the application across
-- services.
applicationSummary_arn :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_arn :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_arn = (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
arn :: Maybe Text
$sel:arn:ApplicationSummary' :: ApplicationSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:arn:ApplicationSummary' :: Maybe Text
arn = Maybe Text
a} :: ApplicationSummary)

-- | The name of the application. The name must be unique in the region in
-- which you are creating the application.
applicationSummary_name :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_name :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_name = (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
name :: Maybe Text
$sel:name:ApplicationSummary' :: ApplicationSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:name:ApplicationSummary' :: Maybe Text
name = Maybe Text
a} :: ApplicationSummary)

-- | The identifier of the application.
applicationSummary_id :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_id :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_id = (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
id :: Maybe Text
$sel:id:ApplicationSummary' :: ApplicationSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:id:ApplicationSummary' :: Maybe Text
id = Maybe Text
a} :: ApplicationSummary)

-- | The ISO-8601 formatted timestamp of the moment when the application was
-- last updated.
applicationSummary_lastUpdateTime :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.UTCTime)
applicationSummary_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_lastUpdateTime = (ApplicationSummary -> Maybe POSIX)
-> (ApplicationSummary -> Maybe POSIX -> ApplicationSummary)
-> Lens
     ApplicationSummary ApplicationSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationSummary' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:ApplicationSummary' :: ApplicationSummary -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe POSIX
a -> ApplicationSummary
s {$sel:lastUpdateTime:ApplicationSummary' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: ApplicationSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ApplicationSummary -> f ApplicationSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ApplicationSummary
-> f ApplicationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description of the application.
applicationSummary_description :: Lens.Lens' ApplicationSummary (Prelude.Maybe Prelude.Text)
applicationSummary_description :: (Maybe Text -> f (Maybe Text))
-> ApplicationSummary -> f ApplicationSummary
applicationSummary_description = (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
description :: Maybe Text
$sel:description:ApplicationSummary' :: ApplicationSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ApplicationSummary
s@ApplicationSummary' {} Maybe Text
a -> ApplicationSummary
s {$sel:description:ApplicationSummary' :: Maybe Text
description = Maybe 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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> ApplicationSummary
ApplicationSummary'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> ApplicationSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ApplicationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ApplicationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Maybe 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
"arn")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> ApplicationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe 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
"name")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> ApplicationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe 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
"id")
            Parser (Maybe POSIX -> Maybe Text -> ApplicationSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> ApplicationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateTime")
            Parser (Maybe Text -> ApplicationSummary)
-> Parser (Maybe Text) -> Parser 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
"description")
      )

instance Prelude.Hashable ApplicationSummary

instance Prelude.NFData ApplicationSummary