{-# 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-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.CodeGuruProfiler.Types.FindingsReportSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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 POSIX
profileStartTime :: Prelude.Maybe Core.POSIX,
    -- | 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 POSIX
profileEndTime :: Prelude.Maybe Core.POSIX,
    -- | The universally unique identifier (UUID) of the recommendation report.
    FindingsReportSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | 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
(FindingsReportSummary -> FindingsReportSummary -> Bool)
-> (FindingsReportSummary -> FindingsReportSummary -> Bool)
-> Eq FindingsReportSummary
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]
(Int -> ReadS FindingsReportSummary)
-> ReadS [FindingsReportSummary]
-> ReadPrec FindingsReportSummary
-> ReadPrec [FindingsReportSummary]
-> Read 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
(Int -> FindingsReportSummary -> ShowS)
-> (FindingsReportSummary -> String)
-> ([FindingsReportSummary] -> ShowS)
-> Show FindingsReportSummary
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. FindingsReportSummary -> Rep FindingsReportSummary x)
-> (forall x. Rep FindingsReportSummary x -> FindingsReportSummary)
-> Generic FindingsReportSummary
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:
--
-- '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.
--
-- '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.
--
-- 'id', 'findingsReportSummary_id' - The universally unique identifier (UUID) of the recommendation report.
--
-- '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' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> FindingsReportSummary
FindingsReportSummary'
    { $sel:profileStartTime:FindingsReportSummary' :: Maybe POSIX
profileStartTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:profileEndTime:FindingsReportSummary' :: Maybe POSIX
profileEndTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:id:FindingsReportSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:profilingGroupName:FindingsReportSummary' :: Maybe Text
profilingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:totalNumberOfFindings:FindingsReportSummary' :: Maybe Int
totalNumberOfFindings = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FindingsReportSummary -> f FindingsReportSummary
findingsReportSummary_profileStartTime = (FindingsReportSummary -> Maybe POSIX)
-> (FindingsReportSummary -> Maybe POSIX -> FindingsReportSummary)
-> Lens
     FindingsReportSummary
     FindingsReportSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe POSIX
profileStartTime :: Maybe POSIX
$sel:profileStartTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe POSIX
profileStartTime} -> Maybe POSIX
profileStartTime) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe POSIX
a -> FindingsReportSummary
s {$sel:profileStartTime:FindingsReportSummary' :: Maybe POSIX
profileStartTime = Maybe POSIX
a} :: FindingsReportSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> FindingsReportSummary -> f FindingsReportSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FindingsReportSummary
-> f FindingsReportSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FindingsReportSummary -> f FindingsReportSummary
findingsReportSummary_profileEndTime = (FindingsReportSummary -> Maybe POSIX)
-> (FindingsReportSummary -> Maybe POSIX -> FindingsReportSummary)
-> Lens
     FindingsReportSummary
     FindingsReportSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingsReportSummary' {Maybe POSIX
profileEndTime :: Maybe POSIX
$sel:profileEndTime:FindingsReportSummary' :: FindingsReportSummary -> Maybe POSIX
profileEndTime} -> Maybe POSIX
profileEndTime) (\s :: FindingsReportSummary
s@FindingsReportSummary' {} Maybe POSIX
a -> FindingsReportSummary
s {$sel:profileEndTime:FindingsReportSummary' :: Maybe POSIX
profileEndTime = Maybe POSIX
a} :: FindingsReportSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> FindingsReportSummary -> f FindingsReportSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FindingsReportSummary
-> f FindingsReportSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The universally unique identifier (UUID) of the recommendation report.
findingsReportSummary_id :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.Text)
findingsReportSummary_id :: (Maybe Text -> f (Maybe Text))
-> FindingsReportSummary -> f FindingsReportSummary
findingsReportSummary_id = (FindingsReportSummary -> Maybe Text)
-> (FindingsReportSummary -> Maybe Text -> FindingsReportSummary)
-> Lens
     FindingsReportSummary
     FindingsReportSummary
     (Maybe Text)
     (Maybe Text)
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 name of the profiling group that is associated with the analysis
-- data.
findingsReportSummary_profilingGroupName :: Lens.Lens' FindingsReportSummary (Prelude.Maybe Prelude.Text)
findingsReportSummary_profilingGroupName :: (Maybe Text -> f (Maybe Text))
-> FindingsReportSummary -> f FindingsReportSummary
findingsReportSummary_profilingGroupName = (FindingsReportSummary -> Maybe Text)
-> (FindingsReportSummary -> Maybe Text -> FindingsReportSummary)
-> Lens
     FindingsReportSummary
     FindingsReportSummary
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Int -> f (Maybe Int))
-> FindingsReportSummary -> f FindingsReportSummary
findingsReportSummary_totalNumberOfFindings = (FindingsReportSummary -> Maybe Int)
-> (FindingsReportSummary -> Maybe Int -> FindingsReportSummary)
-> Lens
     FindingsReportSummary FindingsReportSummary (Maybe Int) (Maybe Int)
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 Core.FromJSON FindingsReportSummary where
  parseJSON :: Value -> Parser FindingsReportSummary
parseJSON =
    String
-> (Object -> Parser FindingsReportSummary)
-> Value
-> Parser FindingsReportSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FindingsReportSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> FindingsReportSummary
FindingsReportSummary'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> FindingsReportSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Maybe Int -> FindingsReportSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"profileStartTime")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> Maybe Int -> FindingsReportSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Int -> FindingsReportSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"profileEndTime")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Int -> FindingsReportSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> FindingsReportSummary)
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
"id")
            Parser (Maybe Text -> Maybe Int -> FindingsReportSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> FindingsReportSummary)
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
"profilingGroupName")
            Parser (Maybe Int -> FindingsReportSummary)
-> Parser (Maybe Int) -> Parser FindingsReportSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"totalNumberOfFindings")
      )

instance Prelude.Hashable FindingsReportSummary

instance Prelude.NFData FindingsReportSummary