{-# 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.ApplicationInsights.Types.ApplicationInfo
-- 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.ApplicationInsights.Types.ApplicationInfo where

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

-- | Describes the status of the application.
--
-- /See:/ 'newApplicationInfo' smart constructor.
data ApplicationInfo = ApplicationInfo'
  { -- | The name of the resource group used for the application.
    ApplicationInfo -> Maybe Text
resourceGroupName :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether Application Insights can listen to CloudWatch events
    -- for the application resources, such as @instance terminated@,
    -- @failed deployment@, and others.
    ApplicationInfo -> Maybe Bool
cWEMonitorEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The SNS topic provided to Application Insights that is associated to the
    -- created opsItems to receive SNS notifications for opsItem updates.
    ApplicationInfo -> Maybe Text
opsItemSNSTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The lifecycle of the application.
    ApplicationInfo -> Maybe Text
lifeCycle :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether Application Insights will create opsItems for any
    -- problem detected by Application Insights for an application.
    ApplicationInfo -> Maybe Bool
opsCenterEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The issues on the user side that block Application Insights from
    -- successfully monitoring an application. Example remarks include:
    --
    -- -   “Configuring application, detected 1 Errors, 3 Warnings”
    --
    -- -   “Configuring application, detected 1 Unconfigured Components”
    ApplicationInfo -> Maybe Text
remarks :: Prelude.Maybe Prelude.Text
  }
  deriving (ApplicationInfo -> ApplicationInfo -> Bool
(ApplicationInfo -> ApplicationInfo -> Bool)
-> (ApplicationInfo -> ApplicationInfo -> Bool)
-> Eq ApplicationInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationInfo -> ApplicationInfo -> Bool
$c/= :: ApplicationInfo -> ApplicationInfo -> Bool
== :: ApplicationInfo -> ApplicationInfo -> Bool
$c== :: ApplicationInfo -> ApplicationInfo -> Bool
Prelude.Eq, ReadPrec [ApplicationInfo]
ReadPrec ApplicationInfo
Int -> ReadS ApplicationInfo
ReadS [ApplicationInfo]
(Int -> ReadS ApplicationInfo)
-> ReadS [ApplicationInfo]
-> ReadPrec ApplicationInfo
-> ReadPrec [ApplicationInfo]
-> Read ApplicationInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationInfo]
$creadListPrec :: ReadPrec [ApplicationInfo]
readPrec :: ReadPrec ApplicationInfo
$creadPrec :: ReadPrec ApplicationInfo
readList :: ReadS [ApplicationInfo]
$creadList :: ReadS [ApplicationInfo]
readsPrec :: Int -> ReadS ApplicationInfo
$creadsPrec :: Int -> ReadS ApplicationInfo
Prelude.Read, Int -> ApplicationInfo -> ShowS
[ApplicationInfo] -> ShowS
ApplicationInfo -> String
(Int -> ApplicationInfo -> ShowS)
-> (ApplicationInfo -> String)
-> ([ApplicationInfo] -> ShowS)
-> Show ApplicationInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationInfo] -> ShowS
$cshowList :: [ApplicationInfo] -> ShowS
show :: ApplicationInfo -> String
$cshow :: ApplicationInfo -> String
showsPrec :: Int -> ApplicationInfo -> ShowS
$cshowsPrec :: Int -> ApplicationInfo -> ShowS
Prelude.Show, (forall x. ApplicationInfo -> Rep ApplicationInfo x)
-> (forall x. Rep ApplicationInfo x -> ApplicationInfo)
-> Generic ApplicationInfo
forall x. Rep ApplicationInfo x -> ApplicationInfo
forall x. ApplicationInfo -> Rep ApplicationInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApplicationInfo x -> ApplicationInfo
$cfrom :: forall x. ApplicationInfo -> Rep ApplicationInfo x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationInfo' 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:
--
-- 'resourceGroupName', 'applicationInfo_resourceGroupName' - The name of the resource group used for the application.
--
-- 'cWEMonitorEnabled', 'applicationInfo_cWEMonitorEnabled' - Indicates whether Application Insights can listen to CloudWatch events
-- for the application resources, such as @instance terminated@,
-- @failed deployment@, and others.
--
-- 'opsItemSNSTopicArn', 'applicationInfo_opsItemSNSTopicArn' - The SNS topic provided to Application Insights that is associated to the
-- created opsItems to receive SNS notifications for opsItem updates.
--
-- 'lifeCycle', 'applicationInfo_lifeCycle' - The lifecycle of the application.
--
-- 'opsCenterEnabled', 'applicationInfo_opsCenterEnabled' - Indicates whether Application Insights will create opsItems for any
-- problem detected by Application Insights for an application.
--
-- 'remarks', 'applicationInfo_remarks' - The issues on the user side that block Application Insights from
-- successfully monitoring an application. Example remarks include:
--
-- -   “Configuring application, detected 1 Errors, 3 Warnings”
--
-- -   “Configuring application, detected 1 Unconfigured Components”
newApplicationInfo ::
  ApplicationInfo
