{-# 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.Support.Types.TrustedAdvisorCheckDescription
-- 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.Support.Types.TrustedAdvisorCheckDescription where

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

-- | The description and metadata for a Trusted Advisor check.
--
-- /See:/ 'newTrustedAdvisorCheckDescription' smart constructor.
data TrustedAdvisorCheckDescription = TrustedAdvisorCheckDescription'
  { -- | The unique identifier for the Trusted Advisor check.
    TrustedAdvisorCheckDescription -> Text
id :: Prelude.Text,
    -- | The display name for the Trusted Advisor check.
    TrustedAdvisorCheckDescription -> Text
name :: Prelude.Text,
    -- | The description of the Trusted Advisor check, which includes the alert
    -- criteria and recommended operations (contains HTML markup).
    TrustedAdvisorCheckDescription -> Text
description :: Prelude.Text,
    -- | The category of the Trusted Advisor check.
    TrustedAdvisorCheckDescription -> Text
category :: Prelude.Text,
    -- | The column headings for the data returned by the Trusted Advisor check.
    -- The order of the headings corresponds to the order of the data in the
    -- __Metadata__ element of the TrustedAdvisorResourceDetail for the check.
    -- __Metadata__ contains all the data that is shown in the Excel download,
    -- even in those cases where the UI shows just summary data.
    TrustedAdvisorCheckDescription -> [Text]
metadata :: [Prelude.Text]
  }
  deriving (TrustedAdvisorCheckDescription
-> TrustedAdvisorCheckDescription -> Bool
(TrustedAdvisorCheckDescription
 -> TrustedAdvisorCheckDescription -> Bool)
-> (TrustedAdvisorCheckDescription
    -> TrustedAdvisorCheckDescription -> Bool)
-> Eq TrustedAdvisorCheckDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrustedAdvisorCheckDescription
-> TrustedAdvisorCheckDescription -> Bool
$c/= :: TrustedAdvisorCheckDescription
-> TrustedAdvisorCheckDescription -> Bool
== :: TrustedAdvisorCheckDescription
-> TrustedAdvisorCheckDescription -> Bool
$c== :: TrustedAdvisorCheckDescription
-> TrustedAdvisorCheckDescription -> Bool
Prelude.Eq, ReadPrec [TrustedAdvisorCheckDescription]
ReadPrec TrustedAdvisorCheckDescription
Int -> ReadS TrustedAdvisorCheckDescription
ReadS [TrustedAdvisorCheckDescription]
(Int -> ReadS TrustedAdvisorCheckDescription)
-> ReadS [TrustedAdvisorCheckDescription]
-> ReadPrec TrustedAdvisorCheckDescription
-> ReadPrec [TrustedAdvisorCheckDescription]
-> Read TrustedAdvisorCheckDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrustedAdvisorCheckDescription]
$creadListPrec :: ReadPrec [TrustedAdvisorCheckDescription]
readPrec :: ReadPrec TrustedAdvisorCheckDescription
$creadPrec :: ReadPrec TrustedAdvisorCheckDescription
readList :: ReadS [TrustedAdvisorCheckDescription]
$creadList :: ReadS [TrustedAdvisorCheckDescription]
readsPrec :: Int -> ReadS TrustedAdvisorCheckDescription
$creadsPrec :: Int -> ReadS TrustedAdvisorCheckDescription
Prelude.Read, Int -> TrustedAdvisorCheckDescription -> ShowS
[TrustedAdvisorCheckDescription] -> ShowS
TrustedAdvisorCheckDescription -> String
(Int -> TrustedAdvisorCheckDescription -> ShowS)
-> (TrustedAdvisorCheckDescription -> String)
-> ([TrustedAdvisorCheckDescription] -> ShowS)
-> Show TrustedAdvisorCheckDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrustedAdvisorCheckDescription] -> ShowS
$cshowList :: [TrustedAdvisorCheckDescription] -> ShowS
show :: TrustedAdvisorCheckDescription -> String
$cshow :: TrustedAdvisorCheckDescription -> String
showsPrec :: Int -> TrustedAdvisorCheckDescription -> ShowS
$cshowsPrec :: Int -> TrustedAdvisorCheckDescription -> ShowS
Prelude.Show, (forall x.
 TrustedAdvisorCheckDescription
 -> Rep TrustedAdvisorCheckDescription x)
-> (forall x.
    Rep TrustedAdvisorCheckDescription x
    -> TrustedAdvisorCheckDescription)
-> Generic TrustedAdvisorCheckDescription
forall x.
Rep TrustedAdvisorCheckDescription x
-> TrustedAdvisorCheckDescription
forall x.
TrustedAdvisorCheckDescription
-> Rep TrustedAdvisorCheckDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TrustedAdvisorCheckDescription x
-> TrustedAdvisorCheckDescription
$cfrom :: forall x.
TrustedAdvisorCheckDescription
-> Rep TrustedAdvisorCheckDescription x
Prelude.Generic)

