module Stratosphere.Lightsail.Distribution.CacheBehaviorProperty (
        CacheBehaviorProperty(..), mkCacheBehaviorProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CacheBehaviorProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehavior.html>
    CacheBehaviorProperty {CacheBehaviorProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-distribution-cachebehavior.html#cfn-lightsail-distribution-cachebehavior-behavior>
                           CacheBehaviorProperty -> Maybe (Value Text)
behavior :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (CacheBehaviorProperty -> CacheBehaviorProperty -> Bool
(CacheBehaviorProperty -> CacheBehaviorProperty -> Bool)
-> (CacheBehaviorProperty -> CacheBehaviorProperty -> Bool)
-> Eq CacheBehaviorProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CacheBehaviorProperty -> CacheBehaviorProperty -> Bool
== :: CacheBehaviorProperty -> CacheBehaviorProperty -> Bool
$c/= :: CacheBehaviorProperty -> CacheBehaviorProperty -> Bool
/= :: CacheBehaviorProperty -> CacheBehaviorProperty -> Bool
Prelude.Eq, Int -> CacheBehaviorProperty -> ShowS
[CacheBehaviorProperty] -> ShowS
CacheBehaviorProperty -> String
(Int -> CacheBehaviorProperty -> ShowS)
-> (CacheBehaviorProperty -> String)
-> ([CacheBehaviorProperty] -> ShowS)
-> Show CacheBehaviorProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CacheBehaviorProperty -> ShowS
showsPrec :: Int -> CacheBehaviorProperty -> ShowS
$cshow :: CacheBehaviorProperty -> String
show :: CacheBehaviorProperty -> String
$cshowList :: [CacheBehaviorProperty] -> ShowS
showList :: [CacheBehaviorProperty] -> ShowS
Prelude.Show)
mkCacheBehaviorProperty :: CacheBehaviorProperty
mkCacheBehaviorProperty :: CacheBehaviorProperty
mkCacheBehaviorProperty
  = CacheBehaviorProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), behavior :: Maybe (Value Text)
behavior = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CacheBehaviorProperty where
  toResourceProperties :: CacheBehaviorProperty -> ResourceProperties
toResourceProperties CacheBehaviorProperty {Maybe (Value Text)
()
haddock_workaround_ :: CacheBehaviorProperty -> ()
behavior :: CacheBehaviorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
behavior :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Lightsail::Distribution.CacheBehavior",
         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
"Behavior" (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)
behavior])}
instance JSON.ToJSON CacheBehaviorProperty where
  toJSON :: CacheBehaviorProperty -> Value
toJSON CacheBehaviorProperty {Maybe (Value Text)
()
haddock_workaround_ :: CacheBehaviorProperty -> ()
behavior :: CacheBehaviorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
behavior :: 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
"Behavior" (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)
behavior]))
instance Property "Behavior" CacheBehaviorProperty where
  type PropertyType "Behavior" CacheBehaviorProperty = Value Prelude.Text
  set :: PropertyType "Behavior" CacheBehaviorProperty
-> CacheBehaviorProperty -> CacheBehaviorProperty
set PropertyType "Behavior" CacheBehaviorProperty
newValue CacheBehaviorProperty {Maybe (Value Text)
()
haddock_workaround_ :: CacheBehaviorProperty -> ()
behavior :: CacheBehaviorProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
behavior :: Maybe (Value Text)
..}
    = CacheBehaviorProperty {behavior :: Maybe (Value Text)
behavior = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Behavior" CacheBehaviorProperty
Value Text
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}