{-# 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.ListPricingRulesFilter
-- 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.ListPricingRulesFilter 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 criteria that the pricing rules returned by
-- the @ListPricingRules@ API will adhere to.
--
-- /See:/ 'newListPricingRulesFilter' smart constructor.
data ListPricingRulesFilter = ListPricingRulesFilter'
  { -- | A list containing the pricing rule Amazon Resource Names (ARNs) to
    -- include in the API response.
    ListPricingRulesFilter -> Maybe (NonEmpty Text)
arns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (ListPricingRulesFilter -> ListPricingRulesFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPricingRulesFilter -> ListPricingRulesFilter -> Bool
$c/= :: ListPricingRulesFilter -> ListPricingRulesFilter -> Bool
== :: ListPricingRulesFilter -> ListPricingRulesFilter -> Bool
$c== :: ListPricingRulesFilter -> ListPricingRulesFilter -> Bool
Prelude.Eq, ReadPrec [ListPricingRulesFilter]
ReadPrec ListPricingRulesFilter
Int -> ReadS ListPricingRulesFilter
ReadS [ListPricingRulesFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPricingRulesFilter]
$creadListPrec :: ReadPrec [ListPricingRulesFilter]
readPrec :: ReadPrec ListPricingRulesFilter
$creadPrec :: ReadPrec ListPricingRulesFilter
readList :: ReadS [ListPricingRulesFilter]
$creadList :: ReadS [ListPricingRulesFilter]
readsPrec :: Int -> ReadS ListPricingRulesFilter
$creadsPrec :: Int -> ReadS ListPricingRulesFilter
Prelude.Read, Int -> ListPricingRulesFilter -> ShowS
[ListPricingRulesFilter] -> ShowS
ListPricingRulesFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPricingRulesFilter] -> ShowS
$cshowList :: [ListPricingRulesFilter] -> ShowS
show :: ListPricingRulesFilter -> String
$cshow :: ListPricingRulesFilter -> String
showsPrec :: Int -> ListPricingRulesFilter -> ShowS
$cshowsPrec :: Int -> ListPricingRulesFilter -> ShowS
Prelude.Show, forall x. Rep ListPricingRulesFilter x -> ListPricingRulesFilter
forall x. ListPricingRulesFilter -> Rep ListPricingRulesFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPricingRulesFilter x -> ListPricingRulesFilter
$cfrom :: forall x. ListPricingRulesFilter -> Rep ListPricingRulesFilter x
Prelude.Generic)

-- |
-- Create a value of 'ListPricingRulesFilter' 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', 'listPricingRulesFilter_arns' - A list containing the pricing rule Amazon Resource Names (ARNs) to
-- include in the API response.
newListPricingRulesFilter ::
  ListPricingRulesFilter
newListPricingRulesFilter :: ListPricingRulesFilter
newListPricingRulesFilter =
  ListPricingRulesFilter' {$sel:arns:ListPricingRulesFilter' :: Maybe (NonEmpty Text)
arns = forall a. Maybe a
Prelude.Nothing}

-- | A list containing the pricing rule Amazon Resource Names (ARNs) to
-- include in the API response.
listPricingRulesFilter_arns :: Lens.Lens' ListPricingRulesFilter (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
listPricingRulesFilter_arns :: Lens' ListPricingRulesFilter (Maybe (NonEmpty Text))
listPricingRulesFilter_arns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPricingRulesFilter' {Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:arns:ListPricingRulesFilter' :: ListPricingRulesFilter -> Maybe (NonEmpty Text)
arns} -> Maybe (NonEmpty Text)
arns) (\s :: ListPricingRulesFilter
s@ListPricingRulesFilter' {} Maybe (NonEmpty Text)
a -> ListPricingRulesFilter
s {$sel:arns:ListPricingRulesFilter' :: Maybe (NonEmpty Text)
arns = Maybe (NonEmpty Text)
a} :: ListPricingRulesFilter) 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 ListPricingRulesFilter where
  hashWithSalt :: Int -> ListPricingRulesFilter -> Int
hashWithSalt Int
_salt ListPricingRulesFilter' {Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:arns:ListPricingRulesFilter' :: ListPricingRulesFilter -> Maybe (NonEmpty Text)
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
arns

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

instance Data.ToJSON ListPricingRulesFilter where
  toJSON :: ListPricingRulesFilter -> Value
toJSON ListPricingRulesFilter' {Maybe (NonEmpty Text)
arns :: Maybe (NonEmpty Text)
$sel:arns:ListPricingRulesFilter' :: ListPricingRulesFilter -> 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]
      )