module Stratosphere.QuickSight.Template.ColumnSortProperty (
        module Exports, ColumnSortProperty(..), mkColumnSortProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.QuickSight.Template.AggregationFunctionProperty as Exports
import {-# SOURCE #-} Stratosphere.QuickSight.Template.ColumnIdentifierProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ColumnSortProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnsort.html>
    ColumnSortProperty {ColumnSortProperty -> ()
haddock_workaround_ :: (),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnsort.html#cfn-quicksight-template-columnsort-aggregationfunction>
                        ColumnSortProperty -> Maybe AggregationFunctionProperty
aggregationFunction :: (Prelude.Maybe AggregationFunctionProperty),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnsort.html#cfn-quicksight-template-columnsort-direction>
                        ColumnSortProperty -> Value Text
direction :: (Value Prelude.Text),
                        -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-template-columnsort.html#cfn-quicksight-template-columnsort-sortby>
                        ColumnSortProperty -> ColumnIdentifierProperty
sortBy :: ColumnIdentifierProperty}
  deriving stock (ColumnSortProperty -> ColumnSortProperty -> Bool
(ColumnSortProperty -> ColumnSortProperty -> Bool)
-> (ColumnSortProperty -> ColumnSortProperty -> Bool)
-> Eq ColumnSortProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColumnSortProperty -> ColumnSortProperty -> Bool
== :: ColumnSortProperty -> ColumnSortProperty -> Bool
$c/= :: ColumnSortProperty -> ColumnSortProperty -> Bool
/= :: ColumnSortProperty -> ColumnSortProperty -> Bool
Prelude.Eq, Int -> ColumnSortProperty -> ShowS
[ColumnSortProperty] -> ShowS
ColumnSortProperty -> String
(Int -> ColumnSortProperty -> ShowS)
-> (ColumnSortProperty -> String)
-> ([ColumnSortProperty] -> ShowS)
-> Show ColumnSortProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColumnSortProperty -> ShowS
showsPrec :: Int -> ColumnSortProperty -> ShowS
$cshow :: ColumnSortProperty -> String
show :: ColumnSortProperty -> String
$cshowList :: [ColumnSortProperty] -> ShowS
showList :: [ColumnSortProperty] -> ShowS
Prelude.Show)
mkColumnSortProperty ::
  Value Prelude.Text
  -> ColumnIdentifierProperty -> ColumnSortProperty
mkColumnSortProperty :: Value Text -> ColumnIdentifierProperty -> ColumnSortProperty
mkColumnSortProperty Value Text
direction ColumnIdentifierProperty
sortBy
  = ColumnSortProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), direction :: Value Text
direction = Value Text
direction, sortBy :: ColumnIdentifierProperty
sortBy = ColumnIdentifierProperty
sortBy,
       aggregationFunction :: Maybe AggregationFunctionProperty
aggregationFunction = Maybe AggregationFunctionProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ColumnSortProperty where
  toResourceProperties :: ColumnSortProperty -> ResourceProperties
toResourceProperties ColumnSortProperty {Maybe AggregationFunctionProperty
()
Value Text
ColumnIdentifierProperty
haddock_workaround_ :: ColumnSortProperty -> ()
aggregationFunction :: ColumnSortProperty -> Maybe AggregationFunctionProperty
direction :: ColumnSortProperty -> Value Text
sortBy :: ColumnSortProperty -> ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
sortBy :: ColumnIdentifierProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::QuickSight::Template.ColumnSort",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"Direction" 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..= Value Text
direction, Key
"SortBy" Key -> ColumnIdentifierProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ColumnIdentifierProperty
sortBy]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> AggregationFunctionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AggregationFunction"
                                 (AggregationFunctionProperty -> (Key, Value))
-> Maybe AggregationFunctionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AggregationFunctionProperty
aggregationFunction]))}
instance JSON.ToJSON ColumnSortProperty where
  toJSON :: ColumnSortProperty -> Value
