{-# 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.ColumnRowFilter
-- 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.ColumnRowFilter 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

-- | /See:/ 'newColumnRowFilter' smart constructor.
data ColumnRowFilter = ColumnRowFilter'
  { ColumnRowFilter -> Maybe Text
columnName :: Prelude.Maybe Prelude.Text,
    ColumnRowFilter -> Maybe Text
rowFilterExpression :: Prelude.Maybe Prelude.Text
  }
  deriving (ColumnRowFilter -> ColumnRowFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnRowFilter -> ColumnRowFilter -> Bool
$c/= :: ColumnRowFilter -> ColumnRowFilter -> Bool
== :: ColumnRowFilter -> ColumnRowFilter -> Bool
$c== :: ColumnRowFilter -> ColumnRowFilter -> Bool
Prelude.Eq, ReadPrec [ColumnRowFilter]
ReadPrec ColumnRowFilter
Int -> ReadS ColumnRowFilter
ReadS [ColumnRowFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnRowFilter]
$creadListPrec :: ReadPrec [ColumnRowFilter]
readPrec :: ReadPrec ColumnRowFilter
$creadPrec :: ReadPrec ColumnRowFilter
readList :: ReadS [ColumnRowFilter]
$creadList :: ReadS [ColumnRowFilter]
readsPrec :: Int -> ReadS ColumnRowFilter
$creadsPrec :: Int -> ReadS ColumnRowFilter
Prelude.Read, Int -> ColumnRowFilter -> ShowS
[ColumnRowFilter] -> ShowS
ColumnRowFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnRowFilter] -> ShowS
$cshowList :: [ColumnRowFilter] -> ShowS
show :: ColumnRowFilter -> String
$cshow :: ColumnRowFilter -> String
showsPrec :: Int -> ColumnRowFilter -> ShowS
$cshowsPrec :: Int -> ColumnRowFilter -> ShowS
Prelude.Show, forall x. Rep ColumnRowFilter x -> ColumnRowFilter
forall x. ColumnRowFilter -> Rep ColumnRowFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ColumnRowFilter x -> ColumnRowFilter
$cfrom :: forall x. ColumnRowFilter -> Rep ColumnRowFilter x
Prelude.Generic)

-- |
-- Create a value of 'ColumnRowFilter' 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:
--
-- 'columnName', 'columnRowFilter_columnName' - Undocumented member.
--
-- 'rowFilterExpression', 'columnRowFilter_rowFilterExpression' - Undocumented member.
newColumnRowFilter ::
  ColumnRowFilter
newColumnRowFilter :: ColumnRowFilter
newColumnRowFilter =
  ColumnRowFilter'
    { $sel:columnName:ColumnRowFilter' :: Maybe Text
columnName = forall a. Maybe a
Prelude.Nothing,
      $sel:rowFilterExpression:ColumnRowFilter' :: Maybe Text
rowFilterExpression = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
columnRowFilter_columnName :: Lens.Lens' ColumnRowFilter (Prelude.Maybe Prelude.Text)
columnRowFilter_columnName :: Lens' ColumnRowFilter (Maybe Text)
columnRowFilter_columnName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnRowFilter' {Maybe Text
columnName :: Maybe Text
$sel:columnName:ColumnRowFilter' :: ColumnRowFilter -> Maybe Text
columnName} -> Maybe Text
columnName) (\s :: ColumnRowFilter
s@ColumnRowFilter' {} Maybe Text
a -> ColumnRowFilter
s {$sel:columnName:ColumnRowFilter' :: Maybe Text
columnName = Maybe Text
a} :: ColumnRowFilter)

-- | Undocumented member.
columnRowFilter_rowFilterExpression :: Lens.Lens' ColumnRowFilter (Prelude.Maybe Prelude.Text)
columnRowFilter_rowFilterExpression :: Lens' ColumnRowFilter (Maybe Text)
columnRowFilter_rowFilterExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnRowFilter' {Maybe Text
rowFilterExpression :: Maybe Text
$sel:rowFilterExpression:ColumnRowFilter' :: ColumnRowFilter -> Maybe Text
rowFilterExpression} -> Maybe Text
rowFilterExpression) (\s :: ColumnRowFilter
s@ColumnRowFilter' {} Maybe Text
a -> ColumnRowFilter
s {$sel:rowFilterExpression:ColumnRowFilter' :: Maybe Text
rowFilterExpression = Maybe Text
a} :: ColumnRowFilter)

instance Data.FromJSON ColumnRowFilter where
  parseJSON :: Value -> Parser ColumnRowFilter
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ColumnRowFilter"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ColumnRowFilter
ColumnRowFilter'
            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
"ColumnName")
            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
"RowFilterExpression")
      )

instance Prelude.Hashable ColumnRowFilter where
  hashWithSalt :: Int -> ColumnRowFilter -> Int
hashWithSalt Int
_salt ColumnRowFilter' {Maybe Text
rowFilterExpression :: Maybe Text
columnName :: Maybe Text
$sel:rowFilterExpression:ColumnRowFilter' :: ColumnRowFilter -> Maybe Text
$sel:columnName:ColumnRowFilter' :: ColumnRowFilter -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
columnName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rowFilterExpression

instance Prelude.NFData ColumnRowFilter where
  rnf :: ColumnRowFilter -> ()
rnf ColumnRowFilter' {Maybe Text
rowFilterExpression :: Maybe Text
columnName :: Maybe Text
$sel:rowFilterExpression:ColumnRowFilter' :: ColumnRowFilter -> Maybe Text
$sel:columnName:ColumnRowFilter' :: ColumnRowFilter -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
columnName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rowFilterExpression