{-# 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.ListBillingGroupsFilter
-- 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.ListBillingGroupsFilter 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 filter that specifies the billing groups and pricing plans to
-- retrieve billing group information.
--
-- /See:/ 'newListBillingGroupsFilter' smart constructor.
data ListBillingGroupsFilter = ListBillingGroupsFilter'
  { -- | The list of billing group Amazon Resource Names (ARNs) to retrieve
    -- information.
    ListBillingGroupsFilter -> Maybe (NonEmpty Text)
arns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The pricing plan Amazon Resource Names (ARNs) to retrieve information.
    ListBillingGroupsFilter -> Maybe Text
pricingPlan :: Prelude.Maybe Prelude.Text
  }
  deriving (ListBillingGroupsFilter -> ListBillingGroupsFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBillingGroupsFilter -> ListBillingGroupsFilter -> Bool
$c/= :: ListBillingGroupsFilter -> ListBillingGroupsFilter -> Bool
== :: ListBillingGroupsFilter -> ListBillingGroupsFilter -> Bool
$c== :: ListBillingGroupsFilter -> ListBillingGroupsFilter -> Bool
Prelude.Eq, ReadPrec [ListBillingGroupsFilter]
ReadPrec ListBillingGroupsFilter
Int -> ReadS ListBillingGroupsFilter
ReadS [ListBillingGroupsFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBillingGroupsFilter]
$creadListPrec :: ReadPrec [ListBillingGroupsFilter]
readPrec :: ReadPrec ListBillingGroupsFilter
$creadPrec :: ReadPrec ListBillingGroupsFilter
readList :: ReadS [ListBillingGroupsFilter]
$creadList :: ReadS [ListBillingGroupsFilter]
readsPrec :: Int -> ReadS ListBillingGroupsFilter
$creadsPrec :: Int -> ReadS ListBillingGroupsFilter
Prelude.Read, Int -> ListBillingGroupsFilter -> ShowS
[ListBillingGroupsFilter] -> ShowS
ListBillingGroupsFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBillingGroupsFilter] -> ShowS
$cshowList :: [ListBillingGroupsFilter] -> ShowS
show :: ListBillingGroupsFilter -> String
$cshow :: ListBillingGroupsFilter -> String
showsPrec :: Int -> ListBillingGroupsFilter -> ShowS
$cshowsPrec :: Int -> ListBillingGroupsFilter -> ShowS
Prelude.Show, forall x. Rep ListBillingGroupsFilter x -> ListBillingGroupsFilter
forall x. ListBillingGroupsFilter -> Rep ListBillingGroupsFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBillingGroupsFilter x -> ListBillingGroupsFilter
$cfrom :: forall x. ListBillingGroupsFilter -> Rep ListBillingGroupsFilter x
Prelude.Generic)

-- |
-- Create a value of 'ListBillingGroupsFilter' 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:
--
-- 'arns', 'listBillingGroupsFilter_arns' - The list of billing group Amazon Resource Names (ARNs) to retrieve
-- information.
--
-- 'pricingPlan', 'listBillingGroupsFilter_pricingPlan' - The pricing plan Amazon Resource Names (ARNs) to retrieve information.
newListBillingGroupsFilter ::
  ListBillingGroupsFilter
newListBillingGroupsFilter :: ListBillingGroupsFilter
newListBillingGroupsFilter =
  ListBillingGroupsFilter'
    { $sel:arns:ListBillingGroupsFilter' :: Maybe (NonEmpty Text)
arns = forall a. Maybe a
Prelude.Nothing,
      $sel:pricingPlan:ListBillingGroupsFilter' :: Maybe Text
pricingPlan = forall a. Maybe a
Prelude.Nothing
    }

-- | The list of billing group Amazon Resource Names (ARNs) to retrieve
-- information.
listBillingGroupsFilter_arns :: Lens.Lens' ListBillingGroupsFilter (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listBillingGroupsFilter_arns :: Lens' ListBillingGroupsFilter (Maybe (NonEmpty Text))
listBillingGroupsFilter_arns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupsFilter' {Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:arns:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe (NonEmpty Text)
arns} -> Maybe (NonEmpty Text)
arns) (\s :: ListBillingGroupsFilter
s@ListBillingGroupsFilter' {} Maybe (NonEmpty Text)
a -> ListBillingGroupsFilter
s {$sel:arns:ListBillingGroupsFilter' :: Maybe (NonEmpty Text)
arns = Maybe (NonEmpty Text)
a} :: ListBillingGroupsFilter) 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 pricing plan Amazon Resource Names (ARNs) to retrieve information.
listBillingGroupsFilter_pricingPlan :: Lens.Lens' ListBillingGroupsFilter (Prelude.Maybe Prelude.Text)
listBillingGroupsFilter_pricingPlan :: Lens' ListBillingGroupsFilter (Maybe Text)
listBillingGroupsFilter_pricingPlan = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupsFilter' {Maybe Text
pricingPlan :: Maybe Text
$sel:pricingPlan:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe Text
pricingPlan} -> Maybe Text
pricingPlan) (\s :: ListBillingGroupsFilter
s@ListBillingGroupsFilter' {} Maybe Text
a -> ListBillingGroupsFilter
s {$sel:pricingPlan:ListBillingGroupsFilter' :: Maybe Text
pricingPlan = Maybe Text
a} :: ListBillingGroupsFilter)

instance Prelude.Hashable ListBillingGroupsFilter where
  hashWithSalt :: Int -> ListBillingGroupsFilter -> Int
hashWithSalt Int
_salt ListBillingGroupsFilter' {Maybe (NonEmpty Text)
Maybe Text
pricingPlan :: Maybe Text
arns :: Maybe (NonEmpty Text)
$sel:pricingPlan:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe Text
$sel:arns:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe (NonEmpty Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
arns
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pricingPlan

instance Prelude.NFData ListBillingGroupsFilter where
  rnf :: ListBillingGroupsFilter -> ()
rnf ListBillingGroupsFilter' {Maybe (NonEmpty Text)
Maybe Text
pricingPlan :: Maybe Text
arns :: Maybe (NonEmpty Text)
$sel:pricingPlan:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe Text
$sel:arns:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
arns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pricingPlan

instance Data.ToJSON ListBillingGroupsFilter where
  toJSON :: ListBillingGroupsFilter -> Value
toJSON ListBillingGroupsFilter' {Maybe (NonEmpty Text)
Maybe Text
pricingPlan :: Maybe Text
arns :: Maybe (NonEmpty Text)
$sel:pricingPlan:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe Text
$sel:arns:ListBillingGroupsFilter' :: ListBillingGroupsFilter -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Arns" 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 (NonEmpty Text)
arns,
            (Key
"PricingPlan" 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
pricingPlan
          ]
      )