{-# 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.MachineLearning.Types.RedshiftMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MachineLearning.Types.RedshiftDatabase
import qualified Amazonka.Prelude as Prelude
data RedshiftMetadata = RedshiftMetadata'
{
RedshiftMetadata -> Maybe Text
selectSqlQuery :: Prelude.Maybe Prelude.Text,
RedshiftMetadata -> Maybe RedshiftDatabase
redshiftDatabase :: Prelude.Maybe RedshiftDatabase,
RedshiftMetadata -> Maybe Text
databaseUserName :: Prelude.Maybe Prelude.Text
}
deriving (RedshiftMetadata -> RedshiftMetadata -> Bool
(RedshiftMetadata -> RedshiftMetadata -> Bool)
-> (RedshiftMetadata -> RedshiftMetadata -> Bool)
-> Eq RedshiftMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftMetadata -> RedshiftMetadata -> Bool
$c/= :: RedshiftMetadata -> RedshiftMetadata -> Bool
== :: RedshiftMetadata -> RedshiftMetadata -> Bool
$c== :: RedshiftMetadata -> RedshiftMetadata -> Bool
Prelude.Eq, ReadPrec [RedshiftMetadata]
ReadPrec RedshiftMetadata
Int -> ReadS RedshiftMetadata
ReadS [RedshiftMetadata]
(Int -> ReadS RedshiftMetadata)
-> ReadS [RedshiftMetadata]
-> ReadPrec RedshiftMetadata
-> ReadPrec [RedshiftMetadata]
-> Read RedshiftMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftMetadata]
$creadListPrec :: ReadPrec [RedshiftMetadata]
readPrec :: ReadPrec RedshiftMetadata
$creadPrec :: ReadPrec RedshiftMetadata
readList :: ReadS [RedshiftMetadata]
$creadList :: ReadS [RedshiftMetadata]
readsPrec :: Int -> ReadS RedshiftMetadata
$creadsPrec :: Int -> ReadS RedshiftMetadata
Prelude.Read, Int -> RedshiftMetadata -> ShowS
[RedshiftMetadata] -> ShowS
RedshiftMetadata -> String
(Int -> RedshiftMetadata -> ShowS)
-> (RedshiftMetadata -> String)
-> ([RedshiftMetadata] -> ShowS)
-> Show RedshiftMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftMetadata] -> ShowS
$cshowList :: [RedshiftMetadata] -> ShowS
show :: RedshiftMetadata -> String
$cshow :: RedshiftMetadata -> String
showsPrec :: Int -> RedshiftMetadata -> ShowS
$cshowsPrec :: Int -> RedshiftMetadata -> ShowS
Prelude.Show, (forall x. RedshiftMetadata -> Rep RedshiftMetadata x)
-> (forall x. Rep RedshiftMetadata x -> RedshiftMetadata)
-> Generic RedshiftMetadata
forall x. Rep RedshiftMetadata x -> RedshiftMetadata
forall x. RedshiftMetadata -> Rep RedshiftMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedshiftMetadata x -> RedshiftMetadata
$cfrom :: forall x. RedshiftMetadata -> Rep RedshiftMetadata x
Prelude.Generic)
newRedshiftMetadata ::
RedshiftMetadata
newRedshiftMetadata :: RedshiftMetadata
newRedshiftMetadata =
RedshiftMetadata' :: Maybe Text
-> Maybe RedshiftDatabase -> Maybe Text -> RedshiftMetadata
RedshiftMetadata'
{ $sel:selectSqlQuery:RedshiftMetadata' :: Maybe Text
selectSqlQuery = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:redshiftDatabase:RedshiftMetadata' :: Maybe RedshiftDatabase
redshiftDatabase = Maybe RedshiftDatabase
forall a. Maybe a
Prelude.Nothing,
$sel:databaseUserName:RedshiftMetadata' :: Maybe Text
databaseUserName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
redshiftMetadata_selectSqlQuery :: Lens.Lens' RedshiftMetadata (Prelude.Maybe Prelude.Text)
redshiftMetadata_selectSqlQuery :: (Maybe Text -> f (Maybe Text))
-> RedshiftMetadata -> f RedshiftMetadata
redshiftMetadata_selectSqlQuery = (RedshiftMetadata -> Maybe Text)
-> (RedshiftMetadata -> Maybe Text -> RedshiftMetadata)
-> Lens RedshiftMetadata RedshiftMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftMetadata' {Maybe Text
selectSqlQuery :: Maybe Text
$sel:selectSqlQuery:RedshiftMetadata' :: RedshiftMetadata -> Maybe Text
selectSqlQuery} -> Maybe Text
selectSqlQuery) (\s :: RedshiftMetadata
s@RedshiftMetadata' {} Maybe Text
a -> RedshiftMetadata
s {$sel:selectSqlQuery:RedshiftMetadata' :: Maybe Text
selectSqlQuery = Maybe Text
a} :: RedshiftMetadata)
redshiftMetadata_redshiftDatabase :: Lens.Lens' RedshiftMetadata (Prelude.Maybe RedshiftDatabase)
redshiftMetadata_redshiftDatabase :: (Maybe RedshiftDatabase -> f (Maybe RedshiftDatabase))
-> RedshiftMetadata -> f RedshiftMetadata
redshiftMetadata_redshiftDatabase = (RedshiftMetadata -> Maybe RedshiftDatabase)
-> (RedshiftMetadata -> Maybe RedshiftDatabase -> RedshiftMetadata)
-> Lens
RedshiftMetadata
RedshiftMetadata
(Maybe RedshiftDatabase)
(Maybe RedshiftDatabase)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftMetadata' {Maybe RedshiftDatabase
redshiftDatabase :: Maybe RedshiftDatabase
$sel:redshiftDatabase:RedshiftMetadata' :: RedshiftMetadata -> Maybe RedshiftDatabase
redshiftDatabase} -> Maybe RedshiftDatabase
redshiftDatabase) (\s :: RedshiftMetadata
s@RedshiftMetadata' {} Maybe RedshiftDatabase
a -> RedshiftMetadata
s {$sel:redshiftDatabase:RedshiftMetadata' :: Maybe RedshiftDatabase
redshiftDatabase = Maybe RedshiftDatabase
a} :: RedshiftMetadata)
redshiftMetadata_databaseUserName :: Lens.Lens' RedshiftMetadata (Prelude.Maybe Prelude.Text)
redshiftMetadata_databaseUserName :: (Maybe Text -> f (Maybe Text))
-> RedshiftMetadata -> f RedshiftMetadata
redshiftMetadata_databaseUserName = (RedshiftMetadata -> Maybe Text)
-> (RedshiftMetadata -> Maybe Text -> RedshiftMetadata)
-> Lens RedshiftMetadata RedshiftMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftMetadata' {Maybe Text
databaseUserName :: Maybe Text
$sel:databaseUserName:RedshiftMetadata' :: RedshiftMetadata -> Maybe Text
databaseUserName} -> Maybe Text
databaseUserName) (\s :: RedshiftMetadata
s@RedshiftMetadata' {} Maybe Text
a -> RedshiftMetadata
s {$sel:databaseUserName:RedshiftMetadata' :: Maybe Text
databaseUserName = Maybe Text
a} :: RedshiftMetadata)
instance Core.FromJSON RedshiftMetadata where
parseJSON :: Value -> Parser RedshiftMetadata
parseJSON =
String
-> (Object -> Parser RedshiftMetadata)
-> Value
-> Parser RedshiftMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RedshiftMetadata"
( \Object
x ->
Maybe Text
-> Maybe RedshiftDatabase -> Maybe Text -> RedshiftMetadata
RedshiftMetadata'
(Maybe Text
-> Maybe RedshiftDatabase -> Maybe Text -> RedshiftMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe RedshiftDatabase -> Maybe Text -> RedshiftMetadata)
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
"SelectSqlQuery")
Parser (Maybe RedshiftDatabase -> Maybe Text -> RedshiftMetadata)
-> Parser (Maybe RedshiftDatabase)
-> Parser (Maybe Text -> RedshiftMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RedshiftDatabase)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RedshiftDatabase")
Parser (Maybe Text -> RedshiftMetadata)
-> Parser (Maybe Text) -> Parser RedshiftMetadata
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
"DatabaseUserName")
)
instance Prelude.Hashable RedshiftMetadata
instance Prelude.NFData RedshiftMetadata