newApplicationInfo :: ApplicationInfo
newApplicationInfo =
  ApplicationInfo' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ApplicationInfo
ApplicationInfo'
    { $sel:resourceGroupName:ApplicationInfo' :: Maybe Text
resourceGroupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cWEMonitorEnabled:ApplicationInfo' :: Maybe Bool
cWEMonitorEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:opsItemSNSTopicArn:ApplicationInfo' :: Maybe Text
opsItemSNSTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lifeCycle:ApplicationInfo' :: Maybe Text
lifeCycle = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:opsCenterEnabled:ApplicationInfo' :: Maybe Bool
opsCenterEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:remarks:ApplicationInfo' :: Maybe Text
remarks = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the resource group used for the application.
applicationInfo_resourceGroupName :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Text)
applicationInfo_resourceGroupName :: (Maybe Text -> f (Maybe Text))
-> ApplicationInfo -> f ApplicationInfo
applicationInfo_resourceGroupName = (ApplicationInfo -> Maybe Text)
-> (ApplicationInfo -> Maybe Text -> ApplicationInfo)
-> Lens ApplicationInfo ApplicationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Text
resourceGroupName :: Maybe Text
$sel:resourceGroupName:ApplicationInfo' :: ApplicationInfo -> Maybe Text
resourceGroupName} -> Maybe Text
resourceGroupName) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Text
a -> ApplicationInfo
s {$sel:resourceGroupName:ApplicationInfo' :: Maybe Text
resourceGroupName = Maybe Text
a} :: ApplicationInfo)

-- | Indicates whether Application Insights can listen to CloudWatch events
-- for the application resources, such as @instance terminated@,
-- @failed deployment@, and others.
applicationInfo_cWEMonitorEnabled :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Bool)
applicationInfo_cWEMonitorEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ApplicationInfo -> f ApplicationInfo
applicationInfo_cWEMonitorEnabled = (ApplicationInfo -> Maybe Bool)
-> (ApplicationInfo -> Maybe Bool -> ApplicationInfo)
-> Lens ApplicationInfo ApplicationInfo (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Bool
cWEMonitorEnabled :: Maybe Bool
$sel:cWEMonitorEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
cWEMonitorEnabled} -> Maybe Bool
cWEMonitorEnabled) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Bool
a -> ApplicationInfo
s {$sel:cWEMonitorEnabled:ApplicationInfo' :: Maybe Bool
cWEMonitorEnabled = Maybe Bool
a} :: ApplicationInfo)

-- | The SNS topic provided to Application Insights that is associated to the
-- created opsItems to receive SNS notifications for opsItem updates.
applicationInfo_opsItemSNSTopicArn :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Text)
applicationInfo_opsItemSNSTopicArn :: (Maybe Text -> f (Maybe Text))
-> ApplicationInfo -> f ApplicationInfo
applicationInfo_opsItemSNSTopicArn = (ApplicationInfo -> Maybe Text)
-> (ApplicationInfo -> Maybe Text -> ApplicationInfo)
-> Lens ApplicationInfo ApplicationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Text
opsItemSNSTopicArn :: Maybe Text
$sel:opsItemSNSTopicArn:ApplicationInfo' :: ApplicationInfo -> Maybe Text
opsItemSNSTopicArn} -> Maybe Text
opsItemSNSTopicArn) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Text
a -> ApplicationInfo
s {$sel:opsItemSNSTopicArn:ApplicationInfo' :: Maybe Text
opsItemSNSTopicArn = Maybe Text
a} :: ApplicationInfo)

