{-# 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.Kafka.ListKafkaVersions
-- 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)
--
-- Returns a list of Kafka versions.
--
-- This operation returns paginated results.
module Amazonka.Kafka.ListKafkaVersions
  ( -- * Creating a Request
    ListKafkaVersions (..),
    newListKafkaVersions,

    -- * Request Lenses
    listKafkaVersions_nextToken,
    listKafkaVersions_maxResults,

    -- * Destructuring the Response
    ListKafkaVersionsResponse (..),
    newListKafkaVersionsResponse,

    -- * Response Lenses
    listKafkaVersionsResponse_kafkaVersions,
    listKafkaVersionsResponse_nextToken,
    listKafkaVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Kafka.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:/ 'newListKafkaVersions' smart constructor.
data ListKafkaVersions = ListKafkaVersions'
  { -- | The paginated results marker. When the result of the operation is
    -- truncated, the call returns NextToken in the response. To get the next
    -- batch, provide this token in your next request.
    ListKafkaVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response. If there are
    -- more results, the response includes a NextToken parameter.
    ListKafkaVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListKafkaVersions -> ListKafkaVersions -> Bool
(ListKafkaVersions -> ListKafkaVersions -> Bool)
-> (ListKafkaVersions -> ListKafkaVersions -> Bool)
-> Eq ListKafkaVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListKafkaVersions -> ListKafkaVersions -> Bool
$c/= :: ListKafkaVersions -> ListKafkaVersions -> Bool
== :: ListKafkaVersions -> ListKafkaVersions -> Bool
$c== :: ListKafkaVersions -> ListKafkaVersions -> Bool
Prelude.Eq, ReadPrec [ListKafkaVersions]
ReadPrec ListKafkaVersions
Int -> ReadS ListKafkaVersions
ReadS [ListKafkaVersions]
(Int -> ReadS ListKafkaVersions)
-> ReadS [ListKafkaVersions]
-> ReadPrec ListKafkaVersions
-> ReadPrec [ListKafkaVersions]
-> Read ListKafkaVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListKafkaVersions]
$creadListPrec :: ReadPrec [ListKafkaVersions]
readPrec :: ReadPrec ListKafkaVersions
$creadPrec :: ReadPrec ListKafkaVersions
readList :: ReadS [ListKafkaVersions]
$creadList :: ReadS [ListKafkaVersions]
readsPrec :: Int -> ReadS ListKafkaVersions
$creadsPrec :: Int -> ReadS ListKafkaVersions
Prelude.Read, Int -> ListKafkaVersions -> ShowS
[ListKafkaVersions] -> ShowS
ListKafkaVersions -> String
(Int -> ListKafkaVersions -> ShowS)
-> (ListKafkaVersions -> String)
-> ([ListKafkaVersions] -> ShowS)
-> Show ListKafkaVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListKafkaVersions] -> ShowS
$cshowList :: [ListKafkaVersions] -> ShowS
show :: ListKafkaVersions -> String
$cshow :: ListKafkaVersions -> String
showsPrec :: Int -> ListKafkaVersions -> ShowS
$cshowsPrec :: Int -> ListKafkaVersions -> ShowS
Prelude.Show, (forall x. ListKafkaVersions -> Rep ListKafkaVersions x)
-> (forall x. Rep ListKafkaVersions x -> ListKafkaVersions)
-> Generic ListKafkaVersions
forall x. Rep ListKafkaVersions x -> ListKafkaVersions
forall x. ListKafkaVersions -> Rep ListKafkaVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListKafkaVersions x -> ListKafkaVersions
$cfrom :: forall x. ListKafkaVersions -> Rep ListKafkaVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListKafkaVersions' 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', 'listKafkaVersions_nextToken' - The paginated results marker. When the result of the operation is
-- truncated, the call returns NextToken in the response. To get the next
-- batch, provide this token in your next request.
--
-- 'maxResults', 'listKafkaVersions_maxResults' - The maximum number of results to return in the response. If there are
-- more results, the response includes a NextToken parameter.
newListKafkaVersions ::
  ListKafkaVersions
newListKafkaVersions :: ListKafkaVersions
newListKafkaVersions =
  ListKafkaVersions' :: Maybe Text -> Maybe Natural -> ListKafkaVersions
ListKafkaVersions'
    { $sel:nextToken:ListKafkaVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListKafkaVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The paginated results marker. When the result of the operation is
-- truncated, the call returns NextToken in the response. To get the next
-- batch, provide this token in your next request.
listKafkaVersions_nextToken :: Lens.Lens' ListKafkaVersions (Prelude.Maybe Prelude.Text)
listKafkaVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListKafkaVersions -> f ListKafkaVersions
listKafkaVersions_nextToken = (ListKafkaVersions -> Maybe Text)
-> (ListKafkaVersions -> Maybe Text -> ListKafkaVersions)
-> Lens
     ListKafkaVersions ListKafkaVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKafkaVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListKafkaVersions' :: ListKafkaVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListKafkaVersions
s@ListKafkaVersions' {} Maybe Text
a -> ListKafkaVersions
s {$sel:nextToken:ListKafkaVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListKafkaVersions)

-- | The maximum number of results to return in the response. If there are
-- more results, the response includes a NextToken parameter.
listKafkaVersions_maxResults :: Lens.Lens' ListKafkaVersions (Prelude.Maybe Prelude.Natural)
listKafkaVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListKafkaVersions -> f ListKafkaVersions
listKafkaVersions_maxResults = (ListKafkaVersions -> Maybe Natural)
-> (ListKafkaVersions -> Maybe Natural -> ListKafkaVersions)
-> Lens
     ListKafkaVersions ListKafkaVersions (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKafkaVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListKafkaVersions' :: ListKafkaVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListKafkaVersions
s@ListKafkaVersions' {} Maybe Natural
a -> ListKafkaVersions
s {$sel:maxResults:ListKafkaVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListKafkaVersions)

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

instance Prelude.NFData ListKafkaVersions

instance Core.ToHeaders ListKafkaVersions where
  toHeaders :: ListKafkaVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListKafkaVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListKafkaVersions where
  toPath :: ListKafkaVersions -> ByteString
toPath = ByteString -> ListKafkaVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/kafka-versions"

instance Core.ToQuery ListKafkaVersions where
  toQuery :: ListKafkaVersions -> QueryString
toQuery ListKafkaVersions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListKafkaVersions' :: ListKafkaVersions -> Maybe Natural
$sel:nextToken:ListKafkaVersions' :: ListKafkaVersions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListKafkaVersionsResponse' smart constructor.
data ListKafkaVersionsResponse = ListKafkaVersionsResponse'
  { ListKafkaVersionsResponse -> Maybe [KafkaVersion]
kafkaVersions :: Prelude.Maybe [KafkaVersion],
    ListKafkaVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListKafkaVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool
(ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool)
-> (ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool)
-> Eq ListKafkaVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool
$c/= :: ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool
== :: ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool
$c== :: ListKafkaVersionsResponse -> ListKafkaVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListKafkaVersionsResponse]
ReadPrec ListKafkaVersionsResponse
Int -> ReadS ListKafkaVersionsResponse
ReadS [ListKafkaVersionsResponse]
(Int -> ReadS ListKafkaVersionsResponse)
-> ReadS [ListKafkaVersionsResponse]
-> ReadPrec ListKafkaVersionsResponse
-> ReadPrec [ListKafkaVersionsResponse]
-> Read ListKafkaVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListKafkaVersionsResponse]
$creadListPrec :: ReadPrec [ListKafkaVersionsResponse]
readPrec :: ReadPrec ListKafkaVersionsResponse
$creadPrec :: ReadPrec ListKafkaVersionsResponse
readList :: ReadS [ListKafkaVersionsResponse]
$creadList :: ReadS [ListKafkaVersionsResponse]
readsPrec :: Int -> ReadS ListKafkaVersionsResponse
$creadsPrec :: Int -> ReadS ListKafkaVersionsResponse
Prelude.Read, Int -> ListKafkaVersionsResponse -> ShowS
[ListKafkaVersionsResponse] -> ShowS
ListKafkaVersionsResponse -> String
(Int -> ListKafkaVersionsResponse -> ShowS)
-> (ListKafkaVersionsResponse -> String)
-> ([ListKafkaVersionsResponse] -> ShowS)
-> Show ListKafkaVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListKafkaVersionsResponse] -> ShowS
$cshowList :: [ListKafkaVersionsResponse] -> ShowS
show :: ListKafkaVersionsResponse -> String
$cshow :: ListKafkaVersionsResponse -> String
showsPrec :: Int -> ListKafkaVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListKafkaVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListKafkaVersionsResponse -> Rep ListKafkaVersionsResponse x)
-> (forall x.
    Rep ListKafkaVersionsResponse x -> ListKafkaVersionsResponse)
-> Generic ListKafkaVersionsResponse
forall x.
Rep ListKafkaVersionsResponse x -> ListKafkaVersionsResponse
forall x.
ListKafkaVersionsResponse -> Rep ListKafkaVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListKafkaVersionsResponse x -> ListKafkaVersionsResponse
$cfrom :: forall x.
ListKafkaVersionsResponse -> Rep ListKafkaVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListKafkaVersionsResponse' 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:
--
-- 'kafkaVersions', 'listKafkaVersionsResponse_kafkaVersions' - Undocumented member.
--
-- 'nextToken', 'listKafkaVersionsResponse_nextToken' - Undocumented member.
--
-- 'httpStatus', 'listKafkaVersionsResponse_httpStatus' - The response's http status code.
newListKafkaVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListKafkaVersionsResponse
newListKafkaVersionsResponse :: Int -> ListKafkaVersionsResponse
newListKafkaVersionsResponse Int
pHttpStatus_ =
  ListKafkaVersionsResponse' :: Maybe [KafkaVersion]
-> Maybe Text -> Int -> ListKafkaVersionsResponse
ListKafkaVersionsResponse'
    { $sel:kafkaVersions:ListKafkaVersionsResponse' :: Maybe [KafkaVersion]
kafkaVersions =
        Maybe [KafkaVersion]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListKafkaVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListKafkaVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
listKafkaVersionsResponse_kafkaVersions :: Lens.Lens' ListKafkaVersionsResponse (Prelude.Maybe [KafkaVersion])
listKafkaVersionsResponse_kafkaVersions :: (Maybe [KafkaVersion] -> f (Maybe [KafkaVersion]))
-> ListKafkaVersionsResponse -> f ListKafkaVersionsResponse
listKafkaVersionsResponse_kafkaVersions = (ListKafkaVersionsResponse -> Maybe [KafkaVersion])
-> (ListKafkaVersionsResponse
    -> Maybe [KafkaVersion] -> ListKafkaVersionsResponse)
-> Lens' ListKafkaVersionsResponse (Maybe [KafkaVersion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKafkaVersionsResponse' {Maybe [KafkaVersion]
kafkaVersions :: Maybe [KafkaVersion]
$sel:kafkaVersions:ListKafkaVersionsResponse' :: ListKafkaVersionsResponse -> Maybe [KafkaVersion]
kafkaVersions} -> Maybe [KafkaVersion]
kafkaVersions) (\s :: ListKafkaVersionsResponse
s@ListKafkaVersionsResponse' {} Maybe [KafkaVersion]
a -> ListKafkaVersionsResponse
s {$sel:kafkaVersions:ListKafkaVersionsResponse' :: Maybe [KafkaVersion]
kafkaVersions = Maybe [KafkaVersion]
a} :: ListKafkaVersionsResponse) ((Maybe [KafkaVersion] -> f (Maybe [KafkaVersion]))
 -> ListKafkaVersionsResponse -> f ListKafkaVersionsResponse)
-> ((Maybe [KafkaVersion] -> f (Maybe [KafkaVersion]))
    -> Maybe [KafkaVersion] -> f (Maybe [KafkaVersion]))
-> (Maybe [KafkaVersion] -> f (Maybe [KafkaVersion]))
-> ListKafkaVersionsResponse
-> f ListKafkaVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [KafkaVersion] [KafkaVersion] [KafkaVersion] [KafkaVersion]
-> Iso
     (Maybe [KafkaVersion])
     (Maybe [KafkaVersion])
     (Maybe [KafkaVersion])
     (Maybe [KafkaVersion])
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 [KafkaVersion] [KafkaVersion] [KafkaVersion] [KafkaVersion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
listKafkaVersionsResponse_nextToken :: Lens.Lens' ListKafkaVersionsResponse (Prelude.Maybe Prelude.Text)
listKafkaVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListKafkaVersionsResponse -> f ListKafkaVersionsResponse
listKafkaVersionsResponse_nextToken = (ListKafkaVersionsResponse -> Maybe Text)
-> (ListKafkaVersionsResponse
    -> Maybe Text -> ListKafkaVersionsResponse)
-> Lens' ListKafkaVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListKafkaVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListKafkaVersionsResponse' :: ListKafkaVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListKafkaVersionsResponse
s@ListKafkaVersionsResponse' {} Maybe Text
a -> ListKafkaVersionsResponse
s {$sel:nextToken:ListKafkaVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListKafkaVersionsResponse)

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

instance Prelude.NFData ListKafkaVersionsResponse