module Stratosphere.Forecast.Dataset.SchemaProperty (
        module Exports, SchemaProperty(..), mkSchemaProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Forecast.Dataset.AttributesItemsProperty as Exports
import Stratosphere.ResourceProperties
data SchemaProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-forecast-dataset-schema.html>
    SchemaProperty {SchemaProperty -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-forecast-dataset-schema.html#cfn-forecast-dataset-schema-attributes>
                    SchemaProperty -> Maybe [AttributesItemsProperty]
attributes :: (Prelude.Maybe [AttributesItemsProperty])}
  deriving stock (SchemaProperty -> SchemaProperty -> Bool
(SchemaProperty -> SchemaProperty -> Bool)
-> (SchemaProperty -> SchemaProperty -> Bool) -> Eq SchemaProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SchemaProperty -> SchemaProperty -> Bool
== :: SchemaProperty -> SchemaProperty -> Bool
$c/= :: SchemaProperty -> SchemaProperty -> Bool
/= :: SchemaProperty -> SchemaProperty -> Bool
Prelude.Eq, Int -> SchemaProperty -> ShowS
[SchemaProperty] -> ShowS
SchemaProperty -> String
(Int -> SchemaProperty -> ShowS)
-> (SchemaProperty -> String)
-> ([SchemaProperty] -> ShowS)
-> Show SchemaProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SchemaProperty -> ShowS
showsPrec :: Int -> SchemaProperty -> ShowS
$cshow :: SchemaProperty -> String
show :: SchemaProperty -> String
$cshowList :: [SchemaProperty] -> ShowS
showList :: [SchemaProperty] -> ShowS
Prelude.Show)
mkSchemaProperty :: SchemaProperty
mkSchemaProperty :: SchemaProperty
mkSchemaProperty
  = SchemaProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), attributes :: Maybe [AttributesItemsProperty]
attributes = Maybe [AttributesItemsProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SchemaProperty where
  toResourceProperties :: SchemaProperty -> ResourceProperties
toResourceProperties SchemaProperty {Maybe [AttributesItemsProperty]
()
haddock_workaround_ :: SchemaProperty -> ()
attributes :: SchemaProperty -> Maybe [AttributesItemsProperty]
haddock_workaround_ :: ()
attributes :: Maybe [AttributesItemsProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Forecast::Dataset.Schema",
         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 -> [AttributesItemsProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Attributes" ([AttributesItemsProperty] -> (Key, Value))
-> Maybe [AttributesItemsProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributesItemsProperty]
attributes])}
instance JSON.ToJSON SchemaProperty where
  toJSON :: SchemaProperty -> Value
toJSON SchemaProperty {Maybe [AttributesItemsProperty]
()
haddock_workaround_ :: SchemaProperty -> ()
attributes :: SchemaProperty -> Maybe [AttributesItemsProperty]
haddock_workaround_ :: ()
attributes :: Maybe [AttributesItemsProperty]
..}
    = [(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 -> [AttributesItemsProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Attributes" ([AttributesItemsProperty] -> (Key, Value))
-> Maybe [AttributesItemsProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributesItemsProperty]
attributes]))
instance Property "Attributes" SchemaProperty where
  type PropertyType "Attributes" SchemaProperty = [AttributesItemsProperty]
  set :: PropertyType "Attributes" SchemaProperty
-> SchemaProperty -> SchemaProperty
set PropertyType "Attributes" SchemaProperty
newValue SchemaProperty {Maybe [AttributesItemsProperty]
()
haddock_workaround_ :: SchemaProperty -> ()
attributes :: SchemaProperty -> Maybe [AttributesItemsProperty]
haddock_workaround_ :: ()
attributes :: Maybe [AttributesItemsProperty]
..}
    = SchemaProperty {attributes :: Maybe [AttributesItemsProperty]
attributes = [AttributesItemsProperty] -> Maybe [AttributesItemsProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [AttributesItemsProperty]
PropertyType "Attributes" SchemaProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}