{-# 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.MigrationHubStrategy.GetRecommendationReportDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves detailed information about the specified recommendation
-- report.
module Amazonka.MigrationHubStrategy.GetRecommendationReportDetails
  ( -- * Creating a Request
    GetRecommendationReportDetails (..),
    newGetRecommendationReportDetails,

    -- * Request Lenses
    getRecommendationReportDetails_id,

    -- * Destructuring the Response
    GetRecommendationReportDetailsResponse (..),
    newGetRecommendationReportDetailsResponse,

    -- * Response Lenses
    getRecommendationReportDetailsResponse_id,
    getRecommendationReportDetailsResponse_recommendationReportDetails,
    getRecommendationReportDetailsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetRecommendationReportDetails' smart constructor.
data GetRecommendationReportDetails = GetRecommendationReportDetails'
  { -- | The recommendation report generation task @id@ returned by
    -- StartRecommendationReportGeneration.
    GetRecommendationReportDetails -> Text
id :: Prelude.Text
  }
  deriving (GetRecommendationReportDetails
-> GetRecommendationReportDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendationReportDetails
-> GetRecommendationReportDetails -> Bool
$c/= :: GetRecommendationReportDetails
-> GetRecommendationReportDetails -> Bool
== :: GetRecommendationReportDetails
-> GetRecommendationReportDetails -> Bool
$c== :: GetRecommendationReportDetails
-> GetRecommendationReportDetails -> Bool
Prelude.Eq, ReadPrec [GetRecommendationReportDetails]
ReadPrec GetRecommendationReportDetails
Int -> ReadS GetRecommendationReportDetails
ReadS [GetRecommendationReportDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendationReportDetails]
$creadListPrec :: ReadPrec [GetRecommendationReportDetails]
readPrec :: ReadPrec GetRecommendationReportDetails
$creadPrec :: ReadPrec GetRecommendationReportDetails
readList :: ReadS [GetRecommendationReportDetails]
$creadList :: ReadS [GetRecommendationReportDetails]
readsPrec :: Int -> ReadS GetRecommendationReportDetails
$creadsPrec :: Int -> ReadS GetRecommendationReportDetails
Prelude.Read, Int -> GetRecommendationReportDetails -> ShowS
[GetRecommendationReportDetails] -> ShowS
GetRecommendationReportDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendationReportDetails] -> ShowS
$cshowList :: [GetRecommendationReportDetails] -> ShowS
show :: GetRecommendationReportDetails -> String
$cshow :: GetRecommendationReportDetails -> String
showsPrec :: Int -> GetRecommendationReportDetails -> ShowS
$cshowsPrec :: Int -> GetRecommendationReportDetails -> ShowS
Prelude.Show, forall x.
Rep GetRecommendationReportDetails x
-> GetRecommendationReportDetails
forall x.
GetRecommendationReportDetails
-> Rep GetRecommendationReportDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecommendationReportDetails x
-> GetRecommendationReportDetails
$cfrom :: forall x.
GetRecommendationReportDetails
-> Rep GetRecommendationReportDetails x
Prelude.Generic)

-- |
-- Create a value of 'GetRecommendationReportDetails' 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', 'getRecommendationReportDetails_id' - The recommendation report generation task @id@ returned by
-- StartRecommendationReportGeneration.
newGetRecommendationReportDetails ::
  -- | 'id'
  Prelude.Text ->
  GetRecommendationReportDetails
newGetRecommendationReportDetails :: Text -> GetRecommendationReportDetails
newGetRecommendationReportDetails Text
pId_ =
  GetRecommendationReportDetails' {$sel:id:GetRecommendationReportDetails' :: Text
id = Text
pId_}

-- | The recommendation report generation task @id@ returned by
-- StartRecommendationReportGeneration.
getRecommendationReportDetails_id :: Lens.Lens' GetRecommendationReportDetails Prelude.Text
getRecommendationReportDetails_id :: Lens' GetRecommendationReportDetails Text
getRecommendationReportDetails_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationReportDetails' {Text
id :: Text
$sel:id:GetRecommendationReportDetails' :: GetRecommendationReportDetails -> Text
id} -> Text
id) (\s :: GetRecommendationReportDetails
s@GetRecommendationReportDetails' {} Text
a -> GetRecommendationReportDetails
s {$sel:id:GetRecommendationReportDetails' :: Text
id = Text
a} :: GetRecommendationReportDetails)

