{-# 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.EKS.DescribeAddonVersions
-- 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)
--
-- Describes the Kubernetes versions that the add-on can be used with.
--
-- This operation returns paginated results.
module Amazonka.EKS.DescribeAddonVersions
  ( -- * Creating a Request
    DescribeAddonVersions (..),
    newDescribeAddonVersions,

    -- * Request Lenses
    describeAddonVersions_addonName,
    describeAddonVersions_nextToken,
    describeAddonVersions_kubernetesVersion,
    describeAddonVersions_maxResults,

    -- * Destructuring the Response
    DescribeAddonVersionsResponse (..),
    newDescribeAddonVersionsResponse,

    -- * Response Lenses
    describeAddonVersionsResponse_addons,
    describeAddonVersionsResponse_nextToken,
    describeAddonVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.EKS.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:/ 'newDescribeAddonVersions' smart constructor.
data DescribeAddonVersions = DescribeAddonVersions'
  { -- | The name of the add-on. The name must match one of the names returned by
    -- <https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html ListAddons>
    -- .
    DescribeAddonVersions -> Maybe Text
addonName :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ value returned from a previous paginated
    -- @DescribeAddonVersionsRequest@ where @maxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @nextToken@ value.
    --
    -- This token should be treated as an opaque identifier that is used only
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    DescribeAddonVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Kubernetes versions that the add-on can be used with.
    DescribeAddonVersions -> Maybe Text
kubernetesVersion :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    DescribeAddonVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeAddonVersions -> DescribeAddonVersions -> Bool
(DescribeAddonVersions -> DescribeAddonVersions -> Bool)
-> (DescribeAddonVersions -> DescribeAddonVersions -> Bool)
-> Eq DescribeAddonVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAddonVersions -> DescribeAddonVersions -> Bool
$c/= :: DescribeAddonVersions -> DescribeAddonVersions -> Bool
== :: DescribeAddonVersions -> DescribeAddonVersions -> Bool
$c== :: DescribeAddonVersions -> DescribeAddonVersions -> Bool
Prelude.Eq, ReadPrec [DescribeAddonVersions]
ReadPrec DescribeAddonVersions
Int -> ReadS DescribeAddonVersions
ReadS [DescribeAddonVersions]
(Int -> ReadS DescribeAddonVersions)
-> ReadS [DescribeAddonVersions]
-> ReadPrec DescribeAddonVersions
-> ReadPrec [DescribeAddonVersions]
-> Read DescribeAddonVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAddonVersions]
$creadListPrec :: ReadPrec [DescribeAddonVersions]
readPrec :: ReadPrec DescribeAddonVersions
$creadPrec :: ReadPrec DescribeAddonVersions
readList :: ReadS [DescribeAddonVersions]
$creadList :: ReadS [DescribeAddonVersions]
readsPrec :: Int -> ReadS DescribeAddonVersions
$creadsPrec :: Int -> ReadS DescribeAddonVersions
Prelude.Read, Int -> DescribeAddonVersions -> ShowS
[DescribeAddonVersions] -> ShowS
DescribeAddonVersions -> String
(Int -> DescribeAddonVersions -> ShowS)
-> (DescribeAddonVersions -> String)
-> ([DescribeAddonVersions] -> ShowS)
-> Show DescribeAddonVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAddonVersions] -> ShowS
$cshowList :: [DescribeAddonVersions] -> ShowS
show :: DescribeAddonVersions -> String
$cshow :: DescribeAddonVersions -> String
showsPrec :: Int -> DescribeAddonVersions -> ShowS
$cshowsPrec :: Int -> DescribeAddonVersions -> ShowS
Prelude.Show, (forall x. DescribeAddonVersions -> Rep DescribeAddonVersions x)
-> (forall x. Rep DescribeAddonVersions x -> DescribeAddonVersions)
-> Generic DescribeAddonVersions
forall x. Rep DescribeAddonVersions x -> DescribeAddonVersions
forall x. DescribeAddonVersions -> Rep DescribeAddonVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAddonVersions x -> DescribeAddonVersions
$cfrom :: forall x. DescribeAddonVersions -> Rep DescribeAddonVersions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAddonVersions' 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:
--
-- 'addonName', 'describeAddonVersions_addonName' - The name of the add-on. The name must match one of the names returned by
-- <https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html ListAddons>
-- .
--
-- 'nextToken', 'describeAddonVersions_nextToken' - The @nextToken@ value returned from a previous paginated
-- @DescribeAddonVersionsRequest@ where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is used only
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
--
-- 'kubernetesVersion', 'describeAddonVersions_kubernetesVersion' - The Kubernetes versions that the add-on can be used with.
--
-- 'maxResults', 'describeAddonVersions_maxResults' - The maximum number of results to return.
newDescribeAddonVersions ::
  DescribeAddonVersions
newDescribeAddonVersions :: DescribeAddonVersions
newDescribeAddonVersions =
  DescribeAddonVersions' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> DescribeAddonVersions
DescribeAddonVersions'
    { $sel:addonName:DescribeAddonVersions' :: Maybe Text
addonName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAddonVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kubernetesVersion:DescribeAddonVersions' :: Maybe Text
kubernetesVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeAddonVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the add-on. The name must match one of the names returned by
-- <https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html ListAddons>
-- .
describeAddonVersions_addonName :: Lens.Lens' DescribeAddonVersions (Prelude.Maybe Prelude.Text)
describeAddonVersions_addonName :: (Maybe Text -> f (Maybe Text))
-> DescribeAddonVersions -> f DescribeAddonVersions
describeAddonVersions_addonName = (DescribeAddonVersions -> Maybe Text)
-> (DescribeAddonVersions -> Maybe Text -> DescribeAddonVersions)
-> Lens
     DescribeAddonVersions
     DescribeAddonVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddonVersions' {Maybe Text
addonName :: Maybe Text
$sel:addonName:DescribeAddonVersions' :: DescribeAddonVersions -> Maybe Text
addonName} -> Maybe Text
addonName) (\s :: DescribeAddonVersions
s@DescribeAddonVersions' {} Maybe Text
a -> DescribeAddonVersions
s {$sel:addonName:DescribeAddonVersions' :: Maybe Text
addonName = Maybe Text
a} :: DescribeAddonVersions)

-- | The @nextToken@ value returned from a previous paginated
-- @DescribeAddonVersionsRequest@ where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is used only
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
describeAddonVersions_nextToken :: Lens.Lens' DescribeAddonVersions (Prelude.Maybe Prelude.Text)
describeAddonVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAddonVersions -> f DescribeAddonVersions
describeAddonVersions_nextToken = (DescribeAddonVersions -> Maybe Text)
-> (DescribeAddonVersions -> Maybe Text -> DescribeAddonVersions)
-> Lens
     DescribeAddonVersions
     DescribeAddonVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddonVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAddonVersions' :: DescribeAddonVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAddonVersions
s@DescribeAddonVersions' {} Maybe Text
a -> DescribeAddonVersions
s {$sel:nextToken:DescribeAddonVersions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAddonVersions)

-- | The Kubernetes versions that the add-on can be used with.
describeAddonVersions_kubernetesVersion :: Lens.Lens' DescribeAddonVersions (Prelude.Maybe Prelude.Text)
describeAddonVersions_kubernetesVersion :: (Maybe Text -> f (Maybe Text))
-> DescribeAddonVersions -> f DescribeAddonVersions
describeAddonVersions_kubernetesVersion = (DescribeAddonVersions -> Maybe Text)
-> (DescribeAddonVersions -> Maybe Text -> DescribeAddonVersions)
-> Lens
     DescribeAddonVersions
     DescribeAddonVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddonVersions' {Maybe Text
kubernetesVersion :: Maybe Text
$sel:kubernetesVersion:DescribeAddonVersions' :: DescribeAddonVersions -> Maybe Text
kubernetesVersion} -> Maybe Text
kubernetesVersion) (\s :: DescribeAddonVersions
s@DescribeAddonVersions' {} Maybe Text
a -> DescribeAddonVersions
s {$sel:kubernetesVersion:DescribeAddonVersions' :: Maybe Text
kubernetesVersion = Maybe Text
a} :: DescribeAddonVersions)

-- | The maximum number of results to return.
describeAddonVersions_maxResults :: Lens.Lens' DescribeAddonVersions (Prelude.Maybe Prelude.Natural)
describeAddonVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeAddonVersions -> f DescribeAddonVersions
describeAddonVersions_maxResults = (DescribeAddonVersions -> Maybe Natural)
-> (DescribeAddonVersions
    -> Maybe Natural -> DescribeAddonVersions)
-> Lens
     DescribeAddonVersions
     DescribeAddonVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddonVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeAddonVersions' :: DescribeAddonVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeAddonVersions
s@DescribeAddonVersions' {} Maybe Natural
a -> DescribeAddonVersions
s {$sel:maxResults:DescribeAddonVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeAddonVersions)

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

instance Prelude.NFData DescribeAddonVersions

instance Core.ToHeaders DescribeAddonVersions where
  toHeaders :: DescribeAddonVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeAddonVersions -> 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 DescribeAddonVersions where
  toPath :: DescribeAddonVersions -> ByteString
toPath = ByteString -> DescribeAddonVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/addons/supported-versions"

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

-- | /See:/ 'newDescribeAddonVersionsResponse' smart constructor.
data DescribeAddonVersionsResponse = DescribeAddonVersionsResponse'
  { -- | The list of available versions with Kubernetes version compatibility.
    DescribeAddonVersionsResponse -> Maybe [AddonInfo]
addons :: Prelude.Maybe [AddonInfo],
    -- | The @nextToken@ value returned from a previous paginated
    -- @DescribeAddonVersionsResponse@ where @maxResults@ was used and the
    -- results exceeded the value of that parameter. Pagination continues from
    -- the end of the previous results that returned the @nextToken@ value.
    --
    -- This token should be treated as an opaque identifier that is used only
    -- to retrieve the next items in a list and not for other programmatic
    -- purposes.
    DescribeAddonVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeAddonVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAddonVersionsResponse
-> DescribeAddonVersionsResponse -> Bool
(DescribeAddonVersionsResponse
 -> DescribeAddonVersionsResponse -> Bool)
-> (DescribeAddonVersionsResponse
    -> DescribeAddonVersionsResponse -> Bool)
-> Eq DescribeAddonVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAddonVersionsResponse
-> DescribeAddonVersionsResponse -> Bool
$c/= :: DescribeAddonVersionsResponse
-> DescribeAddonVersionsResponse -> Bool
== :: DescribeAddonVersionsResponse
-> DescribeAddonVersionsResponse -> Bool
$c== :: DescribeAddonVersionsResponse
-> DescribeAddonVersionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeAddonVersionsResponse]
ReadPrec DescribeAddonVersionsResponse
Int -> ReadS DescribeAddonVersionsResponse
ReadS [DescribeAddonVersionsResponse]
(Int -> ReadS DescribeAddonVersionsResponse)
-> ReadS [DescribeAddonVersionsResponse]
-> ReadPrec DescribeAddonVersionsResponse
-> ReadPrec [DescribeAddonVersionsResponse]
-> Read DescribeAddonVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAddonVersionsResponse]
$creadListPrec :: ReadPrec [DescribeAddonVersionsResponse]
readPrec :: ReadPrec DescribeAddonVersionsResponse
$creadPrec :: ReadPrec DescribeAddonVersionsResponse
readList :: ReadS [DescribeAddonVersionsResponse]
$creadList :: ReadS [DescribeAddonVersionsResponse]
readsPrec :: Int -> ReadS DescribeAddonVersionsResponse
$creadsPrec :: Int -> ReadS DescribeAddonVersionsResponse
Prelude.Read, Int -> DescribeAddonVersionsResponse -> ShowS
[DescribeAddonVersionsResponse] -> ShowS
DescribeAddonVersionsResponse -> String
(Int -> DescribeAddonVersionsResponse -> ShowS)
-> (DescribeAddonVersionsResponse -> String)
-> ([DescribeAddonVersionsResponse] -> ShowS)
-> Show DescribeAddonVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAddonVersionsResponse] -> ShowS
$cshowList :: [DescribeAddonVersionsResponse] -> ShowS
show :: DescribeAddonVersionsResponse -> String
$cshow :: DescribeAddonVersionsResponse -> String
showsPrec :: Int -> DescribeAddonVersionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeAddonVersionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeAddonVersionsResponse
 -> Rep DescribeAddonVersionsResponse x)
-> (forall x.
    Rep DescribeAddonVersionsResponse x
    -> DescribeAddonVersionsResponse)
-> Generic DescribeAddonVersionsResponse
forall x.
Rep DescribeAddonVersionsResponse x
-> DescribeAddonVersionsResponse
forall x.
DescribeAddonVersionsResponse
-> Rep DescribeAddonVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAddonVersionsResponse x
-> DescribeAddonVersionsResponse
$cfrom :: forall x.
DescribeAddonVersionsResponse
-> Rep DescribeAddonVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAddonVersionsResponse' 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:
--
-- 'addons', 'describeAddonVersionsResponse_addons' - The list of available versions with Kubernetes version compatibility.
--
-- 'nextToken', 'describeAddonVersionsResponse_nextToken' - The @nextToken@ value returned from a previous paginated
-- @DescribeAddonVersionsResponse@ where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is used only
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
--
-- 'httpStatus', 'describeAddonVersionsResponse_httpStatus' - The response's http status code.
newDescribeAddonVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAddonVersionsResponse
newDescribeAddonVersionsResponse :: Int -> DescribeAddonVersionsResponse
newDescribeAddonVersionsResponse Int
pHttpStatus_ =
  DescribeAddonVersionsResponse' :: Maybe [AddonInfo]
-> Maybe Text -> Int -> DescribeAddonVersionsResponse
DescribeAddonVersionsResponse'
    { $sel:addons:DescribeAddonVersionsResponse' :: Maybe [AddonInfo]
addons =
        Maybe [AddonInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeAddonVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAddonVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of available versions with Kubernetes version compatibility.
describeAddonVersionsResponse_addons :: Lens.Lens' DescribeAddonVersionsResponse (Prelude.Maybe [AddonInfo])
describeAddonVersionsResponse_addons :: (Maybe [AddonInfo] -> f (Maybe [AddonInfo]))
-> DescribeAddonVersionsResponse -> f DescribeAddonVersionsResponse
describeAddonVersionsResponse_addons = (DescribeAddonVersionsResponse -> Maybe [AddonInfo])
-> (DescribeAddonVersionsResponse
    -> Maybe [AddonInfo] -> DescribeAddonVersionsResponse)
-> Lens' DescribeAddonVersionsResponse (Maybe [AddonInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddonVersionsResponse' {Maybe [AddonInfo]
addons :: Maybe [AddonInfo]
$sel:addons:DescribeAddonVersionsResponse' :: DescribeAddonVersionsResponse -> Maybe [AddonInfo]
addons} -> Maybe [AddonInfo]
addons) (\s :: DescribeAddonVersionsResponse
s@DescribeAddonVersionsResponse' {} Maybe [AddonInfo]
a -> DescribeAddonVersionsResponse
s {$sel:addons:DescribeAddonVersionsResponse' :: Maybe [AddonInfo]
addons = Maybe [AddonInfo]
a} :: DescribeAddonVersionsResponse) ((Maybe [AddonInfo] -> f (Maybe [AddonInfo]))
 -> DescribeAddonVersionsResponse
 -> f DescribeAddonVersionsResponse)
-> ((Maybe [AddonInfo] -> f (Maybe [AddonInfo]))
    -> Maybe [AddonInfo] -> f (Maybe [AddonInfo]))
-> (Maybe [AddonInfo] -> f (Maybe [AddonInfo]))
-> DescribeAddonVersionsResponse
-> f DescribeAddonVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AddonInfo] [AddonInfo] [AddonInfo] [AddonInfo]
-> Iso
     (Maybe [AddonInfo])
     (Maybe [AddonInfo])
     (Maybe [AddonInfo])
     (Maybe [AddonInfo])
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 [AddonInfo] [AddonInfo] [AddonInfo] [AddonInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The @nextToken@ value returned from a previous paginated
-- @DescribeAddonVersionsResponse@ where @maxResults@ was used and the
-- results exceeded the value of that parameter. Pagination continues from
-- the end of the previous results that returned the @nextToken@ value.
--
-- This token should be treated as an opaque identifier that is used only
-- to retrieve the next items in a list and not for other programmatic
-- purposes.
describeAddonVersionsResponse_nextToken :: Lens.Lens' DescribeAddonVersionsResponse (Prelude.Maybe Prelude.Text)
describeAddonVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeAddonVersionsResponse -> f DescribeAddonVersionsResponse
describeAddonVersionsResponse_nextToken = (DescribeAddonVersionsResponse -> Maybe Text)
-> (DescribeAddonVersionsResponse
    -> Maybe Text -> DescribeAddonVersionsResponse)
-> Lens' DescribeAddonVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAddonVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeAddonVersionsResponse' :: DescribeAddonVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeAddonVersionsResponse
s@DescribeAddonVersionsResponse' {} Maybe Text
a -> DescribeAddonVersionsResponse
s {$sel:nextToken:DescribeAddonVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeAddonVersionsResponse)

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

instance Prelude.NFData DescribeAddonVersionsResponse