module Stratosphere.AppSync.ApiCache ( ApiCache(..), mkApiCache ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import Stratosphere.ResourceProperties import Stratosphere.Value data ApiCache = -- | See: ApiCache {haddock_workaround_ :: (), -- | See: apiCachingBehavior :: (Value Prelude.Text), -- | See: apiId :: (Value Prelude.Text), -- | See: atRestEncryptionEnabled :: (Prelude.Maybe (Value Prelude.Bool)), -- | See: healthMetricsConfig :: (Prelude.Maybe (Value Prelude.Text)), -- | See: transitEncryptionEnabled :: (Prelude.Maybe (Value Prelude.Bool)), -- | See: ttl :: (Value Prelude.Double), -- | See: type' :: (Value Prelude.Text)} deriving stock (Prelude.Eq, Prelude.Show) mkApiCache :: Value Prelude.Text -> Value Prelude.Text -> Value Prelude.Double -> Value Prelude.Text -> ApiCache mkApiCache apiCachingBehavior apiId ttl type' = ApiCache {haddock_workaround_ = (), apiCachingBehavior = apiCachingBehavior, apiId = apiId, ttl = ttl, type' = type', atRestEncryptionEnabled = Prelude.Nothing, healthMetricsConfig = Prelude.Nothing, transitEncryptionEnabled = Prelude.Nothing} instance ToResourceProperties ApiCache where toResourceProperties ApiCache {..} = ResourceProperties {awsType = "AWS::AppSync::ApiCache", supportsTags = Prelude.False, properties = Prelude.fromList ((Prelude.<>) ["ApiCachingBehavior" JSON..= apiCachingBehavior, "ApiId" JSON..= apiId, "Ttl" JSON..= ttl, "Type" JSON..= type'] (Prelude.catMaybes [(JSON..=) "AtRestEncryptionEnabled" Prelude.<$> atRestEncryptionEnabled, (JSON..=) "HealthMetricsConfig" Prelude.<$> healthMetricsConfig, (JSON..=) "TransitEncryptionEnabled" Prelude.<$> transitEncryptionEnabled]))} instance JSON.ToJSON ApiCache where toJSON ApiCache {..} = JSON.object (Prelude.fromList ((Prelude.<>) ["ApiCachingBehavior" JSON..= apiCachingBehavior, "ApiId" JSON..= apiId, "Ttl" JSON..= ttl, "Type" JSON..= type'] (Prelude.catMaybes [(JSON..=) "AtRestEncryptionEnabled" Prelude.<$> atRestEncryptionEnabled, (JSON..=) "HealthMetricsConfig" Prelude.<$> healthMetricsConfig, (JSON..=) "TransitEncryptionEnabled" Prelude.<$> transitEncryptionEnabled]))) instance Property "ApiCachingBehavior" ApiCache where type PropertyType "ApiCachingBehavior" ApiCache = Value Prelude.Text set newValue ApiCache {..} = ApiCache {apiCachingBehavior = newValue, ..} instance Property "ApiId" ApiCache where type PropertyType "ApiId" ApiCache = Value Prelude.Text set newValue ApiCache {..} = ApiCache {apiId = newValue, ..} instance Property "AtRestEncryptionEnabled" ApiCache where type PropertyType "AtRestEncryptionEnabled" ApiCache = Value Prelude.Bool set newValue ApiCache {..} = ApiCache {atRestEncryptionEnabled = Prelude.pure newValue, ..} instance Property "HealthMetricsConfig" ApiCache where type PropertyType "HealthMetricsConfig" ApiCache = Value Prelude.Text set newValue ApiCache {..} = ApiCache {healthMetricsConfig = Prelude.pure newValue, ..} instance Property "TransitEncryptionEnabled" ApiCache where type PropertyType "TransitEncryptionEnabled" ApiCache = Value Prelude.Bool set newValue ApiCache {..} = ApiCache {transitEncryptionEnabled = Prelude.pure newValue, ..} instance Property "Ttl" ApiCache where type PropertyType "Ttl" ApiCache = Value Prelude.Double set newValue ApiCache {..} = ApiCache {ttl = newValue, ..} instance Property "Type" ApiCache where type PropertyType "Type" ApiCache = Value Prelude.Text set newValue ApiCache {..} = ApiCache {type' = newValue, ..}