{-# 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.Athena.Types.ColumnInfo where
import Amazonka.Athena.Types.ColumnNullable
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ColumnInfo = ColumnInfo'
{
ColumnInfo -> Maybe Int
scale :: Prelude.Maybe Prelude.Int,
ColumnInfo -> Maybe Int
precision :: Prelude.Maybe Prelude.Int,
ColumnInfo -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
ColumnInfo -> Maybe Text
catalogName :: Prelude.Maybe Prelude.Text,
ColumnInfo -> Maybe Bool
caseSensitive :: Prelude.Maybe Prelude.Bool,
ColumnInfo -> Maybe Text
label :: Prelude.Maybe Prelude.Text,
ColumnInfo -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
ColumnInfo -> Maybe ColumnNullable
nullable :: Prelude.Maybe ColumnNullable,
ColumnInfo -> Text
name :: Prelude.Text,
ColumnInfo -> Text
type' :: Prelude.Text
}
deriving (ColumnInfo -> ColumnInfo -> Bool
(ColumnInfo -> ColumnInfo -> Bool)
-> (ColumnInfo -> ColumnInfo -> Bool) -> Eq ColumnInfo
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]
(Int -> ReadS ColumnInfo)
-> ReadS [ColumnInfo]
-> ReadPrec ColumnInfo
-> ReadPrec [ColumnInfo]
-> Read 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
(Int -> ColumnInfo -> ShowS)
-> (ColumnInfo -> String)
-> ([ColumnInfo] -> ShowS)
-> Show ColumnInfo
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. ColumnInfo -> Rep ColumnInfo x)
-> (forall x. Rep ColumnInfo x -> ColumnInfo) -> Generic ColumnInfo
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 ::
Prelude.Text ->
Prelude.Text ->
ColumnInfo
newColumnInfo :: Text -> Text -> ColumnInfo
newColumnInfo Text
pName_ Text
pType_ =
ColumnInfo' :: Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo
ColumnInfo'
{ $sel:scale:ColumnInfo' :: Maybe Int
scale = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:precision:ColumnInfo' :: Maybe Int
precision = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:schemaName:ColumnInfo' :: Maybe Text
schemaName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:catalogName:ColumnInfo' :: Maybe Text
catalogName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:caseSensitive:ColumnInfo' :: Maybe Bool
caseSensitive = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:label:ColumnInfo' :: Maybe Text
label = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tableName:ColumnInfo' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nullable:ColumnInfo' :: Maybe ColumnNullable
nullable = Maybe ColumnNullable
forall a. Maybe a
Prelude.Nothing,
$sel:name:ColumnInfo' :: Text
name = Text
pName_,
$sel:type':ColumnInfo' :: Text
type' = Text
pType_
}
columnInfo_scale :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Int)
columnInfo_scale :: (Maybe Int -> f (Maybe Int)) -> ColumnInfo -> f ColumnInfo
columnInfo_scale = (ColumnInfo -> Maybe Int)
-> (ColumnInfo -> Maybe Int -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Int
scale :: Maybe Int
$sel:scale:ColumnInfo' :: ColumnInfo -> Maybe Int
scale} -> Maybe Int
scale) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Int
a -> ColumnInfo
s {$sel:scale:ColumnInfo' :: Maybe Int
scale = Maybe Int
a} :: ColumnInfo)
columnInfo_precision :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Int)
columnInfo_precision :: (Maybe Int -> f (Maybe Int)) -> ColumnInfo -> f ColumnInfo
columnInfo_precision = (ColumnInfo -> Maybe Int)
-> (ColumnInfo -> Maybe Int -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Int
precision :: Maybe Int
$sel:precision:ColumnInfo' :: ColumnInfo -> Maybe Int
precision} -> Maybe Int
precision) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Int
a -> ColumnInfo
s {$sel:precision:ColumnInfo' :: Maybe Int
precision = Maybe Int
a} :: ColumnInfo)
columnInfo_schemaName :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Text)
columnInfo_schemaName :: (Maybe Text -> f (Maybe Text)) -> ColumnInfo -> f ColumnInfo
columnInfo_schemaName = (ColumnInfo -> Maybe Text)
-> (ColumnInfo -> Maybe Text -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:ColumnInfo' :: ColumnInfo -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Text
a -> ColumnInfo
s {$sel:schemaName:ColumnInfo' :: Maybe Text
schemaName = Maybe Text
a} :: ColumnInfo)
columnInfo_catalogName :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Text)
columnInfo_catalogName :: (Maybe Text -> f (Maybe Text)) -> ColumnInfo -> f ColumnInfo
columnInfo_catalogName = (ColumnInfo -> Maybe Text)
-> (ColumnInfo -> Maybe Text -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Text
catalogName :: Maybe Text
$sel:catalogName:ColumnInfo' :: ColumnInfo -> Maybe Text
catalogName} -> Maybe Text
catalogName) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Text
a -> ColumnInfo
s {$sel:catalogName:ColumnInfo' :: Maybe Text
catalogName = Maybe Text
a} :: ColumnInfo)
columnInfo_caseSensitive :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Bool)
columnInfo_caseSensitive :: (Maybe Bool -> f (Maybe Bool)) -> ColumnInfo -> f ColumnInfo
columnInfo_caseSensitive = (ColumnInfo -> Maybe Bool)
-> (ColumnInfo -> Maybe Bool -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Bool
caseSensitive :: Maybe Bool
$sel:caseSensitive:ColumnInfo' :: ColumnInfo -> Maybe Bool
caseSensitive} -> Maybe Bool
caseSensitive) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Bool
a -> ColumnInfo
s {$sel:caseSensitive:ColumnInfo' :: Maybe Bool
caseSensitive = Maybe Bool
a} :: ColumnInfo)
columnInfo_label :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Text)
columnInfo_label :: (Maybe Text -> f (Maybe Text)) -> ColumnInfo -> f ColumnInfo
columnInfo_label = (ColumnInfo -> Maybe Text)
-> (ColumnInfo -> Maybe Text -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Text
label :: Maybe Text
$sel:label:ColumnInfo' :: ColumnInfo -> Maybe Text
label} -> Maybe Text
label) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Text
a -> ColumnInfo
s {$sel:label:ColumnInfo' :: Maybe Text
label = Maybe Text
a} :: ColumnInfo)
columnInfo_tableName :: Lens.Lens' ColumnInfo (Prelude.Maybe Prelude.Text)
columnInfo_tableName :: (Maybe Text -> f (Maybe Text)) -> ColumnInfo -> f ColumnInfo
columnInfo_tableName = (ColumnInfo -> Maybe Text)
-> (ColumnInfo -> Maybe Text -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe Text
tableName :: Maybe Text
$sel:tableName:ColumnInfo' :: ColumnInfo -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe Text
a -> ColumnInfo
s {$sel:tableName:ColumnInfo' :: Maybe Text
tableName = Maybe Text
a} :: ColumnInfo)
columnInfo_nullable :: Lens.Lens' ColumnInfo (Prelude.Maybe ColumnNullable)
columnInfo_nullable :: (Maybe ColumnNullable -> f (Maybe ColumnNullable))
-> ColumnInfo -> f ColumnInfo
columnInfo_nullable = (ColumnInfo -> Maybe ColumnNullable)
-> (ColumnInfo -> Maybe ColumnNullable -> ColumnInfo)
-> Lens
ColumnInfo ColumnInfo (Maybe ColumnNullable) (Maybe ColumnNullable)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Maybe ColumnNullable
nullable :: Maybe ColumnNullable
$sel:nullable:ColumnInfo' :: ColumnInfo -> Maybe ColumnNullable
nullable} -> Maybe ColumnNullable
nullable) (\s :: ColumnInfo
s@ColumnInfo' {} Maybe ColumnNullable
a -> ColumnInfo
s {$sel:nullable:ColumnInfo' :: Maybe ColumnNullable
nullable = Maybe ColumnNullable
a} :: ColumnInfo)
columnInfo_name :: Lens.Lens' ColumnInfo Prelude.Text
columnInfo_name :: (Text -> f Text) -> ColumnInfo -> f ColumnInfo
columnInfo_name = (ColumnInfo -> Text)
-> (ColumnInfo -> Text -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Text
name :: Text
$sel:name:ColumnInfo' :: ColumnInfo -> Text
name} -> Text
name) (\s :: ColumnInfo
s@ColumnInfo' {} Text
a -> ColumnInfo
s {$sel:name:ColumnInfo' :: Text
name = Text
a} :: ColumnInfo)
columnInfo_type :: Lens.Lens' ColumnInfo Prelude.Text
columnInfo_type :: (Text -> f Text) -> ColumnInfo -> f ColumnInfo
columnInfo_type = (ColumnInfo -> Text)
-> (ColumnInfo -> Text -> ColumnInfo)
-> Lens ColumnInfo ColumnInfo Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnInfo' {Text
type' :: Text
$sel:type':ColumnInfo' :: ColumnInfo -> Text
type'} -> Text
type') (\s :: ColumnInfo
s@ColumnInfo' {} Text
a -> ColumnInfo
s {$sel:type':ColumnInfo' :: Text
type' = Text
a} :: ColumnInfo)
instance Core.FromJSON ColumnInfo where
parseJSON :: Value -> Parser ColumnInfo
parseJSON =
String
-> (Object -> Parser ColumnInfo) -> Value -> Parser ColumnInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ColumnInfo"
( \Object
x ->
Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo
ColumnInfo'
(Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Scale")
Parser
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Precision")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SchemaName")
Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CatalogName")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CaseSensitive")
Parser
(Maybe Text
-> Maybe Text
-> Maybe ColumnNullable
-> Text
-> Text
-> ColumnInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe ColumnNullable -> Text -> Text -> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Label")
Parser
(Maybe Text -> Maybe ColumnNullable -> Text -> Text -> ColumnInfo)
-> Parser (Maybe Text)
-> Parser (Maybe ColumnNullable -> Text -> Text -> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TableName")
Parser (Maybe ColumnNullable -> Text -> Text -> ColumnInfo)
-> Parser (Maybe ColumnNullable)
-> Parser (Text -> Text -> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ColumnNullable)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Nullable")
Parser (Text -> Text -> ColumnInfo)
-> Parser Text -> Parser (Text -> ColumnInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser (Text -> ColumnInfo) -> Parser Text -> Parser ColumnInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
)
instance Prelude.Hashable ColumnInfo
instance Prelude.NFData ColumnInfo