instance
  Core.AWSRequest
    GetRecommendationReportDetails
  where
  type
    AWSResponse GetRecommendationReportDetails =
      GetRecommendationReportDetailsResponse
  request :: (Service -> Service)
-> GetRecommendationReportDetails
-> Request GetRecommendationReportDetails
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 GetRecommendationReportDetails
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetRecommendationReportDetails)))
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 ->
          Maybe Text
-> Maybe RecommendationReportDetails
-> Int
-> GetRecommendationReportDetailsResponse
GetRecommendationReportDetailsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"recommendationReportDetails")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance
  Prelude.Hashable
    GetRecommendationReportDetails
  where
  hashWithSalt :: Int -> GetRecommendationReportDetails -> Int
hashWithSalt
    Int
_salt
    GetRecommendationReportDetails' {Text
id :: Text
$sel:id:GetRecommendationReportDetails' :: GetRecommendationReportDetails -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

instance
  Prelude.NFData
    GetRecommendationReportDetails
  where
  rnf :: GetRecommendationReportDetails -> ()
rnf GetRecommendationReportDetails' {Text
id :: Text
$sel:id:GetRecommendationReportDetails' :: GetRecommendationReportDetails -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
id

instance
  Data.ToHeaders
    GetRecommendationReportDetails
  where
  toHeaders :: GetRecommendationReportDetails -> 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 GetRecommendationReportDetails where
  toPath :: GetRecommendationReportDetails -> ByteString
toPath GetRecommendationReportDetails' {Text
id :: Text
$sel:id:GetRecommendationReportDetails' :: GetRecommendationReportDetails -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/get-recommendation-report-details/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]

instance Data.ToQuery GetRecommendationReportDetails where
  toQuery :: GetRecommendationReportDetails -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetRecommendationReportDetailsResponse' smart constructor.
data GetRecommendationReportDetailsResponse = GetRecommendationReportDetailsResponse'
  { -- | The ID of the recommendation report generation task. See the response of
    -- StartRecommendationReportGeneration.
    GetRecommendationReportDetailsResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Detailed information about the recommendation report.
    GetRecommendationReportDetailsResponse
-> Maybe RecommendationReportDetails
recommendationReportDetails :: Prelude.Maybe RecommendationReportDetails,
    -- | The response's http status code.
    GetRecommendationReportDetailsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRecommendationReportDetailsResponse
-> GetRecommendationReportDetailsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendationReportDetailsResponse
-> GetRecommendationReportDetailsResponse -> Bool
$c/= :: GetRecommendationReportDetailsResponse
-> GetRecommendationReportDetailsResponse -> Bool
== :: GetRecommendationReportDetailsResponse
-> GetRecommendationReportDetailsResponse -> Bool
$c== :: GetRecommendationReportDetailsResponse
-> GetRecommendationReportDetailsResponse -> Bool
Prelude.Eq, ReadPrec [GetRecommendationReportDetailsResponse]
ReadPrec GetRecommendationReportDetailsResponse
Int -> ReadS GetRecommendationReportDetailsResponse
ReadS [GetRecommendationReportDetailsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendationReportDetailsResponse]
$creadListPrec :: ReadPrec [GetRecommendationReportDetailsResponse]
readPrec :: ReadPrec GetRecommendationReportDetailsResponse
$creadPrec :: ReadPrec GetRecommendationReportDetailsResponse
readList :: ReadS [GetRecommendationReportDetailsResponse]
$creadList :: ReadS [GetRecommendationReportDetailsResponse]
readsPrec :: Int -> ReadS GetRecommendationReportDetailsResponse
$creadsPrec :: Int -> ReadS GetRecommendationReportDetailsResponse
Prelude.Read, Int -> GetRecommendationReportDetailsResponse -> ShowS
[GetRecommendationReportDetailsResponse] -> ShowS
GetRecommendationReportDetailsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendationReportDetailsResponse] -> ShowS
$cshowList :: [GetRecommendationReportDetailsResponse] -> ShowS
show :: GetRecommendationReportDetailsResponse -> String
$cshow :: GetRecommendationReportDetailsResponse -> String
showsPrec :: Int -> GetRecommendationReportDetailsResponse -> ShowS
$cshowsPrec :: Int -> GetRecommendationReportDetailsResponse -> ShowS
Prelude.Show, forall x.
Rep GetRecommendationReportDetailsResponse x
-> GetRecommendationReportDetailsResponse
forall x.
GetRecommendationReportDetailsResponse
-> Rep GetRecommendationReportDetailsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecommendationReportDetailsResponse x
-> GetRecommendationReportDetailsResponse
$cfrom :: forall x.
GetRecommendationReportDetailsResponse
-> Rep GetRecommendationReportDetailsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRecommendationReportDetailsResponse' 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', 'getRecommendationReportDetailsResponse_id' - The ID of the recommendation report generation task. See the response of
-- StartRecommendationReportGeneration.
--
-- 'recommendationReportDetails', 'getRecommendationReportDetailsResponse_recommendationReportDetails' - Detailed information about the recommendation report.
--
-- 'httpStatus', 'getRecommendationReportDetailsResponse_httpStatus' - The response's http status code.
newGetRecommendationReportDetailsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRecommendationReportDetailsResponse
newGetRecommendationReportDetailsResponse :: Int -> GetRecommendationReportDetailsResponse
newGetRecommendationReportDetailsResponse
  Int
pHttpStatus_ =
    GetRecommendationReportDetailsResponse'
      { $sel:id:GetRecommendationReportDetailsResponse' :: Maybe Text
id =
          forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationReportDetails:GetRecommendationReportDetailsResponse' :: Maybe RecommendationReportDetails
recommendationReportDetails =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetRecommendationReportDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The ID of the recommendation report generation task. See the response of
-- StartRecommendationReportGeneration.
getRecommendationReportDetailsResponse_id :: Lens.Lens' GetRecommendationReportDetailsResponse (Prelude.Maybe Prelude.Text)
getRecommendationReportDetailsResponse_id :: Lens' GetRecommendationReportDetailsResponse (Maybe Text)
getRecommendationReportDetailsResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationReportDetailsResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetRecommendationReportDetailsResponse' :: GetRecommendationReportDetailsResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetRecommendationReportDetailsResponse
s@GetRecommendationReportDetailsResponse' {} Maybe Text
a -> GetRecommendationReportDetailsResponse
s {$sel:id:GetRecommendationReportDetailsResponse' :: Maybe Text
id = Maybe Text
a} :: GetRecommendationReportDetailsResponse)

-- | Detailed information about the recommendation report.
getRecommendationReportDetailsResponse_recommendationReportDetails :: Lens.Lens' GetRecommendationReportDetailsResponse (Prelude.Maybe RecommendationReportDetails)
getRecommendationReportDetailsResponse_recommendationReportDetails :: Lens'
  GetRecommendationReportDetailsResponse
  (Maybe RecommendationReportDetails)
getRecommendationReportDetailsResponse_recommendationReportDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationReportDetailsResponse' {Maybe RecommendationReportDetails
recommendationReportDetails :: Maybe RecommendationReportDetails
$sel:recommendationReportDetails:GetRecommendationReportDetailsResponse' :: GetRecommendationReportDetailsResponse
-> Maybe RecommendationReportDetails
recommendationReportDetails} -> Maybe RecommendationReportDetails
recommendationReportDetails) (\s :: GetRecommendationReportDetailsResponse
s@GetRecommendationReportDetailsResponse' {} Maybe RecommendationReportDetails
a -> GetRecommendationReportDetailsResponse
s {$sel:recommendationReportDetails:GetRecommendationReportDetailsResponse' :: Maybe RecommendationReportDetails
recommendationReportDetails = Maybe RecommendationReportDetails
a} :: GetRecommendationReportDetailsResponse)

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

instance
  Prelude.NFData
    GetRecommendationReportDetailsResponse
  where
  rnf :: GetRecommendationReportDetailsResponse -> ()
rnf GetRecommendationReportDetailsResponse' {Int
Maybe Text
Maybe RecommendationReportDetails
httpStatus :: Int
recommendationReportDetails :: Maybe RecommendationReportDetails
id :: Maybe Text
$sel:httpStatus:GetRecommendationReportDetailsResponse' :: GetRecommendationReportDetailsResponse -> Int
$sel:recommendationReportDetails:GetRecommendationReportDetailsResponse' :: GetRecommendationReportDetailsResponse
-> Maybe RecommendationReportDetails
$sel:id:GetRecommendationReportDetailsResponse' :: GetRecommendationReportDetailsResponse -> 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 RecommendationReportDetails
recommendationReportDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus