{-# 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.BillingConductor.Types.FreeTierConfig
-- 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.BillingConductor.Types.FreeTierConfig 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

-- | The possible Amazon Web Services Free Tier configurations.
--
-- /See:/ 'newFreeTierConfig' smart constructor.
data FreeTierConfig = FreeTierConfig'
  { -- | Activate or deactivate Amazon Web Services Free Tier application.
    FreeTierConfig -> Bool
activated :: Prelude.Bool
  }
  deriving (FreeTierConfig -> FreeTierConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FreeTierConfig -> FreeTierConfig -> Bool
$c/= :: FreeTierConfig -> FreeTierConfig -> Bool
== :: FreeTierConfig -> FreeTierConfig -> Bool
$c== :: FreeTierConfig -> FreeTierConfig -> Bool
Prelude.Eq, ReadPrec [FreeTierConfig]
ReadPrec FreeTierConfig
Int -> ReadS FreeTierConfig
ReadS [FreeTierConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FreeTierConfig]
$creadListPrec :: ReadPrec [FreeTierConfig]
readPrec :: ReadPrec FreeTierConfig
$creadPrec :: ReadPrec FreeTierConfig
readList :: ReadS [FreeTierConfig]
$creadList :: ReadS [FreeTierConfig]
readsPrec :: Int -> ReadS FreeTierConfig
$creadsPrec :: Int -> ReadS FreeTierConfig
Prelude.Read, Int -> FreeTierConfig -> ShowS
[FreeTierConfig] -> ShowS
FreeTierConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FreeTierConfig] -> ShowS
$cshowList :: [FreeTierConfig] -> ShowS
show :: FreeTierConfig -> String
$cshow :: FreeTierConfig -> String
showsPrec :: Int -> FreeTierConfig -> ShowS
$cshowsPrec :: Int -> FreeTierConfig -> ShowS
Prelude.Show, forall x. Rep FreeTierConfig x -> FreeTierConfig
forall x. FreeTierConfig -> Rep FreeTierConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FreeTierConfig x -> FreeTierConfig
$cfrom :: forall x. FreeTierConfig -> Rep FreeTierConfig x
Prelude.Generic)

-- |
-- Create a value of 'FreeTierConfig' 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:
--
-- 'activated', 'freeTierConfig_activated' - Activate or deactivate Amazon Web Services Free Tier application.
newFreeTierConfig ::
  -- | 'activated'
  Prelude.Bool ->
  FreeTierConfig
newFreeTierConfig :: Bool -> FreeTierConfig
newFreeTierConfig Bool
pActivated_ =
  FreeTierConfig' {$sel:activated:FreeTierConfig' :: Bool
activated = Bool
pActivated_}

-- | Activate or deactivate Amazon Web Services Free Tier application.
freeTierConfig_activated :: Lens.Lens' FreeTierConfig Prelude.Bool
freeTierConfig_activated :: Lens' FreeTierConfig Bool
freeTierConfig_activated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FreeTierConfig' {Bool
activated :: Bool
$sel:activated:FreeTierConfig' :: FreeTierConfig -> Bool
activated} -> Bool
activated) (\s :: FreeTierConfig
s@FreeTierConfig' {} Bool
a -> FreeTierConfig
s {$sel:activated:FreeTierConfig' :: Bool
activated = Bool
a} :: FreeTierConfig)

instance Data.FromJSON FreeTierConfig where
  parseJSON :: Value -> Parser FreeTierConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FreeTierConfig"
      ( \Object
x ->
          Bool -> FreeTierConfig
FreeTierConfig' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Activated")
      )

instance Prelude.Hashable FreeTierConfig where
  hashWithSalt :: Int -> FreeTierConfig -> Int
hashWithSalt Int
_salt FreeTierConfig' {Bool
activated :: Bool
$sel:activated:FreeTierConfig' :: FreeTierConfig -> Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
activated

instance Prelude.NFData FreeTierConfig where
  rnf :: FreeTierConfig -> ()
rnf FreeTierConfig' {Bool
activated :: Bool
$sel:activated:FreeTierConfig' :: FreeTierConfig -> Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Bool
activated