{-# 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.CostExplorer.Types.CurrentInstance
-- 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)
module Amazonka.CostExplorer.Types.CurrentInstance where

import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types.ResourceDetails
import Amazonka.CostExplorer.Types.ResourceUtilization
import Amazonka.CostExplorer.Types.TagValues
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Context about the current instance.
--
-- /See:/ 'newCurrentInstance' smart constructor.
data CurrentInstance = CurrentInstance'
  { -- | Resource ID of the current instance.
    CurrentInstance -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The currency code that Amazon Web Services used to calculate the costs
    -- for this instance.
    CurrentInstance -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | Utilization information of the current instance during the lookback
    -- period.
    CurrentInstance -> Maybe ResourceUtilization
resourceUtilization :: Prelude.Maybe ResourceUtilization,
    -- | Details about the resource and utilization.
    CurrentInstance -> Maybe ResourceDetails
resourceDetails :: Prelude.Maybe ResourceDetails,
    -- | The total number of hours that the instance ran during the lookback
    -- period.
    CurrentInstance -> Maybe Text
totalRunningHoursInLookbackPeriod :: Prelude.Maybe Prelude.Text,
    -- | The number of hours during the lookback period that\'s covered by
    -- reservations.
    CurrentInstance -> Maybe Text
reservationCoveredHoursInLookbackPeriod :: Prelude.Maybe Prelude.Text,
    -- | The number of hours during the lookback period that\'s billed at
    -- On-Demand rates.
    CurrentInstance -> Maybe Text
onDemandHoursInLookbackPeriod :: Prelude.Maybe Prelude.Text,
    -- | The current On-Demand cost of operating this instance on a monthly
    -- basis.
    CurrentInstance -> Maybe Text
monthlyCost :: Prelude.Maybe Prelude.Text,
    -- | The name that you given an instance. This field shows as blank if you
    -- haven\'t given the instance a name.
    CurrentInstance -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text,
    -- | The number of hours during the lookback period that\'s covered by
    -- Savings Plans.
    CurrentInstance -> Maybe Text
savingsPlansCoveredHoursInLookbackPeriod :: Prelude.Maybe Prelude.Text,
    -- | Cost allocation resource tags that are applied to the instance.
    CurrentInstance -> Maybe [TagValues]
tags :: Prelude.Maybe [TagValues]
  }
  deriving (CurrentInstance -> CurrentInstance -> Bool
(CurrentInstance -> CurrentInstance -> Bool)
-> (CurrentInstance -> CurrentInstance -> Bool)
-> Eq CurrentInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CurrentInstance -> CurrentInstance -> Bool
$c/= :: CurrentInstance -> CurrentInstance -> Bool
== :: CurrentInstance -> CurrentInstance -> Bool
$c== :: CurrentInstance -> CurrentInstance -> Bool
Prelude.Eq, ReadPrec [CurrentInstance]
ReadPrec CurrentInstance
Int -> ReadS CurrentInstance
ReadS [CurrentInstance]
(Int -> ReadS CurrentInstance)
-> ReadS [CurrentInstance]
-> ReadPrec CurrentInstance
-> ReadPrec [CurrentInstance]
-> Read CurrentInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CurrentInstance]
$creadListPrec :: ReadPrec [CurrentInstance]
readPrec :: ReadPrec CurrentInstance
$creadPrec :: ReadPrec CurrentInstance
readList :: ReadS [CurrentInstance]
$creadList :: ReadS [CurrentInstance]
readsPrec :: Int -> ReadS CurrentInstance
$creadsPrec :: Int -> ReadS CurrentInstance
Prelude.Read, Int -> CurrentInstance -> ShowS
[CurrentInstance] -> ShowS
CurrentInstance -> String
(Int -> CurrentInstance -> ShowS)
-> (CurrentInstance -> String)
-> ([CurrentInstance] -> ShowS)
-> Show CurrentInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CurrentInstance] -> ShowS
$cshowList :: [CurrentInstance] -> ShowS
show :: CurrentInstance -> String
$cshow :: CurrentInstance -> String
showsPrec :: Int -> CurrentInstance -> ShowS
$cshowsPrec :: Int -> CurrentInstance -> ShowS
Prelude.Show, (forall x. CurrentInstance -> Rep CurrentInstance x)
-> (forall x. Rep CurrentInstance x -> CurrentInstance)
-> Generic CurrentInstance
forall x. Rep CurrentInstance x -> CurrentInstance
forall x. CurrentInstance -> Rep CurrentInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CurrentInstance x -> CurrentInstance
$cfrom :: forall x. CurrentInstance -> Rep CurrentInstance x
Prelude.Generic)