-- | The lifecycle of the application.
applicationInfo_lifeCycle :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Text)
applicationInfo_lifeCycle :: (Maybe Text -> f (Maybe Text))
-> ApplicationInfo -> f ApplicationInfo
applicationInfo_lifeCycle = (ApplicationInfo -> Maybe Text)
-> (ApplicationInfo -> Maybe Text -> ApplicationInfo)
-> Lens ApplicationInfo ApplicationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Text
lifeCycle :: Maybe Text
$sel:lifeCycle:ApplicationInfo' :: ApplicationInfo -> Maybe Text
lifeCycle} -> Maybe Text
lifeCycle) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Text
a -> ApplicationInfo
s {$sel:lifeCycle:ApplicationInfo' :: Maybe Text
lifeCycle = Maybe Text
a} :: ApplicationInfo)

-- | Indicates whether Application Insights will create opsItems for any
-- problem detected by Application Insights for an application.
applicationInfo_opsCenterEnabled :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Bool)
applicationInfo_opsCenterEnabled :: (Maybe Bool -> f (Maybe Bool))
-> ApplicationInfo -> f ApplicationInfo
applicationInfo_opsCenterEnabled = (ApplicationInfo -> Maybe Bool)
-> (ApplicationInfo -> Maybe Bool -> ApplicationInfo)
-> Lens ApplicationInfo ApplicationInfo (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Bool
opsCenterEnabled :: Maybe Bool
$sel:opsCenterEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
opsCenterEnabled} -> Maybe Bool
opsCenterEnabled) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Bool
a -> ApplicationInfo
s {$sel:opsCenterEnabled:ApplicationInfo' :: Maybe Bool
opsCenterEnabled = Maybe Bool
a} :: ApplicationInfo)

-- | The issues on the user side that block Application Insights from
-- successfully monitoring an application. Example remarks include:
--
-- -   “Configuring application, detected 1 Errors, 3 Warnings”
--
-- -   “Configuring application, detected 1 Unconfigured Components”
applicationInfo_remarks :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Text)
applicationInfo_remarks :: (Maybe Text -> f (Maybe Text))
-> ApplicationInfo -> f ApplicationInfo
applicationInfo_remarks = (ApplicationInfo -> Maybe Text)
-> (ApplicationInfo -> Maybe Text -> ApplicationInfo)
-> Lens ApplicationInfo ApplicationInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Text
remarks :: Maybe Text
$sel:remarks:ApplicationInfo' :: ApplicationInfo -> Maybe Text
remarks} -> Maybe Text
remarks) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Text
a -> ApplicationInfo
s {$sel:remarks:ApplicationInfo' :: Maybe Text
remarks = Maybe Text
a} :: ApplicationInfo)

instance Core.FromJSON ApplicationInfo where
  parseJSON :: Value -> Parser ApplicationInfo
parseJSON =
    String
-> (Object -> Parser ApplicationInfo)
-> Value
-> Parser ApplicationInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApplicationInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> ApplicationInfo
ApplicationInfo'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> ApplicationInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> ApplicationInfo)
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
"ResourceGroupName")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> ApplicationInfo)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Bool -> Maybe Text -> ApplicationInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CWEMonitorEnabled")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Bool -> Maybe Text -> ApplicationInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Bool -> Maybe Text -> ApplicationInfo)
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
"OpsItemSNSTopicArn")
            Parser (Maybe Text -> Maybe Bool -> Maybe Text -> ApplicationInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Text -> ApplicationInfo)
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
"LifeCycle")
            Parser (Maybe Bool -> Maybe Text -> ApplicationInfo)
-> Parser (Maybe Bool) -> Parser (Maybe Text -> ApplicationInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OpsCenterEnabled")
            Parser (Maybe Text -> ApplicationInfo)
-> Parser (Maybe Text) -> Parser ApplicationInfo
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
"Remarks")
      )

instance Prelude.Hashable ApplicationInfo

instance Prelude.NFData ApplicationInfo