{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RDSData.Types.ColumnMetadata
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RDSData.Types.ColumnMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains the metadata for a column.
--
-- /See:/ 'newColumnMetadata' smart constructor.
data ColumnMetadata = ColumnMetadata'
  { -- | The database-specific data type of the column.
    ColumnMetadata -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether the column is case-sensitive.
    ColumnMetadata -> Maybe Bool
isCaseSensitive :: Prelude.Maybe Prelude.Bool,
    -- | A value that indicates whether the column contains currency values.
    ColumnMetadata -> Maybe Bool
isCurrency :: Prelude.Maybe Prelude.Bool,
    -- | The scale value of a decimal number column.
    ColumnMetadata -> Maybe Int
scale :: Prelude.Maybe Prelude.Int,
    -- | The precision value of a decimal number column.
    ColumnMetadata -> Maybe Int
precision :: Prelude.Maybe Prelude.Int,
    -- | The name of the schema that owns the table that includes the column.
    ColumnMetadata -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether the column increments automatically.
    ColumnMetadata -> Maybe Bool
isAutoIncrement :: Prelude.Maybe Prelude.Bool,
    -- | The name of the column.
    ColumnMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of the column.
    ColumnMetadata -> Maybe Int
arrayBaseColumnType :: Prelude.Maybe Prelude.Int,
    -- | The type of the column.
    ColumnMetadata -> Maybe Int
type' :: Prelude.Maybe Prelude.Int,
    -- | A value that indicates whether an integer column is signed.
    ColumnMetadata -> Maybe Bool
isSigned :: Prelude.Maybe Prelude.Bool,
    -- | The label for the column.
    ColumnMetadata -> Maybe Text
label :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether the column is nullable.
    ColumnMetadata -> Maybe Int
nullable :: Prelude.Maybe Prelude.Int,
    -- | The name of the table that includes the column.
    ColumnMetadata -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text
  }
  deriving (ColumnMetadata -> ColumnMetadata -> Bool
(ColumnMetadata -> ColumnMetadata -> Bool)
-> (ColumnMetadata -> ColumnMetadata -> Bool) -> Eq ColumnMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnMetadata -> ColumnMetadata -> Bool
$c/= :: ColumnMetadata -> ColumnMetadata -> Bool
== :: ColumnMetadata -> ColumnMetadata -> Bool
$c== :: ColumnMetadata -> ColumnMetadata -> Bool
Prelude.Eq, ReadPrec [ColumnMetadata]
ReadPrec ColumnMetadata
Int -> ReadS ColumnMetadata
ReadS [ColumnMetadata]
(Int -> ReadS ColumnMetadata)
-> ReadS [ColumnMetadata]
-> ReadPrec ColumnMetadata
-> ReadPrec [ColumnMetadata]
-> Read ColumnMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnMetadata]
$creadListPrec :: ReadPrec [ColumnMetadata]
readPrec :: ReadPrec ColumnMetadata
$creadPrec :: ReadPrec ColumnMetadata
readList :: ReadS [ColumnMetadata]
$creadList :: ReadS [ColumnMetadata]
readsPrec :: Int -> ReadS ColumnMetadata
$creadsPrec :: Int -> ReadS ColumnMetadata
Prelude.Read, Int -> ColumnMetadata -> ShowS
[ColumnMetadata] -> ShowS
ColumnMetadata -> String
(Int -> ColumnMetadata -> ShowS)
-> (ColumnMetadata -> String)
-> ([ColumnMetadata] -> ShowS)
-> Show ColumnMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnMetadata] -> ShowS
$cshowList :: [ColumnMetadata] -> ShowS
show :: ColumnMetadata -> String
$cshow :: ColumnMetadata -> String
showsPrec :: Int -> ColumnMetadata -> ShowS
$cshowsPrec :: Int -> ColumnMetadata -> ShowS
Prelude.Show, (forall x. ColumnMetadata -> Rep ColumnMetadata x)
-> (forall x. Rep ColumnMetadata x -> ColumnMetadata)
-> Generic ColumnMetadata
forall x. Rep ColumnMetadata x -> ColumnMetadata
forall x. ColumnMetadata -> Rep ColumnMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColumnMetadata x -> ColumnMetadata
$cfrom :: forall x. ColumnMetadata -> Rep ColumnMetadata x
Prelude.Generic)

-- |
-- Create a value of 'ColumnMetadata' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'typeName', 'columnMetadata_typeName' - The database-specific data type of the column.
--
-- 'isCaseSensitive', 'columnMetadata_isCaseSensitive' - A value that indicates whether the column is case-sensitive.
--
-- 'isCurrency', 'columnMetadata_isCurrency' - A value that indicates whether the column contains currency values.
--
-- 'scale', 'columnMetadata_scale' - The scale value of a decimal number column.
--
-- 'precision', 'columnMetadata_precision' - The precision value of a decimal number column.
--
-- 'schemaName', 'columnMetadata_schemaName' - The name of the schema that owns the table that includes the column.
--
-- 'isAutoIncrement', 'columnMetadata_isAutoIncrement' - A value that indicates whether the column increments automatically.
--
-- 'name', 'columnMetadata_name' - The name of the column.
--
-- 'arrayBaseColumnType', 'columnMetadata_arrayBaseColumnType' - The type of the column.
--
-- 'type'', 'columnMetadata_type' - The type of the column.
--
-- 'isSigned', 'columnMetadata_isSigned' - A value that indicates whether an integer column is signed.
--
-- 'label', 'columnMetadata_label' - The label for the column.
--
-- 'nullable', 'columnMetadata_nullable' - A value that indicates whether the column is nullable.
--
-- 'tableName', 'columnMetadata_tableName' - The name of the table that includes the column.
newColumnMetadata ::
  ColumnMetadata
newColumnMetadata :: ColumnMetadata
newColumnMetadata =
  ColumnMetadata' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ColumnMetadata
ColumnMetadata'
    { $sel:typeName:ColumnMetadata' :: Maybe Text
typeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isCaseSensitive:ColumnMetadata' :: Maybe Bool
isCaseSensitive = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:isCurrency:ColumnMetadata' :: Maybe Bool
isCurrency = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:scale:ColumnMetadata' :: Maybe Int
scale = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:precision:ColumnMetadata' :: Maybe Int
precision = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaName:ColumnMetadata' :: Maybe Text
schemaName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isAutoIncrement:ColumnMetadata' :: Maybe Bool
isAutoIncrement = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ColumnMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arrayBaseColumnType:ColumnMetadata' :: Maybe Int
arrayBaseColumnType = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ColumnMetadata' :: Maybe Int
type' = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:isSigned:ColumnMetadata' :: Maybe Bool
isSigned = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:label:ColumnMetadata' :: Maybe Text
label = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nullable:ColumnMetadata' :: Maybe Int
nullable = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:tableName:ColumnMetadata' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The database-specific data type of the column.
columnMetadata_typeName :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)
columnMetadata_typeName :: (Maybe Text -> f (Maybe Text))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_typeName = (ColumnMetadata -> Maybe Text)
-> (ColumnMetadata -> Maybe Text -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Text
typeName :: Maybe Text
$sel:typeName:ColumnMetadata' :: ColumnMetadata -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Text
a -> ColumnMetadata
s {$sel:typeName:ColumnMetadata' :: Maybe Text
typeName = Maybe Text
a} :: ColumnMetadata)

-- | A value that indicates whether the column is case-sensitive.
columnMetadata_isCaseSensitive :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)
columnMetadata_isCaseSensitive :: (Maybe Bool -> f (Maybe Bool))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_isCaseSensitive = (ColumnMetadata -> Maybe Bool)
-> (ColumnMetadata -> Maybe Bool -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Bool
isCaseSensitive :: Maybe Bool
$sel:isCaseSensitive:ColumnMetadata' :: ColumnMetadata -> Maybe Bool
isCaseSensitive} -> Maybe Bool
isCaseSensitive) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Bool
a -> ColumnMetadata
s {$sel:isCaseSensitive:ColumnMetadata' :: Maybe Bool
isCaseSensitive = Maybe Bool
a} :: ColumnMetadata)

-- | A value that indicates whether the column contains currency values.
columnMetadata_isCurrency :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)
columnMetadata_isCurrency :: (Maybe Bool -> f (Maybe Bool))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_isCurrency = (ColumnMetadata -> Maybe Bool)
-> (ColumnMetadata -> Maybe Bool -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Bool
isCurrency :: Maybe Bool
$sel:isCurrency:ColumnMetadata' :: ColumnMetadata -> Maybe Bool
isCurrency} -> Maybe Bool
isCurrency) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Bool
a -> ColumnMetadata
s {$sel:isCurrency:ColumnMetadata' :: Maybe Bool
isCurrency = Maybe Bool
a} :: ColumnMetadata)

-- | The scale value of a decimal number column.
columnMetadata_scale :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)
columnMetadata_scale :: (Maybe Int -> f (Maybe Int)) -> ColumnMetadata -> f ColumnMetadata
columnMetadata_scale = (ColumnMetadata -> Maybe Int)
-> (ColumnMetadata -> Maybe Int -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Int
scale :: Maybe Int
$sel:scale:ColumnMetadata' :: ColumnMetadata -> Maybe Int
scale} -> Maybe Int
scale) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Int
a -> ColumnMetadata
s {$sel:scale:ColumnMetadata' :: Maybe Int
scale = Maybe Int
a} :: ColumnMetadata)

-- | The precision value of a decimal number column.
columnMetadata_precision :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)
columnMetadata_precision :: (Maybe Int -> f (Maybe Int)) -> ColumnMetadata -> f ColumnMetadata
columnMetadata_precision = (ColumnMetadata -> Maybe Int)
-> (ColumnMetadata -> Maybe Int -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Int
precision :: Maybe Int
$sel:precision:ColumnMetadata' :: ColumnMetadata -> Maybe Int
precision} -> Maybe Int
precision) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Int
a -> ColumnMetadata
s {$sel:precision:ColumnMetadata' :: Maybe Int
precision = Maybe Int
a} :: ColumnMetadata)

-- | The name of the schema that owns the table that includes the column.
columnMetadata_schemaName :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)
columnMetadata_schemaName :: (Maybe Text -> f (Maybe Text))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_schemaName = (ColumnMetadata -> Maybe Text)
-> (ColumnMetadata -> Maybe Text -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:ColumnMetadata' :: ColumnMetadata -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Text
a -> ColumnMetadata
s {$sel:schemaName:ColumnMetadata' :: Maybe Text
schemaName = Maybe Text
a} :: ColumnMetadata)

-- | A value that indicates whether the column increments automatically.
columnMetadata_isAutoIncrement :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)
columnMetadata_isAutoIncrement :: (Maybe Bool -> f (Maybe Bool))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_isAutoIncrement = (ColumnMetadata -> Maybe Bool)
-> (ColumnMetadata -> Maybe Bool -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Bool
isAutoIncrement :: Maybe Bool
$sel:isAutoIncrement:ColumnMetadata' :: ColumnMetadata -> Maybe Bool
isAutoIncrement} -> Maybe Bool
isAutoIncrement) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Bool
a -> ColumnMetadata
s {$sel:isAutoIncrement:ColumnMetadata' :: Maybe Bool
isAutoIncrement = Maybe Bool
a} :: ColumnMetadata)

-- | The name of the column.
columnMetadata_name :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)
columnMetadata_name :: (Maybe Text -> f (Maybe Text))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_name = (ColumnMetadata -> Maybe Text)
-> (ColumnMetadata -> Maybe Text -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Text
name :: Maybe Text
$sel:name:ColumnMetadata' :: ColumnMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Text
a -> ColumnMetadata
s {$sel:name:ColumnMetadata' :: Maybe Text
name = Maybe Text
a} :: ColumnMetadata)

-- | The type of the column.
columnMetadata_arrayBaseColumnType :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)
columnMetadata_arrayBaseColumnType :: (Maybe Int -> f (Maybe Int)) -> ColumnMetadata -> f ColumnMetadata
columnMetadata_arrayBaseColumnType = (ColumnMetadata -> Maybe Int)
-> (ColumnMetadata -> Maybe Int -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Int
arrayBaseColumnType :: Maybe Int
$sel:arrayBaseColumnType:ColumnMetadata' :: ColumnMetadata -> Maybe Int
arrayBaseColumnType} -> Maybe Int
arrayBaseColumnType) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Int
a -> ColumnMetadata
s {$sel:arrayBaseColumnType:ColumnMetadata' :: Maybe Int
arrayBaseColumnType = Maybe Int
a} :: ColumnMetadata)

-- | The type of the column.
columnMetadata_type :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)
columnMetadata_type :: (Maybe Int -> f (Maybe Int)) -> ColumnMetadata -> f ColumnMetadata
columnMetadata_type = (ColumnMetadata -> Maybe Int)
-> (ColumnMetadata -> Maybe Int -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Int
type' :: Maybe Int
$sel:type':ColumnMetadata' :: ColumnMetadata -> Maybe Int
type'} -> Maybe Int
type') (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Int
a -> ColumnMetadata
s {$sel:type':ColumnMetadata' :: Maybe Int
type' = Maybe Int
a} :: ColumnMetadata)

-- | A value that indicates whether an integer column is signed.
columnMetadata_isSigned :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)
columnMetadata_isSigned :: (Maybe Bool -> f (Maybe Bool))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_isSigned = (ColumnMetadata -> Maybe Bool)
-> (ColumnMetadata -> Maybe Bool -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Bool
isSigned :: Maybe Bool
$sel:isSigned:ColumnMetadata' :: ColumnMetadata -> Maybe Bool
isSigned} -> Maybe Bool
isSigned) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Bool
a -> ColumnMetadata
s {$sel:isSigned:ColumnMetadata' :: Maybe Bool
isSigned = Maybe Bool
a} :: ColumnMetadata)

-- | The label for the column.
columnMetadata_label :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)
columnMetadata_label :: (Maybe Text -> f (Maybe Text))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_label = (ColumnMetadata -> Maybe Text)
-> (ColumnMetadata -> Maybe Text -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Text
label :: Maybe Text
$sel:label:ColumnMetadata' :: ColumnMetadata -> Maybe Text
label} -> Maybe Text
label) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Text
a -> ColumnMetadata
s {$sel:label:ColumnMetadata' :: Maybe Text
label = Maybe Text
a} :: ColumnMetadata)

-- | A value that indicates whether the column is nullable.
columnMetadata_nullable :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)
columnMetadata_nullable :: (Maybe Int -> f (Maybe Int)) -> ColumnMetadata -> f ColumnMetadata
columnMetadata_nullable = (ColumnMetadata -> Maybe Int)
-> (ColumnMetadata -> Maybe Int -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Int
nullable :: Maybe Int
$sel:nullable:ColumnMetadata' :: ColumnMetadata -> Maybe Int
nullable} -> Maybe Int
nullable) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Int
a -> ColumnMetadata
s {$sel:nullable:ColumnMetadata' :: Maybe Int
nullable = Maybe Int
a} :: ColumnMetadata)

-- | The name of the table that includes the column.
columnMetadata_tableName :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)
columnMetadata_tableName :: (Maybe Text -> f (Maybe Text))
-> ColumnMetadata -> f ColumnMetadata
columnMetadata_tableName = (ColumnMetadata -> Maybe Text)
-> (ColumnMetadata -> Maybe Text -> ColumnMetadata)
-> Lens ColumnMetadata ColumnMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnMetadata' {Maybe Text
tableName :: Maybe Text
$sel:tableName:ColumnMetadata' :: ColumnMetadata -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: ColumnMetadata
s@ColumnMetadata' {} Maybe Text
a -> ColumnMetadata
s {$sel:tableName:ColumnMetadata' :: Maybe Text
tableName = Maybe Text
a} :: ColumnMetadata)

instance Core.FromJSON ColumnMetadata where
  parseJSON :: Value -> Parser ColumnMetadata
parseJSON =
    String
-> (Object -> Parser ColumnMetadata)
-> Value
-> Parser ColumnMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ColumnMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> ColumnMetadata
ColumnMetadata'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> ColumnMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
forall (f :: * -> *) a b. Functor 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
"typeName")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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
"isCaseSensitive")
            Parser
  (Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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
"isCurrency")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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
"scale")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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 Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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 Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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
"isAutoIncrement")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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
"name")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> ColumnMetadata)
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
"arrayBaseColumnType")
            Parser
  (Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> ColumnMetadata)
-> Parser (Maybe Int)
-> Parser
     (Maybe Bool
      -> Maybe Text -> Maybe Int -> Maybe Text -> ColumnMetadata)
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
"type")
            Parser
  (Maybe Bool
   -> Maybe Text -> Maybe Int -> Maybe Text -> ColumnMetadata)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Int -> Maybe Text -> ColumnMetadata)
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
"isSigned")
            Parser (Maybe Text -> Maybe Int -> Maybe Text -> ColumnMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> ColumnMetadata)
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 Int -> Maybe Text -> ColumnMetadata)
-> Parser (Maybe Int) -> Parser (Maybe Text -> ColumnMetadata)
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
"nullable")
            Parser (Maybe Text -> ColumnMetadata)
-> Parser (Maybe Text) -> Parser ColumnMetadata
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")
      )

instance Prelude.Hashable ColumnMetadata

instance Prelude.NFData ColumnMetadata