{-# 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.DevOpsGuru.Types.RecommendationRelatedAnomalyResource
-- 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.DevOpsGuru.Types.RecommendationRelatedAnomalyResource where

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

-- | Information about a resource in which DevOps Guru detected anomalous
-- behavior.
--
-- /See:/ 'newRecommendationRelatedAnomalyResource' smart constructor.
data RecommendationRelatedAnomalyResource = RecommendationRelatedAnomalyResource'
  { -- | The name of the resource.
    RecommendationRelatedAnomalyResource -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of the resource.
    RecommendationRelatedAnomalyResource -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (RecommendationRelatedAnomalyResource
-> RecommendationRelatedAnomalyResource -> Bool
(RecommendationRelatedAnomalyResource
 -> RecommendationRelatedAnomalyResource -> Bool)
-> (RecommendationRelatedAnomalyResource
    -> RecommendationRelatedAnomalyResource -> Bool)
-> Eq RecommendationRelatedAnomalyResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationRelatedAnomalyResource
-> RecommendationRelatedAnomalyResource -> Bool
$c/= :: RecommendationRelatedAnomalyResource
-> RecommendationRelatedAnomalyResource -> Bool
== :: RecommendationRelatedAnomalyResource
-> RecommendationRelatedAnomalyResource -> Bool
$c== :: RecommendationRelatedAnomalyResource
-> RecommendationRelatedAnomalyResource -> Bool
Prelude.Eq, ReadPrec [RecommendationRelatedAnomalyResource]
ReadPrec RecommendationRelatedAnomalyResource
Int -> ReadS RecommendationRelatedAnomalyResource
ReadS [RecommendationRelatedAnomalyResource]
(Int -> ReadS RecommendationRelatedAnomalyResource)
-> ReadS [RecommendationRelatedAnomalyResource]
-> ReadPrec RecommendationRelatedAnomalyResource
-> ReadPrec [RecommendationRelatedAnomalyResource]
-> Read RecommendationRelatedAnomalyResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationRelatedAnomalyResource]
$creadListPrec :: ReadPrec [RecommendationRelatedAnomalyResource]
readPrec :: ReadPrec RecommendationRelatedAnomalyResource
$creadPrec :: ReadPrec RecommendationRelatedAnomalyResource
readList :: ReadS [RecommendationRelatedAnomalyResource]
$creadList :: ReadS [RecommendationRelatedAnomalyResource]
readsPrec :: Int -> ReadS RecommendationRelatedAnomalyResource
$creadsPrec :: Int -> ReadS RecommendationRelatedAnomalyResource
Prelude.Read, Int -> RecommendationRelatedAnomalyResource -> ShowS
[RecommendationRelatedAnomalyResource] -> ShowS
RecommendationRelatedAnomalyResource -> String
(Int -> RecommendationRelatedAnomalyResource -> ShowS)
-> (RecommendationRelatedAnomalyResource -> String)
-> ([RecommendationRelatedAnomalyResource] -> ShowS)
-> Show RecommendationRelatedAnomalyResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationRelatedAnomalyResource] -> ShowS
$cshowList :: [RecommendationRelatedAnomalyResource] -> ShowS
show :: RecommendationRelatedAnomalyResource -> String
$cshow :: RecommendationRelatedAnomalyResource -> String
showsPrec :: Int -> RecommendationRelatedAnomalyResource -> ShowS
$cshowsPrec :: Int -> RecommendationRelatedAnomalyResource -> ShowS
Prelude.Show, (forall x.
 RecommendationRelatedAnomalyResource
 -> Rep RecommendationRelatedAnomalyResource x)
-> (forall x.
    Rep RecommendationRelatedAnomalyResource x
    -> RecommendationRelatedAnomalyResource)
-> Generic RecommendationRelatedAnomalyResource
forall x.
Rep RecommendationRelatedAnomalyResource x
-> RecommendationRelatedAnomalyResource
forall x.
RecommendationRelatedAnomalyResource
-> Rep RecommendationRelatedAnomalyResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecommendationRelatedAnomalyResource x
-> RecommendationRelatedAnomalyResource
$cfrom :: forall x.
RecommendationRelatedAnomalyResource
-> Rep RecommendationRelatedAnomalyResource x
Prelude.Generic)

