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

-- | 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. Resource types take the same form that is used
    -- by Amazon Web Services CloudFormation resource type identifiers,
    -- @service-provider::service-name::data-type-name@. For example,
    -- @AWS::RDS::DBCluster@. For more information, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html Amazon Web Services resource and property types reference>
    -- in the /Amazon Web Services CloudFormation User Guide/.
    RecommendationRelatedAnomalyResource -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (RecommendationRelatedAnomalyResource
-> RecommendationRelatedAnomalyResource -> Bool
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]
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
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.
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. Resource types take the same form that is used
-- by Amazon Web Services CloudFormation resource type identifiers,
-- @service-provider::service-name::data-type-name@. For example,
-- @AWS::RDS::DBCluster@. For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html Amazon Web Services resource and property types reference>
-- in the /Amazon Web Services CloudFormation User Guide/.
newRecommendationRelatedAnomalyResource ::
  RecommendationRelatedAnomalyResource
newRecommendationRelatedAnomalyResource :: RecommendationRelatedAnomalyResource
newRecommendationRelatedAnomalyResource =
  RecommendationRelatedAnomalyResource'
    { $sel:name:RecommendationRelatedAnomalyResource' :: Maybe Text
name =
        forall a. Maybe a
Prelude.Nothing,
      $sel:type':RecommendationRelatedAnomalyResource' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the resource.
recommendationRelatedAnomalyResource_name :: Lens.Lens' RecommendationRelatedAnomalyResource (Prelude.Maybe Prelude.Text)
recommendationRelatedAnomalyResource_name :: Lens' RecommendationRelatedAnomalyResource (Maybe Text)
recommendationRelatedAnomalyResource_name = 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. Resource types take the same form that is used
-- by Amazon Web Services CloudFormation resource type identifiers,
-- @service-provider::service-name::data-type-name@. For example,
-- @AWS::RDS::DBCluster@. For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html Amazon Web Services resource and property types reference>
-- in the /Amazon Web Services CloudFormation User Guide/.
recommendationRelatedAnomalyResource_type :: Lens.Lens' RecommendationRelatedAnomalyResource (Prelude.Maybe Prelude.Text)
recommendationRelatedAnomalyResource_type :: Lens' RecommendationRelatedAnomalyResource (Maybe Text)
recommendationRelatedAnomalyResource_type = 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
  Data.FromJSON
    RecommendationRelatedAnomalyResource
  where
  parseJSON :: Value -> Parser RecommendationRelatedAnomalyResource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecommendationRelatedAnomalyResource"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> RecommendationRelatedAnomalyResource
RecommendationRelatedAnomalyResource'
            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
"Name")
            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
"Type")
      )

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

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