{-# 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.ListCustomLineItemsFilter
-- 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.ListCustomLineItemsFilter 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

-- | A filter that specifies the custom line items and billing groups to
-- retrieve FFLI information.
--
-- /See:/ 'newListCustomLineItemsFilter' smart constructor.
data ListCustomLineItemsFilter = ListCustomLineItemsFilter'
  { -- | A list of custom line item ARNs to retrieve information.
    ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
arns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The billing group Amazon Resource Names (ARNs) to retrieve information.
    ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
billingGroups :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | A list of custom line items to retrieve information.
    ListCustomLineItemsFilter -> Maybe (NonEmpty (Sensitive Text))
names :: Prelude.Maybe (Prelude.NonEmpty (Data.Sensitive Prelude.Text))
  }
  deriving (ListCustomLineItemsFilter -> ListCustomLineItemsFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCustomLineItemsFilter -> ListCustomLineItemsFilter -> Bool
$c/= :: ListCustomLineItemsFilter -> ListCustomLineItemsFilter -> Bool
== :: ListCustomLineItemsFilter -> ListCustomLineItemsFilter -> Bool
$c== :: ListCustomLineItemsFilter -> ListCustomLineItemsFilter -> Bool
Prelude.Eq, Int -> ListCustomLineItemsFilter -> ShowS
[ListCustomLineItemsFilter] -> ShowS
ListCustomLineItemsFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCustomLineItemsFilter] -> ShowS
$cshowList :: [ListCustomLineItemsFilter] -> ShowS
show :: ListCustomLineItemsFilter -> String
$cshow :: ListCustomLineItemsFilter -> String
showsPrec :: Int -> ListCustomLineItemsFilter -> ShowS
$cshowsPrec :: Int -> ListCustomLineItemsFilter -> ShowS
Prelude.Show, forall x.
Rep ListCustomLineItemsFilter x -> ListCustomLineItemsFilter
forall x.
ListCustomLineItemsFilter -> Rep ListCustomLineItemsFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCustomLineItemsFilter x -> ListCustomLineItemsFilter
$cfrom :: forall x.
ListCustomLineItemsFilter -> Rep ListCustomLineItemsFilter x
Prelude.Generic)

-- |
-- Create a value of 'ListCustomLineItemsFilter' 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', 'listCustomLineItemsFilter_arns' - A list of custom line item ARNs to retrieve information.
--
-- 'billingGroups', 'listCustomLineItemsFilter_billingGroups' - The billing group Amazon Resource Names (ARNs) to retrieve information.
--
-- 'names', 'listCustomLineItemsFilter_names' - A list of custom line items to retrieve information.
newListCustomLineItemsFilter ::
  ListCustomLineItemsFilter
newListCustomLineItemsFilter :: ListCustomLineItemsFilter
newListCustomLineItemsFilter =
  ListCustomLineItemsFilter'
    { $sel:arns:ListCustomLineItemsFilter' :: Maybe (NonEmpty Text)
arns = forall a. Maybe a
Prelude.Nothing,
      $sel:billingGroups:ListCustomLineItemsFilter' :: Maybe (NonEmpty Text)
billingGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:names:ListCustomLineItemsFilter' :: Maybe (NonEmpty (Sensitive Text))
names = forall a. Maybe a
Prelude.Nothing
    }

-- | A list of custom line item ARNs to retrieve information.
listCustomLineItemsFilter_arns :: Lens.Lens' ListCustomLineItemsFilter (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listCustomLineItemsFilter_arns :: Lens' ListCustomLineItemsFilter (Maybe (NonEmpty Text))
listCustomLineItemsFilter_arns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemsFilter' {Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:arns:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
arns} -> Maybe (NonEmpty Text)
arns) (\s :: ListCustomLineItemsFilter
s@ListCustomLineItemsFilter' {} Maybe (NonEmpty Text)
a -> ListCustomLineItemsFilter
s {$sel:arns:ListCustomLineItemsFilter' :: Maybe (NonEmpty Text)
arns = Maybe (NonEmpty Text)
a} :: ListCustomLineItemsFilter) 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 billing group Amazon Resource Names (ARNs) to retrieve information.
listCustomLineItemsFilter_billingGroups :: Lens.Lens' ListCustomLineItemsFilter (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listCustomLineItemsFilter_billingGroups :: Lens' ListCustomLineItemsFilter (Maybe (NonEmpty Text))
listCustomLineItemsFilter_billingGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemsFilter' {Maybe (NonEmpty Text)
billingGroups :: Maybe (NonEmpty Text)
$sel:billingGroups:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
billingGroups} -> Maybe (NonEmpty Text)
billingGroups) (\s :: ListCustomLineItemsFilter
s@ListCustomLineItemsFilter' {} Maybe (NonEmpty Text)
a -> ListCustomLineItemsFilter
s {$sel:billingGroups:ListCustomLineItemsFilter' :: Maybe (NonEmpty Text)
billingGroups = Maybe (NonEmpty Text)
a} :: ListCustomLineItemsFilter) 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

-- | A list of custom line items to retrieve information.
listCustomLineItemsFilter_names :: Lens.Lens' ListCustomLineItemsFilter (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listCustomLineItemsFilter_names :: Lens' ListCustomLineItemsFilter (Maybe (NonEmpty Text))
listCustomLineItemsFilter_names = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCustomLineItemsFilter' {Maybe (NonEmpty (Sensitive Text))
names :: Maybe (NonEmpty (Sensitive Text))
$sel:names:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty (Sensitive Text))
names} -> Maybe (NonEmpty (Sensitive Text))
names) (\s :: ListCustomLineItemsFilter
s@ListCustomLineItemsFilter' {} Maybe (NonEmpty (Sensitive Text))
a -> ListCustomLineItemsFilter
s {$sel:names:ListCustomLineItemsFilter' :: Maybe (NonEmpty (Sensitive Text))
names = Maybe (NonEmpty (Sensitive Text))
a} :: ListCustomLineItemsFilter) 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 ListCustomLineItemsFilter where
  hashWithSalt :: Int -> ListCustomLineItemsFilter -> Int
hashWithSalt Int
_salt ListCustomLineItemsFilter' {Maybe (NonEmpty Text)
Maybe (NonEmpty (Sensitive Text))
names :: Maybe (NonEmpty (Sensitive Text))
billingGroups :: Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:names:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty (Sensitive Text))
$sel:billingGroups:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
$sel:arns:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> 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 (NonEmpty Text)
billingGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty (Sensitive Text))
names

instance Prelude.NFData ListCustomLineItemsFilter where
  rnf :: ListCustomLineItemsFilter -> ()
rnf ListCustomLineItemsFilter' {Maybe (NonEmpty Text)
Maybe (NonEmpty (Sensitive Text))
names :: Maybe (NonEmpty (Sensitive Text))
billingGroups :: Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:names:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty (Sensitive Text))
$sel:billingGroups:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
$sel:arns:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> 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 (NonEmpty Text)
billingGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty (Sensitive Text))
names

instance Data.ToJSON ListCustomLineItemsFilter where
  toJSON :: ListCustomLineItemsFilter -> Value
toJSON ListCustomLineItemsFilter' {Maybe (NonEmpty Text)
Maybe (NonEmpty (Sensitive Text))
names :: Maybe (NonEmpty (Sensitive Text))
billingGroups :: Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:names:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty (Sensitive Text))
$sel:billingGroups:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> Maybe (NonEmpty Text)
$sel:arns:ListCustomLineItemsFilter' :: ListCustomLineItemsFilter -> 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
"BillingGroups" 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)
billingGroups,
            (Key
"Names" 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 (Sensitive Text))
names
          ]
      )