{-# 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.IoT.Types.BillingGroupProperties
-- 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.IoT.Types.BillingGroupProperties 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 properties of a billing group.
--
-- /See:/ 'newBillingGroupProperties' smart constructor.
data BillingGroupProperties = BillingGroupProperties'
  { -- | The description of the billing group.
    BillingGroupProperties -> Maybe Text
billingGroupDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (BillingGroupProperties -> BillingGroupProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BillingGroupProperties -> BillingGroupProperties -> Bool
$c/= :: BillingGroupProperties -> BillingGroupProperties -> Bool
== :: BillingGroupProperties -> BillingGroupProperties -> Bool
$c== :: BillingGroupProperties -> BillingGroupProperties -> Bool
Prelude.Eq, ReadPrec [BillingGroupProperties]
ReadPrec BillingGroupProperties
Int -> ReadS BillingGroupProperties
ReadS [BillingGroupProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BillingGroupProperties]
$creadListPrec :: ReadPrec [BillingGroupProperties]
readPrec :: ReadPrec BillingGroupProperties
$creadPrec :: ReadPrec BillingGroupProperties
readList :: ReadS [BillingGroupProperties]
$creadList :: ReadS [BillingGroupProperties]
readsPrec :: Int -> ReadS BillingGroupProperties
$creadsPrec :: Int -> ReadS BillingGroupProperties
Prelude.Read, Int -> BillingGroupProperties -> ShowS
[BillingGroupProperties] -> ShowS
BillingGroupProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BillingGroupProperties] -> ShowS
$cshowList :: [BillingGroupProperties] -> ShowS
show :: BillingGroupProperties -> String
$cshow :: BillingGroupProperties -> String
showsPrec :: Int -> BillingGroupProperties -> ShowS
$cshowsPrec :: Int -> BillingGroupProperties -> ShowS
Prelude.Show, forall x. Rep BillingGroupProperties x -> BillingGroupProperties
forall x. BillingGroupProperties -> Rep BillingGroupProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BillingGroupProperties x -> BillingGroupProperties
$cfrom :: forall x. BillingGroupProperties -> Rep BillingGroupProperties x
Prelude.Generic)

-- |
-- Create a value of 'BillingGroupProperties' 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:
--
-- 'billingGroupDescription', 'billingGroupProperties_billingGroupDescription' - The description of the billing group.
newBillingGroupProperties ::
  BillingGroupProperties
newBillingGroupProperties :: BillingGroupProperties
newBillingGroupProperties =
  BillingGroupProperties'
    { $sel:billingGroupDescription:BillingGroupProperties' :: Maybe Text
billingGroupDescription =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the billing group.
billingGroupProperties_billingGroupDescription :: Lens.Lens' BillingGroupProperties (Prelude.Maybe Prelude.Text)
billingGroupProperties_billingGroupDescription :: Lens' BillingGroupProperties (Maybe Text)
billingGroupProperties_billingGroupDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupProperties' {Maybe Text
billingGroupDescription :: Maybe Text
$sel:billingGroupDescription:BillingGroupProperties' :: BillingGroupProperties -> Maybe Text
billingGroupDescription} -> Maybe Text
billingGroupDescription) (\s :: BillingGroupProperties
s@BillingGroupProperties' {} Maybe Text
a -> BillingGroupProperties
s {$sel:billingGroupDescription:BillingGroupProperties' :: Maybe Text
billingGroupDescription = Maybe Text
a} :: BillingGroupProperties)

instance Data.FromJSON BillingGroupProperties where
  parseJSON :: Value -> Parser BillingGroupProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BillingGroupProperties"
      ( \Object
x ->
          Maybe Text -> BillingGroupProperties
BillingGroupProperties'
            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
"billingGroupDescription")
      )

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

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

instance Data.ToJSON BillingGroupProperties where
  toJSON :: BillingGroupProperties -> Value
toJSON BillingGroupProperties' {Maybe Text
billingGroupDescription :: Maybe Text
$sel:billingGroupDescription:BillingGroupProperties' :: BillingGroupProperties -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"billingGroupDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
billingGroupDescription
          ]
      )