{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.StepFunctions.Types.BillingDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.StepFunctions.Types.BillingDetails where

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

-- | An object that describes workflow billing details.
--
-- /See:/ 'newBillingDetails' smart constructor.
data BillingDetails = BillingDetails'
  { -- | Billed duration of your workflow, in milliseconds.
    BillingDetails -> Maybe Natural
billedDurationInMilliseconds :: Prelude.Maybe Prelude.Natural,
    -- | Billed memory consumption of your workflow, in MB.
    BillingDetails -> Maybe Natural
billedMemoryUsedInMB :: Prelude.Maybe Prelude.Natural
  }
  deriving (BillingDetails -> BillingDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BillingDetails -> BillingDetails -> Bool
$c/= :: BillingDetails -> BillingDetails -> Bool
== :: BillingDetails -> BillingDetails -> Bool
$c== :: BillingDetails -> BillingDetails -> Bool
Prelude.Eq, ReadPrec [BillingDetails]
ReadPrec BillingDetails
Int -> ReadS BillingDetails
ReadS [BillingDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BillingDetails]
$creadListPrec :: ReadPrec [BillingDetails]
readPrec :: ReadPrec BillingDetails
$creadPrec :: ReadPrec BillingDetails
readList :: ReadS [BillingDetails]
$creadList :: ReadS [BillingDetails]
readsPrec :: Int -> ReadS BillingDetails
$creadsPrec :: Int -> ReadS BillingDetails
Prelude.Read, Int -> BillingDetails -> ShowS
[BillingDetails] -> ShowS
BillingDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BillingDetails] -> ShowS
$cshowList :: [BillingDetails] -> ShowS
show :: BillingDetails -> String
$cshow :: BillingDetails -> String
showsPrec :: Int -> BillingDetails -> ShowS
$cshowsPrec :: Int -> BillingDetails -> ShowS
Prelude.Show, forall x. Rep BillingDetails x -> BillingDetails
forall x. BillingDetails -> Rep BillingDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BillingDetails x -> BillingDetails
$cfrom :: forall x. BillingDetails -> Rep BillingDetails x
Prelude.Generic)

-- |
-- Create a value of 'BillingDetails' 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:
--
-- 'billedDurationInMilliseconds', 'billingDetails_billedDurationInMilliseconds' - Billed duration of your workflow, in milliseconds.
--
-- 'billedMemoryUsedInMB', 'billingDetails_billedMemoryUsedInMB' - Billed memory consumption of your workflow, in MB.
newBillingDetails ::
  BillingDetails
newBillingDetails :: BillingDetails
newBillingDetails =
  BillingDetails'
    { $sel:billedDurationInMilliseconds:BillingDetails' :: Maybe Natural
billedDurationInMilliseconds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:billedMemoryUsedInMB:BillingDetails' :: Maybe Natural
billedMemoryUsedInMB = forall a. Maybe a
Prelude.Nothing
    }

-- | Billed duration of your workflow, in milliseconds.
billingDetails_billedDurationInMilliseconds :: Lens.Lens' BillingDetails (Prelude.Maybe Prelude.Natural)
billingDetails_billedDurationInMilliseconds :: Lens' BillingDetails (Maybe Natural)
billingDetails_billedDurationInMilliseconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingDetails' {Maybe Natural
billedDurationInMilliseconds :: Maybe Natural
$sel:billedDurationInMilliseconds:BillingDetails' :: BillingDetails -> Maybe Natural
billedDurationInMilliseconds} -> Maybe Natural
billedDurationInMilliseconds) (\s :: BillingDetails
s@BillingDetails' {} Maybe Natural
a -> BillingDetails
s {$sel:billedDurationInMilliseconds:BillingDetails' :: Maybe Natural
billedDurationInMilliseconds = Maybe Natural
a} :: BillingDetails)

-- | Billed memory consumption of your workflow, in MB.
billingDetails_billedMemoryUsedInMB :: Lens.Lens' BillingDetails (Prelude.Maybe Prelude.Natural)
billingDetails_billedMemoryUsedInMB :: Lens' BillingDetails (Maybe Natural)
billingDetails_billedMemoryUsedInMB = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingDetails' {Maybe Natural
billedMemoryUsedInMB :: Maybe Natural
$sel:billedMemoryUsedInMB:BillingDetails' :: BillingDetails -> Maybe Natural
billedMemoryUsedInMB} -> Maybe Natural
billedMemoryUsedInMB) (\s :: BillingDetails
s@BillingDetails' {} Maybe Natural
a -> BillingDetails
s {$sel:billedMemoryUsedInMB:BillingDetails' :: Maybe Natural
billedMemoryUsedInMB = Maybe Natural
a} :: BillingDetails)

instance Data.FromJSON BillingDetails where
  parseJSON :: Value -> Parser BillingDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BillingDetails"
      ( \Object
x ->
          Maybe Natural -> Maybe Natural -> BillingDetails
BillingDetails'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"billedDurationInMilliseconds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"billedMemoryUsedInMB")
      )

instance Prelude.Hashable BillingDetails where
  hashWithSalt :: Int -> BillingDetails -> Int
hashWithSalt Int
_salt BillingDetails' {Maybe Natural
billedMemoryUsedInMB :: Maybe Natural
billedDurationInMilliseconds :: Maybe Natural
$sel:billedMemoryUsedInMB:BillingDetails' :: BillingDetails -> Maybe Natural
$sel:billedDurationInMilliseconds:BillingDetails' :: BillingDetails -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
billedDurationInMilliseconds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
billedMemoryUsedInMB

instance Prelude.NFData BillingDetails where
  rnf :: BillingDetails -> ()
rnf BillingDetails' {Maybe Natural
billedMemoryUsedInMB :: Maybe Natural
billedDurationInMilliseconds :: Maybe Natural
$sel:billedMemoryUsedInMB:BillingDetails' :: BillingDetails -> Maybe Natural
$sel:billedDurationInMilliseconds:BillingDetails' :: BillingDetails -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
billedDurationInMilliseconds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
billedMemoryUsedInMB