{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Athena.ListDataCatalogs
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the data catalogs in the current Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.Athena.ListDataCatalogs
  ( -- * Creating a Request
    ListDataCatalogs (..),
    newListDataCatalogs,

    -- * Request Lenses
    listDataCatalogs_nextToken,
    listDataCatalogs_maxResults,

    -- * Destructuring the Response
    ListDataCatalogsResponse (..),
    newListDataCatalogsResponse,

    -- * Response Lenses
    listDataCatalogsResponse_dataCatalogsSummary,
    listDataCatalogsResponse_nextToken,
    listDataCatalogsResponse_httpStatus,
  )
where

import Amazonka.Athena.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListDataCatalogs' smart constructor.
data ListDataCatalogs = ListDataCatalogs'
  { -- | A token generated by the Athena service that specifies where to continue
    -- pagination if a previous request was truncated. To obtain the next set
    -- of pages, pass in the NextToken from the response object of the previous
    -- page call.
    ListDataCatalogs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the maximum number of data catalogs to return.
    ListDataCatalogs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListDataCatalogs -> ListDataCatalogs -> Bool
(ListDataCatalogs -> ListDataCatalogs -> Bool)
-> (ListDataCatalogs -> ListDataCatalogs -> Bool)
-> Eq ListDataCatalogs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataCatalogs -> ListDataCatalogs -> Bool
$c/= :: ListDataCatalogs -> ListDataCatalogs -> Bool
== :: ListDataCatalogs -> ListDataCatalogs -> Bool
$c== :: ListDataCatalogs -> ListDataCatalogs -> Bool
Prelude.Eq, ReadPrec [ListDataCatalogs]
ReadPrec ListDataCatalogs
Int -> ReadS ListDataCatalogs
ReadS [ListDataCatalogs]
(Int -> ReadS ListDataCatalogs)
-> ReadS [ListDataCatalogs]
-> ReadPrec ListDataCatalogs
-> ReadPrec [ListDataCatalogs]
-> Read ListDataCatalogs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataCatalogs]
$creadListPrec :: ReadPrec [ListDataCatalogs]
readPrec :: ReadPrec ListDataCatalogs
$creadPrec :: ReadPrec ListDataCatalogs
readList :: ReadS [ListDataCatalogs]
$creadList :: ReadS [ListDataCatalogs]
readsPrec :: Int -> ReadS ListDataCatalogs
$creadsPrec :: Int -> ReadS ListDataCatalogs
Prelude.Read, Int -> ListDataCatalogs -> ShowS
[ListDataCatalogs] -> ShowS
ListDataCatalogs -> String
(Int -> ListDataCatalogs -> ShowS)
-> (ListDataCatalogs -> String)
-> ([ListDataCatalogs] -> ShowS)
-> Show ListDataCatalogs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataCatalogs] -> ShowS
$cshowList :: [ListDataCatalogs] -> ShowS
show :: ListDataCatalogs -> String
$cshow :: ListDataCatalogs -> String
showsPrec :: Int -> ListDataCatalogs -> ShowS
$cshowsPrec :: Int -> ListDataCatalogs -> ShowS
Prelude.Show, (forall x. ListDataCatalogs -> Rep ListDataCatalogs x)
-> (forall x. Rep ListDataCatalogs x -> ListDataCatalogs)
-> Generic ListDataCatalogs
forall x. Rep ListDataCatalogs x -> ListDataCatalogs
forall x. ListDataCatalogs -> Rep ListDataCatalogs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataCatalogs x -> ListDataCatalogs
$cfrom :: forall x. ListDataCatalogs -> Rep ListDataCatalogs x
Prelude.Generic)

-- |
-- Create a value of 'ListDataCatalogs' 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:
--
-- 'nextToken', 'listDataCatalogs_nextToken' - A token generated by the Athena service that specifies where to continue
-- pagination if a previous request was truncated. To obtain the next set
-- of pages, pass in the NextToken from the response object of the previous
-- page call.
--
-- 'maxResults', 'listDataCatalogs_maxResults' - Specifies the maximum number of data catalogs to return.
newListDataCatalogs ::
  ListDataCatalogs
newListDataCatalogs :: ListDataCatalogs
newListDataCatalogs =
  ListDataCatalogs' :: Maybe Text -> Maybe Natural -> ListDataCatalogs
ListDataCatalogs'
    { $sel:nextToken:ListDataCatalogs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDataCatalogs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token generated by the Athena service that specifies where to continue
-- pagination if a previous request was truncated. To obtain the next set
-- of pages, pass in the NextToken from the response object of the previous
-- page call.
listDataCatalogs_nextToken :: Lens.Lens' ListDataCatalogs (Prelude.Maybe Prelude.Text)
listDataCatalogs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDataCatalogs -> f ListDataCatalogs
listDataCatalogs_nextToken = (ListDataCatalogs -> Maybe Text)
-> (ListDataCatalogs -> Maybe Text -> ListDataCatalogs)
-> Lens ListDataCatalogs ListDataCatalogs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataCatalogs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataCatalogs' :: ListDataCatalogs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataCatalogs
s@ListDataCatalogs' {} Maybe Text
a -> ListDataCatalogs
s {$sel:nextToken:ListDataCatalogs' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataCatalogs)

-- | Specifies the maximum number of data catalogs to return.
listDataCatalogs_maxResults :: Lens.Lens' ListDataCatalogs (Prelude.Maybe Prelude.Natural)
listDataCatalogs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDataCatalogs -> f ListDataCatalogs
listDataCatalogs_maxResults = (ListDataCatalogs -> Maybe Natural)
-> (ListDataCatalogs -> Maybe Natural -> ListDataCatalogs)
-> Lens
     ListDataCatalogs ListDataCatalogs (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataCatalogs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDataCatalogs' :: ListDataCatalogs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDataCatalogs
s@ListDataCatalogs' {} Maybe Natural
a -> ListDataCatalogs
s {$sel:maxResults:ListDataCatalogs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDataCatalogs)

instance Core.AWSPager ListDataCatalogs where
  page :: ListDataCatalogs
-> AWSResponse ListDataCatalogs -> Maybe ListDataCatalogs
page ListDataCatalogs
rq AWSResponse ListDataCatalogs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDataCatalogs
ListDataCatalogsResponse
rs
            ListDataCatalogsResponse
-> Getting (First Text) ListDataCatalogsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDataCatalogsResponse
-> Const (First Text) ListDataCatalogsResponse
Lens' ListDataCatalogsResponse (Maybe Text)
listDataCatalogsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDataCatalogsResponse
 -> Const (First Text) ListDataCatalogsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDataCatalogsResponse 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 ListDataCatalogs
forall a. Maybe a
Prelude.Nothing
    | Maybe [DataCatalogSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDataCatalogs
ListDataCatalogsResponse
rs
            ListDataCatalogsResponse
-> Getting
     (First [DataCatalogSummary])
     ListDataCatalogsResponse
     [DataCatalogSummary]
-> Maybe [DataCatalogSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DataCatalogSummary]
 -> Const (First [DataCatalogSummary]) (Maybe [DataCatalogSummary]))
-> ListDataCatalogsResponse
-> Const (First [DataCatalogSummary]) ListDataCatalogsResponse
Lens' ListDataCatalogsResponse (Maybe [DataCatalogSummary])
listDataCatalogsResponse_dataCatalogsSummary
              ((Maybe [DataCatalogSummary]
  -> Const (First [DataCatalogSummary]) (Maybe [DataCatalogSummary]))
 -> ListDataCatalogsResponse
 -> Const (First [DataCatalogSummary]) ListDataCatalogsResponse)
-> (([DataCatalogSummary]
     -> Const (First [DataCatalogSummary]) [DataCatalogSummary])
    -> Maybe [DataCatalogSummary]
    -> Const (First [DataCatalogSummary]) (Maybe [DataCatalogSummary]))
-> Getting
     (First [DataCatalogSummary])
     ListDataCatalogsResponse
     [DataCatalogSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DataCatalogSummary]
 -> Const (First [DataCatalogSummary]) [DataCatalogSummary])
-> Maybe [DataCatalogSummary]
-> Const (First [DataCatalogSummary]) (Maybe [DataCatalogSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDataCatalogs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDataCatalogs -> Maybe ListDataCatalogs
forall a. a -> Maybe a
Prelude.Just (ListDataCatalogs -> Maybe ListDataCatalogs)
-> ListDataCatalogs -> Maybe ListDataCatalogs
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDataCatalogs
rq
          ListDataCatalogs
-> (ListDataCatalogs -> ListDataCatalogs) -> ListDataCatalogs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDataCatalogs -> Identity ListDataCatalogs
Lens ListDataCatalogs ListDataCatalogs (Maybe Text) (Maybe Text)
listDataCatalogs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDataCatalogs -> Identity ListDataCatalogs)
-> Maybe Text -> ListDataCatalogs -> ListDataCatalogs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDataCatalogs
ListDataCatalogsResponse
rs
          ListDataCatalogsResponse
-> Getting (First Text) ListDataCatalogsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDataCatalogsResponse
-> Const (First Text) ListDataCatalogsResponse
Lens' ListDataCatalogsResponse (Maybe Text)
listDataCatalogsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDataCatalogsResponse
 -> Const (First Text) ListDataCatalogsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDataCatalogsResponse 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 ListDataCatalogs where
  type
    AWSResponse ListDataCatalogs =
      ListDataCatalogsResponse
  request :: ListDataCatalogs -> Request ListDataCatalogs
request = Service -> ListDataCatalogs -> Request ListDataCatalogs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDataCatalogs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDataCatalogs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDataCatalogs))
-> Logger
-> Service
-> Proxy ListDataCatalogs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDataCatalogs)))
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 [DataCatalogSummary]
-> Maybe Text -> Int -> ListDataCatalogsResponse
ListDataCatalogsResponse'
            (Maybe [DataCatalogSummary]
 -> Maybe Text -> Int -> ListDataCatalogsResponse)
-> Either String (Maybe [DataCatalogSummary])
-> Either String (Maybe Text -> Int -> ListDataCatalogsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [DataCatalogSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DataCatalogsSummary"
                            Either String (Maybe (Maybe [DataCatalogSummary]))
-> Maybe [DataCatalogSummary]
-> Either String (Maybe [DataCatalogSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DataCatalogSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> ListDataCatalogsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListDataCatalogsResponse)
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 (Int -> ListDataCatalogsResponse)
-> Either String Int -> Either String ListDataCatalogsResponse
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 ListDataCatalogs

instance Prelude.NFData ListDataCatalogs

instance Core.ToHeaders ListDataCatalogs where
  toHeaders :: ListDataCatalogs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDataCatalogs -> 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
"AmazonAthena.ListDataCatalogs" ::
                          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 ListDataCatalogs where
  toJSON :: ListDataCatalogs -> Value
toJSON ListDataCatalogs' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListDataCatalogs' :: ListDataCatalogs -> Maybe Natural
$sel:nextToken:ListDataCatalogs' :: ListDataCatalogs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
          ]
      )

instance Core.ToPath ListDataCatalogs where
  toPath :: ListDataCatalogs -> ByteString
toPath = ByteString -> ListDataCatalogs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListDataCatalogs where
  toQuery :: ListDataCatalogs -> QueryString
toQuery = QueryString -> ListDataCatalogs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListDataCatalogsResponse' smart constructor.
data ListDataCatalogsResponse = ListDataCatalogsResponse'
  { -- | A summary list of data catalogs.
    ListDataCatalogsResponse -> Maybe [DataCatalogSummary]
dataCatalogsSummary :: Prelude.Maybe [DataCatalogSummary],
    -- | A token generated by the Athena service that specifies where to continue
    -- pagination if a previous request was truncated. To obtain the next set
    -- of pages, pass in the NextToken from the response object of the previous
    -- page call.
    ListDataCatalogsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDataCatalogsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool
(ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool)
-> (ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool)
-> Eq ListDataCatalogsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool
$c/= :: ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool
== :: ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool
$c== :: ListDataCatalogsResponse -> ListDataCatalogsResponse -> Bool
Prelude.Eq, ReadPrec [ListDataCatalogsResponse]
ReadPrec ListDataCatalogsResponse
Int -> ReadS ListDataCatalogsResponse
ReadS [ListDataCatalogsResponse]
(Int -> ReadS ListDataCatalogsResponse)
-> ReadS [ListDataCatalogsResponse]
-> ReadPrec ListDataCatalogsResponse
-> ReadPrec [ListDataCatalogsResponse]
-> Read ListDataCatalogsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataCatalogsResponse]
$creadListPrec :: ReadPrec [ListDataCatalogsResponse]
readPrec :: ReadPrec ListDataCatalogsResponse
$creadPrec :: ReadPrec ListDataCatalogsResponse
readList :: ReadS [ListDataCatalogsResponse]
$creadList :: ReadS [ListDataCatalogsResponse]
readsPrec :: Int -> ReadS ListDataCatalogsResponse
$creadsPrec :: Int -> ReadS ListDataCatalogsResponse
Prelude.Read, Int -> ListDataCatalogsResponse -> ShowS
[ListDataCatalogsResponse] -> ShowS
ListDataCatalogsResponse -> String
(Int -> ListDataCatalogsResponse -> ShowS)
-> (ListDataCatalogsResponse -> String)
-> ([ListDataCatalogsResponse] -> ShowS)
-> Show ListDataCatalogsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataCatalogsResponse] -> ShowS
$cshowList :: [ListDataCatalogsResponse] -> ShowS
show :: ListDataCatalogsResponse -> String
$cshow :: ListDataCatalogsResponse -> String
showsPrec :: Int -> ListDataCatalogsResponse -> ShowS
$cshowsPrec :: Int -> ListDataCatalogsResponse -> ShowS
Prelude.Show, (forall x.
 ListDataCatalogsResponse -> Rep ListDataCatalogsResponse x)
-> (forall x.
    Rep ListDataCatalogsResponse x -> ListDataCatalogsResponse)
-> Generic ListDataCatalogsResponse
forall x.
Rep ListDataCatalogsResponse x -> ListDataCatalogsResponse
forall x.
ListDataCatalogsResponse -> Rep ListDataCatalogsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDataCatalogsResponse x -> ListDataCatalogsResponse
$cfrom :: forall x.
ListDataCatalogsResponse -> Rep ListDataCatalogsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDataCatalogsResponse' 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:
--
-- 'dataCatalogsSummary', 'listDataCatalogsResponse_dataCatalogsSummary' - A summary list of data catalogs.
--
-- 'nextToken', 'listDataCatalogsResponse_nextToken' - A token generated by the Athena service that specifies where to continue
-- pagination if a previous request was truncated. To obtain the next set
-- of pages, pass in the NextToken from the response object of the previous
-- page call.
--
-- 'httpStatus', 'listDataCatalogsResponse_httpStatus' - The response's http status code.
newListDataCatalogsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDataCatalogsResponse
newListDataCatalogsResponse :: Int -> ListDataCatalogsResponse
newListDataCatalogsResponse Int
pHttpStatus_ =
  ListDataCatalogsResponse' :: Maybe [DataCatalogSummary]
-> Maybe Text -> Int -> ListDataCatalogsResponse
ListDataCatalogsResponse'
    { $sel:dataCatalogsSummary:ListDataCatalogsResponse' :: Maybe [DataCatalogSummary]
dataCatalogsSummary =
        Maybe [DataCatalogSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDataCatalogsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDataCatalogsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A summary list of data catalogs.
listDataCatalogsResponse_dataCatalogsSummary :: Lens.Lens' ListDataCatalogsResponse (Prelude.Maybe [DataCatalogSummary])
listDataCatalogsResponse_dataCatalogsSummary :: (Maybe [DataCatalogSummary] -> f (Maybe [DataCatalogSummary]))
-> ListDataCatalogsResponse -> f ListDataCatalogsResponse
listDataCatalogsResponse_dataCatalogsSummary = (ListDataCatalogsResponse -> Maybe [DataCatalogSummary])
-> (ListDataCatalogsResponse
    -> Maybe [DataCatalogSummary] -> ListDataCatalogsResponse)
-> Lens' ListDataCatalogsResponse (Maybe [DataCatalogSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataCatalogsResponse' {Maybe [DataCatalogSummary]
dataCatalogsSummary :: Maybe [DataCatalogSummary]
$sel:dataCatalogsSummary:ListDataCatalogsResponse' :: ListDataCatalogsResponse -> Maybe [DataCatalogSummary]
dataCatalogsSummary} -> Maybe [DataCatalogSummary]
dataCatalogsSummary) (\s :: ListDataCatalogsResponse
s@ListDataCatalogsResponse' {} Maybe [DataCatalogSummary]
a -> ListDataCatalogsResponse
s {$sel:dataCatalogsSummary:ListDataCatalogsResponse' :: Maybe [DataCatalogSummary]
dataCatalogsSummary = Maybe [DataCatalogSummary]
a} :: ListDataCatalogsResponse) ((Maybe [DataCatalogSummary] -> f (Maybe [DataCatalogSummary]))
 -> ListDataCatalogsResponse -> f ListDataCatalogsResponse)
-> ((Maybe [DataCatalogSummary] -> f (Maybe [DataCatalogSummary]))
    -> Maybe [DataCatalogSummary] -> f (Maybe [DataCatalogSummary]))
-> (Maybe [DataCatalogSummary] -> f (Maybe [DataCatalogSummary]))
-> ListDataCatalogsResponse
-> f ListDataCatalogsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DataCatalogSummary]
  [DataCatalogSummary]
  [DataCatalogSummary]
  [DataCatalogSummary]
-> Iso
     (Maybe [DataCatalogSummary])
     (Maybe [DataCatalogSummary])
     (Maybe [DataCatalogSummary])
     (Maybe [DataCatalogSummary])
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
  [DataCatalogSummary]
  [DataCatalogSummary]
  [DataCatalogSummary]
  [DataCatalogSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token generated by the Athena service that specifies where to continue
-- pagination if a previous request was truncated. To obtain the next set
-- of pages, pass in the NextToken from the response object of the previous
-- page call.
listDataCatalogsResponse_nextToken :: Lens.Lens' ListDataCatalogsResponse (Prelude.Maybe Prelude.Text)
listDataCatalogsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDataCatalogsResponse -> f ListDataCatalogsResponse
listDataCatalogsResponse_nextToken = (ListDataCatalogsResponse -> Maybe Text)
-> (ListDataCatalogsResponse
    -> Maybe Text -> ListDataCatalogsResponse)
-> Lens' ListDataCatalogsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataCatalogsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataCatalogsResponse' :: ListDataCatalogsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataCatalogsResponse
s@ListDataCatalogsResponse' {} Maybe Text
a -> ListDataCatalogsResponse
s {$sel:nextToken:ListDataCatalogsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataCatalogsResponse)

-- | The response's http status code.
listDataCatalogsResponse_httpStatus :: Lens.Lens' ListDataCatalogsResponse Prelude.Int
listDataCatalogsResponse_httpStatus :: (Int -> f Int)
-> ListDataCatalogsResponse -> f ListDataCatalogsResponse
listDataCatalogsResponse_httpStatus = (ListDataCatalogsResponse -> Int)
-> (ListDataCatalogsResponse -> Int -> ListDataCatalogsResponse)
-> Lens ListDataCatalogsResponse ListDataCatalogsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataCatalogsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDataCatalogsResponse' :: ListDataCatalogsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDataCatalogsResponse
s@ListDataCatalogsResponse' {} Int
a -> ListDataCatalogsResponse
s {$sel:httpStatus:ListDataCatalogsResponse' :: Int
httpStatus = Int
a} :: ListDataCatalogsResponse)

instance Prelude.NFData ListDataCatalogsResponse