content: module Stratosphere.KinesisAnalyticsV2.ApplicationReferenceDataSource.ReferenceSchemaProperty (
          module Exports, ReferenceSchemaProperty(..),
          mkReferenceSchemaProperty
      ) where
  import qualified Data.Aeson as JSON
  import qualified Stratosphere.Prelude as Prelude
  import Stratosphere.Property
  import {-# SOURCE #-} Stratosphere.KinesisAnalyticsV2.ApplicationReferenceDataSource.RecordColumnProperty as Exports
  import {-# SOURCE #-} Stratosphere.KinesisAnalyticsV2.ApplicationReferenceDataSource.RecordFormatProperty as Exports
  import Stratosphere.ResourceProperties
  import Stratosphere.Value
  data ReferenceSchemaProperty
    = ReferenceSchemaProperty {recordColumns :: [RecordColumnProperty],
                               recordEncoding :: (Prelude.Maybe (Value Prelude.Text)),
                               recordFormat :: RecordFormatProperty}
    deriving stock (Prelude.Eq, Prelude.Show)
  mkReferenceSchemaProperty ::
    [RecordColumnProperty]
    -> RecordFormatProperty -> ReferenceSchemaProperty
  mkReferenceSchemaProperty recordColumns recordFormat
    = ReferenceSchemaProperty
        {recordColumns = recordColumns, recordFormat = recordFormat,
         recordEncoding = Prelude.Nothing}
  instance ToResourceProperties ReferenceSchemaProperty where
    toResourceProperties ReferenceSchemaProperty {..}
      = ResourceProperties
          {awsType = "AWS::KinesisAnalyticsV2::ApplicationReferenceDataSource.ReferenceSchema",
           supportsTags = Prelude.False,
           properties = Prelude.fromList
                          ((Prelude.<>)
                             ["RecordColumns" JSON..= recordColumns,
                              "RecordFormat" JSON..= recordFormat]
                             (Prelude.catMaybes
                                [(JSON..=) "RecordEncoding" Prelude.<$> recordEncoding]))}
  instance JSON.ToJSON ReferenceSchemaProperty where
    toJSON ReferenceSchemaProperty {..}
      = JSON.object
          (Prelude.fromList
             ((Prelude.<>)
                ["RecordColumns" JSON..= recordColumns,
                 "RecordFormat" JSON..= recordFormat]
                (Prelude.catMaybes
                   [(JSON..=) "RecordEncoding" Prelude.<$> recordEncoding])))
  instance Property "RecordColumns" ReferenceSchemaProperty where
    type PropertyType "RecordColumns" ReferenceSchemaProperty = [RecordColumnProperty]
    set newValue ReferenceSchemaProperty {..}
      = ReferenceSchemaProperty {recordColumns = newValue, ..}
  instance Property "RecordEncoding" ReferenceSchemaProperty where
    type PropertyType "RecordEncoding" ReferenceSchemaProperty = Value Prelude.Text
    set newValue ReferenceSchemaProperty {..}
      = ReferenceSchemaProperty
          {recordEncoding = Prelude.pure newValue, ..}
  instance Property "RecordFormat" ReferenceSchemaProperty where
    type PropertyType "RecordFormat" ReferenceSchemaProperty = RecordFormatProperty
    set newValue ReferenceSchemaProperty {..}
      = ReferenceSchemaProperty {recordFormat = newValue, ..}