-- |
-- Create a value of 'TrustedAdvisorCheckDescription' 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:
--
-- 'id', 'trustedAdvisorCheckDescription_id' - The unique identifier for the Trusted Advisor check.
--
-- 'name', 'trustedAdvisorCheckDescription_name' - The display name for the Trusted Advisor check.
--
-- 'description', 'trustedAdvisorCheckDescription_description' - The description of the Trusted Advisor check, which includes the alert
-- criteria and recommended operations (contains HTML markup).
--
-- 'category', 'trustedAdvisorCheckDescription_category' - The category of the Trusted Advisor check.
--
-- 'metadata', 'trustedAdvisorCheckDescription_metadata' - The column headings for the data returned by the Trusted Advisor check.
-- The order of the headings corresponds to the order of the data in the
-- __Metadata__ element of the TrustedAdvisorResourceDetail for the check.
-- __Metadata__ contains all the data that is shown in the Excel download,
-- even in those cases where the UI shows just summary data.
newTrustedAdvisorCheckDescription ::
  -- | 'id'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'description'
  Prelude.Text ->
  -- | 'category'
  Prelude.Text ->
  TrustedAdvisorCheckDescription
newTrustedAdvisorCheckDescription :: Text -> Text -> Text -> Text -> TrustedAdvisorCheckDescription
newTrustedAdvisorCheckDescription
  Text
pId_
  Text
pName_
  Text
pDescription_
  Text
pCategory_ =
    TrustedAdvisorCheckDescription' :: Text
-> Text -> Text -> Text -> [Text] -> TrustedAdvisorCheckDescription
TrustedAdvisorCheckDescription'
      { $sel:id:TrustedAdvisorCheckDescription' :: Text
id = Text
pId_,
        $sel:name:TrustedAdvisorCheckDescription' :: Text
name = Text
pName_,
        $sel:description:TrustedAdvisorCheckDescription' :: Text
description = Text
pDescription_,
        $sel:category:TrustedAdvisorCheckDescription' :: Text
category = Text
pCategory_,
        $sel:metadata:TrustedAdvisorCheckDescription' :: [Text]
metadata = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The unique identifier for the Trusted Advisor check.
trustedAdvisorCheckDescription_id :: Lens.Lens' TrustedAdvisorCheckDescription Prelude.Text
trustedAdvisorCheckDescription_id :: (Text -> f Text)
-> TrustedAdvisorCheckDescription
-> f TrustedAdvisorCheckDescription
trustedAdvisorCheckDescription_id = (TrustedAdvisorCheckDescription -> Text)
-> (TrustedAdvisorCheckDescription
    -> Text -> TrustedAdvisorCheckDescription)
-> Lens
     TrustedAdvisorCheckDescription
     TrustedAdvisorCheckDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckDescription' {Text
id :: Text
$sel:id:TrustedAdvisorCheckDescription' :: TrustedAdvisorCheckDescription -> Text
id} -> Text
id) (\s :: TrustedAdvisorCheckDescription
s@TrustedAdvisorCheckDescription' {} Text
a -> TrustedAdvisorCheckDescription
s {$sel:id:TrustedAdvisorCheckDescription' :: Text
id = Text
a} :: TrustedAdvisorCheckDescription)

-- | The display name for the Trusted Advisor check.
trustedAdvisorCheckDescription_name :: Lens.Lens' TrustedAdvisorCheckDescription Prelude.Text
trustedAdvisorCheckDescription_name :: (Text -> f Text)
-> TrustedAdvisorCheckDescription
-> f TrustedAdvisorCheckDescription
trustedAdvisorCheckDescription_name = (TrustedAdvisorCheckDescription -> Text)
-> (TrustedAdvisorCheckDescription
    -> Text -> TrustedAdvisorCheckDescription)
-> Lens
     TrustedAdvisorCheckDescription
     TrustedAdvisorCheckDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckDescription' {Text
name :: Text
$sel:name:TrustedAdvisorCheckDescription' :: TrustedAdvisorCheckDescription -> Text
name} -> Text
name) (\s :: TrustedAdvisorCheckDescription
s@TrustedAdvisorCheckDescription' {} Text
a -> TrustedAdvisorCheckDescription
s {$sel:name:TrustedAdvisorCheckDescription' :: Text
name = Text
a} :: TrustedAdvisorCheckDescription)

-- | The description of the Trusted Advisor check, which includes the alert
-- criteria and recommended operations (contains HTML markup).
trustedAdvisorCheckDescription_description :: Lens.Lens' TrustedAdvisorCheckDescription Prelude.Text
trustedAdvisorCheckDescription_description :: (Text -> f Text)
-> TrustedAdvisorCheckDescription
-> f TrustedAdvisorCheckDescription
trustedAdvisorCheckDescription_description = (TrustedAdvisorCheckDescription -> Text)
-> (TrustedAdvisorCheckDescription
    -> Text -> TrustedAdvisorCheckDescription)
