{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.QuickSight.Types.TimeRangeFilterValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.RollingDateConfiguration
data TimeRangeFilterValue = TimeRangeFilterValue'
{
TimeRangeFilterValue -> Maybe Text
parameter :: Prelude.Maybe Prelude.Text,
TimeRangeFilterValue -> Maybe RollingDateConfiguration
rollingDate :: Prelude.Maybe RollingDateConfiguration,
TimeRangeFilterValue -> Maybe POSIX
staticValue :: Prelude.Maybe Data.POSIX
}
deriving (TimeRangeFilterValue -> TimeRangeFilterValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TimeRangeFilterValue -> TimeRangeFilterValue -> Bool
$c/= :: TimeRangeFilterValue -> TimeRangeFilterValue -> Bool
== :: TimeRangeFilterValue -> TimeRangeFilterValue -> Bool
$c== :: TimeRangeFilterValue -> TimeRangeFilterValue -> Bool
Prelude.Eq, Int -> TimeRangeFilterValue -> ShowS
[TimeRangeFilterValue] -> ShowS
TimeRangeFilterValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TimeRangeFilterValue] -> ShowS
$cshowList :: [TimeRangeFilterValue] -> ShowS
show :: TimeRangeFilterValue -> String
$cshow :: TimeRangeFilterValue -> String
showsPrec :: Int -> TimeRangeFilterValue -> ShowS
$cshowsPrec :: Int -> TimeRangeFilterValue -> ShowS
Prelude.Show, forall x. Rep TimeRangeFilterValue x -> TimeRangeFilterValue
forall x. TimeRangeFilterValue -> Rep TimeRangeFilterValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TimeRangeFilterValue x -> TimeRangeFilterValue
$cfrom :: forall x. TimeRangeFilterValue -> Rep TimeRangeFilterValue x
Prelude.Generic)
newTimeRangeFilterValue ::
TimeRangeFilterValue
newTimeRangeFilterValue :: TimeRangeFilterValue
newTimeRangeFilterValue =
TimeRangeFilterValue'
{ $sel:parameter:TimeRangeFilterValue' :: Maybe Text
parameter = forall a. Maybe a
Prelude.Nothing,
$sel:rollingDate:TimeRangeFilterValue' :: Maybe RollingDateConfiguration
rollingDate = forall a. Maybe a
Prelude.Nothing,
$sel:staticValue:TimeRangeFilterValue' :: Maybe POSIX
staticValue = forall a. Maybe a
Prelude.Nothing
}
timeRangeFilterValue_parameter :: Lens.Lens' TimeRangeFilterValue (Prelude.Maybe Prelude.Text)
timeRangeFilterValue_parameter :: Lens' TimeRangeFilterValue (Maybe Text)
timeRangeFilterValue_parameter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeRangeFilterValue' {Maybe Text
parameter :: Maybe Text
$sel:parameter:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe Text
parameter} -> Maybe Text
parameter) (\s :: TimeRangeFilterValue
s@TimeRangeFilterValue' {} Maybe Text
a -> TimeRangeFilterValue
s {$sel:parameter:TimeRangeFilterValue' :: Maybe Text
parameter = Maybe Text
a} :: TimeRangeFilterValue)
timeRangeFilterValue_rollingDate :: Lens.Lens' TimeRangeFilterValue (Prelude.Maybe RollingDateConfiguration)
timeRangeFilterValue_rollingDate :: Lens' TimeRangeFilterValue (Maybe RollingDateConfiguration)
timeRangeFilterValue_rollingDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeRangeFilterValue' {Maybe RollingDateConfiguration
rollingDate :: Maybe RollingDateConfiguration
$sel:rollingDate:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe RollingDateConfiguration
rollingDate} -> Maybe RollingDateConfiguration
rollingDate) (\s :: TimeRangeFilterValue
s@TimeRangeFilterValue' {} Maybe RollingDateConfiguration
a -> TimeRangeFilterValue
s {$sel:rollingDate:TimeRangeFilterValue' :: Maybe RollingDateConfiguration
rollingDate = Maybe RollingDateConfiguration
a} :: TimeRangeFilterValue)
timeRangeFilterValue_staticValue :: Lens.Lens' TimeRangeFilterValue (Prelude.Maybe Prelude.UTCTime)
timeRangeFilterValue_staticValue :: Lens' TimeRangeFilterValue (Maybe UTCTime)
timeRangeFilterValue_staticValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TimeRangeFilterValue' {Maybe POSIX
staticValue :: Maybe POSIX
$sel:staticValue:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe POSIX
staticValue} -> Maybe POSIX
staticValue) (\s :: TimeRangeFilterValue
s@TimeRangeFilterValue' {} Maybe POSIX
a -> TimeRangeFilterValue
s {$sel:staticValue:TimeRangeFilterValue' :: Maybe POSIX
staticValue = Maybe POSIX
a} :: TimeRangeFilterValue) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON TimeRangeFilterValue where
parseJSON :: Value -> Parser TimeRangeFilterValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TimeRangeFilterValue"
( \Object
x ->
Maybe Text
-> Maybe RollingDateConfiguration
-> Maybe POSIX
-> TimeRangeFilterValue
TimeRangeFilterValue'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Parameter")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RollingDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StaticValue")
)
instance Prelude.Hashable TimeRangeFilterValue where
hashWithSalt :: Int -> TimeRangeFilterValue -> Int
hashWithSalt Int
_salt TimeRangeFilterValue' {Maybe Text
Maybe POSIX
Maybe RollingDateConfiguration
staticValue :: Maybe POSIX
rollingDate :: Maybe RollingDateConfiguration
parameter :: Maybe Text
$sel:staticValue:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe POSIX
$sel:rollingDate:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe RollingDateConfiguration
$sel:parameter:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RollingDateConfiguration
rollingDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
staticValue
instance Prelude.NFData TimeRangeFilterValue where
rnf :: TimeRangeFilterValue -> ()
rnf TimeRangeFilterValue' {Maybe Text
Maybe POSIX
Maybe RollingDateConfiguration
staticValue :: Maybe POSIX
rollingDate :: Maybe RollingDateConfiguration
parameter :: Maybe Text
$sel:staticValue:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe POSIX
$sel:rollingDate:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe RollingDateConfiguration
$sel:parameter:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RollingDateConfiguration
rollingDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
staticValue
instance Data.ToJSON TimeRangeFilterValue where
toJSON :: TimeRangeFilterValue -> Value
toJSON TimeRangeFilterValue' {Maybe Text
Maybe POSIX
Maybe RollingDateConfiguration
staticValue :: Maybe POSIX
rollingDate :: Maybe RollingDateConfiguration
parameter :: Maybe Text
$sel:staticValue:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe POSIX
$sel:rollingDate:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe RollingDateConfiguration
$sel:parameter:TimeRangeFilterValue' :: TimeRangeFilterValue -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Parameter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameter,
(Key
"RollingDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RollingDateConfiguration
rollingDate,
(Key
"StaticValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
staticValue
]
)