{-# 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.AppConfig.Types.Application
-- 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.AppConfig.Types.Application 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

-- | /See:/ 'newApplication' smart constructor.
data Application = Application'
  { -- | The description of the application.
    Application -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The application ID.
    Application -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The application name.
    Application -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (Application -> Application -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Application -> Application -> Bool
$c/= :: Application -> Application -> Bool
== :: Application -> Application -> Bool
$c== :: Application -> Application -> Bool
Prelude.Eq, ReadPrec [Application]
ReadPrec Application
Int -> ReadS Application
ReadS [Application]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Application]
$creadListPrec :: ReadPrec [Application]
readPrec :: ReadPrec Application
$creadPrec :: ReadPrec Application
readList :: ReadS [Application]
$creadList :: ReadS [Application]
readsPrec :: Int -> ReadS Application
$creadsPrec :: Int -> ReadS Application
Prelude.Read, Int -> Application -> ShowS
[Application] -> ShowS
Application -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Application] -> ShowS
$cshowList :: [Application] -> ShowS
show :: Application -> String
$cshow :: Application -> String
showsPrec :: Int -> Application -> ShowS
$cshowsPrec :: Int -> Application -> ShowS
Prelude.Show, forall x. Rep Application x -> Application
forall x. Application -> Rep Application x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Application x -> Application
$cfrom :: forall x. Application -> Rep Application x
Prelude.Generic)

-- |
-- Create a value of 'Application' 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:
--
-- 'description', 'application_description' - The description of the application.
--
-- 'id', 'application_id' - The application ID.
--
-- 'name', 'application_name' - The application name.
newApplication ::
  Application
newApplication :: Application
newApplication =
  Application'
    { $sel:description:Application' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:Application' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Application' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the application.
application_description :: Lens.Lens' Application (Prelude.Maybe Prelude.Text)
application_description :: Lens' Application (Maybe Text)
application_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Application' {Maybe Text
description :: Maybe Text
$sel:description:Application' :: Application -> Maybe Text
description} -> Maybe Text
description) (\s :: Application
s@Application' {} Maybe Text
a -> Application
s {$sel:description:Application' :: Maybe Text
description = Maybe Text
a} :: Application)

-- | The application ID.
application_id :: Lens.Lens' Application (Prelude.Maybe Prelude.Text)
application_id :: Lens' Application (Maybe Text)
application_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Application' {Maybe Text
id :: Maybe Text
$sel:id:Application' :: Application -> Maybe Text
id} -> Maybe Text
id) (\s :: Application
s@Application' {} Maybe Text
a -> Application
s {$sel:id:Application' :: Maybe Text
id = Maybe Text
a} :: Application)

-- | The application name.
application_name :: Lens.Lens' Application (Prelude.Maybe Prelude.Text)
application_name :: Lens' Application (Maybe Text)
application_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Application' {Maybe Text
name :: Maybe Text
$sel:name:Application' :: Application -> Maybe Text
name} -> Maybe Text
name) (\s :: Application
s@Application' {} Maybe Text
a -> Application
s {$sel:name:Application' :: Maybe Text
name = Maybe Text
a} :: Application)

instance Data.FromJSON Application where
  parseJSON :: Value -> Parser Application
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Application"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> Application
Application'
            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
"Description")
            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
"Id")
            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
"Name")
      )

instance Prelude.Hashable Application where
  hashWithSalt :: Int -> Application -> Int
hashWithSalt Int
_salt Application' {Maybe Text
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
$sel:name:Application' :: Application -> Maybe Text
$sel:id:Application' :: Application -> Maybe Text
$sel:description:Application' :: Application -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData Application where
  rnf :: Application -> ()
rnf Application' {Maybe Text
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
$sel:name:Application' :: Application -> Maybe Text
$sel:id:Application' :: Application -> Maybe Text
$sel:description:Application' :: Application -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name