{-# 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 #-}
module Amazonka.BillingConductor.Types.ComputationPreference 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
data ComputationPreference = ComputationPreference'
{
ComputationPreference -> Text
pricingPlanArn :: Prelude.Text
}
deriving (ComputationPreference -> ComputationPreference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputationPreference -> ComputationPreference -> Bool
$c/= :: ComputationPreference -> ComputationPreference -> Bool
== :: ComputationPreference -> ComputationPreference -> Bool
$c== :: ComputationPreference -> ComputationPreference -> Bool
Prelude.Eq, ReadPrec [ComputationPreference]
ReadPrec ComputationPreference
Int -> ReadS ComputationPreference
ReadS [ComputationPreference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputationPreference]
$creadListPrec :: ReadPrec [ComputationPreference]
readPrec :: ReadPrec ComputationPreference
$creadPrec :: ReadPrec ComputationPreference
readList :: ReadS [ComputationPreference]
$creadList :: ReadS [ComputationPreference]
readsPrec :: Int -> ReadS ComputationPreference
$creadsPrec :: Int -> ReadS ComputationPreference
Prelude.Read, Int -> ComputationPreference -> ShowS
[ComputationPreference] -> ShowS
ComputationPreference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputationPreference] -> ShowS
$cshowList :: [ComputationPreference] -> ShowS
show :: ComputationPreference -> String
$cshow :: ComputationPreference -> String
showsPrec :: Int -> ComputationPreference -> ShowS
$cshowsPrec :: Int -> ComputationPreference -> ShowS
Prelude.Show, forall x. Rep ComputationPreference x -> ComputationPreference
forall x. ComputationPreference -> Rep ComputationPreference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputationPreference x -> ComputationPreference
$cfrom :: forall x. ComputationPreference -> Rep ComputationPreference x
Prelude.Generic)
newComputationPreference ::
Prelude.Text ->
ComputationPreference
newComputationPreference :: Text -> ComputationPreference
newComputationPreference Text
pPricingPlanArn_ =
ComputationPreference'
{ $sel:pricingPlanArn:ComputationPreference' :: Text
pricingPlanArn =
Text
pPricingPlanArn_
}
computationPreference_pricingPlanArn :: Lens.Lens' ComputationPreference Prelude.Text
computationPreference_pricingPlanArn :: Lens' ComputationPreference Text
computationPreference_pricingPlanArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputationPreference' {Text
pricingPlanArn :: Text
$sel:pricingPlanArn:ComputationPreference' :: ComputationPreference -> Text
pricingPlanArn} -> Text
pricingPlanArn) (\s :: ComputationPreference
s@ComputationPreference' {} Text
a -> ComputationPreference
s {$sel:pricingPlanArn:ComputationPreference' :: Text
pricingPlanArn = Text
a} :: ComputationPreference)
instance Data.FromJSON ComputationPreference where
parseJSON :: Value -> Parser ComputationPreference
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ComputationPreference"
( \Object
x ->
Text -> ComputationPreference
ComputationPreference'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PricingPlanArn")
)
instance Prelude.Hashable ComputationPreference where
hashWithSalt :: Int -> ComputationPreference -> Int
hashWithSalt Int
_salt ComputationPreference' {Text
pricingPlanArn :: Text
$sel:pricingPlanArn:ComputationPreference' :: ComputationPreference -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
pricingPlanArn
instance Prelude.NFData ComputationPreference where
rnf :: ComputationPreference -> ()
rnf ComputationPreference' {Text
pricingPlanArn :: Text
$sel:pricingPlanArn:ComputationPreference' :: ComputationPreference -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
pricingPlanArn
instance Data.ToJSON ComputationPreference where
toJSON :: ComputationPreference -> Value
toJSON ComputationPreference' {Text
pricingPlanArn :: Text
$sel:pricingPlanArn:ComputationPreference' :: ComputationPreference -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"PricingPlanArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
pricingPlanArn)
]
)