-- |
-- Create a value of 'RecommendationRelatedAnomalyResource' 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:
--
-- 'name', 'recommendationRelatedAnomalyResource_name' - The name of the resource.
--
-- 'type'', 'recommendationRelatedAnomalyResource_type' - The type of the resource.
newRecommendationRelatedAnomalyResource ::
  RecommendationRelatedAnomalyResource
newRecommendationRelatedAnomalyResource :: RecommendationRelatedAnomalyResource
newRecommendationRelatedAnomalyResource =
  RecommendationRelatedAnomalyResource' :: Maybe Text -> Maybe Text -> RecommendationRelatedAnomalyResource
RecommendationRelatedAnomalyResource'
    { $sel:name:RecommendationRelatedAnomalyResource' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':RecommendationRelatedAnomalyResource' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the resource.
recommendationRelatedAnomalyResource_name :: Lens.Lens' RecommendationRelatedAnomalyResource (Prelude.Maybe Prelude.Text)
recommendationRelatedAnomalyResource_name :: (Maybe Text -> f (Maybe Text))
-> RecommendationRelatedAnomalyResource
-> f RecommendationRelatedAnomalyResource
recommendationRelatedAnomalyResource_name = (RecommendationRelatedAnomalyResource -> Maybe Text)
-> (RecommendationRelatedAnomalyResource
    -> Maybe Text -> RecommendationRelatedAnomalyResource)
-> Lens
     RecommendationRelatedAnomalyResource
     RecommendationRelatedAnomalyResource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationRelatedAnomalyResource' {Maybe Text
name :: Maybe Text
$sel:name:RecommendationRelatedAnomalyResource' :: RecommendationRelatedAnomalyResource -> Maybe Text
name} -> Maybe Text
name) (\s :: RecommendationRelatedAnomalyResource
s@RecommendationRelatedAnomalyResource' {} Maybe Text
a -> RecommendationRelatedAnomalyResource
s {$sel:name:RecommendationRelatedAnomalyResource' :: Maybe Text
name = Maybe Text
a} :: RecommendationRelatedAnomalyResource)

-- | The type of the resource.
recommendationRelatedAnomalyResource_type :: Lens.Lens' RecommendationRelatedAnomalyResource (Prelude.Maybe Prelude.Text)
recommendationRelatedAnomalyResource_type :: (Maybe Text -> f (Maybe Text))
-> RecommendationRelatedAnomalyResource
-> f RecommendationRelatedAnomalyResource
recommendationRelatedAnomalyResource_type = (RecommendationRelatedAnomalyResource -> Maybe Text)
-> (RecommendationRelatedAnomalyResource
    -> Maybe Text -> RecommendationRelatedAnomalyResource)
-> Lens
     RecommendationRelatedAnomalyResource
     RecommendationRelatedAnomalyResource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationRelatedAnomalyResource' {Maybe Text
type' :: Maybe Text
$sel:type':RecommendationRelatedAnomalyResource' :: RecommendationRelatedAnomalyResource -> Maybe Text
type'} -> Maybe Text
type') (\s :: RecommendationRelatedAnomalyResource
s@RecommendationRelatedAnomalyResource' {} Maybe Text
a -> RecommendationRelatedAnomalyResource
s {$sel:type':RecommendationRelatedAnomalyResource' :: Maybe Text
type' = Maybe Text
a} :: RecommendationRelatedAnomalyResource)

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

instance
  Prelude.Hashable
    RecommendationRelatedAnomalyResource

instance
  Prelude.NFData
    RecommendationRelatedAnomalyResource