-> Lens
     TrustedAdvisorCheckDescription
     TrustedAdvisorCheckDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckDescription' {Text
description :: Text
$sel:description:TrustedAdvisorCheckDescription' :: TrustedAdvisorCheckDescription -> Text
description} -> Text
description) (\s :: TrustedAdvisorCheckDescription
s@TrustedAdvisorCheckDescription' {} Text
a -> TrustedAdvisorCheckDescription
s {$sel:description:TrustedAdvisorCheckDescription' :: Text
description = Text
a} :: TrustedAdvisorCheckDescription)

-- | The category of the Trusted Advisor check.
trustedAdvisorCheckDescription_category :: Lens.Lens' TrustedAdvisorCheckDescription Prelude.Text
trustedAdvisorCheckDescription_category :: (Text -> f Text)
-> TrustedAdvisorCheckDescription
-> f TrustedAdvisorCheckDescription
trustedAdvisorCheckDescription_category = (TrustedAdvisorCheckDescription -> Text)
-> (TrustedAdvisorCheckDescription
    -> Text -> TrustedAdvisorCheckDescription)
-> Lens
     TrustedAdvisorCheckDescription
     TrustedAdvisorCheckDescription
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckDescription' {Text
category :: Text
$sel:category:TrustedAdvisorCheckDescription' :: TrustedAdvisorCheckDescription -> Text
category} -> Text
category) (\s :: TrustedAdvisorCheckDescription
s@TrustedAdvisorCheckDescription' {} Text
a -> TrustedAdvisorCheckDescription
s {$sel:category:TrustedAdvisorCheckDescription' :: Text
category = Text
a} :: TrustedAdvisorCheckDescription)

-- | The column headings for the data returned by the Trusted Advisor check.
-- The order of the headings corresponds to the order of the data in the
-- __Metadata__ element of the TrustedAdvisorResourceDetail for the check.
-- __Metadata__ contains all the data that is shown in the Excel download,
-- even in those cases where the UI shows just summary data.
trustedAdvisorCheckDescription_metadata :: Lens.Lens' TrustedAdvisorCheckDescription [Prelude.Text]
trustedAdvisorCheckDescription_metadata :: ([Text] -> f [Text])
-> TrustedAdvisorCheckDescription
-> f TrustedAdvisorCheckDescription
trustedAdvisorCheckDescription_metadata = (TrustedAdvisorCheckDescription -> [Text])
-> (TrustedAdvisorCheckDescription
    -> [Text] -> TrustedAdvisorCheckDescription)
-> Lens
     TrustedAdvisorCheckDescription
     TrustedAdvisorCheckDescription
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckDescription' {[Text]
metadata :: [Text]
$sel:metadata:TrustedAdvisorCheckDescription' :: TrustedAdvisorCheckDescription -> [Text]
metadata} -> [Text]
metadata) (\s :: TrustedAdvisorCheckDescription
s@TrustedAdvisorCheckDescription' {} [Text]
a -> TrustedAdvisorCheckDescription
s {$sel:metadata:TrustedAdvisorCheckDescription' :: [Text]
metadata = [Text]
a} :: TrustedAdvisorCheckDescription) (([Text] -> f [Text])
 -> TrustedAdvisorCheckDescription
 -> f TrustedAdvisorCheckDescription)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> TrustedAdvisorCheckDescription
-> f TrustedAdvisorCheckDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON TrustedAdvisorCheckDescription where
  parseJSON :: Value -> Parser TrustedAdvisorCheckDescription
parseJSON =
    String
-> (Object -> Parser TrustedAdvisorCheckDescription)
-> Value
-> Parser TrustedAdvisorCheckDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TrustedAdvisorCheckDescription"
      ( \Object
x ->
          Text
-> Text -> Text -> Text -> [Text] -> TrustedAdvisorCheckDescription
TrustedAdvisorCheckDescription'
            (Text
 -> Text
 -> Text
 -> Text
 -> [Text]
 -> TrustedAdvisorCheckDescription)
-> Parser Text
-> Parser
     (Text -> Text -> Text -> [Text] -> TrustedAdvisorCheckDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"id")
            Parser
  (Text -> Text -> Text -> [Text] -> TrustedAdvisorCheckDescription)
-> Parser Text
-> Parser
     (Text -> Text -> [Text] -> TrustedAdvisorCheckDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
            Parser (Text -> Text -> [Text] -> TrustedAdvisorCheckDescription)
-> Parser Text
-> Parser (Text -> [Text] -> TrustedAdvisorCheckDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"description")
            Parser (Text -> [Text] -> TrustedAdvisorCheckDescription)
-> Parser Text -> Parser ([Text] -> TrustedAdvisorCheckDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"category")
            Parser ([Text] -> TrustedAdvisorCheckDescription)
-> Parser [Text] -> Parser TrustedAdvisorCheckDescription
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
"metadata" Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    TrustedAdvisorCheckDescription

instance
  Prelude.NFData
    TrustedAdvisorCheckDescription