{-# 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.ColumnInfo 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.Type
data ColumnInfo = ColumnInfo'
{
ColumnInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ColumnInfo -> Type
type' :: Type
}
deriving (ColumnInfo -> ColumnInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnInfo -> ColumnInfo -> Bool
$c/= :: ColumnInfo -> ColumnInfo -> Bool
== :: ColumnInfo -> ColumnInfo -> Bool
$c== :: ColumnInfo -> ColumnInfo -> Bool
Prelude.Eq, ReadPrec [ColumnInfo]
ReadPrec ColumnInfo
Int -> ReadS ColumnInfo
ReadS [ColumnInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnInfo]
$creadListPrec :: ReadPrec [ColumnInfo]
readPrec :: ReadPrec ColumnInfo
$creadPrec :: ReadPrec ColumnInfo
readList :: ReadS [ColumnInfo]
$creadList :: ReadS [ColumnInfo]
readsPrec :: Int -> ReadS ColumnInfo
$creadsPrec :: Int -> ReadS ColumnInfo
Prelude.Read, Int -> ColumnInfo -> ShowS
[ColumnInfo] -> ShowS
ColumnInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnInfo] -> ShowS
$cshowList :: [ColumnInfo] -> ShowS
show :: ColumnInfo -> String
$cshow :: ColumnInfo -> String
showsPrec :: Int -> ColumnInfo -> ShowS
$cshowsPrec :: Int -> ColumnInfo -> ShowS
Prelude.Show, forall x. Rep ColumnInfo x -> ColumnInfo
forall x. ColumnInfo -> Rep ColumnInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColumnInfo x -> ColumnInfo
$cfrom :: forall x. ColumnInfo -> Rep ColumnInfo x
Prelude.Generic)
newColumnInfo ::
Type ->
ColumnInfo
newColumnInfo :: Type -> ColumnInfo
newColumnInfo Type
pType_ =
ColumnInfo' {$sel:name:ColumnInfo' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing, $sel:type':ColumnInfo' :: Type
type' = Type
pType_}
columnInfo_name :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Text)
columnInfo_name :: Lens' ColumnInfo (Maybe Text)
columnInfo_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Text
name :: Maybe Text
$sel:name:ColumnInfo' :: ColumnInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Text
a -> ColumnInfo
s {$sel:name:ColumnInfo' :: Maybe Text
name = Maybe Text
a} :: ColumnInfo)
columnInfo_type :: Lens.Lens' ColumnInfo Type
columnInfo_type :: Lens' ColumnInfo Type
columnInfo_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Type
type' :: Type
$sel:type':ColumnInfo' :: ColumnInfo -> Type
type'} -> Type
type') (\s :: ColumnInfo
s@ColumnInfo' {} Type
a -> ColumnInfo
s {$sel:type':ColumnInfo' :: Type
type' = Type
a} :: ColumnInfo)
instance Data.FromJSON ColumnInfo where
parseJSON :: Value -> Parser ColumnInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ColumnInfo"
( \Object
x ->
Maybe Text -> Type -> ColumnInfo
ColumnInfo'
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
"Name")
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
"Type")
)
instance Prelude.Hashable ColumnInfo where
hashWithSalt :: Int -> ColumnInfo -> Int
hashWithSalt Int
_salt ColumnInfo' {Maybe Text
Type
type' :: Type
name :: Maybe Text
$sel:type':ColumnInfo' :: ColumnInfo -> Type
$sel:name:ColumnInfo' :: ColumnInfo -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Type
type'
instance Prelude.NFData ColumnInfo where
rnf :: ColumnInfo -> ()
rnf ColumnInfo' {Maybe Text
Type
type' :: Type
name :: Maybe Text
$sel:type':ColumnInfo' :: ColumnInfo -> Type
$sel:name:ColumnInfo' :: ColumnInfo -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Type
type'