{-# 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.ListBillingGroupCostReportsFilter
-- 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.ListBillingGroupCostReportsFilter 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 used to retrieve specific @BillingGroupCostReportElements@.
--
-- /See:/ 'newListBillingGroupCostReportsFilter' smart constructor.
data ListBillingGroupCostReportsFilter = ListBillingGroupCostReportsFilter'
  { -- | The list of Amazon Resource Names (ARNs) used to filter billing groups
    -- to retrieve reports.
    ListBillingGroupCostReportsFilter -> Maybe (NonEmpty Text)
billingGroupArns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (ListBillingGroupCostReportsFilter
-> ListBillingGroupCostReportsFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBillingGroupCostReportsFilter
-> ListBillingGroupCostReportsFilter -> Bool
$c/= :: ListBillingGroupCostReportsFilter
-> ListBillingGroupCostReportsFilter -> Bool
== :: ListBillingGroupCostReportsFilter
-> ListBillingGroupCostReportsFilter -> Bool
$c== :: ListBillingGroupCostReportsFilter
-> ListBillingGroupCostReportsFilter -> Bool
Prelude.Eq, ReadPrec [ListBillingGroupCostReportsFilter]
ReadPrec ListBillingGroupCostReportsFilter
Int -> ReadS ListBillingGroupCostReportsFilter
ReadS [ListBillingGroupCostReportsFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBillingGroupCostReportsFilter]
$creadListPrec :: ReadPrec [ListBillingGroupCostReportsFilter]
readPrec :: ReadPrec ListBillingGroupCostReportsFilter
$creadPrec :: ReadPrec ListBillingGroupCostReportsFilter
readList :: ReadS [ListBillingGroupCostReportsFilter]
$creadList :: ReadS [ListBillingGroupCostReportsFilter]
readsPrec :: Int -> ReadS ListBillingGroupCostReportsFilter
$creadsPrec :: Int -> ReadS ListBillingGroupCostReportsFilter
Prelude.Read, Int -> ListBillingGroupCostReportsFilter -> ShowS
[ListBillingGroupCostReportsFilter] -> ShowS
ListBillingGroupCostReportsFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBillingGroupCostReportsFilter] -> ShowS
$cshowList :: [ListBillingGroupCostReportsFilter] -> ShowS
show :: ListBillingGroupCostReportsFilter -> String
$cshow :: ListBillingGroupCostReportsFilter -> String
showsPrec :: Int -> ListBillingGroupCostReportsFilter -> ShowS
$cshowsPrec :: Int -> ListBillingGroupCostReportsFilter -> ShowS
Prelude.Show, forall x.
Rep ListBillingGroupCostReportsFilter x
-> ListBillingGroupCostReportsFilter
forall x.
ListBillingGroupCostReportsFilter
-> Rep ListBillingGroupCostReportsFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBillingGroupCostReportsFilter x
-> ListBillingGroupCostReportsFilter
$cfrom :: forall x.
ListBillingGroupCostReportsFilter
-> Rep ListBillingGroupCostReportsFilter x
Prelude.Generic)

-- |
-- Create a value of 'ListBillingGroupCostReportsFilter' 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:
--
-- 'billingGroupArns', 'listBillingGroupCostReportsFilter_billingGroupArns' - The list of Amazon Resource Names (ARNs) used to filter billing groups
-- to retrieve reports.
newListBillingGroupCostReportsFilter ::
  ListBillingGroupCostReportsFilter
newListBillingGroupCostReportsFilter :: ListBillingGroupCostReportsFilter
newListBillingGroupCostReportsFilter =
  ListBillingGroupCostReportsFilter'
    { $sel:billingGroupArns:ListBillingGroupCostReportsFilter' :: Maybe (NonEmpty Text)
billingGroupArns =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The list of Amazon Resource Names (ARNs) used to filter billing groups
-- to retrieve reports.
listBillingGroupCostReportsFilter_billingGroupArns :: Lens.Lens' ListBillingGroupCostReportsFilter (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listBillingGroupCostReportsFilter_billingGroupArns :: Lens' ListBillingGroupCostReportsFilter (Maybe (NonEmpty Text))
listBillingGroupCostReportsFilter_billingGroupArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBillingGroupCostReportsFilter' {Maybe (NonEmpty Text)
billingGroupArns :: Maybe (NonEmpty Text)
$sel:billingGroupArns:ListBillingGroupCostReportsFilter' :: ListBillingGroupCostReportsFilter -> Maybe (NonEmpty Text)
billingGroupArns} -> Maybe (NonEmpty Text)
billingGroupArns) (\s :: ListBillingGroupCostReportsFilter
s@ListBillingGroupCostReportsFilter' {} Maybe (NonEmpty Text)
a -> ListBillingGroupCostReportsFilter
s {$sel:billingGroupArns:ListBillingGroupCostReportsFilter' :: Maybe (NonEmpty Text)
billingGroupArns = Maybe (NonEmpty Text)
a} :: ListBillingGroupCostReportsFilter) 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

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

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

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