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

import Amazonka.ApplicationInsights.Types.DiscoveryType
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

-- | Describes the status of the application.
--
-- /See:/ 'newApplicationInfo' smart constructor.
data ApplicationInfo = ApplicationInfo'
  { -- | Indicates whether auto-configuration is turned on for this application.
    ApplicationInfo -> Maybe Bool
autoConfigEnabled :: Prelude.Maybe Prelude.Bool,
    -- | 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 method used by Application Insights to onboard your resources.
    ApplicationInfo -> Maybe DiscoveryType
discoveryType :: Prelude.Maybe DiscoveryType,
    -- | 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 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 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,
    -- | The name of the resource group used for the application.
    ApplicationInfo -> Maybe Text
resourceGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (ApplicationInfo -> ApplicationInfo -> Bool
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]
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
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. 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:
--
-- 'autoConfigEnabled', 'applicationInfo_autoConfigEnabled' - Indicates whether auto-configuration is turned on for this 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.
--
-- 'discoveryType', 'applicationInfo_discoveryType' - The method used by Application Insights to onboard your resources.
--
-- '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.
--
-- 'opsItemSNSTopicArn', 'applicationInfo_opsItemSNSTopicArn' - The SNS topic provided to Application Insights that is associated to the
-- created opsItems to receive SNS notifications for opsItem updates.
--
-- '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”
--
-- 'resourceGroupName', 'applicationInfo_resourceGroupName' - The name of the resource group used for the application.
newApplicationInfo ::
  ApplicationInfo
newApplicationInfo :: ApplicationInfo
newApplicationInfo =
  ApplicationInfo'
    { $sel:autoConfigEnabled:ApplicationInfo' :: Maybe Bool
autoConfigEnabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cWEMonitorEnabled:ApplicationInfo' :: Maybe Bool
cWEMonitorEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:discoveryType:ApplicationInfo' :: Maybe DiscoveryType
discoveryType = forall a. Maybe a
Prelude.Nothing,
      $sel:lifeCycle:ApplicationInfo' :: Maybe Text
lifeCycle = forall a. Maybe a
Prelude.Nothing,
      $sel:opsCenterEnabled:ApplicationInfo' :: Maybe Bool
opsCenterEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:opsItemSNSTopicArn:ApplicationInfo' :: Maybe Text
opsItemSNSTopicArn = forall a. Maybe a
Prelude.Nothing,
      $sel:remarks:ApplicationInfo' :: Maybe Text
remarks = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceGroupName:ApplicationInfo' :: Maybe Text
resourceGroupName = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether auto-configuration is turned on for this application.
applicationInfo_autoConfigEnabled :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Bool)
applicationInfo_autoConfigEnabled :: Lens' ApplicationInfo (Maybe Bool)
applicationInfo_autoConfigEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe Bool
autoConfigEnabled :: Maybe Bool
$sel:autoConfigEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
autoConfigEnabled} -> Maybe Bool
autoConfigEnabled) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe Bool
a -> ApplicationInfo
s {$sel:autoConfigEnabled:ApplicationInfo' :: Maybe Bool
autoConfigEnabled = Maybe Bool
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 :: Lens' ApplicationInfo (Maybe Bool)
applicationInfo_cWEMonitorEnabled = 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 method used by Application Insights to onboard your resources.
applicationInfo_discoveryType :: Lens.Lens' ApplicationInfo (Prelude.Maybe DiscoveryType)
applicationInfo_discoveryType :: Lens' ApplicationInfo (Maybe DiscoveryType)
applicationInfo_discoveryType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationInfo' {Maybe DiscoveryType
discoveryType :: Maybe DiscoveryType
$sel:discoveryType:ApplicationInfo' :: ApplicationInfo -> Maybe DiscoveryType
discoveryType} -> Maybe DiscoveryType
discoveryType) (\s :: ApplicationInfo
s@ApplicationInfo' {} Maybe DiscoveryType
a -> ApplicationInfo
s {$sel:discoveryType:ApplicationInfo' :: Maybe DiscoveryType
discoveryType = Maybe DiscoveryType
a} :: ApplicationInfo)

-- | The lifecycle of the application.
applicationInfo_lifeCycle :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Text)
applicationInfo_lifeCycle :: Lens' ApplicationInfo (Maybe Text)
applicationInfo_lifeCycle = 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 :: Lens' ApplicationInfo (Maybe Bool)
applicationInfo_opsCenterEnabled = 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 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 :: Lens' ApplicationInfo (Maybe Text)
applicationInfo_opsItemSNSTopicArn = 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 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 :: Lens' ApplicationInfo (Maybe Text)
applicationInfo_remarks = 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)

-- | The name of the resource group used for the application.
applicationInfo_resourceGroupName :: Lens.Lens' ApplicationInfo (Prelude.Maybe Prelude.Text)
applicationInfo_resourceGroupName :: Lens' ApplicationInfo (Maybe Text)
applicationInfo_resourceGroupName = 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)

instance Data.FromJSON ApplicationInfo where
  parseJSON :: Value -> Parser ApplicationInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ApplicationInfo"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe DiscoveryType
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ApplicationInfo
ApplicationInfo'
            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
"AutoConfigEnabled")
            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
"CWEMonitorEnabled")
            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
"DiscoveryType")
            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
"LifeCycle")
            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
"OpsCenterEnabled")
            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
"OpsItemSNSTopicArn")
            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
"Remarks")
            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
"ResourceGroupName")
      )

instance Prelude.Hashable ApplicationInfo where
  hashWithSalt :: Int -> ApplicationInfo -> Int
hashWithSalt Int
_salt ApplicationInfo' {Maybe Bool
Maybe Text
Maybe DiscoveryType
resourceGroupName :: Maybe Text
remarks :: Maybe Text
opsItemSNSTopicArn :: Maybe Text
opsCenterEnabled :: Maybe Bool
lifeCycle :: Maybe Text
discoveryType :: Maybe DiscoveryType
cWEMonitorEnabled :: Maybe Bool
autoConfigEnabled :: Maybe Bool
$sel:resourceGroupName:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:remarks:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:opsItemSNSTopicArn:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:opsCenterEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
$sel:lifeCycle:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:discoveryType:ApplicationInfo' :: ApplicationInfo -> Maybe DiscoveryType
$sel:cWEMonitorEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
$sel:autoConfigEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoConfigEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
cWEMonitorEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DiscoveryType
discoveryType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lifeCycle
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
opsCenterEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
opsItemSNSTopicArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
remarks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceGroupName

instance Prelude.NFData ApplicationInfo where
  rnf :: ApplicationInfo -> ()
rnf ApplicationInfo' {Maybe Bool
Maybe Text
Maybe DiscoveryType
resourceGroupName :: Maybe Text
remarks :: Maybe Text
opsItemSNSTopicArn :: Maybe Text
opsCenterEnabled :: Maybe Bool
lifeCycle :: Maybe Text
discoveryType :: Maybe DiscoveryType
cWEMonitorEnabled :: Maybe Bool
autoConfigEnabled :: Maybe Bool
$sel:resourceGroupName:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:remarks:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:opsItemSNSTopicArn:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:opsCenterEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
$sel:lifeCycle:ApplicationInfo' :: ApplicationInfo -> Maybe Text
$sel:discoveryType:ApplicationInfo' :: ApplicationInfo -> Maybe DiscoveryType
$sel:cWEMonitorEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
$sel:autoConfigEnabled:ApplicationInfo' :: ApplicationInfo -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoConfigEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
cWEMonitorEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DiscoveryType
discoveryType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lifeCycle
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
opsCenterEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
opsItemSNSTopicArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
remarks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceGroupName