{-# 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.CodeGuruProfiler.Types.FindingsReportSummary
-- 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.CodeGuruProfiler.Types.FindingsReportSummary 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 potential recommendations that might be created from
-- the analysis of profiling data.
--
-- /See:/ 'newFindingsReportSummary' smart constructor.
data FindingsReportSummary = FindingsReportSummary'
  { -- | The universally unique identifier (UUID) of the recommendation report.
    FindingsReportSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The end time of the period during which the metric is flagged as
    -- anomalous. This is specified using the ISO 8601 format. For example,
    -- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
    -- 1:15:02 PM UTC.
    FindingsReportSummary -> Maybe ISO8601
profileEndTime :: Prelude.Maybe Data.ISO8601,
    -- | The start time of the profile the analysis data is about. This is
    -- specified using the ISO 8601 format. For example,
    -- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
    -- 1:15:02 PM UTC.
    FindingsReportSummary -> Maybe ISO8601
profileStartTime :: Prelude.Maybe Data.ISO8601,
    -- | The name of the profiling group that is associated with the analysis
    -- data.
    FindingsReportSummary -> Maybe Text
profilingGroupName :: Prelude.Maybe Prelude.Text,
    -- | The total number of different recommendations that were found by the
    -- analysis.
    FindingsReportSummary -> Maybe Int
totalNumberOfFindings :: Prelude.Maybe Prelude.Int
  }
  deriving (FindingsReportSummary -> FindingsReportSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FindingsReportSummary -> FindingsReportSummary -> Bool
$c/= :: FindingsReportSummary -> FindingsReportSummary -> Bool
== :: FindingsReportSummary -> FindingsReportSummary -> Bool
$c== :: FindingsReportSummary -> FindingsReportSummary -> Bool
Prelude.Eq, ReadPrec [FindingsReportSummary]
ReadPrec FindingsReportSummary
Int -> ReadS FindingsReportSummary
ReadS [FindingsReportSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FindingsReportSummary]
$creadListPrec :: ReadPrec [FindingsReportSummary]
readPrec :: ReadPrec FindingsReportSummary
$creadPrec :: ReadPrec FindingsReportSummary
readList :: ReadS [FindingsReportSummary]
$creadList :: ReadS [FindingsReportSummary]
readsPrec :: Int -> ReadS FindingsReportSummary
$creadsPrec :: Int -> ReadS FindingsReportSummary
Prelude.Read, Int -> FindingsReportSummary -> ShowS
[FindingsReportSummary] -> ShowS
FindingsReportSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FindingsReportSummary] -> ShowS
$cshowList :: [FindingsReportSummary] -> ShowS
show :: FindingsReportSummary -> String
$cshow :: FindingsReportSummary -> String
showsPrec :: Int -> FindingsReportSummary -> ShowS
$cshowsPrec :: Int -> FindingsReportSummary -> ShowS
Prelude.Show, forall x. Rep FindingsReportSummary x -> FindingsReportSummary
forall x. FindingsReportSummary -> Rep FindingsReportSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FindingsReportSummary x -> FindingsReportSummary
$cfrom :: forall x. FindingsReportSummary -> Rep FindingsReportSummary x
Prelude.Generic)

-- |
-- Create a value of 'FindingsReportSummary' 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', 'findingsReportSummary_id' - The universally unique identifier (UUID) of the recommendation report.
--
-- 'profileEndTime', 'findingsReportSummary_profileEndTime' - The end time of the period during which the metric is flagged as
-- anomalous. This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
--
-- 'profileStartTime', 'findingsReportSummary_profileStartTime' - The start time of the profile the analysis data is about. This is
-- specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
--
-- 'profilingGroupName', 'findingsReportSummary_profilingGroupName' - The name of the profiling group that is associated with the analysis
-- data.
--
-- 'totalNumberOfFindings', 'findingsReportSummary_totalNumberOfFindings' - The total number of different recommendations that were found by the
-- analysis.
newFindingsReportSummary ::
  FindingsReportSummary
newFindingsReportSummary :: FindingsReportSummary
newFindingsReportSummary =
  FindingsReportSummary'
    { $sel:id:FindingsReportSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:profileEndTime:FindingsReportSummary' :: Maybe ISO8601
profileEndTime = forall a. Maybe a
Prelude.Nothing,
      $sel:profileStartTime:FindingsReportSummary' :: Maybe ISO8601
profileStartTime = forall a. Maybe a
Prelude.Nothing,
      $sel:profilingGroupName:FindingsReportSummary' :: Maybe Text
profilingGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:totalNumberOfFindings:FindingsReportSummary' :: Maybe Int
totalNumberOfFindings = forall a. Maybe a
Prelude.Nothing
    }

-- | The universally unique identifier (UUID) of the recommendation report.
findingsReportSummary_id :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.Text)
findingsReportSummary_id :: Lens' FindingsReportSummary (Maybe Text)
findingsReportSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe Text
id :: Maybe Text
$sel:id:FindingsReportSummary' :: FindingsReportSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe Text
a -> FindingsReportSummary
s {$sel:id:FindingsReportSummary' :: Maybe Text
id = Maybe Text
a} :: FindingsReportSummary)

-- | The end time of the period during which the metric is flagged as
-- anomalous. This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
findingsReportSummary_profileEndTime :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.UTCTime)
findingsReportSummary_profileEndTime :: Lens' FindingsReportSummary (Maybe UTCTime)
findingsReportSummary_profileEndTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe ISO8601
profileEndTime :: Maybe ISO8601
$sel:profileEndTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe ISO8601
profileEndTime} -> Maybe ISO8601
profileEndTime) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe ISO8601
a -> FindingsReportSummary
s {$sel:profileEndTime:FindingsReportSummary' :: Maybe ISO8601
profileEndTime = Maybe ISO8601
a} :: FindingsReportSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The start time of the profile the analysis data is about. This is
-- specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
findingsReportSummary_profileStartTime :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.UTCTime)
findingsReportSummary_profileStartTime :: Lens' FindingsReportSummary (Maybe UTCTime)
findingsReportSummary_profileStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe ISO8601
profileStartTime :: Maybe ISO8601
$sel:profileStartTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe ISO8601
profileStartTime} -> Maybe ISO8601
profileStartTime) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe ISO8601
a -> FindingsReportSummary
s {$sel:profileStartTime:FindingsReportSummary' :: Maybe ISO8601
profileStartTime = Maybe ISO8601
a} :: FindingsReportSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the profiling group that is associated with the analysis
-- data.
findingsReportSummary_profilingGroupName :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.Text)
findingsReportSummary_profilingGroupName :: Lens' FindingsReportSummary (Maybe Text)
findingsReportSummary_profilingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe Text
profilingGroupName :: Maybe Text
$sel:profilingGroupName:FindingsReportSummary' :: FindingsReportSummary -> Maybe Text
profilingGroupName} -> Maybe Text
profilingGroupName) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe Text
a -> FindingsReportSummary
s {$sel:profilingGroupName:FindingsReportSummary' :: Maybe Text
profilingGroupName = Maybe Text
a} :: FindingsReportSummary)

-- | The total number of different recommendations that were found by the
-- analysis.
findingsReportSummary_totalNumberOfFindings :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.Int)
findingsReportSummary_totalNumberOfFindings :: Lens' FindingsReportSummary (Maybe Int)
findingsReportSummary_totalNumberOfFindings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe Int
totalNumberOfFindings :: Maybe Int
$sel:totalNumberOfFindings:FindingsReportSummary' :: FindingsReportSummary -> Maybe Int
totalNumberOfFindings} -> Maybe Int
totalNumberOfFindings) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe Int
a -> FindingsReportSummary
s {$sel:totalNumberOfFindings:FindingsReportSummary' :: Maybe Int
totalNumberOfFindings = Maybe Int
a} :: FindingsReportSummary)

instance Data.FromJSON FindingsReportSummary where
  parseJSON :: Value -> Parser FindingsReportSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FindingsReportSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ISO8601
-> Maybe ISO8601
-> Maybe Text
-> Maybe Int
-> FindingsReportSummary
FindingsReportSummary'
            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
"id")
            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
"profileEndTime")
            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
"profileStartTime")
            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
"profilingGroupName")
            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
"totalNumberOfFindings")
      )

instance Prelude.Hashable FindingsReportSummary where
  hashWithSalt :: Int -> FindingsReportSummary -> Int
hashWithSalt Int
_salt FindingsReportSummary' {Maybe Int
Maybe Text
Maybe ISO8601
totalNumberOfFindings :: Maybe Int
profilingGroupName :: Maybe Text
profileStartTime :: Maybe ISO8601
profileEndTime :: Maybe ISO8601
id :: Maybe Text
$sel:totalNumberOfFindings:FindingsReportSummary' :: FindingsReportSummary -> Maybe Int
$sel:profilingGroupName:FindingsReportSummary' :: FindingsReportSummary -> Maybe Text
$sel:profileStartTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe ISO8601
$sel:profileEndTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe ISO8601
$sel:id:FindingsReportSummary' :: FindingsReportSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
profileEndTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
profileStartTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
profilingGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalNumberOfFindings

instance Prelude.NFData FindingsReportSummary where
  rnf :: FindingsReportSummary -> ()
rnf FindingsReportSummary' {Maybe Int
Maybe Text
Maybe ISO8601
totalNumberOfFindings :: Maybe Int
profilingGroupName :: Maybe Text
profileStartTime :: Maybe ISO8601
profileEndTime :: Maybe ISO8601
id :: Maybe Text
$sel:totalNumberOfFindings:FindingsReportSummary' :: FindingsReportSummary -> Maybe Int
$sel:profilingGroupName:FindingsReportSummary' :: FindingsReportSummary -> Maybe Text
$sel:profileStartTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe ISO8601
$sel:profileEndTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe ISO8601
$sel:id:FindingsReportSummary' :: FindingsReportSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
profileEndTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
profileStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
profilingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalNumberOfFindings