{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.RedshiftData.DescribeTable
(
DescribeTable (..),
newDescribeTable,
describeTable_dbUser,
describeTable_connectedDatabase,
describeTable_schema,
describeTable_nextToken,
describeTable_secretArn,
describeTable_table,
describeTable_maxResults,
describeTable_clusterIdentifier,
describeTable_database,
DescribeTableResponse (..),
newDescribeTableResponse,
describeTableResponse_columnList,
describeTableResponse_nextToken,
describeTableResponse_tableName,
describeTableResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftData.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeTable = DescribeTable'
{
DescribeTable -> Maybe Text
dbUser :: Prelude.Maybe Prelude.Text,
DescribeTable -> Maybe Text
connectedDatabase :: Prelude.Maybe Prelude.Text,
DescribeTable -> Maybe Text
schema :: Prelude.Maybe Prelude.Text,
DescribeTable -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeTable -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
DescribeTable -> Maybe Text
table :: Prelude.Maybe Prelude.Text,
DescribeTable -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
DescribeTable -> Text
clusterIdentifier :: Prelude.Text,
DescribeTable -> Text
database :: Prelude.Text
}
deriving (DescribeTable -> DescribeTable -> Bool
(DescribeTable -> DescribeTable -> Bool)
-> (DescribeTable -> DescribeTable -> Bool) -> Eq DescribeTable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTable -> DescribeTable -> Bool
$c/= :: DescribeTable -> DescribeTable -> Bool
== :: DescribeTable -> DescribeTable -> Bool
$c== :: DescribeTable -> DescribeTable -> Bool
Prelude.Eq, ReadPrec [DescribeTable]
ReadPrec DescribeTable
Int -> ReadS DescribeTable
ReadS [DescribeTable]
(Int -> ReadS DescribeTable)
-> ReadS [DescribeTable]
-> ReadPrec DescribeTable
-> ReadPrec [DescribeTable]
-> Read DescribeTable
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTable]
$creadListPrec :: ReadPrec [DescribeTable]
readPrec :: ReadPrec DescribeTable
$creadPrec :: ReadPrec DescribeTable
readList :: ReadS [DescribeTable]
$creadList :: ReadS [DescribeTable]
readsPrec :: Int -> ReadS DescribeTable
$creadsPrec :: Int -> ReadS DescribeTable
Prelude.Read, Int -> DescribeTable -> ShowS
[DescribeTable] -> ShowS
DescribeTable -> String
(Int -> DescribeTable -> ShowS)
-> (DescribeTable -> String)
-> ([DescribeTable] -> ShowS)
-> Show DescribeTable
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTable] -> ShowS
$cshowList :: [DescribeTable] -> ShowS
show :: DescribeTable -> String
$cshow :: DescribeTable -> String
showsPrec :: Int -> DescribeTable -> ShowS
$cshowsPrec :: Int -> DescribeTable -> ShowS
Prelude.Show, (forall x. DescribeTable -> Rep DescribeTable x)
-> (forall x. Rep DescribeTable x -> DescribeTable)
-> Generic DescribeTable
forall x. Rep DescribeTable x -> DescribeTable
forall x. DescribeTable -> Rep DescribeTable x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTable x -> DescribeTable
$cfrom :: forall x. DescribeTable -> Rep DescribeTable x
Prelude.Generic)
newDescribeTable ::
Prelude.Text ->
Prelude.Text ->
DescribeTable
newDescribeTable :: Text -> Text -> DescribeTable
newDescribeTable Text
pClusterIdentifier_ Text
pDatabase_ =
DescribeTable' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> Text
-> DescribeTable
DescribeTable'
{ $sel:dbUser:DescribeTable' :: Maybe Text
dbUser = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectedDatabase:DescribeTable' :: Maybe Text
connectedDatabase = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:schema:DescribeTable' :: Maybe Text
schema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeTable' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:secretArn:DescribeTable' :: Maybe Text
secretArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:table:DescribeTable' :: Maybe Text
table = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:DescribeTable' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:clusterIdentifier:DescribeTable' :: Text
clusterIdentifier = Text
pClusterIdentifier_,
$sel:database:DescribeTable' :: Text
database = Text
pDatabase_
}
describeTable_dbUser :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)
describeTable_dbUser :: (Maybe Text -> f (Maybe Text)) -> DescribeTable -> f DescribeTable
describeTable_dbUser = (DescribeTable -> Maybe Text)
-> (DescribeTable -> Maybe Text -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Text
dbUser :: Maybe Text
$sel:dbUser:DescribeTable' :: DescribeTable -> Maybe Text
dbUser} -> Maybe Text
dbUser) (\s :: DescribeTable
s@DescribeTable' {} Maybe Text
a -> DescribeTable
s {$sel:dbUser:DescribeTable' :: Maybe Text
dbUser = Maybe Text
a} :: DescribeTable)
describeTable_connectedDatabase :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)
describeTable_connectedDatabase :: (Maybe Text -> f (Maybe Text)) -> DescribeTable -> f DescribeTable
describeTable_connectedDatabase = (DescribeTable -> Maybe Text)
-> (DescribeTable -> Maybe Text -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Text
connectedDatabase :: Maybe Text
$sel:connectedDatabase:DescribeTable' :: DescribeTable -> Maybe Text
connectedDatabase} -> Maybe Text
connectedDatabase) (\s :: DescribeTable
s@DescribeTable' {} Maybe Text
a -> DescribeTable
s {$sel:connectedDatabase:DescribeTable' :: Maybe Text
connectedDatabase = Maybe Text
a} :: DescribeTable)
describeTable_schema :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)
describeTable_schema :: (Maybe Text -> f (Maybe Text)) -> DescribeTable -> f DescribeTable
describeTable_schema = (DescribeTable -> Maybe Text)
-> (DescribeTable -> Maybe Text -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Text
schema :: Maybe Text
$sel:schema:DescribeTable' :: DescribeTable -> Maybe Text
schema} -> Maybe Text
schema) (\s :: DescribeTable
s@DescribeTable' {} Maybe Text
a -> DescribeTable
s {$sel:schema:DescribeTable' :: Maybe Text
schema = Maybe Text
a} :: DescribeTable)
describeTable_nextToken :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)
describeTable_nextToken :: (Maybe Text -> f (Maybe Text)) -> DescribeTable -> f DescribeTable
describeTable_nextToken = (DescribeTable -> Maybe Text)
-> (DescribeTable -> Maybe Text -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTable' :: DescribeTable -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTable
s@DescribeTable' {} Maybe Text
a -> DescribeTable
s {$sel:nextToken:DescribeTable' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTable)
describeTable_secretArn :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)
describeTable_secretArn :: (Maybe Text -> f (Maybe Text)) -> DescribeTable -> f DescribeTable
describeTable_secretArn = (DescribeTable -> Maybe Text)
-> (DescribeTable -> Maybe Text -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:DescribeTable' :: DescribeTable -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: DescribeTable
s@DescribeTable' {} Maybe Text
a -> DescribeTable
s {$sel:secretArn:DescribeTable' :: Maybe Text
secretArn = Maybe Text
a} :: DescribeTable)
describeTable_table :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)
describeTable_table :: (Maybe Text -> f (Maybe Text)) -> DescribeTable -> f DescribeTable
describeTable_table = (DescribeTable -> Maybe Text)
-> (DescribeTable -> Maybe Text -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Text
table :: Maybe Text
$sel:table:DescribeTable' :: DescribeTable -> Maybe Text
table} -> Maybe Text
table) (\s :: DescribeTable
s@DescribeTable' {} Maybe Text
a -> DescribeTable
s {$sel:table:DescribeTable' :: Maybe Text
table = Maybe Text
a} :: DescribeTable)
describeTable_maxResults :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Natural)
describeTable_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeTable -> f DescribeTable
describeTable_maxResults = (DescribeTable -> Maybe Natural)
-> (DescribeTable -> Maybe Natural -> DescribeTable)
-> Lens DescribeTable DescribeTable (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeTable' :: DescribeTable -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeTable
s@DescribeTable' {} Maybe Natural
a -> DescribeTable
s {$sel:maxResults:DescribeTable' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeTable)
describeTable_clusterIdentifier :: Lens.Lens' DescribeTable Prelude.Text
describeTable_clusterIdentifier :: (Text -> f Text) -> DescribeTable -> f DescribeTable
describeTable_clusterIdentifier = (DescribeTable -> Text)
-> (DescribeTable -> Text -> DescribeTable)
-> Lens DescribeTable DescribeTable Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:DescribeTable' :: DescribeTable -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: DescribeTable
s@DescribeTable' {} Text
a -> DescribeTable
s {$sel:clusterIdentifier:DescribeTable' :: Text
clusterIdentifier = Text
a} :: DescribeTable)
describeTable_database :: Lens.Lens' DescribeTable Prelude.Text
describeTable_database :: (Text -> f Text) -> DescribeTable -> f DescribeTable
describeTable_database = (DescribeTable -> Text)
-> (DescribeTable -> Text -> DescribeTable)
-> Lens DescribeTable DescribeTable Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTable' {Text
database :: Text
$sel:database:DescribeTable' :: DescribeTable -> Text
database} -> Text
database) (\s :: DescribeTable
s@DescribeTable' {} Text
a -> DescribeTable
s {$sel:database:DescribeTable' :: Text
database = Text
a} :: DescribeTable)
instance Core.AWSPager DescribeTable where
page :: DescribeTable -> AWSResponse DescribeTable -> Maybe DescribeTable
page DescribeTable
rq AWSResponse DescribeTable
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeTable
DescribeTableResponse
rs
DescribeTableResponse
-> Getting (First Text) DescribeTableResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTableResponse
-> Const (First Text) DescribeTableResponse
Lens' DescribeTableResponse (Maybe Text)
describeTableResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTableResponse
-> Const (First Text) DescribeTableResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeTableResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeTable
forall a. Maybe a
Prelude.Nothing
| Maybe [ColumnMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeTable
DescribeTableResponse
rs
DescribeTableResponse
-> Getting
(First [ColumnMetadata]) DescribeTableResponse [ColumnMetadata]
-> Maybe [ColumnMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ColumnMetadata]
-> Const (First [ColumnMetadata]) (Maybe [ColumnMetadata]))
-> DescribeTableResponse
-> Const (First [ColumnMetadata]) DescribeTableResponse
Lens' DescribeTableResponse (Maybe [ColumnMetadata])
describeTableResponse_columnList
((Maybe [ColumnMetadata]
-> Const (First [ColumnMetadata]) (Maybe [ColumnMetadata]))
-> DescribeTableResponse
-> Const (First [ColumnMetadata]) DescribeTableResponse)
-> (([ColumnMetadata]
-> Const (First [ColumnMetadata]) [ColumnMetadata])
-> Maybe [ColumnMetadata]
-> Const (First [ColumnMetadata]) (Maybe [ColumnMetadata]))
-> Getting
(First [ColumnMetadata]) DescribeTableResponse [ColumnMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ColumnMetadata]
-> Const (First [ColumnMetadata]) [ColumnMetadata])
-> Maybe [ColumnMetadata]
-> Const (First [ColumnMetadata]) (Maybe [ColumnMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeTable
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeTable -> Maybe DescribeTable
forall a. a -> Maybe a
Prelude.Just (DescribeTable -> Maybe DescribeTable)
-> DescribeTable -> Maybe DescribeTable
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeTable
rq
DescribeTable -> (DescribeTable -> DescribeTable) -> DescribeTable
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeTable -> Identity DescribeTable
Lens DescribeTable DescribeTable (Maybe Text) (Maybe Text)
describeTable_nextToken
((Maybe Text -> Identity (Maybe Text))
-> DescribeTable -> Identity DescribeTable)
-> Maybe Text -> DescribeTable -> DescribeTable
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTable
DescribeTableResponse
rs
DescribeTableResponse
-> Getting (First Text) DescribeTableResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTableResponse
-> Const (First Text) DescribeTableResponse
Lens' DescribeTableResponse (Maybe Text)
describeTableResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTableResponse
-> Const (First Text) DescribeTableResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeTableResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest DescribeTable where
type
AWSResponse DescribeTable =
DescribeTableResponse
request :: DescribeTable -> Request DescribeTable
request = Service -> DescribeTable -> Request DescribeTable
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeTable
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTable)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeTable))
-> Logger
-> Service
-> Proxy DescribeTable
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeTable)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [ColumnMetadata]
-> Maybe Text -> Maybe Text -> Int -> DescribeTableResponse
DescribeTableResponse'
(Maybe [ColumnMetadata]
-> Maybe Text -> Maybe Text -> Int -> DescribeTableResponse)
-> Either String (Maybe [ColumnMetadata])
-> Either
String (Maybe Text -> Maybe Text -> Int -> DescribeTableResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ColumnMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ColumnList" Either String (Maybe (Maybe [ColumnMetadata]))
-> Maybe [ColumnMetadata] -> Either String (Maybe [ColumnMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ColumnMetadata]
forall a. Monoid a => a
Prelude.mempty)
Either
String (Maybe Text -> Maybe Text -> Int -> DescribeTableResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DescribeTableResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either String (Maybe Text -> Int -> DescribeTableResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeTableResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TableName")
Either String (Int -> DescribeTableResponse)
-> Either String Int -> Either String DescribeTableResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeTable
instance Prelude.NFData DescribeTable
instance Core.ToHeaders DescribeTable where
toHeaders :: DescribeTable -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeTable -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"RedshiftData.DescribeTable" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeTable where
toJSON :: DescribeTable -> Value
toJSON DescribeTable' {Maybe Natural
Maybe Text
Text
database :: Text
clusterIdentifier :: Text
maxResults :: Maybe Natural
table :: Maybe Text
secretArn :: Maybe Text
nextToken :: Maybe Text
schema :: Maybe Text
connectedDatabase :: Maybe Text
dbUser :: Maybe Text
$sel:database:DescribeTable' :: DescribeTable -> Text
$sel:clusterIdentifier:DescribeTable' :: DescribeTable -> Text
$sel:maxResults:DescribeTable' :: DescribeTable -> Maybe Natural
$sel:table:DescribeTable' :: DescribeTable -> Maybe Text
$sel:secretArn:DescribeTable' :: DescribeTable -> Maybe Text
$sel:nextToken:DescribeTable' :: DescribeTable -> Maybe Text
$sel:schema:DescribeTable' :: DescribeTable -> Maybe Text
$sel:connectedDatabase:DescribeTable' :: DescribeTable -> Maybe Text
$sel:dbUser:DescribeTable' :: DescribeTable -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DbUser" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dbUser,
(Text
"ConnectedDatabase" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
connectedDatabase,
(Text
"Schema" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
schema,
(Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"SecretArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
secretArn,
(Text
"Table" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
table,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ClusterIdentifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterIdentifier),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Database" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
database)
]
)
instance Core.ToPath DescribeTable where
toPath :: DescribeTable -> ByteString
toPath = ByteString -> DescribeTable -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeTable where
toQuery :: DescribeTable -> QueryString
toQuery = QueryString -> DescribeTable -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeTableResponse = DescribeTableResponse'
{
DescribeTableResponse -> Maybe [ColumnMetadata]
columnList :: Prelude.Maybe [ColumnMetadata],
DescribeTableResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
DescribeTableResponse -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
DescribeTableResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeTableResponse -> DescribeTableResponse -> Bool
(DescribeTableResponse -> DescribeTableResponse -> Bool)
-> (DescribeTableResponse -> DescribeTableResponse -> Bool)
-> Eq DescribeTableResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTableResponse -> DescribeTableResponse -> Bool
$c/= :: DescribeTableResponse -> DescribeTableResponse -> Bool
== :: DescribeTableResponse -> DescribeTableResponse -> Bool
$c== :: DescribeTableResponse -> DescribeTableResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTableResponse]
ReadPrec DescribeTableResponse
Int -> ReadS DescribeTableResponse
ReadS [DescribeTableResponse]
(Int -> ReadS DescribeTableResponse)
-> ReadS [DescribeTableResponse]
-> ReadPrec DescribeTableResponse
-> ReadPrec [DescribeTableResponse]
-> Read DescribeTableResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTableResponse]
$creadListPrec :: ReadPrec [DescribeTableResponse]
readPrec :: ReadPrec DescribeTableResponse
$creadPrec :: ReadPrec DescribeTableResponse
readList :: ReadS [DescribeTableResponse]
$creadList :: ReadS [DescribeTableResponse]
readsPrec :: Int -> ReadS DescribeTableResponse
$creadsPrec :: Int -> ReadS DescribeTableResponse
Prelude.Read, Int -> DescribeTableResponse -> ShowS
[DescribeTableResponse] -> ShowS
DescribeTableResponse -> String
(Int -> DescribeTableResponse -> ShowS)
-> (DescribeTableResponse -> String)
-> ([DescribeTableResponse] -> ShowS)
-> Show DescribeTableResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTableResponse] -> ShowS
$cshowList :: [DescribeTableResponse] -> ShowS
show :: DescribeTableResponse -> String
$cshow :: DescribeTableResponse -> String
showsPrec :: Int -> DescribeTableResponse -> ShowS
$cshowsPrec :: Int -> DescribeTableResponse -> ShowS
Prelude.Show, (forall x. DescribeTableResponse -> Rep DescribeTableResponse x)
-> (forall x. Rep DescribeTableResponse x -> DescribeTableResponse)
-> Generic DescribeTableResponse
forall x. Rep DescribeTableResponse x -> DescribeTableResponse
forall x. DescribeTableResponse -> Rep DescribeTableResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTableResponse x -> DescribeTableResponse
$cfrom :: forall x. DescribeTableResponse -> Rep DescribeTableResponse x
Prelude.Generic)
newDescribeTableResponse ::
Prelude.Int ->
DescribeTableResponse
newDescribeTableResponse :: Int -> DescribeTableResponse
newDescribeTableResponse Int
pHttpStatus_ =
DescribeTableResponse' :: Maybe [ColumnMetadata]
-> Maybe Text -> Maybe Text -> Int -> DescribeTableResponse
DescribeTableResponse'
{ $sel:columnList:DescribeTableResponse' :: Maybe [ColumnMetadata]
columnList =
Maybe [ColumnMetadata]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:DescribeTableResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tableName:DescribeTableResponse' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeTableResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeTableResponse_columnList :: Lens.Lens' DescribeTableResponse (Prelude.Maybe [ColumnMetadata])
describeTableResponse_columnList :: (Maybe [ColumnMetadata] -> f (Maybe [ColumnMetadata]))
-> DescribeTableResponse -> f DescribeTableResponse
describeTableResponse_columnList = (DescribeTableResponse -> Maybe [ColumnMetadata])
-> (DescribeTableResponse
-> Maybe [ColumnMetadata] -> DescribeTableResponse)
-> Lens' DescribeTableResponse (Maybe [ColumnMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableResponse' {Maybe [ColumnMetadata]
columnList :: Maybe [ColumnMetadata]
$sel:columnList:DescribeTableResponse' :: DescribeTableResponse -> Maybe [ColumnMetadata]
columnList} -> Maybe [ColumnMetadata]
columnList) (\s :: DescribeTableResponse
s@DescribeTableResponse' {} Maybe [ColumnMetadata]
a -> DescribeTableResponse
s {$sel:columnList:DescribeTableResponse' :: Maybe [ColumnMetadata]
columnList = Maybe [ColumnMetadata]
a} :: DescribeTableResponse) ((Maybe [ColumnMetadata] -> f (Maybe [ColumnMetadata]))
-> DescribeTableResponse -> f DescribeTableResponse)
-> ((Maybe [ColumnMetadata] -> f (Maybe [ColumnMetadata]))
-> Maybe [ColumnMetadata] -> f (Maybe [ColumnMetadata]))
-> (Maybe [ColumnMetadata] -> f (Maybe [ColumnMetadata]))
-> DescribeTableResponse
-> f DescribeTableResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ColumnMetadata] [ColumnMetadata] [ColumnMetadata] [ColumnMetadata]
-> Iso
(Maybe [ColumnMetadata])
(Maybe [ColumnMetadata])
(Maybe [ColumnMetadata])
(Maybe [ColumnMetadata])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ColumnMetadata] [ColumnMetadata] [ColumnMetadata] [ColumnMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeTableResponse_nextToken :: Lens.Lens' DescribeTableResponse (Prelude.Maybe Prelude.Text)
describeTableResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeTableResponse -> f DescribeTableResponse
describeTableResponse_nextToken = (DescribeTableResponse -> Maybe Text)
-> (DescribeTableResponse -> Maybe Text -> DescribeTableResponse)
-> Lens' DescribeTableResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeTableResponse' :: DescribeTableResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeTableResponse
s@DescribeTableResponse' {} Maybe Text
a -> DescribeTableResponse
s {$sel:nextToken:DescribeTableResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeTableResponse)
describeTableResponse_tableName :: Lens.Lens' DescribeTableResponse (Prelude.Maybe Prelude.Text)
describeTableResponse_tableName :: (Maybe Text -> f (Maybe Text))
-> DescribeTableResponse -> f DescribeTableResponse
describeTableResponse_tableName = (DescribeTableResponse -> Maybe Text)
-> (DescribeTableResponse -> Maybe Text -> DescribeTableResponse)
-> Lens' DescribeTableResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableResponse' {Maybe Text
tableName :: Maybe Text
$sel:tableName:DescribeTableResponse' :: DescribeTableResponse -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: DescribeTableResponse
s@DescribeTableResponse' {} Maybe Text
a -> DescribeTableResponse
s {$sel:tableName:DescribeTableResponse' :: Maybe Text
tableName = Maybe Text
a} :: DescribeTableResponse)
describeTableResponse_httpStatus :: Lens.Lens' DescribeTableResponse Prelude.Int
describeTableResponse_httpStatus :: (Int -> f Int) -> DescribeTableResponse -> f DescribeTableResponse
describeTableResponse_httpStatus = (DescribeTableResponse -> Int)
-> (DescribeTableResponse -> Int -> DescribeTableResponse)
-> Lens DescribeTableResponse DescribeTableResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTableResponse' :: DescribeTableResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTableResponse
s@DescribeTableResponse' {} Int
a -> DescribeTableResponse
s {$sel:httpStatus:DescribeTableResponse' :: Int
httpStatus = Int
a} :: DescribeTableResponse)
instance Prelude.NFData DescribeTableResponse