module Stratosphere.EC2.LaunchTemplate.CreditSpecificationProperty (
        CreditSpecificationProperty(..), mkCreditSpecificationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CreditSpecificationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-creditspecification.html>
    CreditSpecificationProperty {CreditSpecificationProperty -> ()
haddock_workaround_ :: (),
                                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-creditspecification.html#cfn-ec2-launchtemplate-creditspecification-cpucredits>
                                 CreditSpecificationProperty -> Maybe (Value Text)
cpuCredits :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (CreditSpecificationProperty -> CreditSpecificationProperty -> Bool
(CreditSpecificationProperty
 -> CreditSpecificationProperty -> Bool)
-> (CreditSpecificationProperty
    -> CreditSpecificationProperty -> Bool)
-> Eq CreditSpecificationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreditSpecificationProperty -> CreditSpecificationProperty -> Bool
== :: CreditSpecificationProperty -> CreditSpecificationProperty -> Bool
$c/= :: CreditSpecificationProperty -> CreditSpecificationProperty -> Bool
/= :: CreditSpecificationProperty -> CreditSpecificationProperty -> Bool
Prelude.Eq, Int -> CreditSpecificationProperty -> ShowS
[CreditSpecificationProperty] -> ShowS
CreditSpecificationProperty -> String
(Int -> CreditSpecificationProperty -> ShowS)
-> (CreditSpecificationProperty -> String)
-> ([CreditSpecificationProperty] -> ShowS)
-> Show CreditSpecificationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreditSpecificationProperty -> ShowS
showsPrec :: Int -> CreditSpecificationProperty -> ShowS
$cshow :: CreditSpecificationProperty -> String
show :: CreditSpecificationProperty -> String
$cshowList :: [CreditSpecificationProperty] -> ShowS
showList :: [CreditSpecificationProperty] -> ShowS
Prelude.Show)
mkCreditSpecificationProperty :: CreditSpecificationProperty
mkCreditSpecificationProperty :: CreditSpecificationProperty
mkCreditSpecificationProperty
  = CreditSpecificationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), cpuCredits :: Maybe (Value Text)
cpuCredits = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CreditSpecificationProperty where
  toResourceProperties :: CreditSpecificationProperty -> ResourceProperties
toResourceProperties CreditSpecificationProperty {Maybe (Value Text)
()
haddock_workaround_ :: CreditSpecificationProperty -> ()
cpuCredits :: CreditSpecificationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cpuCredits :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::EC2::LaunchTemplate.CreditSpecification",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CpuCredits" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
cpuCredits])}
instance JSON.ToJSON CreditSpecificationProperty where
  toJSON :: CreditSpecificationProperty -> Value
toJSON CreditSpecificationProperty {Maybe (Value Text)
()
haddock_workaround_ :: CreditSpecificationProperty -> ()
cpuCredits :: CreditSpecificationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cpuCredits :: Maybe (Value Text)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"CpuCredits" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
cpuCredits]))
instance Property "CpuCredits" CreditSpecificationProperty where
  type PropertyType "CpuCredits" CreditSpecificationProperty = Value Prelude.Text
  set :: PropertyType "CpuCredits" CreditSpecificationProperty
-> CreditSpecificationProperty -> CreditSpecificationProperty
set PropertyType "CpuCredits" CreditSpecificationProperty
newValue CreditSpecificationProperty {Maybe (Value Text)
()
haddock_workaround_ :: CreditSpecificationProperty -> ()
cpuCredits :: CreditSpecificationProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
cpuCredits :: Maybe (Value Text)
..}
    = CreditSpecificationProperty
        {cpuCredits :: Maybe (Value Text)
cpuCredits = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CpuCredits" CreditSpecificationProperty
Value Text
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}