{-# 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.TimeStreamQuery.Types.Type 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 {-# SOURCE #-} Amazonka.TimeStreamQuery.Types.ColumnInfo
import Amazonka.TimeStreamQuery.Types.ScalarType
data Type = Type'
{
Type -> Maybe ColumnInfo
arrayColumnInfo :: Prelude.Maybe ColumnInfo,
Type -> Maybe [ColumnInfo]
rowColumnInfo :: Prelude.Maybe [ColumnInfo],
Type -> Maybe ScalarType
scalarType :: Prelude.Maybe ScalarType,
Type -> Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo :: Prelude.Maybe ColumnInfo
}
deriving (Type -> Type -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Type -> Type -> Bool
$c/= :: Type -> Type -> Bool
== :: Type -> Type -> Bool
$c== :: Type -> Type -> Bool
Prelude.Eq, ReadPrec [Type]
ReadPrec Type
Int -> ReadS Type
ReadS [Type]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Type]
$creadListPrec :: ReadPrec [Type]
readPrec :: ReadPrec Type
$creadPrec :: ReadPrec Type
readList :: ReadS [Type]
$creadList :: ReadS [Type]
readsPrec :: Int -> ReadS Type
$creadsPrec :: Int -> ReadS Type
Prelude.Read, Int -> Type -> ShowS
[Type] -> ShowS
Type -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Type] -> ShowS
$cshowList :: [Type] -> ShowS
show :: Type -> String
$cshow :: Type -> String
showsPrec :: Int -> Type -> ShowS
$cshowsPrec :: Int -> Type -> ShowS
Prelude.Show, forall x. Rep Type x -> Type
forall x. Type -> Rep Type x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Type x -> Type
$cfrom :: forall x. Type -> Rep Type x
Prelude.Generic)
newType ::
Type
newType :: Type
newType =
Type'
{ $sel:arrayColumnInfo:Type' :: Maybe ColumnInfo
arrayColumnInfo = forall a. Maybe a
Prelude.Nothing,
$sel:rowColumnInfo:Type' :: Maybe [ColumnInfo]
rowColumnInfo = forall a. Maybe a
Prelude.Nothing,
$sel:scalarType:Type' :: Maybe ScalarType
scalarType = forall a. Maybe a
Prelude.Nothing,
$sel:timeSeriesMeasureValueColumnInfo:Type' :: Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo = forall a. Maybe a
Prelude.Nothing
}
type_arrayColumnInfo :: Lens.Lens' Type (Prelude.Maybe ColumnInfo)
type_arrayColumnInfo :: Lens' Type (Maybe ColumnInfo)
type_arrayColumnInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Type' {Maybe ColumnInfo
arrayColumnInfo :: Maybe ColumnInfo
$sel:arrayColumnInfo:Type' :: Type -> Maybe ColumnInfo
arrayColumnInfo} -> Maybe ColumnInfo
arrayColumnInfo) (\s :: Type
s@Type' {} Maybe ColumnInfo
a -> Type
s {$sel:arrayColumnInfo:Type' :: Maybe ColumnInfo
arrayColumnInfo = Maybe ColumnInfo
a} :: Type)
type_rowColumnInfo :: Lens.Lens' Type (Prelude.Maybe [ColumnInfo])
type_rowColumnInfo :: Lens' Type (Maybe [ColumnInfo])
type_rowColumnInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Type' {Maybe [ColumnInfo]
rowColumnInfo :: Maybe [ColumnInfo]
$sel:rowColumnInfo:Type' :: Type -> Maybe [ColumnInfo]
rowColumnInfo} -> Maybe [ColumnInfo]
rowColumnInfo) (\s :: Type
s@Type' {} Maybe [ColumnInfo]
a -> Type
s {$sel:rowColumnInfo:Type' :: Maybe [ColumnInfo]
rowColumnInfo = Maybe [ColumnInfo]
a} :: Type) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
type_scalarType :: Lens.Lens' Type (Prelude.Maybe ScalarType)
type_scalarType :: Lens' Type (Maybe ScalarType)
type_scalarType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Type' {Maybe ScalarType
scalarType :: Maybe ScalarType
$sel:scalarType:Type' :: Type -> Maybe ScalarType
scalarType} -> Maybe ScalarType
scalarType) (\s :: Type
s@Type' {} Maybe ScalarType
a -> Type
s {$sel:scalarType:Type' :: Maybe ScalarType
scalarType = Maybe ScalarType
a} :: Type)
type_timeSeriesMeasureValueColumnInfo :: Lens.Lens' Type (Prelude.Maybe ColumnInfo)
type_timeSeriesMeasureValueColumnInfo :: Lens' Type (Maybe ColumnInfo)
type_timeSeriesMeasureValueColumnInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Type' {Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo :: Maybe ColumnInfo
$sel:timeSeriesMeasureValueColumnInfo:Type' :: Type -> Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo} -> Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo) (\s :: Type
s@Type' {} Maybe ColumnInfo
a -> Type
s {$sel:timeSeriesMeasureValueColumnInfo:Type' :: Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo = Maybe ColumnInfo
a} :: Type)
instance Data.FromJSON Type where
parseJSON :: Value -> Parser Type
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Type"
( \Object
x ->
Maybe ColumnInfo
-> Maybe [ColumnInfo]
-> Maybe ScalarType
-> Maybe ColumnInfo
-> Type
Type'
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
"ArrayColumnInfo")
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
"RowColumnInfo" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"ScalarType")
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
"TimeSeriesMeasureValueColumnInfo")
)
instance Prelude.Hashable Type where
hashWithSalt :: Int -> Type -> Int
hashWithSalt Int
_salt Type' {Maybe [ColumnInfo]
Maybe ColumnInfo
Maybe ScalarType
timeSeriesMeasureValueColumnInfo :: Maybe ColumnInfo
scalarType :: Maybe ScalarType
rowColumnInfo :: Maybe [ColumnInfo]
arrayColumnInfo :: Maybe ColumnInfo
$sel:timeSeriesMeasureValueColumnInfo:Type' :: Type -> Maybe ColumnInfo
$sel:scalarType:Type' :: Type -> Maybe ScalarType
$sel:rowColumnInfo:Type' :: Type -> Maybe [ColumnInfo]
$sel:arrayColumnInfo:Type' :: Type -> Maybe ColumnInfo
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ColumnInfo
arrayColumnInfo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ColumnInfo]
rowColumnInfo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScalarType
scalarType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo
instance Prelude.NFData Type where
rnf :: Type -> ()
rnf Type' {Maybe [ColumnInfo]
Maybe ColumnInfo
Maybe ScalarType
timeSeriesMeasureValueColumnInfo :: Maybe ColumnInfo
scalarType :: Maybe ScalarType
rowColumnInfo :: Maybe [ColumnInfo]
arrayColumnInfo :: Maybe ColumnInfo
$sel:timeSeriesMeasureValueColumnInfo:Type' :: Type -> Maybe ColumnInfo
$sel:scalarType:Type' :: Type -> Maybe ScalarType
$sel:rowColumnInfo:Type' :: Type -> Maybe [ColumnInfo]
$sel:arrayColumnInfo:Type' :: Type -> Maybe ColumnInfo
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ColumnInfo
arrayColumnInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ColumnInfo]
rowColumnInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScalarType
scalarType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ColumnInfo
timeSeriesMeasureValueColumnInfo