{-# 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.DevOpsGuru.GetCostEstimation
-- 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 an estimate of the monthly cost for DevOps Guru to analyze your
-- Amazon Web Services resources. For more information, see
-- <https://docs.aws.amazon.com/devops-guru/latest/userguide/cost-estimate.html Estimate your Amazon DevOps Guru costs>
-- and
-- <http://aws.amazon.com/devops-guru/pricing/ Amazon DevOps Guru pricing>.
--
-- This operation returns paginated results.
module Amazonka.DevOpsGuru.GetCostEstimation
  ( -- * Creating a Request
    GetCostEstimation (..),
    newGetCostEstimation,

    -- * Request Lenses
    getCostEstimation_nextToken,

    -- * Destructuring the Response
    GetCostEstimationResponse (..),
    newGetCostEstimationResponse,

    -- * Response Lenses
    getCostEstimationResponse_costs,
    getCostEstimationResponse_nextToken,
    getCostEstimationResponse_resourceCollection,
    getCostEstimationResponse_status,
    getCostEstimationResponse_timeRange,
    getCostEstimationResponse_totalCost,
    getCostEstimationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetCostEstimation' smart constructor.
data GetCostEstimation = GetCostEstimation'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    GetCostEstimation -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetCostEstimation -> GetCostEstimation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCostEstimation -> GetCostEstimation -> Bool
$c/= :: GetCostEstimation -> GetCostEstimation -> Bool
== :: GetCostEstimation -> GetCostEstimation -> Bool
$c== :: GetCostEstimation -> GetCostEstimation -> Bool
Prelude.Eq, ReadPrec [GetCostEstimation]
ReadPrec GetCostEstimation
Int -> ReadS GetCostEstimation
ReadS [GetCostEstimation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCostEstimation]
$creadListPrec :: ReadPrec [GetCostEstimation]
readPrec :: ReadPrec GetCostEstimation
$creadPrec :: ReadPrec GetCostEstimation
readList :: ReadS [GetCostEstimation]
$creadList :: ReadS [GetCostEstimation]
readsPrec :: Int -> ReadS GetCostEstimation
$creadsPrec :: Int -> ReadS GetCostEstimation
Prelude.Read, Int -> GetCostEstimation -> ShowS
[GetCostEstimation] -> ShowS
GetCostEstimation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCostEstimation] -> ShowS
$cshowList :: [GetCostEstimation] -> ShowS
show :: GetCostEstimation -> String
$cshow :: GetCostEstimation -> String
showsPrec :: Int -> GetCostEstimation -> ShowS
$cshowsPrec :: Int -> GetCostEstimation -> ShowS
Prelude.Show, forall x. Rep GetCostEstimation x -> GetCostEstimation
forall x. GetCostEstimation -> Rep GetCostEstimation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCostEstimation x -> GetCostEstimation
$cfrom :: forall x. GetCostEstimation -> Rep GetCostEstimation x
Prelude.Generic)

-- |
-- Create a value of 'GetCostEstimation' 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:
--
-- 'nextToken', 'getCostEstimation_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
newGetCostEstimation ::
  GetCostEstimation
newGetCostEstimation :: GetCostEstimation
newGetCostEstimation =
  GetCostEstimation' {$sel:nextToken:GetCostEstimation' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing}

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
getCostEstimation_nextToken :: Lens.Lens' GetCostEstimation (Prelude.Maybe Prelude.Text)
getCostEstimation_nextToken :: Lens' GetCostEstimation (Maybe Text)
getCostEstimation_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimation' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCostEstimation' :: GetCostEstimation -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCostEstimation
s@GetCostEstimation' {} Maybe Text
a -> GetCostEstimation
s {$sel:nextToken:GetCostEstimation' :: Maybe Text
nextToken = Maybe Text
a} :: GetCostEstimation)

instance Core.AWSPager GetCostEstimation where
  page :: GetCostEstimation
-> AWSResponse GetCostEstimation -> Maybe GetCostEstimation
page GetCostEstimation
rq AWSResponse GetCostEstimation
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetCostEstimation
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetCostEstimationResponse (Maybe Text)
getCostEstimationResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetCostEstimation
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetCostEstimationResponse (Maybe [ServiceResourceCost])
getCostEstimationResponse_costs
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetCostEstimation
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetCostEstimation (Maybe Text)
getCostEstimation_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetCostEstimation
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetCostEstimationResponse (Maybe Text)
getCostEstimationResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetCostEstimation where
  type
    AWSResponse GetCostEstimation =
      GetCostEstimationResponse
  request :: (Service -> Service)
