{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetRecommendations
-- 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)
--
-- Returns a list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html Recommendation>
-- objects that contain recommendations for a profiling group for a given
-- time period. A list of
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html Anomaly>
-- objects that contains details about anomalies detected in the profiling
-- group for the same time period is also returned.
module Amazonka.CodeGuruProfiler.GetRecommendations
  ( -- * Creating a Request
    GetRecommendations (..),
    newGetRecommendations,

    -- * Request Lenses
    getRecommendations_locale,
    getRecommendations_endTime,
    getRecommendations_profilingGroupName,
    getRecommendations_startTime,

    -- * Destructuring the Response
    GetRecommendationsResponse (..),
    newGetRecommendationsResponse,

    -- * Response Lenses
    getRecommendationsResponse_httpStatus,
    getRecommendationsResponse_anomalies,
    getRecommendationsResponse_profileEndTime,
    getRecommendationsResponse_profileStartTime,
    getRecommendationsResponse_profilingGroupName,
    getRecommendationsResponse_recommendations,
  )
where

import Amazonka.CodeGuruProfiler.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The structure representing the GetRecommendationsRequest.
--
-- /See:/ 'newGetRecommendations' smart constructor.
data GetRecommendations = GetRecommendations'
  { -- | The language used to provide analysis. Specify using a string that is
    -- one of the following @BCP 47@ language codes.
    --
    -- -   @de-DE@ - German, Germany
    --
    -- -   @en-GB@ - English, United Kingdom
    --
    -- -   @en-US@ - English, United States
    --
    -- -   @es-ES@ - Spanish, Spain
    --
    -- -   @fr-FR@ - French, France
    --
    -- -   @it-IT@ - Italian, Italy
    --
    -- -   @ja-JP@ - Japanese, Japan
    --
    -- -   @ko-KR@ - Korean, Republic of Korea
    --
    -- -   @pt-BR@ - Portugese, Brazil
    --
    -- -   @zh-CN@ - Chinese, China
    --
    -- -   @zh-TW@ - Chinese, Taiwan
    GetRecommendations -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
    -- | The start time of the profile to get analysis data about. You must
    -- specify @startTime@ and @endTime@. 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.
    GetRecommendations -> POSIX
endTime :: Core.POSIX,
    -- | The name of the profiling group to get analysis data about.
    GetRecommendations -> Text
profilingGroupName :: Prelude.Text,
    -- | The end time of the profile to get analysis data about. You must specify
    -- @startTime@ and @endTime@. 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.
    GetRecommendations -> POSIX
startTime :: Core.POSIX
  }
  deriving (GetRecommendations -> GetRecommendations -> Bool
(GetRecommendations -> GetRecommendations -> Bool)
-> (GetRecommendations -> GetRecommendations -> Bool)
-> Eq GetRecommendations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendations -> GetRecommendations -> Bool
$c/= :: GetRecommendations -> GetRecommendations -> Bool
== :: GetRecommendations -> GetRecommendations -> Bool
$c== :: GetRecommendations -> GetRecommendations -> Bool
Prelude.Eq, ReadPrec [GetRecommendations]
ReadPrec GetRecommendations
Int -> ReadS GetRecommendations
ReadS [GetRecommendations]
(Int -> ReadS GetRecommendations)
-> ReadS [GetRecommendations]
-> ReadPrec GetRecommendations
-> ReadPrec [GetRecommendations]
-> Read GetRecommendations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendations]
$creadListPrec :: ReadPrec [GetRecommendations]
readPrec :: ReadPrec GetRecommendations
$creadPrec :: ReadPrec GetRecommendations
readList :: ReadS [GetRecommendations]
$creadList :: ReadS [GetRecommendations]
readsPrec :: Int -> ReadS GetRecommendations
$creadsPrec :: Int -> ReadS GetRecommendations
Prelude.Read, Int -> GetRecommendations -> ShowS
[GetRecommendations] -> ShowS
GetRecommendations -> String
(Int -> GetRecommendations -> ShowS)
-> (GetRecommendations -> String)
-> ([GetRecommendations] -> ShowS)
-> Show GetRecommendations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendations] -> ShowS
$cshowList :: [GetRecommendations] -> ShowS
show :: GetRecommendations -> String
$cshow :: GetRecommendations -> String
showsPrec :: Int -> GetRecommendations -> ShowS
$cshowsPrec :: Int -> GetRecommendations -> ShowS
Prelude.Show, (forall x. GetRecommendations -> Rep GetRecommendations x)
-> (forall x. Rep GetRecommendations x -> GetRecommendations)
-> Generic GetRecommendations
forall x. Rep GetRecommendations x -> GetRecommendations
forall x. GetRecommendations -> Rep GetRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRecommendations x -> GetRecommendations
$cfrom :: forall x. GetRecommendations -> Rep GetRecommendations x
Prelude.Generic)

-- |
-- Create a value of 'GetRecommendations' 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:
--
-- 'locale', 'getRecommendations_locale' - The language used to provide analysis. Specify using a string that is
-- one of the following @BCP 47@ language codes.
--
-- -   @de-DE@ - German, Germany
--
-- -   @en-GB@ - English, United Kingdom
--
-- -   @en-US@ - English, United States
--
-- -   @es-ES@ - Spanish, Spain
--
-- -   @fr-FR@ - French, France
--
-- -   @it-IT@ - Italian, Italy
--
-- -   @ja-JP@ - Japanese, Japan
--
-- -   @ko-KR@ - Korean, Republic of Korea
--
-- -   @pt-BR@ - Portugese, Brazil
--
-- -   @zh-CN@ - Chinese, China
--
-- -   @zh-TW@ - Chinese, Taiwan
--
-- 'endTime', 'getRecommendations_endTime' - The start time of the profile to get analysis data about. You must
-- specify @startTime@ and @endTime@. 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', 'getRecommendations_profilingGroupName' - The name of the profiling group to get analysis data about.
--
-- 'startTime', 'getRecommendations_startTime' - The end time of the profile to get analysis data about. You must specify
-- @startTime@ and @endTime@. 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.
newGetRecommendations ::
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'profilingGroupName'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  GetRecommendations
newGetRecommendations :: UTCTime -> Text -> UTCTime -> GetRecommendations
newGetRecommendations
  UTCTime
pEndTime_
  Text
pProfilingGroupName_
  UTCTime
pStartTime_ =
    GetRecommendations' :: Maybe Text -> POSIX -> Text -> POSIX -> GetRecommendations
GetRecommendations'
      { $sel:locale:GetRecommendations' :: Maybe Text
locale = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:GetRecommendations' :: POSIX
endTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:profilingGroupName:GetRecommendations' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:startTime:GetRecommendations' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
      }

-- | The language used to provide analysis. Specify using a string that is
-- one of the following @BCP 47@ language codes.
--
-- -   @de-DE@ - German, Germany
--
-- -   @en-GB@ - English, United Kingdom
--
-- -   @en-US@ - English, United States
--
-- -   @es-ES@ - Spanish, Spain
--
-- -   @fr-FR@ - French, France
--
-- -   @it-IT@ - Italian, Italy
--
-- -   @ja-JP@ - Japanese, Japan
--
-- -   @ko-KR@ - Korean, Republic of Korea
--
-- -   @pt-BR@ - Portugese, Brazil
--
-- -   @zh-CN@ - Chinese, China
--
-- -   @zh-TW@ - Chinese, Taiwan
getRecommendations_locale :: Lens.Lens' GetRecommendations (Prelude.Maybe Prelude.Text)
getRecommendations_locale :: (Maybe Text -> f (Maybe Text))
-> GetRecommendations -> f GetRecommendations
getRecommendations_locale = (GetRecommendations -> Maybe Text)
-> (GetRecommendations -> Maybe Text -> GetRecommendations)
-> Lens
     GetRecommendations GetRecommendations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Maybe Text
locale :: Maybe Text
$sel:locale:GetRecommendations' :: GetRecommendations -> Maybe Text
locale} -> Maybe Text
locale) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe Text
a -> GetRecommendations
s {$sel:locale:GetRecommendations' :: Maybe Text
locale = Maybe Text
a} :: GetRecommendations)

