{-# 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.Glue.GetPartitionIndexes
-- 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)
--
-- Retrieves the partition indexes associated with a table.
--
-- This operation returns paginated results.
module Amazonka.Glue.GetPartitionIndexes
  ( -- * Creating a Request
    GetPartitionIndexes (..),
    newGetPartitionIndexes,

    -- * Request Lenses
    getPartitionIndexes_catalogId,
    getPartitionIndexes_nextToken,
    getPartitionIndexes_databaseName,
    getPartitionIndexes_tableName,

    -- * Destructuring the Response
    GetPartitionIndexesResponse (..),
    newGetPartitionIndexesResponse,

    -- * Response Lenses
    getPartitionIndexesResponse_partitionIndexDescriptorList,
    getPartitionIndexesResponse_nextToken,
    getPartitionIndexesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
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:/ 'newGetPartitionIndexes' smart constructor.
data GetPartitionIndexes = GetPartitionIndexes'
  { -- | The catalog ID where the table resides.
    GetPartitionIndexes -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | A continuation token, included if this is a continuation call.
    GetPartitionIndexes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the name of a database from which you want to retrieve
    -- partition indexes.
    GetPartitionIndexes -> Text
databaseName :: Prelude.Text,
    -- | Specifies the name of a table for which you want to retrieve the
    -- partition indexes.
    GetPartitionIndexes -> Text
tableName :: Prelude.Text
  }
  deriving (GetPartitionIndexes -> GetPartitionIndexes -> Bool
(GetPartitionIndexes -> GetPartitionIndexes -> Bool)
-> (GetPartitionIndexes -> GetPartitionIndexes -> Bool)
-> Eq GetPartitionIndexes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPartitionIndexes -> GetPartitionIndexes -> Bool
$c/= :: GetPartitionIndexes -> GetPartitionIndexes -> Bool
== :: GetPartitionIndexes -> GetPartitionIndexes -> Bool
$c== :: GetPartitionIndexes -> GetPartitionIndexes -> Bool
Prelude.Eq, ReadPrec [GetPartitionIndexes]
ReadPrec GetPartitionIndexes
Int -> ReadS GetPartitionIndexes
ReadS [GetPartitionIndexes]
(Int -> ReadS GetPartitionIndexes)
-> ReadS [GetPartitionIndexes]
-> ReadPrec GetPartitionIndexes
-> ReadPrec [GetPartitionIndexes]
-> Read GetPartitionIndexes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPartitionIndexes]
$creadListPrec :: ReadPrec [GetPartitionIndexes]
readPrec :: ReadPrec GetPartitionIndexes
$creadPrec :: ReadPrec GetPartitionIndexes
readList :: ReadS [GetPartitionIndexes]
$creadList :: ReadS [GetPartitionIndexes]
readsPrec :: Int -> ReadS GetPartitionIndexes
$creadsPrec :: Int -> ReadS GetPartitionIndexes
Prelude.Read, Int -> GetPartitionIndexes -> ShowS
[GetPartitionIndexes] -> ShowS
GetPartitionIndexes -> String
(Int -> GetPartitionIndexes -> ShowS)
-> (GetPartitionIndexes -> String)
-> ([GetPartitionIndexes] -> ShowS)
-> Show GetPartitionIndexes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPartitionIndexes] -> ShowS
$cshowList :: [GetPartitionIndexes] -> ShowS
show :: GetPartitionIndexes -> String
$cshow :: GetPartitionIndexes -> String
showsPrec :: Int -> GetPartitionIndexes -> ShowS
$cshowsPrec :: Int -> GetPartitionIndexes -> ShowS
Prelude.Show, (forall x. GetPartitionIndexes -> Rep GetPartitionIndexes x)
-> (forall x. Rep GetPartitionIndexes x -> GetPartitionIndexes)
-> Generic GetPartitionIndexes
forall x. Rep GetPartitionIndexes x -> GetPartitionIndexes
forall x. GetPartitionIndexes -> Rep GetPartitionIndexes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetPartitionIndexes x -> GetPartitionIndexes
$cfrom :: forall x. GetPartitionIndexes -> Rep GetPartitionIndexes x
Prelude.Generic)

-- |
-- Create a value of 'GetPartitionIndexes' 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:
--
-- 'catalogId', 'getPartitionIndexes_catalogId' - The catalog ID where the table resides.
--
-- 'nextToken', 'getPartitionIndexes_nextToken' - A continuation token, included if this is a continuation call.
--
-- 'databaseName', 'getPartitionIndexes_databaseName' - Specifies the name of a database from which you want to retrieve
-- partition indexes.
--
-- 'tableName', 'getPartitionIndexes_tableName' - Specifies the name of a table for which you want to retrieve the
-- partition indexes.
newGetPartitionIndexes ::
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  GetPartitionIndexes
newGetPartitionIndexes :: Text -> Text -> GetPartitionIndexes
newGetPartitionIndexes Text
pDatabaseName_ Text
pTableName_ =
  GetPartitionIndexes' :: Maybe Text -> Maybe Text -> Text -> Text -> GetPartitionIndexes
GetPartitionIndexes'
    { $sel:catalogId:GetPartitionIndexes' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetPartitionIndexes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:GetPartitionIndexes' :: Text
databaseName = Text
pDatabaseName_,
      $sel:tableName:GetPartitionIndexes' :: Text
tableName = Text
pTableName_
    }

-- | The catalog ID where the table resides.
getPartitionIndexes_catalogId :: Lens.Lens' GetPartitionIndexes (Prelude.Maybe Prelude.Text)
getPartitionIndexes_catalogId :: (Maybe Text -> f (Maybe Text))
-> GetPartitionIndexes -> f GetPartitionIndexes
getPartitionIndexes_catalogId = (GetPartitionIndexes -> Maybe Text)
-> (GetPartitionIndexes -> Maybe Text -> GetPartitionIndexes)
-> Lens
     GetPartitionIndexes GetPartitionIndexes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPartitionIndexes' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetPartitionIndexes' :: GetPartitionIndexes -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetPartitionIndexes
s@GetPartitionIndexes' {} Maybe Text
a -> GetPartitionIndexes
s {$sel:catalogId:GetPartitionIndexes' :: Maybe Text
catalogId = Maybe Text
a} :: GetPartitionIndexes)

-- | A continuation token, included if this is a continuation call.
getPartitionIndexes_nextToken :: Lens.Lens' GetPartitionIndexes (Prelude.Maybe Prelude.Text)
getPartitionIndexes_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetPartitionIndexes -> f GetPartitionIndexes
getPartitionIndexes_nextToken = (GetPartitionIndexes -> Maybe Text)
-> (GetPartitionIndexes -> Maybe Text -> GetPartitionIndexes)
-> Lens
     GetPartitionIndexes GetPartitionIndexes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPartitionIndexes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetPartitionIndexes' :: GetPartitionIndexes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetPartitionIndexes
s@GetPartitionIndexes' {} Maybe Text
a -> GetPartitionIndexes
s {$sel:nextToken:GetPartitionIndexes' :: Maybe Text
nextToken = Maybe Text
a} :: GetPartitionIndexes)

-- | Specifies the name of a database from which you want to retrieve
-- partition indexes.
getPartitionIndexes_databaseName :: Lens.Lens' GetPartitionIndexes Prelude.Text
getPartitionIndexes_databaseName :: (Text -> f Text) -> GetPartitionIndexes -> f GetPartitionIndexes
getPartitionIndexes_databaseName = (GetPartitionIndexes -> Text)
-> (GetPartitionIndexes -> Text -> GetPartitionIndexes)
-> Lens GetPartitionIndexes GetPartitionIndexes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPartitionIndexes' {Text
databaseName :: Text
$sel:databaseName:GetPartitionIndexes' :: GetPartitionIndexes -> Text
databaseName} -> Text
databaseName) (\s :: GetPartitionIndexes
s@GetPartitionIndexes' {} Text
a -> GetPartitionIndexes
s {$sel:databaseName:GetPartitionIndexes' :: Text
databaseName = Text
a} :: GetPartitionIndexes)

-- | Specifies the name of a table for which you want to retrieve the
-- partition indexes.
getPartitionIndexes_tableName :: Lens.Lens' GetPartitionIndexes Prelude.Text
getPartitionIndexes_tableName :: (Text -> f Text) -> GetPartitionIndexes -> f GetPartitionIndexes
getPartitionIndexes_tableName = (GetPartitionIndexes -> Text)
-> (GetPartitionIndexes -> Text -> GetPartitionIndexes)
-> Lens GetPartitionIndexes GetPartitionIndexes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPartitionIndexes' {Text
tableName :: Text
$sel:tableName:GetPartitionIndexes' :: GetPartitionIndexes -> Text
tableName} -> Text
tableName) (\s :: GetPartitionIndexes
s@GetPartitionIndexes' {} Text
a -> GetPartitionIndexes
s {$sel:tableName:GetPartitionIndexes' :: Text
tableName = Text
a} :: GetPartitionIndexes)

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

instance Prelude.NFData GetPartitionIndexes

instance Core.ToHeaders GetPartitionIndexes where
  toHeaders :: GetPartitionIndexes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetPartitionIndexes -> 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
"AWSGlue.GetPartitionIndexes" ::
                          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 GetPartitionIndexes where
  toJSON :: GetPartitionIndexes -> Value
toJSON GetPartitionIndexes' {Maybe Text
Text
tableName :: Text
databaseName :: Text
nextToken :: Maybe Text
catalogId :: Maybe Text
$sel:tableName:GetPartitionIndexes' :: GetPartitionIndexes -> Text
$sel:databaseName:GetPartitionIndexes' :: GetPartitionIndexes -> Text
$sel:nextToken:GetPartitionIndexes' :: GetPartitionIndexes -> Maybe Text
$sel:catalogId:GetPartitionIndexes' :: GetPartitionIndexes -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CatalogId" 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
catalogId,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName)
          ]
      )

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

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

-- | /See:/ 'newGetPartitionIndexesResponse' smart constructor.
data GetPartitionIndexesResponse = GetPartitionIndexesResponse'
  { -- | A list of index descriptors.
    GetPartitionIndexesResponse -> Maybe [PartitionIndexDescriptor]
partitionIndexDescriptorList :: Prelude.Maybe [PartitionIndexDescriptor],
    -- | A continuation token, present if the current list segment is not the
    -- last.
    GetPartitionIndexesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetPartitionIndexesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetPartitionIndexesResponse -> GetPartitionIndexesResponse -> Bool
(GetPartitionIndexesResponse
 -> GetPartitionIndexesResponse -> Bool)
-> (GetPartitionIndexesResponse
    -> GetPartitionIndexesResponse -> Bool)
-> Eq GetPartitionIndexesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPartitionIndexesResponse -> GetPartitionIndexesResponse -> Bool
$c/= :: GetPartitionIndexesResponse -> GetPartitionIndexesResponse -> Bool
== :: GetPartitionIndexesResponse -> GetPartitionIndexesResponse -> Bool
$c== :: GetPartitionIndexesResponse -> GetPartitionIndexesResponse -> Bool
Prelude.Eq, ReadPrec [GetPartitionIndexesResponse]
ReadPrec GetPartitionIndexesResponse
Int -> ReadS GetPartitionIndexesResponse
ReadS [GetPartitionIndexesResponse]
(Int -> ReadS GetPartitionIndexesResponse)
-> ReadS [GetPartitionIndexesResponse]
-> ReadPrec GetPartitionIndexesResponse
-> ReadPrec [GetPartitionIndexesResponse]
-> Read GetPartitionIndexesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPartitionIndexesResponse]
$creadListPrec :: ReadPrec [GetPartitionIndexesResponse]
readPrec :: ReadPrec GetPartitionIndexesResponse
$creadPrec :: ReadPrec GetPartitionIndexesResponse
readList :: ReadS [GetPartitionIndexesResponse]
$creadList :: ReadS [GetPartitionIndexesResponse]
readsPrec :: Int -> ReadS GetPartitionIndexesResponse
$creadsPrec :: Int -> ReadS GetPartitionIndexesResponse
Prelude.Read, Int -> GetPartitionIndexesResponse -> ShowS
[GetPartitionIndexesResponse] -> ShowS
GetPartitionIndexesResponse -> String
(Int -> GetPartitionIndexesResponse -> ShowS)
-> (GetPartitionIndexesResponse -> String)
-> ([GetPartitionIndexesResponse] -> ShowS)
-> Show GetPartitionIndexesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPartitionIndexesResponse] -> ShowS
$cshowList :: [GetPartitionIndexesResponse] -> ShowS
show :: GetPartitionIndexesResponse -> String
$cshow :: GetPartitionIndexesResponse -> String
showsPrec :: Int -> GetPartitionIndexesResponse -> ShowS
$cshowsPrec :: Int -> GetPartitionIndexesResponse -> ShowS
Prelude.Show, (forall x.
 GetPartitionIndexesResponse -> Rep GetPartitionIndexesResponse x)
-> (forall x.
    Rep GetPartitionIndexesResponse x -> GetPartitionIndexesResponse)
-> Generic GetPartitionIndexesResponse
forall x.
Rep GetPartitionIndexesResponse x -> GetPartitionIndexesResponse
forall x.
GetPartitionIndexesResponse -> Rep GetPartitionIndexesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPartitionIndexesResponse x -> GetPartitionIndexesResponse
$cfrom :: forall x.
GetPartitionIndexesResponse -> Rep GetPartitionIndexesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetPartitionIndexesResponse' 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:
--
-- 'partitionIndexDescriptorList', 'getPartitionIndexesResponse_partitionIndexDescriptorList' - A list of index descriptors.
--
-- 'nextToken', 'getPartitionIndexesResponse_nextToken' - A continuation token, present if the current list segment is not the
-- last.
--
-- 'httpStatus', 'getPartitionIndexesResponse_httpStatus' - The response's http status code.
newGetPartitionIndexesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetPartitionIndexesResponse
newGetPartitionIndexesResponse :: Int -> GetPartitionIndexesResponse
newGetPartitionIndexesResponse Int
pHttpStatus_ =
  GetPartitionIndexesResponse' :: Maybe [PartitionIndexDescriptor]
-> Maybe Text -> Int -> GetPartitionIndexesResponse
GetPartitionIndexesResponse'
    { $sel:partitionIndexDescriptorList:GetPartitionIndexesResponse' :: Maybe [PartitionIndexDescriptor]
partitionIndexDescriptorList =
        Maybe [PartitionIndexDescriptor]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetPartitionIndexesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetPartitionIndexesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of index descriptors.
getPartitionIndexesResponse_partitionIndexDescriptorList :: Lens.Lens' GetPartitionIndexesResponse (Prelude.Maybe [PartitionIndexDescriptor])
getPartitionIndexesResponse_partitionIndexDescriptorList :: (Maybe [PartitionIndexDescriptor]
 -> f (Maybe [PartitionIndexDescriptor]))
-> GetPartitionIndexesResponse -> f GetPartitionIndexesResponse
getPartitionIndexesResponse_partitionIndexDescriptorList = (GetPartitionIndexesResponse -> Maybe [PartitionIndexDescriptor])
-> (GetPartitionIndexesResponse
    -> Maybe [PartitionIndexDescriptor] -> GetPartitionIndexesResponse)
-> Lens'
     GetPartitionIndexesResponse (Maybe [PartitionIndexDescriptor])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPartitionIndexesResponse' {Maybe [PartitionIndexDescriptor]
partitionIndexDescriptorList :: Maybe [PartitionIndexDescriptor]
$sel:partitionIndexDescriptorList:GetPartitionIndexesResponse' :: GetPartitionIndexesResponse -> Maybe [PartitionIndexDescriptor]
partitionIndexDescriptorList} -> Maybe [PartitionIndexDescriptor]
partitionIndexDescriptorList) (\s :: GetPartitionIndexesResponse
s@GetPartitionIndexesResponse' {} Maybe [PartitionIndexDescriptor]
a -> GetPartitionIndexesResponse
s {$sel:partitionIndexDescriptorList:GetPartitionIndexesResponse' :: Maybe [PartitionIndexDescriptor]
partitionIndexDescriptorList = Maybe [PartitionIndexDescriptor]
a} :: GetPartitionIndexesResponse) ((Maybe [PartitionIndexDescriptor]
  -> f (Maybe [PartitionIndexDescriptor]))
 -> GetPartitionIndexesResponse -> f GetPartitionIndexesResponse)
-> ((Maybe [PartitionIndexDescriptor]
     -> f (Maybe [PartitionIndexDescriptor]))
    -> Maybe [PartitionIndexDescriptor]
    -> f (Maybe [PartitionIndexDescriptor]))
-> (Maybe [PartitionIndexDescriptor]
    -> f (Maybe [PartitionIndexDescriptor]))
-> GetPartitionIndexesResponse
-> f GetPartitionIndexesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PartitionIndexDescriptor]
  [PartitionIndexDescriptor]
  [PartitionIndexDescriptor]
  [PartitionIndexDescriptor]
-> Iso
     (Maybe [PartitionIndexDescriptor])
     (Maybe [PartitionIndexDescriptor])
     (Maybe [PartitionIndexDescriptor])
     (Maybe [PartitionIndexDescriptor])
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
  [PartitionIndexDescriptor]
  [PartitionIndexDescriptor]
  [PartitionIndexDescriptor]
  [PartitionIndexDescriptor]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A continuation token, present if the current list segment is not the
-- last.
getPartitionIndexesResponse_nextToken :: Lens.Lens' GetPartitionIndexesResponse (Prelude.Maybe Prelude.Text)
getPartitionIndexesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetPartitionIndexesResponse -> f GetPartitionIndexesResponse
getPartitionIndexesResponse_nextToken = (GetPartitionIndexesResponse -> Maybe Text)
-> (GetPartitionIndexesResponse
    -> Maybe Text -> GetPartitionIndexesResponse)
-> Lens' GetPartitionIndexesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPartitionIndexesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetPartitionIndexesResponse' :: GetPartitionIndexesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetPartitionIndexesResponse
s@GetPartitionIndexesResponse' {} Maybe Text
a -> GetPartitionIndexesResponse
s {$sel:nextToken:GetPartitionIndexesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetPartitionIndexesResponse)

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

instance Prelude.NFData GetPartitionIndexesResponse