-> GetCostEstimation -> Request GetCostEstimation
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 GetCostEstimation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCostEstimation)))
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 [ServiceResourceCost]
-> Maybe Text
-> Maybe CostEstimationResourceCollectionFilter
-> Maybe CostEstimationStatus
-> Maybe CostEstimationTimeRange
-> Maybe Double
-> Int
-> GetCostEstimationResponse
GetCostEstimationResponse'
            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
"Costs" 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 (Maybe a)
Data..?> Key
"NextToken")
            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
"ResourceCollection")
            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
"Status")
            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
"TimeRange")
            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
"TotalCost")
            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 GetCostEstimation where
  hashWithSalt :: Int -> GetCostEstimation -> Int
hashWithSalt Int
_salt GetCostEstimation' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCostEstimation' :: GetCostEstimation -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

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

instance Data.ToHeaders GetCostEstimation where
  toHeaders :: GetCostEstimation -> 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 GetCostEstimation where
  toPath :: GetCostEstimation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/cost-estimation"

instance Data.ToQuery GetCostEstimation where
  toQuery :: GetCostEstimation -> QueryString
toQuery GetCostEstimation' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCostEstimation' :: GetCostEstimation -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken]

-- | /See:/ 'newGetCostEstimationResponse' smart constructor.
data GetCostEstimationResponse = GetCostEstimationResponse'
  { -- | An array of @ResourceCost@ objects that each contains details about the
    -- monthly cost estimate to analyze one of your Amazon Web Services
    -- resources.
    GetCostEstimationResponse -> Maybe [ServiceResourceCost]
costs :: Prelude.Maybe [ServiceResourceCost],
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    GetCostEstimationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The collection of the Amazon Web Services resources used to create your
    -- monthly DevOps Guru cost estimate.
    GetCostEstimationResponse
-> Maybe CostEstimationResourceCollectionFilter
resourceCollection :: Prelude.Maybe CostEstimationResourceCollectionFilter,
    -- | The status of creating this cost estimate. If it\'s still in progress,
    -- the status @ONGOING@ is returned. If it is finished, the status
    -- @COMPLETED@ is returned.
    GetCostEstimationResponse -> Maybe CostEstimationStatus
status :: Prelude.Maybe CostEstimationStatus,
    -- | The start and end time of the cost estimation.
    GetCostEstimationResponse -> Maybe CostEstimationTimeRange
timeRange :: Prelude.Maybe CostEstimationTimeRange,
    -- | The estimated monthly cost to analyze the Amazon Web Services resources.
    -- This value is the sum of the estimated costs to analyze each resource in
    -- the @Costs@ object in this response.
    GetCostEstimationResponse -> Maybe Double
totalCost :: Prelude.Maybe Prelude.Double,
    -- | The response's http status code.
    GetCostEstimationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCostEstimationResponse -> GetCostEstimationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCostEstimationResponse -> GetCostEstimationResponse -> Bool
$c/= :: GetCostEstimationResponse -> GetCostEstimationResponse -> Bool
== :: GetCostEstimationResponse -> GetCostEstimationResponse -> Bool
$c== :: GetCostEstimationResponse -> GetCostEstimationResponse -> Bool
Prelude.Eq, ReadPrec [GetCostEstimationResponse]
ReadPrec GetCostEstimationResponse
Int -> ReadS GetCostEstimationResponse
ReadS [GetCostEstimationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCostEstimationResponse]
$creadListPrec :: ReadPrec [GetCostEstimationResponse]
readPrec :: ReadPrec GetCostEstimationResponse
$creadPrec :: ReadPrec GetCostEstimationResponse
readList :: ReadS [GetCostEstimationResponse]
$creadList :: ReadS [GetCostEstimationResponse]
readsPrec :: Int -> ReadS GetCostEstimationResponse
$creadsPrec :: Int -> ReadS GetCostEstimationResponse
Prelude.Read, Int -> GetCostEstimationResponse -> ShowS
[GetCostEstimationResponse] -> ShowS
GetCostEstimationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCostEstimationResponse] -> ShowS
$cshowList :: [GetCostEstimationResponse] -> ShowS
show :: GetCostEstimationResponse -> String
$cshow :: GetCostEstimationResponse -> String
showsPrec :: Int -> GetCostEstimationResponse -> ShowS
$cshowsPrec :: Int -> GetCostEstimationResponse -> ShowS
Prelude.Show, forall x.
Rep GetCostEstimationResponse x -> GetCostEstimationResponse
forall x.
GetCostEstimationResponse -> Rep GetCostEstimationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCostEstimationResponse x -> GetCostEstimationResponse
$cfrom :: forall x.
GetCostEstimationResponse -> Rep GetCostEstimationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCostEstimationResponse' 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:
--
-- 'costs', 'getCostEstimationResponse_costs' - An array of @ResourceCost@ objects that each contains details about the
-- monthly cost estimate to analyze one of your Amazon Web Services
-- resources.
--
-- 'nextToken', 'getCostEstimationResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'resourceCollection', 'getCostEstimationResponse_resourceCollection' - The collection of the Amazon Web Services resources used to create your
-- monthly DevOps Guru cost estimate.
--
-- 'status', 'getCostEstimationResponse_status' - The status of creating this cost estimate. If it\'s still in progress,
-- the status @ONGOING@ is returned. If it is finished, the status
-- @COMPLETED@ is returned.
--
-- 'timeRange', 'getCostEstimationResponse_timeRange' - The start and end time of the cost estimation.
--
-- 'totalCost', 'getCostEstimationResponse_totalCost' - The estimated monthly cost to analyze the Amazon Web Services resources.
-- This value is the sum of the estimated costs to analyze each resource in
-- the @Costs@ object in this response.
--
-- 'httpStatus', 'getCostEstimationResponse_httpStatus' - The response's http status code.
newGetCostEstimationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCostEstimationResponse
newGetCostEstimationResponse :: Int -> GetCostEstimationResponse
newGetCostEstimationResponse Int
pHttpStatus_ =
  GetCostEstimationResponse'
    { $sel:costs:GetCostEstimationResponse' :: Maybe [ServiceResourceCost]
costs = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetCostEstimationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceCollection:GetCostEstimationResponse' :: Maybe CostEstimationResourceCollectionFilter
resourceCollection = forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetCostEstimationResponse' :: Maybe CostEstimationStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:timeRange:GetCostEstimationResponse' :: Maybe CostEstimationTimeRange
timeRange = forall a. Maybe a
Prelude.Nothing,
      $sel:totalCost:GetCostEstimationResponse' :: Maybe Double
totalCost = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCostEstimationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @ResourceCost@ objects that each contains details about the
-- monthly cost estimate to analyze one of your Amazon Web Services
-- resources.
getCostEstimationResponse_costs :: Lens.Lens' GetCostEstimationResponse (Prelude.Maybe [ServiceResourceCost])
getCostEstimationResponse_costs :: Lens' GetCostEstimationResponse (Maybe [ServiceResourceCost])
getCostEstimationResponse_costs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimationResponse' {Maybe [ServiceResourceCost]
costs :: Maybe [ServiceResourceCost]
$sel:costs:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe [ServiceResourceCost]
costs} -> Maybe [ServiceResourceCost]
costs) (\s :: GetCostEstimationResponse
s@GetCostEstimationResponse' {} Maybe [ServiceResourceCost]
a -> GetCostEstimationResponse
s {$sel:costs:GetCostEstimationResponse' :: Maybe [ServiceResourceCost]
costs = Maybe [ServiceResourceCost]
a} :: GetCostEstimationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
getCostEstimationResponse_nextToken :: Lens.Lens' GetCostEstimationResponse (Prelude.Maybe Prelude.Text)
getCostEstimationResponse_nextToken :: Lens' GetCostEstimationResponse (Maybe Text)
getCostEstimationResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCostEstimationResponse
s@GetCostEstimationResponse' {} Maybe Text
a -> GetCostEstimationResponse
s {$sel:nextToken:GetCostEstimationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetCostEstimationResponse)

-- | The collection of the Amazon Web Services resources used to create your
-- monthly DevOps Guru cost estimate.
getCostEstimationResponse_resourceCollection :: Lens.Lens' GetCostEstimationResponse (Prelude.Maybe CostEstimationResourceCollectionFilter)
getCostEstimationResponse_resourceCollection :: Lens'
  GetCostEstimationResponse
  (Maybe CostEstimationResourceCollectionFilter)
getCostEstimationResponse_resourceCollection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimationResponse' {Maybe CostEstimationResourceCollectionFilter
resourceCollection :: Maybe CostEstimationResourceCollectionFilter
$sel:resourceCollection:GetCostEstimationResponse' :: GetCostEstimationResponse
-> Maybe CostEstimationResourceCollectionFilter
resourceCollection} -> Maybe CostEstimationResourceCollectionFilter
resourceCollection) (\s :: GetCostEstimationResponse
s@GetCostEstimationResponse' {} Maybe CostEstimationResourceCollectionFilter
a -> GetCostEstimationResponse
s {$sel:resourceCollection:GetCostEstimationResponse' :: Maybe CostEstimationResourceCollectionFilter
resourceCollection = Maybe CostEstimationResourceCollectionFilter
a} :: GetCostEstimationResponse)