-- |
-- Create a value of 'CurrentInstance' 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:
--
-- 'resourceId', 'currentInstance_resourceId' - Resource ID of the current instance.
--
-- 'currencyCode', 'currentInstance_currencyCode' - The currency code that Amazon Web Services used to calculate the costs
-- for this instance.
--
-- 'resourceUtilization', 'currentInstance_resourceUtilization' - Utilization information of the current instance during the lookback
-- period.
--
-- 'resourceDetails', 'currentInstance_resourceDetails' - Details about the resource and utilization.
--
-- 'totalRunningHoursInLookbackPeriod', 'currentInstance_totalRunningHoursInLookbackPeriod' - The total number of hours that the instance ran during the lookback
-- period.
--
-- 'reservationCoveredHoursInLookbackPeriod', 'currentInstance_reservationCoveredHoursInLookbackPeriod' - The number of hours during the lookback period that\'s covered by
-- reservations.
--
-- 'onDemandHoursInLookbackPeriod', 'currentInstance_onDemandHoursInLookbackPeriod' - The number of hours during the lookback period that\'s billed at
-- On-Demand rates.
--
-- 'monthlyCost', 'currentInstance_monthlyCost' - The current On-Demand cost of operating this instance on a monthly
-- basis.
--
-- 'instanceName', 'currentInstance_instanceName' - The name that you given an instance. This field shows as blank if you
-- haven\'t given the instance a name.
--
-- 'savingsPlansCoveredHoursInLookbackPeriod', 'currentInstance_savingsPlansCoveredHoursInLookbackPeriod' - The number of hours during the lookback period that\'s covered by
-- Savings Plans.
--
-- 'tags', 'currentInstance_tags' - Cost allocation resource tags that are applied to the instance.
newCurrentInstance ::
  CurrentInstance
newCurrentInstance :: CurrentInstance
newCurrentInstance =
  CurrentInstance' :: Maybe Text
-> Maybe Text
-> Maybe ResourceUtilization
-> Maybe ResourceDetails
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [TagValues]
-> CurrentInstance
CurrentInstance'
    { $sel:resourceId:CurrentInstance' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currencyCode:CurrentInstance' :: Maybe Text
currencyCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceUtilization:CurrentInstance' :: Maybe ResourceUtilization
resourceUtilization = Maybe ResourceUtilization
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceDetails:CurrentInstance' :: Maybe ResourceDetails
resourceDetails = Maybe ResourceDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:totalRunningHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
totalRunningHoursInLookbackPeriod = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reservationCoveredHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
reservationCoveredHoursInLookbackPeriod =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:onDemandHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
onDemandHoursInLookbackPeriod = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:monthlyCost:CurrentInstance' :: Maybe Text
monthlyCost = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceName:CurrentInstance' :: Maybe Text
instanceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlansCoveredHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
savingsPlansCoveredHoursInLookbackPeriod =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CurrentInstance' :: Maybe [TagValues]
tags = Maybe [TagValues]
forall a. Maybe a
Prelude.Nothing
    }

-- | Resource ID of the current instance.
currentInstance_resourceId :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_resourceId :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_resourceId = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:CurrentInstance' :: CurrentInstance -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:resourceId:CurrentInstance' :: Maybe Text
resourceId = Maybe Text
a} :: CurrentInstance)

-- | The currency code that Amazon Web Services used to calculate the costs
-- for this instance.
currentInstance_currencyCode :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_currencyCode :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_currencyCode = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
currencyCode :: Maybe Text
$sel:currencyCode:CurrentInstance' :: CurrentInstance -> Maybe Text
currencyCode} -> Maybe Text
currencyCode) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:currencyCode:CurrentInstance' :: Maybe Text
currencyCode = Maybe Text
a} :: CurrentInstance)

-- | Utilization information of the current instance during the lookback
-- period.
currentInstance_resourceUtilization :: Lens.Lens' CurrentInstance (Prelude.Maybe ResourceUtilization)
currentInstance_resourceUtilization :: (Maybe ResourceUtilization -> f (Maybe ResourceUtilization))
-> CurrentInstance -> f CurrentInstance
currentInstance_resourceUtilization = (CurrentInstance -> Maybe ResourceUtilization)
-> (CurrentInstance
    -> Maybe ResourceUtilization -> CurrentInstance)
-> Lens
     CurrentInstance
     CurrentInstance
     (Maybe ResourceUtilization)
     (Maybe ResourceUtilization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe ResourceUtilization
resourceUtilization :: Maybe ResourceUtilization
$sel:resourceUtilization:CurrentInstance' :: CurrentInstance -> Maybe ResourceUtilization
resourceUtilization} -> Maybe ResourceUtilization
resourceUtilization) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe ResourceUtilization
a -> CurrentInstance
s {$sel:resourceUtilization:CurrentInstance' :: Maybe ResourceUtilization
resourceUtilization = Maybe ResourceUtilization
a} :: CurrentInstance)

-- | Details about the resource and utilization.
currentInstance_resourceDetails :: Lens.Lens' CurrentInstance (Prelude.Maybe ResourceDetails)
currentInstance_resourceDetails :: (Maybe ResourceDetails -> f (Maybe ResourceDetails))
-> CurrentInstance -> f CurrentInstance
currentInstance_resourceDetails = (CurrentInstance -> Maybe ResourceDetails)
-> (CurrentInstance -> Maybe ResourceDetails -> CurrentInstance)
-> Lens
     CurrentInstance
     CurrentInstance
     (Maybe ResourceDetails)
     (Maybe ResourceDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe ResourceDetails
resourceDetails :: Maybe ResourceDetails
$sel:resourceDetails:CurrentInstance' :: CurrentInstance -> Maybe ResourceDetails
resourceDetails} -> Maybe ResourceDetails
resourceDetails) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe ResourceDetails
a -> CurrentInstance
s {$sel:resourceDetails:CurrentInstance' :: Maybe ResourceDetails
resourceDetails = Maybe ResourceDetails
a} :: CurrentInstance)

-- | The total number of hours that the instance ran during the lookback
-- period.
currentInstance_totalRunningHoursInLookbackPeriod :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_totalRunningHoursInLookbackPeriod :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_totalRunningHoursInLookbackPeriod = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
totalRunningHoursInLookbackPeriod :: Maybe Text
$sel:totalRunningHoursInLookbackPeriod:CurrentInstance' :: CurrentInstance -> Maybe Text
totalRunningHoursInLookbackPeriod} -> Maybe Text
totalRunningHoursInLookbackPeriod) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:totalRunningHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
totalRunningHoursInLookbackPeriod = Maybe Text
a} :: CurrentInstance)

-- | The number of hours during the lookback period that\'s covered by
-- reservations.
currentInstance_reservationCoveredHoursInLookbackPeriod :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_reservationCoveredHoursInLookbackPeriod :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_reservationCoveredHoursInLookbackPeriod = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
reservationCoveredHoursInLookbackPeriod :: Maybe Text
$sel:reservationCoveredHoursInLookbackPeriod:CurrentInstance' :: CurrentInstance -> Maybe Text
reservationCoveredHoursInLookbackPeriod} -> Maybe Text
reservationCoveredHoursInLookbackPeriod) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:reservationCoveredHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
reservationCoveredHoursInLookbackPeriod = Maybe Text
a} :: CurrentInstance)

-- | The number of hours during the lookback period that\'s billed at
-- On-Demand rates.
currentInstance_onDemandHoursInLookbackPeriod :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_onDemandHoursInLookbackPeriod :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_onDemandHoursInLookbackPeriod = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
onDemandHoursInLookbackPeriod :: Maybe Text
$sel:onDemandHoursInLookbackPeriod:CurrentInstance' :: CurrentInstance -> Maybe Text
onDemandHoursInLookbackPeriod} -> Maybe Text
onDemandHoursInLookbackPeriod) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:onDemandHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
onDemandHoursInLookbackPeriod = Maybe Text
a} :: CurrentInstance)

-- | The current On-Demand cost of operating this instance on a monthly
-- basis.
currentInstance_monthlyCost :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_monthlyCost :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_monthlyCost = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
monthlyCost :: Maybe Text
$sel:monthlyCost:CurrentInstance' :: CurrentInstance -> Maybe Text
monthlyCost} -> Maybe Text
monthlyCost) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:monthlyCost:CurrentInstance' :: Maybe Text
monthlyCost = Maybe Text
a} :: CurrentInstance)

-- | The name that you given an instance. This field shows as blank if you
-- haven\'t given the instance a name.
currentInstance_instanceName :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_instanceName :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_instanceName = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
instanceName :: Maybe Text
$sel:instanceName:CurrentInstance' :: CurrentInstance -> Maybe Text
instanceName} -> Maybe Text
instanceName) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:instanceName:CurrentInstance' :: Maybe Text
instanceName = Maybe Text
a} :: CurrentInstance)

-- | The number of hours during the lookback period that\'s covered by
-- Savings Plans.
currentInstance_savingsPlansCoveredHoursInLookbackPeriod :: Lens.Lens' CurrentInstance (Prelude.Maybe Prelude.Text)
currentInstance_savingsPlansCoveredHoursInLookbackPeriod :: (Maybe Text -> f (Maybe Text))
-> CurrentInstance -> f CurrentInstance
currentInstance_savingsPlansCoveredHoursInLookbackPeriod = (CurrentInstance -> Maybe Text)
-> (CurrentInstance -> Maybe Text -> CurrentInstance)
-> Lens CurrentInstance CurrentInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe Text
savingsPlansCoveredHoursInLookbackPeriod :: Maybe Text
$sel:savingsPlansCoveredHoursInLookbackPeriod:CurrentInstance' :: CurrentInstance -> Maybe Text
savingsPlansCoveredHoursInLookbackPeriod} -> Maybe Text
savingsPlansCoveredHoursInLookbackPeriod) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe Text
a -> CurrentInstance
s {$sel:savingsPlansCoveredHoursInLookbackPeriod:CurrentInstance' :: Maybe Text
savingsPlansCoveredHoursInLookbackPeriod = Maybe Text
a} :: CurrentInstance)

-- | Cost allocation resource tags that are applied to the instance.
currentInstance_tags :: Lens.Lens' CurrentInstance (Prelude.Maybe [TagValues])
currentInstance_tags :: (Maybe [TagValues] -> f (Maybe [TagValues]))
-> CurrentInstance -> f CurrentInstance
currentInstance_tags = (CurrentInstance -> Maybe [TagValues])
-> (CurrentInstance -> Maybe [TagValues] -> CurrentInstance)
-> Lens
     CurrentInstance
     CurrentInstance
     (Maybe [TagValues])
     (Maybe [TagValues])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentInstance' {Maybe [TagValues]
tags :: Maybe [TagValues]
$sel:tags:CurrentInstance' :: CurrentInstance -> Maybe [TagValues]
tags} -> Maybe [TagValues]
tags) (\s :: CurrentInstance
s@CurrentInstance' {} Maybe [TagValues]
a -> CurrentInstance
s {$sel:tags:CurrentInstance' :: Maybe [TagValues]
tags = Maybe [TagValues]
a} :: CurrentInstance) ((Maybe [TagValues] -> f (Maybe [TagValues]))
 -> CurrentInstance -> f CurrentInstance)
-> ((Maybe [TagValues] -> f (Maybe [TagValues]))
    -> Maybe [TagValues] -> f (Maybe [TagValues]))
-> (Maybe [TagValues] -> f (Maybe [TagValues]))
-> CurrentInstance
-> f CurrentInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TagValues] [TagValues] [TagValues] [TagValues]
-> Iso
     (Maybe [TagValues])
     (Maybe [TagValues])
     (Maybe [TagValues])
     (Maybe [TagValues])
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 AnIso [TagValues] [TagValues] [TagValues] [TagValues]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON CurrentInstance where
  parseJSON :: Value -> Parser CurrentInstance
parseJSON =
    String
-> (Object -> Parser CurrentInstance)
-> Value
-> Parser CurrentInstance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CurrentInstance"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ResourceUtilization
-> Maybe ResourceDetails
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [TagValues]
-> CurrentInstance
CurrentInstance'
            (Maybe Text
 -> Maybe Text
 -> Maybe ResourceUtilization
 -> Maybe ResourceDetails
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [TagValues]
 -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ResourceUtilization
      -> Maybe ResourceDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceId")
            Parser
  (Maybe Text
   -> Maybe ResourceUtilization
   -> Maybe ResourceDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourceUtilization
      -> Maybe ResourceDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrencyCode")
            Parser
  (Maybe ResourceUtilization
   -> Maybe ResourceDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe ResourceUtilization)
-> Parser
     (Maybe ResourceDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceUtilization)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceUtilization")
            Parser
  (Maybe ResourceDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe ResourceDetails)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceDetails")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TotalRunningHoursInLookbackPeriod")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReservationCoveredHoursInLookbackPeriod"
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [TagValues]
      -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OnDemandHoursInLookbackPeriod")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [TagValues]
   -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe [TagValues] -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MonthlyCost")
            Parser
  (Maybe Text -> Maybe Text -> Maybe [TagValues] -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [TagValues] -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceName")
            Parser (Maybe Text -> Maybe [TagValues] -> CurrentInstance)
-> Parser (Maybe Text)
-> Parser (Maybe [TagValues] -> CurrentInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SavingsPlansCoveredHoursInLookbackPeriod"
                        )
            Parser (Maybe [TagValues] -> CurrentInstance)
-> Parser (Maybe [TagValues]) -> Parser CurrentInstance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [TagValues]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [TagValues]))
-> Maybe [TagValues] -> Parser (Maybe [TagValues])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [TagValues]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable CurrentInstance

instance Prelude.NFData CurrentInstance