toJSON ColumnSortProperty {Maybe AggregationFunctionProperty
()
Value Text
ColumnIdentifierProperty
haddock_workaround_ :: ColumnSortProperty -> ()
aggregationFunction :: ColumnSortProperty -> Maybe AggregationFunctionProperty
direction :: ColumnSortProperty -> Value Text
sortBy :: ColumnSortProperty -> ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
sortBy :: ColumnIdentifierProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"Direction" 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..= Value Text
direction, Key
"SortBy" Key -> ColumnIdentifierProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ColumnIdentifierProperty
sortBy]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> AggregationFunctionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AggregationFunction"
                    (AggregationFunctionProperty -> (Key, Value))
-> Maybe AggregationFunctionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AggregationFunctionProperty
aggregationFunction])))
instance Property "AggregationFunction" ColumnSortProperty where
  type PropertyType "AggregationFunction" ColumnSortProperty = AggregationFunctionProperty
  set :: PropertyType "AggregationFunction" ColumnSortProperty
-> ColumnSortProperty -> ColumnSortProperty
set PropertyType "AggregationFunction" ColumnSortProperty
newValue ColumnSortProperty {Maybe AggregationFunctionProperty
()
Value Text
ColumnIdentifierProperty
haddock_workaround_ :: ColumnSortProperty -> ()
aggregationFunction :: ColumnSortProperty -> Maybe AggregationFunctionProperty
direction :: ColumnSortProperty -> Value Text
sortBy :: ColumnSortProperty -> ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
sortBy :: ColumnIdentifierProperty
..}
    = ColumnSortProperty
        {aggregationFunction :: Maybe AggregationFunctionProperty
aggregationFunction = AggregationFunctionProperty -> Maybe AggregationFunctionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AggregationFunction" ColumnSortProperty
AggregationFunctionProperty
newValue, ()
Value Text
ColumnIdentifierProperty
haddock_workaround_ :: ()
direction :: Value Text
sortBy :: ColumnIdentifierProperty
haddock_workaround_ :: ()
direction :: Value Text
sortBy :: ColumnIdentifierProperty
..}
instance Property "Direction" ColumnSortProperty where
  type PropertyType "Direction" ColumnSortProperty = Value Prelude.Text
  set :: PropertyType "Direction" ColumnSortProperty
-> ColumnSortProperty -> ColumnSortProperty
set PropertyType "Direction" ColumnSortProperty
newValue ColumnSortProperty {Maybe AggregationFunctionProperty
()
Value Text
ColumnIdentifierProperty
haddock_workaround_ :: ColumnSortProperty -> ()
aggregationFunction :: ColumnSortProperty -> Maybe AggregationFunctionProperty
direction :: ColumnSortProperty -> Value Text
sortBy :: ColumnSortProperty -> ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
sortBy :: ColumnIdentifierProperty
..}
    = ColumnSortProperty {direction :: Value Text
direction = PropertyType "Direction" ColumnSortProperty
Value Text
newValue, Maybe AggregationFunctionProperty
()
ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
sortBy :: ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
sortBy :: ColumnIdentifierProperty
..}
instance Property "SortBy" ColumnSortProperty where
  type PropertyType "SortBy" ColumnSortProperty = ColumnIdentifierProperty
  set :: PropertyType "SortBy" ColumnSortProperty
-> ColumnSortProperty -> ColumnSortProperty
set PropertyType "SortBy" ColumnSortProperty
newValue ColumnSortProperty {Maybe AggregationFunctionProperty
()
Value Text
ColumnIdentifierProperty
haddock_workaround_ :: ColumnSortProperty -> ()
aggregationFunction :: ColumnSortProperty -> Maybe AggregationFunctionProperty
direction :: ColumnSortProperty -> Value Text
sortBy :: ColumnSortProperty -> ColumnIdentifierProperty
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
sortBy :: ColumnIdentifierProperty
..}
    = ColumnSortProperty {sortBy :: ColumnIdentifierProperty
sortBy = PropertyType "SortBy" ColumnSortProperty
ColumnIdentifierProperty
newValue, Maybe AggregationFunctionProperty
()
Value Text
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
haddock_workaround_ :: ()
aggregationFunction :: Maybe AggregationFunctionProperty
direction :: Value Text
..}