{-# 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.IoTAnalytics.Types.Variable where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTAnalytics.Types.DatasetContentVersionValue
import Amazonka.IoTAnalytics.Types.OutputFileUriValue
import qualified Amazonka.Prelude as Prelude
data Variable = Variable'
{
Variable -> Maybe DatasetContentVersionValue
datasetContentVersionValue :: Prelude.Maybe DatasetContentVersionValue,
Variable -> Maybe Double
doubleValue :: Prelude.Maybe Prelude.Double,
Variable -> Maybe OutputFileUriValue
outputFileUriValue :: Prelude.Maybe OutputFileUriValue,
Variable -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text,
Variable -> Text
name :: Prelude.Text
}
deriving (Variable -> Variable -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Variable -> Variable -> Bool
$c/= :: Variable -> Variable -> Bool
== :: Variable -> Variable -> Bool
$c== :: Variable -> Variable -> Bool
Prelude.Eq, ReadPrec [Variable]
ReadPrec Variable
Int -> ReadS Variable
ReadS [Variable]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Variable]
$creadListPrec :: ReadPrec [Variable]
readPrec :: ReadPrec Variable
$creadPrec :: ReadPrec Variable
readList :: ReadS [Variable]
$creadList :: ReadS [Variable]
readsPrec :: Int -> ReadS Variable
$creadsPrec :: Int -> ReadS Variable
Prelude.Read, Int -> Variable -> ShowS
[Variable] -> ShowS
Variable -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Variable] -> ShowS
$cshowList :: [Variable] -> ShowS
show :: Variable -> String
$cshow :: Variable -> String
showsPrec :: Int -> Variable -> ShowS
$cshowsPrec :: Int -> Variable -> ShowS
Prelude.Show, forall x. Rep Variable x -> Variable
forall x. Variable -> Rep Variable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Variable x -> Variable
$cfrom :: forall x. Variable -> Rep Variable x
Prelude.Generic)
newVariable ::
Prelude.Text ->
Variable
newVariable :: Text -> Variable
newVariable Text
pName_ =
Variable'
{ $sel:datasetContentVersionValue:Variable' :: Maybe DatasetContentVersionValue
datasetContentVersionValue =
forall a. Maybe a
Prelude.Nothing,
$sel:doubleValue:Variable' :: Maybe Double
doubleValue = forall a. Maybe a
Prelude.Nothing,
$sel:outputFileUriValue:Variable' :: Maybe OutputFileUriValue
outputFileUriValue = forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:Variable' :: Maybe Text
stringValue = forall a. Maybe a
Prelude.Nothing,
$sel:name:Variable' :: Text
name = Text
pName_
}
variable_datasetContentVersionValue :: Lens.Lens' Variable (Prelude.Maybe DatasetContentVersionValue)
variable_datasetContentVersionValue :: Lens' Variable (Maybe DatasetContentVersionValue)
variable_datasetContentVersionValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Variable' {Maybe DatasetContentVersionValue
datasetContentVersionValue :: Maybe DatasetContentVersionValue
$sel:datasetContentVersionValue:Variable' :: Variable -> Maybe DatasetContentVersionValue
datasetContentVersionValue} -> Maybe DatasetContentVersionValue
datasetContentVersionValue) (\s :: Variable
s@Variable' {} Maybe DatasetContentVersionValue
a -> Variable
s {$sel:datasetContentVersionValue:Variable' :: Maybe DatasetContentVersionValue
datasetContentVersionValue = Maybe DatasetContentVersionValue
a} :: Variable)
variable_doubleValue :: Lens.Lens' Variable (Prelude.Maybe Prelude.Double)
variable_doubleValue :: Lens' Variable (Maybe Double)
variable_doubleValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Variable' {Maybe Double
doubleValue :: Maybe Double
$sel:doubleValue:Variable' :: Variable -> Maybe Double
doubleValue} -> Maybe Double
doubleValue) (\s :: Variable
s@Variable' {} Maybe Double
a -> Variable
s {$sel:doubleValue:Variable' :: Maybe Double
doubleValue = Maybe Double
a} :: Variable)
variable_outputFileUriValue :: Lens.Lens' Variable (Prelude.Maybe OutputFileUriValue)
variable_outputFileUriValue :: Lens' Variable (Maybe OutputFileUriValue)
variable_outputFileUriValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Variable' {Maybe OutputFileUriValue
outputFileUriValue :: Maybe OutputFileUriValue
$sel:outputFileUriValue:Variable' :: Variable -> Maybe OutputFileUriValue
outputFileUriValue} -> Maybe OutputFileUriValue
outputFileUriValue) (\s :: Variable
s@Variable' {} Maybe OutputFileUriValue
a -> Variable
s {$sel:outputFileUriValue:Variable' :: Maybe OutputFileUriValue
outputFileUriValue = Maybe OutputFileUriValue
a} :: Variable)
variable_stringValue :: Lens.Lens' Variable (Prelude.Maybe Prelude.Text)
variable_stringValue :: Lens' Variable (Maybe Text)
variable_stringValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Variable' {Maybe Text
stringValue :: Maybe Text
$sel:stringValue:Variable' :: Variable -> Maybe Text
stringValue} -> Maybe Text
stringValue) (\s :: Variable
s@Variable' {} Maybe Text
a -> Variable
s {$sel:stringValue:Variable' :: Maybe Text
stringValue = Maybe Text
a} :: Variable)
variable_name :: Lens.Lens' Variable Prelude.Text
variable_name :: Lens' Variable Text
variable_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Variable' {Text
name :: Text
$sel:name:Variable' :: Variable -> Text
name} -> Text
name) (\s :: Variable
s@Variable' {} Text
a -> Variable
s {$sel:name:Variable' :: Text
name = Text
a} :: Variable)
instance Data.FromJSON Variable where
parseJSON :: Value -> Parser Variable
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Variable"
( \Object
x ->
Maybe DatasetContentVersionValue
-> Maybe Double
-> Maybe OutputFileUriValue
-> Maybe Text
-> Text
-> Variable
Variable'
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
"datasetContentVersionValue")
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
"doubleValue")
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
"outputFileUriValue")
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
"stringValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
)
instance Prelude.Hashable Variable where
hashWithSalt :: Int -> Variable -> Int
hashWithSalt Int
_salt Variable' {Maybe Double
Maybe Text
Maybe DatasetContentVersionValue
Maybe OutputFileUriValue
Text
name :: Text
stringValue :: Maybe Text
outputFileUriValue :: Maybe OutputFileUriValue
doubleValue :: Maybe Double
datasetContentVersionValue :: Maybe DatasetContentVersionValue
$sel:name:Variable' :: Variable -> Text
$sel:stringValue:Variable' :: Variable -> Maybe Text
$sel:outputFileUriValue:Variable' :: Variable -> Maybe OutputFileUriValue
$sel:doubleValue:Variable' :: Variable -> Maybe Double
$sel:datasetContentVersionValue:Variable' :: Variable -> Maybe DatasetContentVersionValue
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatasetContentVersionValue
datasetContentVersionValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
doubleValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OutputFileUriValue
outputFileUriValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stringValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData Variable where
rnf :: Variable -> ()
rnf Variable' {Maybe Double
Maybe Text
Maybe DatasetContentVersionValue
Maybe OutputFileUriValue
Text
name :: Text
stringValue :: Maybe Text
outputFileUriValue :: Maybe OutputFileUriValue
doubleValue :: Maybe Double
datasetContentVersionValue :: Maybe DatasetContentVersionValue
$sel:name:Variable' :: Variable -> Text
$sel:stringValue:Variable' :: Variable -> Maybe Text
$sel:outputFileUriValue:Variable' :: Variable -> Maybe OutputFileUriValue
$sel:doubleValue:Variable' :: Variable -> Maybe Double
$sel:datasetContentVersionValue:Variable' :: Variable -> Maybe DatasetContentVersionValue
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DatasetContentVersionValue
datasetContentVersionValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
doubleValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OutputFileUriValue
outputFileUriValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stringValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON Variable where
toJSON :: Variable -> Value
toJSON Variable' {Maybe Double
Maybe Text
Maybe DatasetContentVersionValue
Maybe OutputFileUriValue
Text
name :: Text
stringValue :: Maybe Text
outputFileUriValue :: Maybe OutputFileUriValue
doubleValue :: Maybe Double
datasetContentVersionValue :: Maybe DatasetContentVersionValue
$sel:name:Variable' :: Variable -> Text
$sel:stringValue:Variable' :: Variable -> Maybe Text
$sel:outputFileUriValue:Variable' :: Variable -> Maybe OutputFileUriValue
$sel:doubleValue:Variable' :: Variable -> Maybe Double
$sel:datasetContentVersionValue:Variable' :: Variable -> Maybe DatasetContentVersionValue
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"datasetContentVersionValue" 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 DatasetContentVersionValue
datasetContentVersionValue,
(Key
"doubleValue" 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 Double
doubleValue,
(Key
"outputFileUriValue" 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 OutputFileUriValue
outputFileUriValue,
(Key
"stringValue" 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
stringValue,
forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)