{-# 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.DMS.Types.TableToReload
-- 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.DMS.Types.TableToReload 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

-- | Provides the name of the schema and table to be reloaded.
--
-- /See:/ 'newTableToReload' smart constructor.
data TableToReload = TableToReload'
  { -- | The schema name of the table to be reloaded.
    TableToReload -> Text
schemaName :: Prelude.Text,
    -- | The table name of the table to be reloaded.
    TableToReload -> Text
tableName :: Prelude.Text
  }
  deriving (TableToReload -> TableToReload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableToReload -> TableToReload -> Bool
$c/= :: TableToReload -> TableToReload -> Bool
== :: TableToReload -> TableToReload -> Bool
$c== :: TableToReload -> TableToReload -> Bool
Prelude.Eq, ReadPrec [TableToReload]
ReadPrec TableToReload
Int -> ReadS TableToReload
ReadS [TableToReload]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableToReload]
$creadListPrec :: ReadPrec [TableToReload]
readPrec :: ReadPrec TableToReload
$creadPrec :: ReadPrec TableToReload
readList :: ReadS [TableToReload]
$creadList :: ReadS [TableToReload]
readsPrec :: Int -> ReadS TableToReload
$creadsPrec :: Int -> ReadS TableToReload
Prelude.Read, Int -> TableToReload -> ShowS
[TableToReload] -> ShowS
TableToReload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableToReload] -> ShowS
$cshowList :: [TableToReload] -> ShowS
show :: TableToReload -> String
$cshow :: TableToReload -> String
showsPrec :: Int -> TableToReload -> ShowS
$cshowsPrec :: Int -> TableToReload -> ShowS
Prelude.Show, forall x. Rep TableToReload x -> TableToReload
forall x. TableToReload -> Rep TableToReload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableToReload x -> TableToReload
$cfrom :: forall x. TableToReload -> Rep TableToReload x
Prelude.Generic)

-- |
-- Create a value of 'TableToReload' 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:
--
-- 'schemaName', 'tableToReload_schemaName' - The schema name of the table to be reloaded.
--
-- 'tableName', 'tableToReload_tableName' - The table name of the table to be reloaded.
newTableToReload ::
  -- | 'schemaName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  TableToReload
newTableToReload :: Text -> Text -> TableToReload
newTableToReload Text
pSchemaName_ Text
pTableName_ =
  TableToReload'
    { $sel:schemaName:TableToReload' :: Text
schemaName = Text
pSchemaName_,
      $sel:tableName:TableToReload' :: Text
tableName = Text
pTableName_
    }

-- | The schema name of the table to be reloaded.
tableToReload_schemaName :: Lens.Lens' TableToReload Prelude.Text
tableToReload_schemaName :: Lens' TableToReload Text
tableToReload_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableToReload' {Text
schemaName :: Text
$sel:schemaName:TableToReload' :: TableToReload -> Text
schemaName} -> Text
schemaName) (\s :: TableToReload
s@TableToReload' {} Text
a -> TableToReload
s {$sel:schemaName:TableToReload' :: Text
schemaName = Text
a} :: TableToReload)

-- | The table name of the table to be reloaded.
tableToReload_tableName :: Lens.Lens' TableToReload Prelude.Text
tableToReload_tableName :: Lens' TableToReload Text
tableToReload_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableToReload' {Text
tableName :: Text
$sel:tableName:TableToReload' :: TableToReload -> Text
tableName} -> Text
tableName) (\s :: TableToReload
s@TableToReload' {} Text
a -> TableToReload
s {$sel:tableName:TableToReload' :: Text
tableName = Text
a} :: TableToReload)

instance Prelude.Hashable TableToReload where
  hashWithSalt :: Int -> TableToReload -> Int
hashWithSalt Int
_salt TableToReload' {Text
tableName :: Text
schemaName :: Text
$sel:tableName:TableToReload' :: TableToReload -> Text
$sel:schemaName:TableToReload' :: TableToReload -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
schemaName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tableName

instance Prelude.NFData TableToReload where
  rnf :: TableToReload -> ()
rnf TableToReload' {Text
tableName :: Text
schemaName :: Text
$sel:tableName:TableToReload' :: TableToReload -> Text
$sel:schemaName:TableToReload' :: TableToReload -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
schemaName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tableName

instance Data.ToJSON TableToReload where
  toJSON :: TableToReload -> Value
toJSON TableToReload' {Text
tableName :: Text
schemaName :: Text
$sel:tableName:TableToReload' :: TableToReload -> Text
$sel:schemaName:TableToReload' :: TableToReload -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"SchemaName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
schemaName),
            forall a. a -> Maybe a
Prelude.Just (Key
"TableName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tableName)
          ]
      )