-- | The status of creating this cost estimate. If it\'s still in progress,
-- the status @ONGOING@ is returned. If it is finished, the status
-- @COMPLETED@ is returned.
getCostEstimationResponse_status :: Lens.Lens' GetCostEstimationResponse (Prelude.Maybe CostEstimationStatus)
getCostEstimationResponse_status :: Lens' GetCostEstimationResponse (Maybe CostEstimationStatus)
getCostEstimationResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimationResponse' {Maybe CostEstimationStatus
status :: Maybe CostEstimationStatus
$sel:status:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe CostEstimationStatus
status} -> Maybe CostEstimationStatus
status) (\s :: GetCostEstimationResponse
s@GetCostEstimationResponse' {} Maybe CostEstimationStatus
a -> GetCostEstimationResponse
s {$sel:status:GetCostEstimationResponse' :: Maybe CostEstimationStatus
status = Maybe CostEstimationStatus
a} :: GetCostEstimationResponse)

-- | The start and end time of the cost estimation.
getCostEstimationResponse_timeRange :: Lens.Lens' GetCostEstimationResponse (Prelude.Maybe CostEstimationTimeRange)
getCostEstimationResponse_timeRange :: Lens' GetCostEstimationResponse (Maybe CostEstimationTimeRange)
getCostEstimationResponse_timeRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimationResponse' {Maybe CostEstimationTimeRange
timeRange :: Maybe CostEstimationTimeRange
$sel:timeRange:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe CostEstimationTimeRange
timeRange} -> Maybe CostEstimationTimeRange
timeRange) (\s :: GetCostEstimationResponse
s@GetCostEstimationResponse' {} Maybe CostEstimationTimeRange
a -> GetCostEstimationResponse
s {$sel:timeRange:GetCostEstimationResponse' :: Maybe CostEstimationTimeRange
timeRange = Maybe CostEstimationTimeRange
a} :: GetCostEstimationResponse)

