{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 -> ISO8601
endTime :: Data.ISO8601,
    -- | 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 -> ISO8601
startTime :: Data.ISO8601
  }
  deriving (GetRecommendations -> GetRecommendations -> Bool
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]
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
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. 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'
      { $sel:locale:GetRecommendations' :: Maybe Text
locale = forall a. Maybe a
Prelude.Nothing,
        $sel:endTime:GetRecommendations' :: ISO8601
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:profilingGroupName:GetRecommendations' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:startTime:GetRecommendations' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' GetRecommendations (Maybe Text)
getRecommendations_locale = 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 :: Lens' GetRecommendations UTCTime
getRecommendations_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {ISO8601
endTime :: ISO8601
$sel:endTime:GetRecommendations' :: GetRecommendations -> ISO8601
endTime} -> ISO8601
endTime) (\s :: GetRecommendations
s@GetRecommendations' {} ISO8601
a -> GetRecommendations
s {$sel:endTime:GetRecommendations' :: ISO8601
endTime = ISO8601
a} :: GetRecommendations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the profiling group to get analysis data about.
getRecommendations_profilingGroupName :: Lens.Lens' GetRecommendations Prelude.Text
getRecommendations_profilingGroupName :: Lens' GetRecommendations Text
getRecommendations_profilingGroupName = 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 :: Lens' GetRecommendations UTCTime
getRecommendations_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {ISO8601
startTime :: ISO8601
$sel:startTime:GetRecommendations' :: GetRecommendations -> ISO8601
startTime} -> ISO8601
startTime) (\s :: GetRecommendations
s@GetRecommendations' {} ISO8601
a -> GetRecommendations
s {$sel:startTime:GetRecommendations' :: ISO8601
startTime = ISO8601
a} :: GetRecommendations) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance Prelude.Hashable GetRecommendations where
  hashWithSalt :: Int -> GetRecommendations -> Int
hashWithSalt Int
_salt GetRecommendations' {Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
locale :: Maybe Text
$sel:startTime:GetRecommendations' :: GetRecommendations -> ISO8601
$sel:profilingGroupName:GetRecommendations' :: GetRecommendations -> Text
$sel:endTime:GetRecommendations' :: GetRecommendations -> ISO8601
$sel:locale:GetRecommendations' :: GetRecommendations -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
locale
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime

instance Prelude.NFData GetRecommendations where
  rnf :: GetRecommendations -> ()
rnf GetRecommendations' {Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
locale :: Maybe Text
$sel:startTime:GetRecommendations' :: GetRecommendations -> ISO8601
$sel:profilingGroupName:GetRecommendations' :: GetRecommendations -> Text
$sel:endTime:GetRecommendations' :: GetRecommendations -> ISO8601
$sel:locale:GetRecommendations' :: GetRecommendations -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locale
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime

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

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

instance Data.ToQuery GetRecommendations where
  toQuery :: GetRecommendations -> QueryString
toQuery GetRecommendations' {Maybe Text
Text
ISO8601
startTime :: ISO8601
profilingGroupName :: Text
endTime :: ISO8601
locale :: Maybe Text
$sel:startTime:GetRecommendations' :: GetRecommendations -> ISO8601
$sel:profilingGroupName:GetRecommendations' :: GetRecommendations -> Text
$sel:endTime:GetRecommendations' :: GetRecommendations -> ISO8601
$sel:locale:GetRecommendations' :: GetRecommendations -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"locale" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
locale,
        ByteString
"endTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
endTime,
        ByteString
"startTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
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 -> ISO8601
profileEndTime :: 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.
    GetRecommendationsResponse -> ISO8601
profileStartTime :: Data.ISO8601,
    -- | 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
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]
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
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.
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'
      { $sel:httpStatus:GetRecommendationsResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:anomalies:GetRecommendationsResponse' :: [Anomaly]
anomalies = forall a. Monoid a => a
Prelude.mempty,
        $sel:profileEndTime:GetRecommendationsResponse' :: ISO8601
profileEndTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pProfileEndTime_,
        $sel:profileStartTime:GetRecommendationsResponse' :: ISO8601
profileStartTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pProfileStartTime_,
        $sel:profilingGroupName:GetRecommendationsResponse' :: Text
profilingGroupName = Text
pProfilingGroupName_,
        $sel:recommendations:GetRecommendationsResponse' :: [Recommendation]
recommendations = forall a. Monoid a => a
Prelude.mempty
      }

-- | The response's http status code.
getRecommendationsResponse_httpStatus :: Lens.Lens' GetRecommendationsResponse Prelude.Int
getRecommendationsResponse_httpStatus :: Lens' GetRecommendationsResponse Int
getRecommendationsResponse_httpStatus = 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 :: Lens' GetRecommendationsResponse [Anomaly]
getRecommendationsResponse_anomalies = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' GetRecommendationsResponse UTCTime
getRecommendationsResponse_profileEndTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {ISO8601
profileEndTime :: ISO8601
$sel:profileEndTime:GetRecommendationsResponse' :: GetRecommendationsResponse -> ISO8601
profileEndTime} -> ISO8601
profileEndTime) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} ISO8601
a -> GetRecommendationsResponse
s {$sel:profileEndTime:GetRecommendationsResponse' :: ISO8601
profileEndTime = ISO8601
a} :: GetRecommendationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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.
getRecommendationsResponse_profileStartTime :: Lens.Lens' GetRecommendationsResponse Prelude.UTCTime
getRecommendationsResponse_profileStartTime :: Lens' GetRecommendationsResponse UTCTime
getRecommendationsResponse_profileStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {ISO8601
profileStartTime :: ISO8601
$sel:profileStartTime:GetRecommendationsResponse' :: GetRecommendationsResponse -> ISO8601
profileStartTime} -> ISO8601
profileStartTime) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} ISO8601
a -> GetRecommendationsResponse
s {$sel:profileStartTime:GetRecommendationsResponse' :: ISO8601
profileStartTime = ISO8601
a} :: GetRecommendationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the profiling group the analysis data is about.
getRecommendationsResponse_profilingGroupName :: Lens.Lens' GetRecommendationsResponse Prelude.Text
getRecommendationsResponse_profilingGroupName :: Lens' GetRecommendationsResponse Text
getRecommendationsResponse_profilingGroupName = 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 :: Lens' GetRecommendationsResponse [Recommendation]
getRecommendationsResponse_recommendations = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData GetRecommendationsResponse where
  rnf :: GetRecommendationsResponse -> ()
rnf GetRecommendationsResponse' {Int
[Recommendation]
[Anomaly]
Text
ISO8601
recommendations :: [Recommendation]
profilingGroupName :: Text
profileStartTime :: ISO8601
profileEndTime :: ISO8601
anomalies :: [Anomaly]
httpStatus :: Int
$sel:recommendations:GetRecommendationsResponse' :: GetRecommendationsResponse -> [Recommendation]
$sel:profilingGroupName:GetRecommendationsResponse' :: GetRecommendationsResponse -> Text
$sel:profileStartTime:GetRecommendationsResponse' :: GetRecommendationsResponse -> ISO8601
$sel:profileEndTime:GetRecommendationsResponse' :: GetRecommendationsResponse -> ISO8601
$sel:anomalies:GetRecommendationsResponse' :: GetRecommendationsResponse -> [Anomaly]
$sel:httpStatus:GetRecommendationsResponse' :: GetRecommendationsResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Anomaly]
anomalies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
profileEndTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
profileStartTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Recommendation]
recommendations