-- | The start time of the profile to get analysis data about. You must
-- specify @startTime@ and @endTime@. 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.
getRecommendations_endTime :: Lens.Lens' GetRecommendations Prelude.UTCTime
getRecommendations_endTime :: (UTCTime -> f UTCTime)
-> GetRecommendations -> f GetRecommendations
getRecommendations_endTime = (GetRecommendations -> POSIX)
-> (GetRecommendations -> POSIX -> GetRecommendations)
-> Lens GetRecommendations GetRecommendations POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {POSIX
endTime :: POSIX
$sel:endTime:GetRecommendations' :: GetRecommendations -> POSIX
endTime} -> POSIX
endTime) (\s :: GetRecommendations
s@GetRecommendations' {} POSIX
a -> GetRecommendations
s {$sel:endTime:GetRecommendations' :: POSIX
endTime = POSIX
a} :: GetRecommendations) ((POSIX -> f POSIX) -> GetRecommendations -> f GetRecommendations)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRecommendations
-> f GetRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the profiling group to get analysis data about.
getRecommendations_profilingGroupName :: Lens.Lens' GetRecommendations Prelude.Text
getRecommendations_profilingGroupName :: (Text -> f Text) -> GetRecommendations -> f GetRecommendations
getRecommendations_profilingGroupName = (GetRecommendations -> Text)
-> (GetRecommendations -> Text -> GetRecommendations)
-> Lens GetRecommendations GetRecommendations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Text
profilingGroupName :: Text
$sel:profilingGroupName:GetRecommendations' :: GetRecommendations -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: GetRecommendations
s@GetRecommendations' {} Text
a -> GetRecommendations
s {$sel:profilingGroupName:GetRecommendations' :: Text
profilingGroupName = Text
a} :: GetRecommendations)

-- | The end time of the profile to get analysis data about. You must specify
-- @startTime@ and @endTime@. 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.
getRecommendations_startTime :: Lens.Lens' GetRecommendations Prelude.UTCTime
getRecommendations_startTime :: (UTCTime -> f UTCTime)
-> GetRecommendations -> f GetRecommendations
getRecommendations_startTime = (GetRecommendations -> POSIX)
-> (GetRecommendations -> POSIX -> GetRecommendations)
-> Lens GetRecommendations GetRecommendations POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {POSIX
startTime :: POSIX
$sel:startTime:GetRecommendations' :: GetRecommendations -> POSIX
startTime} -> POSIX
startTime) (\s :: GetRecommendations
s@GetRecommendations' {} POSIX
a -> GetRecommendations
s {$sel:startTime:GetRecommendations' :: POSIX
startTime = POSIX
a} :: GetRecommendations) ((POSIX -> f POSIX) -> GetRecommendations -> f GetRecommendations)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRecommendations
-> f GetRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.AWSRequest GetRecommendations where
  type
    AWSResponse GetRecommendations =
      GetRecommendationsResponse
  request :: GetRecommendations -> Request GetRecommendations
request = Service -> GetRecommendations -> Request GetRecommendations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRecommendations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRecommendations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRecommendations))
-> Logger
-> Service
-> Proxy GetRecommendations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRecommendations)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> [Anomaly]
-> POSIX
-> POSIX
-> Text
-> [Recommendation]
-> GetRecommendationsResponse
GetRecommendationsResponse'
            (Int
 -> [Anomaly]
 -> POSIX
 -> POSIX
 -> Text
 -> [Recommendation]
 -> GetRecommendationsResponse)
-> Either String Int
-> Either
     String
     ([Anomaly]
      -> POSIX
      -> POSIX
      -> Text
      -> [Recommendation]
      -> GetRecommendationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([Anomaly]
   -> POSIX
   -> POSIX
   -> Text
   -> [Recommendation]
   -> GetRecommendationsResponse)
-> Either String [Anomaly]
-> Either
     String
     (POSIX
      -> POSIX -> Text -> [Recommendation] -> GetRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [Anomaly])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"anomalies" Either String (Maybe [Anomaly])
-> [Anomaly] -> Either String [Anomaly]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Anomaly]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (POSIX
   -> POSIX -> Text -> [Recommendation] -> GetRecommendationsResponse)
-> Either String POSIX
-> Either
     String
     (POSIX -> Text -> [Recommendation] -> GetRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"profileEndTime")
            Either
  String
  (POSIX -> Text -> [Recommendation] -> GetRecommendationsResponse)
-> Either String POSIX
-> Either
     String (Text -> [Recommendation] -> GetRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"profileStartTime")
            Either
  String (Text -> [Recommendation] -> GetRecommendationsResponse)
-> Either String Text
-> Either String ([Recommendation] -> GetRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"profilingGroupName")
            Either String ([Recommendation] -> GetRecommendationsResponse)
-> Either String [Recommendation]
-> Either String GetRecommendationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [Recommendation])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"recommendations"
                            Either String (Maybe [Recommendation])
-> [Recommendation] -> Either String [Recommendation]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Recommendation]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable GetRecommendations

instance Prelude.NFData GetRecommendations

instance Core.ToHeaders GetRecommendations where
  toHeaders :: GetRecommendations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetRecommendations -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetRecommendations where
  toPath :: GetRecommendations -> ByteString
toPath GetRecommendations' {Maybe Text
Text
POSIX
startTime :: POSIX
profilingGroupName :: Text
endTime :: POSIX
locale :: Maybe Text
$sel:startTime:GetRecommendations' :: GetRecommendations -> POSIX
$sel:profilingGroupName:GetRecommendations' :: GetRecommendations -> Text
$sel:endTime:GetRecommendations' :: GetRecommendations -> POSIX
$sel:locale:GetRecommendations' :: GetRecommendations -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/internal/profilingGroups/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
profilingGroupName,
        ByteString
"/recommendations"
      ]

instance Core.ToQuery GetRecommendations where
  toQuery :: GetRecommendations -> QueryString
toQuery GetRecommendations' {Maybe Text
Text
POSIX
startTime :: POSIX
profilingGroupName :: Text
endTime :: POSIX
locale :: Maybe Text
$sel:startTime:GetRecommendations' :: GetRecommendations -> POSIX
$sel:profilingGroupName:GetRecommendations' :: GetRecommendations -> Text
$sel:endTime:GetRecommendations' :: GetRecommendations -> POSIX
$sel:locale:GetRecommendations' :: GetRecommendations -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"locale" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
locale,
        ByteString
"endTime" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
endTime,
        ByteString
"startTime" ByteString -> POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: POSIX
startTime
      ]

-- | The structure representing the GetRecommendationsResponse.
--
-- /See:/ 'newGetRecommendationsResponse' smart constructor.
data GetRecommendationsResponse = GetRecommendationsResponse'
  { -- | The response's http status code.
    GetRecommendationsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of anomalies that the analysis has found for this profile.
    GetRecommendationsResponse -> [Anomaly]
anomalies :: [Anomaly],
    -- | The end 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.
    GetRecommendationsResponse -> POSIX
profileEndTime :: Core.POSIX,
    -- | 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.
    GetRecommendationsResponse -> POSIX
profileStartTime :: Core.POSIX,
    -- | The name of the profiling group the analysis data is about.
    GetRecommendationsResponse -> Text
profilingGroupName :: Prelude.Text,
    -- | The list of recommendations that the analysis found for this profile.
    GetRecommendationsResponse -> [Recommendation]
recommendations :: [Recommendation]
  }
  deriving (GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
(GetRecommendationsResponse -> GetRecommendationsResponse -> Bool)
-> (GetRecommendationsResponse
    -> GetRecommendationsResponse -> Bool)
-> Eq GetRecommendationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
$c/= :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
== :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
$c== :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [GetRecommendationsResponse]
ReadPrec GetRecommendationsResponse
Int -> ReadS GetRecommendationsResponse
ReadS [GetRecommendationsResponse]
(Int -> ReadS GetRecommendationsResponse)
-> ReadS [GetRecommendationsResponse]
-> ReadPrec GetRecommendationsResponse
-> ReadPrec [GetRecommendationsResponse]
-> Read GetRecommendationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendationsResponse]
$creadListPrec :: ReadPrec [GetRecommendationsResponse]
readPrec :: ReadPrec GetRecommendationsResponse
$creadPrec :: ReadPrec GetRecommendationsResponse
readList :: ReadS [GetRecommendationsResponse]
$creadList :: ReadS [GetRecommendationsResponse]
readsPrec :: Int -> ReadS GetRecommendationsResponse
$creadsPrec :: Int -> ReadS GetRecommendationsResponse
Prelude.Read, Int -> GetRecommendationsResponse -> ShowS
[GetRecommendationsResponse] -> ShowS
GetRecommendationsResponse -> String
(Int -> GetRecommendationsResponse -> ShowS)
-> (GetRecommendationsResponse -> String)
-> ([GetRecommendationsResponse] -> ShowS)
-> Show GetRecommendationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendationsResponse] -> ShowS
$cshowList :: [GetRecommendationsResponse] -> ShowS
show :: GetRecommendationsResponse -> String
$cshow :: GetRecommendationsResponse -> String
showsPrec :: Int -> GetRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> GetRecommendationsResponse -> ShowS
Prelude.Show, (forall x.
 GetRecommendationsResponse -> Rep GetRecommendationsResponse x)