-- | The estimated monthly cost to analyze the Amazon Web Services resources.
-- This value is the sum of the estimated costs to analyze each resource in
-- the @Costs@ object in this response.
getCostEstimationResponse_totalCost :: Lens.Lens' GetCostEstimationResponse (Prelude.Maybe Prelude.Double)
getCostEstimationResponse_totalCost :: Lens' GetCostEstimationResponse (Maybe Double)
getCostEstimationResponse_totalCost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostEstimationResponse' {Maybe Double
totalCost :: Maybe Double
$sel:totalCost:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe Double
totalCost} -> Maybe Double
totalCost) (\s :: GetCostEstimationResponse
s@GetCostEstimationResponse' {} Maybe Double
a -> GetCostEstimationResponse
s {$sel:totalCost:GetCostEstimationResponse' :: Maybe Double
totalCost = Maybe Double
a} :: GetCostEstimationResponse)

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

instance Prelude.NFData GetCostEstimationResponse where
  rnf :: GetCostEstimationResponse -> ()
rnf GetCostEstimationResponse' {Int
Maybe Double
Maybe [ServiceResourceCost]
Maybe Text
Maybe CostEstimationStatus
Maybe CostEstimationTimeRange
Maybe CostEstimationResourceCollectionFilter
httpStatus :: Int
totalCost :: Maybe Double
timeRange :: Maybe CostEstimationTimeRange
status :: Maybe CostEstimationStatus
resourceCollection :: Maybe CostEstimationResourceCollectionFilter
nextToken :: Maybe Text
costs :: Maybe [ServiceResourceCost]
$sel:httpStatus:GetCostEstimationResponse' :: GetCostEstimationResponse -> Int
$sel:totalCost:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe Double
$sel:timeRange:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe CostEstimationTimeRange
$sel:status:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe CostEstimationStatus
$sel:resourceCollection:GetCostEstimationResponse' :: GetCostEstimationResponse
-> Maybe CostEstimationResourceCollectionFilter
$sel:nextToken:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe Text
$sel:costs:GetCostEstimationResponse' :: GetCostEstimationResponse -> Maybe [ServiceResourceCost]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceResourceCost]
costs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CostEstimationResourceCollectionFilter
resourceCollection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CostEstimationStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CostEstimationTimeRange
timeRange
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
totalCost
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus