{-# 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.Glue.Types.NullCheckBoxList
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.NullCheckBoxList 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

-- | Represents whether certain values are recognized as null values for
-- removal.
--
-- /See:/ 'newNullCheckBoxList' smart constructor.
data NullCheckBoxList = NullCheckBoxList'
  { -- | Specifies that an empty string is considered as a null value.
    NullCheckBoxList -> Maybe Bool
isEmpty :: Prelude.Maybe Prelude.Bool,
    -- | Specifies that an integer value of -1 is considered as a null value.
    NullCheckBoxList -> Maybe Bool
isNegOne :: Prelude.Maybe Prelude.Bool,
    -- | Specifies that a value spelling out the word \'null\' is considered as a
    -- null value.
    NullCheckBoxList -> Maybe Bool
isNullString :: Prelude.Maybe Prelude.Bool
  }
  deriving (NullCheckBoxList -> NullCheckBoxList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NullCheckBoxList -> NullCheckBoxList -> Bool
$c/= :: NullCheckBoxList -> NullCheckBoxList -> Bool
== :: NullCheckBoxList -> NullCheckBoxList -> Bool
$c== :: NullCheckBoxList -> NullCheckBoxList -> Bool
Prelude.Eq, ReadPrec [NullCheckBoxList]
ReadPrec NullCheckBoxList
Int -> ReadS NullCheckBoxList
ReadS [NullCheckBoxList]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NullCheckBoxList]
$creadListPrec :: ReadPrec [NullCheckBoxList]
readPrec :: ReadPrec NullCheckBoxList
$creadPrec :: ReadPrec NullCheckBoxList
readList :: ReadS [NullCheckBoxList]
$creadList :: ReadS [NullCheckBoxList]
readsPrec :: Int -> ReadS NullCheckBoxList
$creadsPrec :: Int -> ReadS NullCheckBoxList
Prelude.Read, Int -> NullCheckBoxList -> ShowS
[NullCheckBoxList] -> ShowS
NullCheckBoxList -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NullCheckBoxList] -> ShowS
$cshowList :: [NullCheckBoxList] -> ShowS
show :: NullCheckBoxList -> String
$cshow :: NullCheckBoxList -> String
showsPrec :: Int -> NullCheckBoxList -> ShowS
$cshowsPrec :: Int -> NullCheckBoxList -> ShowS
Prelude.Show, forall x. Rep NullCheckBoxList x -> NullCheckBoxList
forall x. NullCheckBoxList -> Rep NullCheckBoxList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NullCheckBoxList x -> NullCheckBoxList
$cfrom :: forall x. NullCheckBoxList -> Rep NullCheckBoxList x
Prelude.Generic)

-- |
-- Create a value of 'NullCheckBoxList' 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:
--
-- 'isEmpty', 'nullCheckBoxList_isEmpty' - Specifies that an empty string is considered as a null value.
--
-- 'isNegOne', 'nullCheckBoxList_isNegOne' - Specifies that an integer value of -1 is considered as a null value.
--
-- 'isNullString', 'nullCheckBoxList_isNullString' - Specifies that a value spelling out the word \'null\' is considered as a
-- null value.
newNullCheckBoxList ::
  NullCheckBoxList
newNullCheckBoxList :: NullCheckBoxList
newNullCheckBoxList =
  NullCheckBoxList'
    { $sel:isEmpty:NullCheckBoxList' :: Maybe Bool
isEmpty = forall a. Maybe a
Prelude.Nothing,
      $sel:isNegOne:NullCheckBoxList' :: Maybe Bool
isNegOne = forall a. Maybe a
Prelude.Nothing,
      $sel:isNullString:NullCheckBoxList' :: Maybe Bool
isNullString = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies that an empty string is considered as a null value.
nullCheckBoxList_isEmpty :: Lens.Lens' NullCheckBoxList (Prelude.Maybe Prelude.Bool)
nullCheckBoxList_isEmpty :: Lens' NullCheckBoxList (Maybe Bool)
nullCheckBoxList_isEmpty = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NullCheckBoxList' {Maybe Bool
isEmpty :: Maybe Bool
$sel:isEmpty:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
isEmpty} -> Maybe Bool
isEmpty) (\s :: NullCheckBoxList
s@NullCheckBoxList' {} Maybe Bool
a -> NullCheckBoxList
s {$sel:isEmpty:NullCheckBoxList' :: Maybe Bool
isEmpty = Maybe Bool
a} :: NullCheckBoxList)

-- | Specifies that an integer value of -1 is considered as a null value.
nullCheckBoxList_isNegOne :: Lens.Lens' NullCheckBoxList (Prelude.Maybe Prelude.Bool)
nullCheckBoxList_isNegOne :: Lens' NullCheckBoxList (Maybe Bool)
nullCheckBoxList_isNegOne = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NullCheckBoxList' {Maybe Bool
isNegOne :: Maybe Bool
$sel:isNegOne:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
isNegOne} -> Maybe Bool
isNegOne) (\s :: NullCheckBoxList
s@NullCheckBoxList' {} Maybe Bool
a -> NullCheckBoxList
s {$sel:isNegOne:NullCheckBoxList' :: Maybe Bool
isNegOne = Maybe Bool
a} :: NullCheckBoxList)

-- | Specifies that a value spelling out the word \'null\' is considered as a
-- null value.
nullCheckBoxList_isNullString :: Lens.Lens' NullCheckBoxList (Prelude.Maybe Prelude.Bool)
nullCheckBoxList_isNullString :: Lens' NullCheckBoxList (Maybe Bool)
nullCheckBoxList_isNullString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NullCheckBoxList' {Maybe Bool
isNullString :: Maybe Bool
$sel:isNullString:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
isNullString} -> Maybe Bool
isNullString) (\s :: NullCheckBoxList
s@NullCheckBoxList' {} Maybe Bool
a -> NullCheckBoxList
s {$sel:isNullString:NullCheckBoxList' :: Maybe Bool
isNullString = Maybe Bool
a} :: NullCheckBoxList)

instance Data.FromJSON NullCheckBoxList where
  parseJSON :: Value -> Parser NullCheckBoxList
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NullCheckBoxList"
      ( \Object
x ->
          Maybe Bool -> Maybe Bool -> Maybe Bool -> NullCheckBoxList
NullCheckBoxList'
            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
"IsEmpty")
            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
"IsNegOne")
            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
"IsNullString")
      )

instance Prelude.Hashable NullCheckBoxList where
  hashWithSalt :: Int -> NullCheckBoxList -> Int
hashWithSalt Int
_salt NullCheckBoxList' {Maybe Bool
isNullString :: Maybe Bool
isNegOne :: Maybe Bool
isEmpty :: Maybe Bool
$sel:isNullString:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
$sel:isNegOne:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
$sel:isEmpty:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isEmpty
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isNegOne
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isNullString

instance Prelude.NFData NullCheckBoxList where
  rnf :: NullCheckBoxList -> ()
rnf NullCheckBoxList' {Maybe Bool
isNullString :: Maybe Bool
isNegOne :: Maybe Bool
isEmpty :: Maybe Bool
$sel:isNullString:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
$sel:isNegOne:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
$sel:isEmpty:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isEmpty
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isNegOne
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isNullString

instance Data.ToJSON NullCheckBoxList where
  toJSON :: NullCheckBoxList -> Value
toJSON NullCheckBoxList' {Maybe Bool
isNullString :: Maybe Bool
isNegOne :: Maybe Bool
isEmpty :: Maybe Bool
$sel:isNullString:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
$sel:isNegOne:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
$sel:isEmpty:NullCheckBoxList' :: NullCheckBoxList -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"IsEmpty" 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 Bool
isEmpty,
            (Key
"IsNegOne" 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 Bool
isNegOne,
            (Key
"IsNullString" 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 Bool
isNullString
          ]
      )