-> (forall x.
    Rep GetRecommendationsResponse x -> GetRecommendationsResponse)
-> Generic GetRecommendationsResponse
forall x.
Rep GetRecommendationsResponse x -> GetRecommendationsResponse
forall x.
GetRecommendationsResponse -> Rep GetRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecommendationsResponse x -> GetRecommendationsResponse
$cfrom :: forall x.
GetRecommendationsResponse -> Rep GetRecommendationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRecommendationsResponse' 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:
--
-- 'httpStatus', 'getRecommendationsResponse_httpStatus' - The response's http status code.
--
-- 'anomalies', 'getRecommendationsResponse_anomalies' - The list of anomalies that the analysis has found for this profile.
--
-- 'profileEndTime', 'getRecommendationsResponse_profileEndTime' - The end 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.
--
-- 'profileStartTime', 'getRecommendationsResponse_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', 'getRecommendationsResponse_profilingGroupName' - The name of the profiling group the analysis data is about.
--
-- 'recommendations', 'getRecommendationsResponse_recommendations' - The list of recommendations that the analysis found for this profile.
newGetRecommendationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'profileEndTime'
  Prelude.UTCTime ->
  -- | 'profileStartTime'
  Prelude.UTCTime ->
  -- | 'profilingGroupName'
  Prelude.Text ->
  GetRecommendationsResponse
newGetRecommendationsResponse :: Int -> UTCTime -> UTCTime -> Text -> GetRecommendationsResponse
newGetRecommendationsResponse
  Int
pHttpStatus_
  UTCTime
pProfileEndTime_
  UTCTime
pProfileStartTime_
  Text
pProfilingGroupName_ =
    GetRecommendationsResponse' :: Int
-> [Anomaly]
-> POSIX
-> POSIX
-> Text
-> [Recommendation]
-> GetRecommendationsResponse
GetRecommendationsResponse'
      { $sel:httpStatus:GetRecommendationsResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:anomalies:GetRecommendationsResponse' :: [Anomaly]
anomalies = [Anomaly]
forall a. Monoid a => a
Prelude.mempty,
        $sel:profileEndTime:GetRecommendationsResponse' :: POSIX
profileEndTime =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pProfileEndTime_,
        $sel:profileStartTime:GetRecommendationsResponse' :: POSIX
profileStartTime =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pProfileStartTime_,
        $sel:profilingGroupName:GetRecommendationsResponse' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:recommendations:GetRecommendationsResponse' :: [Recommendation]
recommendations = [Recommendation]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The response's http status code.
getRecommendationsResponse_httpStatus :: Lens.Lens' GetRecommendationsResponse Prelude.Int
getRecommendationsResponse_httpStatus :: (Int -> f Int)
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_httpStatus = (GetRecommendationsResponse -> Int)
-> (GetRecommendationsResponse
    -> Int -> GetRecommendationsResponse)
-> Lens
     GetRecommendationsResponse GetRecommendationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRecommendationsResponse' :: GetRecommendationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} Int
a -> GetRecommendationsResponse
s {$sel:httpStatus:GetRecommendationsResponse' :: Int
httpStatus = Int
a} :: GetRecommendationsResponse)

-- | The list of anomalies that the analysis has found for this profile.
getRecommendationsResponse_anomalies :: Lens.Lens' GetRecommendationsResponse [Anomaly]
getRecommendationsResponse_anomalies :: ([Anomaly] -> f [Anomaly])
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_anomalies = (GetRecommendationsResponse -> [Anomaly])
-> (GetRecommendationsResponse
    -> [Anomaly] -> GetRecommendationsResponse)
-> Lens
     GetRecommendationsResponse
     GetRecommendationsResponse
     [Anomaly]
     [Anomaly]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {[Anomaly]
anomalies :: [Anomaly]
$sel:anomalies:GetRecommendationsResponse' :: GetRecommendationsResponse -> [Anomaly]
anomalies} -> [Anomaly]
anomalies) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} [Anomaly]
a -> GetRecommendationsResponse
s {$sel:anomalies:GetRecommendationsResponse' :: [Anomaly]
anomalies = [Anomaly]
a} :: GetRecommendationsResponse) (([Anomaly] -> f [Anomaly])
 -> GetRecommendationsResponse -> f GetRecommendationsResponse)
-> (([Anomaly] -> f [Anomaly]) -> [Anomaly] -> f [Anomaly])
-> ([Anomaly] -> f [Anomaly])
-> GetRecommendationsResponse
-> f GetRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Anomaly] -> f [Anomaly]) -> [Anomaly] -> f [Anomaly]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The end 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.
getRecommendationsResponse_profileEndTime :: Lens.Lens' GetRecommendationsResponse Prelude.UTCTime
getRecommendationsResponse_profileEndTime :: (UTCTime -> f UTCTime)
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_profileEndTime = (GetRecommendationsResponse -> POSIX)
-> (GetRecommendationsResponse
    -> POSIX -> GetRecommendationsResponse)
-> Lens
     GetRecommendationsResponse GetRecommendationsResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {POSIX
profileEndTime :: POSIX
$sel:profileEndTime:GetRecommendationsResponse' :: GetRecommendationsResponse -> POSIX
profileEndTime} -> POSIX
profileEndTime) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} POSIX
a -> GetRecommendationsResponse
s {$sel:profileEndTime:GetRecommendationsResponse' :: POSIX
profileEndTime = POSIX
a} :: GetRecommendationsResponse) ((POSIX -> f POSIX)
 -> GetRecommendationsResponse -> f GetRecommendationsResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRecommendationsResponse
-> f GetRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._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.
getRecommendationsResponse_profileStartTime :: Lens.Lens' GetRecommendationsResponse Prelude.UTCTime
getRecommendationsResponse_profileStartTime :: (UTCTime -> f UTCTime)
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_profileStartTime = (GetRecommendationsResponse -> POSIX)
-> (GetRecommendationsResponse
    -> POSIX -> GetRecommendationsResponse)
-> Lens
     GetRecommendationsResponse GetRecommendationsResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {POSIX
profileStartTime :: POSIX
$sel:profileStartTime:GetRecommendationsResponse' :: GetRecommendationsResponse -> POSIX
profileStartTime} -> POSIX
profileStartTime) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} POSIX
a -> GetRecommendationsResponse
s {$sel:profileStartTime:GetRecommendationsResponse' :: POSIX
profileStartTime = POSIX
a} :: GetRecommendationsResponse) ((POSIX -> f POSIX)
 -> GetRecommendationsResponse -> f GetRecommendationsResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRecommendationsResponse
-> f GetRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the profiling group the analysis data is about.
getRecommendationsResponse_profilingGroupName :: Lens.Lens' GetRecommendationsResponse Prelude.Text
getRecommendationsResponse_profilingGroupName :: (Text -> f Text)
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_profilingGroupName = (GetRecommendationsResponse -> Text)
-> (GetRecommendationsResponse
    -> Text -> GetRecommendationsResponse)
-> Lens
     GetRecommendationsResponse GetRecommendationsResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {Text
profilingGroupName :: Text
$sel:profilingGroupName:GetRecommendationsResponse' :: GetRecommendationsResponse -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} Text
a -> GetRecommendationsResponse
s {$sel:profilingGroupName:GetRecommendationsResponse' :: Text
profilingGroupName = Text
a} :: GetRecommendationsResponse)

-- | The list of recommendations that the analysis found for this profile.
getRecommendationsResponse_recommendations :: Lens.Lens' GetRecommendationsResponse [Recommendation]
getRecommendationsResponse_recommendations :: ([Recommendation] -> f [Recommendation])
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_recommendations = (GetRecommendationsResponse -> [Recommendation])
-> (GetRecommendationsResponse
    -> [Recommendation] -> GetRecommendationsResponse)
-> Lens
     GetRecommendationsResponse
     GetRecommendationsResponse
     [Recommendation]
     [Recommendation]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {[Recommendation]
recommendations :: [Recommendation]
$sel:recommendations:GetRecommendationsResponse' :: GetRecommendationsResponse -> [Recommendation]
recommendations} -> [Recommendation]
recommendations) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} [Recommendation]
a -> GetRecommendationsResponse
s {$sel:recommendations:GetRecommendationsResponse' :: [Recommendation]
recommendations = [Recommendation]
a} :: GetRecommendationsResponse) (([Recommendation] -> f [Recommendation])
 -> GetRecommendationsResponse -> f GetRecommendationsResponse)
-> (([Recommendation] -> f [Recommendation])
    -> [Recommendation] -> f [Recommendation])
-> ([Recommendation] -> f [Recommendation])
-> GetRecommendationsResponse
-> f GetRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Recommendation] -> f [Recommendation])
-> [Recommendation] -> f [Recommendation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData GetRecommendationsResponse