{-# 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.ListAddons
-- 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 available add-ons.
--
-- This operation returns paginated results.
module Amazonka.EKS.ListAddons
  ( -- * Creating a Request
    ListAddons (..),
    newListAddons,

    -- * Request Lenses
    listAddons_nextToken,
    listAddons_maxResults,
    listAddons_clusterName,

    -- * Destructuring the Response
    ListAddonsResponse (..),
    newListAddonsResponse,

    -- * Response Lenses
    listAddonsResponse_addons,
    listAddonsResponse_nextToken,
    listAddonsResponse_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:/ 'newListAddons' smart constructor.
data ListAddons = ListAddons'
  { -- | The @nextToken@ value returned from a previous paginated
    -- @ListAddonsRequest@ 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.
    ListAddons -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of add-on results returned by @ListAddonsRequest@ in
    -- paginated output. When you use this parameter, @ListAddonsRequest@
    -- returns only @maxResults@ results in a single page along with a
    -- @nextToken@ response element. You can see the remaining results of the
    -- initial request by sending another @ListAddonsRequest@ request with the
    -- returned @nextToken@ value. This value can be between 1 and 100. If you
    -- don\'t use this parameter, @ListAddonsRequest@ returns up to 100 results
    -- and a @nextToken@ value, if applicable.
    ListAddons -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the cluster.
    ListAddons -> Text
clusterName :: Prelude.Text
  }
  deriving (ListAddons -> ListAddons -> Bool
(ListAddons -> ListAddons -> Bool)
-> (ListAddons -> ListAddons -> Bool) -> Eq ListAddons
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAddons -> ListAddons -> Bool
$c/= :: ListAddons -> ListAddons -> Bool
== :: ListAddons -> ListAddons -> Bool
$c== :: ListAddons -> ListAddons -> Bool
Prelude.Eq, ReadPrec [ListAddons]
ReadPrec ListAddons
Int -> ReadS ListAddons
ReadS [ListAddons]
(Int -> ReadS ListAddons)
-> ReadS [ListAddons]
-> ReadPrec ListAddons
-> ReadPrec [ListAddons]
-> Read ListAddons
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAddons]
$creadListPrec :: ReadPrec [ListAddons]
readPrec :: ReadPrec ListAddons
$creadPrec :: ReadPrec ListAddons
readList :: ReadS [ListAddons]
$creadList :: ReadS [ListAddons]
readsPrec :: Int -> ReadS ListAddons
$creadsPrec :: Int -> ReadS ListAddons
Prelude.Read, Int -> ListAddons -> ShowS
[ListAddons] -> ShowS
ListAddons -> String
(Int -> ListAddons -> ShowS)
-> (ListAddons -> String)
-> ([ListAddons] -> ShowS)
-> Show ListAddons
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAddons] -> ShowS
$cshowList :: [ListAddons] -> ShowS
show :: ListAddons -> String
$cshow :: ListAddons -> String
showsPrec :: Int -> ListAddons -> ShowS
$cshowsPrec :: Int -> ListAddons -> ShowS
Prelude.Show, (forall x. ListAddons -> Rep ListAddons x)
-> (forall x. Rep ListAddons x -> ListAddons) -> Generic ListAddons
forall x. Rep ListAddons x -> ListAddons
forall x. ListAddons -> Rep ListAddons x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAddons x -> ListAddons
$cfrom :: forall x. ListAddons -> Rep ListAddons x
Prelude.Generic)

-- |
-- Create a value of 'ListAddons' 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', 'listAddons_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListAddonsRequest@ 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.
--
-- 'maxResults', 'listAddons_maxResults' - The maximum number of add-on results returned by @ListAddonsRequest@ in
-- paginated output. When you use this parameter, @ListAddonsRequest@
-- returns only @maxResults@ results in a single page along with a
-- @nextToken@ response element. You can see the remaining results of the
-- initial request by sending another @ListAddonsRequest@ request with the
-- returned @nextToken@ value. This value can be between 1 and 100. If you
-- don\'t use this parameter, @ListAddonsRequest@ returns up to 100 results
-- and a @nextToken@ value, if applicable.
--
-- 'clusterName', 'listAddons_clusterName' - The name of the cluster.
newListAddons ::
  -- | 'clusterName'
  Prelude.Text ->
  ListAddons
newListAddons :: Text -> ListAddons
newListAddons Text
pClusterName_ =
  ListAddons' :: Maybe Text -> Maybe Natural -> Text -> ListAddons
ListAddons'
    { $sel:nextToken:ListAddons' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAddons' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:ListAddons' :: Text
clusterName = Text
pClusterName_
    }

-- | The @nextToken@ value returned from a previous paginated
-- @ListAddonsRequest@ 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.
listAddons_nextToken :: Lens.Lens' ListAddons (Prelude.Maybe Prelude.Text)
listAddons_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListAddons -> f ListAddons
listAddons_nextToken = (ListAddons -> Maybe Text)
-> (ListAddons -> Maybe Text -> ListAddons)
-> Lens ListAddons ListAddons (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddons' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAddons
s@ListAddons' {} Maybe Text
a -> ListAddons
s {$sel:nextToken:ListAddons' :: Maybe Text
nextToken = Maybe Text
a} :: ListAddons)

-- | The maximum number of add-on results returned by @ListAddonsRequest@ in
-- paginated output. When you use this parameter, @ListAddonsRequest@
-- returns only @maxResults@ results in a single page along with a
-- @nextToken@ response element. You can see the remaining results of the
-- initial request by sending another @ListAddonsRequest@ request with the
-- returned @nextToken@ value. This value can be between 1 and 100. If you
-- don\'t use this parameter, @ListAddonsRequest@ returns up to 100 results
-- and a @nextToken@ value, if applicable.
listAddons_maxResults :: Lens.Lens' ListAddons (Prelude.Maybe Prelude.Natural)
listAddons_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListAddons -> f ListAddons
listAddons_maxResults = (ListAddons -> Maybe Natural)
-> (ListAddons -> Maybe Natural -> ListAddons)
-> Lens ListAddons ListAddons (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddons' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAddons' :: ListAddons -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAddons
s@ListAddons' {} Maybe Natural
a -> ListAddons
s {$sel:maxResults:ListAddons' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAddons)

-- | The name of the cluster.
listAddons_clusterName :: Lens.Lens' ListAddons Prelude.Text
listAddons_clusterName :: (Text -> f Text) -> ListAddons -> f ListAddons
listAddons_clusterName = (ListAddons -> Text)
-> (ListAddons -> Text -> ListAddons)
-> Lens ListAddons ListAddons Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddons' {Text
clusterName :: Text
$sel:clusterName:ListAddons' :: ListAddons -> Text
clusterName} -> Text
clusterName) (\s :: ListAddons
s@ListAddons' {} Text
a -> ListAddons
s {$sel:clusterName:ListAddons' :: Text
clusterName = Text
a} :: ListAddons)

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

instance Prelude.NFData ListAddons

instance Core.ToHeaders ListAddons where
  toHeaders :: ListAddons -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAddons -> 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 ListAddons where
  toPath :: ListAddons -> ByteString
toPath ListAddons' {Maybe Natural
Maybe Text
Text
clusterName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:clusterName:ListAddons' :: ListAddons -> Text
$sel:maxResults:ListAddons' :: ListAddons -> Maybe Natural
$sel:nextToken:ListAddons' :: ListAddons -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/clusters/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
clusterName, ByteString
"/addons"]

instance Core.ToQuery ListAddons where
  toQuery :: ListAddons -> QueryString
toQuery ListAddons' {Maybe Natural
Maybe Text
Text
clusterName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:clusterName:ListAddons' :: ListAddons -> Text
$sel:maxResults:ListAddons' :: ListAddons -> Maybe Natural
$sel:nextToken:ListAddons' :: ListAddons -> 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:/ 'newListAddonsResponse' smart constructor.
data ListAddonsResponse = ListAddonsResponse'
  { -- | A list of available add-ons.
    ListAddonsResponse -> Maybe [Text]
addons :: Prelude.Maybe [Prelude.Text],
    -- | The @nextToken@ value returned from a previous paginated
    -- @ListAddonsResponse@ 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.
    ListAddonsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAddonsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAddonsResponse -> ListAddonsResponse -> Bool
(ListAddonsResponse -> ListAddonsResponse -> Bool)
-> (ListAddonsResponse -> ListAddonsResponse -> Bool)
-> Eq ListAddonsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAddonsResponse -> ListAddonsResponse -> Bool
$c/= :: ListAddonsResponse -> ListAddonsResponse -> Bool
== :: ListAddonsResponse -> ListAddonsResponse -> Bool
$c== :: ListAddonsResponse -> ListAddonsResponse -> Bool
Prelude.Eq, ReadPrec [ListAddonsResponse]
ReadPrec ListAddonsResponse
Int -> ReadS ListAddonsResponse
ReadS [ListAddonsResponse]
(Int -> ReadS ListAddonsResponse)
-> ReadS [ListAddonsResponse]
-> ReadPrec ListAddonsResponse
-> ReadPrec [ListAddonsResponse]
-> Read ListAddonsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAddonsResponse]
$creadListPrec :: ReadPrec [ListAddonsResponse]
readPrec :: ReadPrec ListAddonsResponse
$creadPrec :: ReadPrec ListAddonsResponse
readList :: ReadS [ListAddonsResponse]
$creadList :: ReadS [ListAddonsResponse]
readsPrec :: Int -> ReadS ListAddonsResponse
$creadsPrec :: Int -> ReadS ListAddonsResponse
Prelude.Read, Int -> ListAddonsResponse -> ShowS
[ListAddonsResponse] -> ShowS
ListAddonsResponse -> String
(Int -> ListAddonsResponse -> ShowS)
-> (ListAddonsResponse -> String)
-> ([ListAddonsResponse] -> ShowS)
-> Show ListAddonsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAddonsResponse] -> ShowS
$cshowList :: [ListAddonsResponse] -> ShowS
show :: ListAddonsResponse -> String
$cshow :: ListAddonsResponse -> String
showsPrec :: Int -> ListAddonsResponse -> ShowS
$cshowsPrec :: Int -> ListAddonsResponse -> ShowS
Prelude.Show, (forall x. ListAddonsResponse -> Rep ListAddonsResponse x)
-> (forall x. Rep ListAddonsResponse x -> ListAddonsResponse)
-> Generic ListAddonsResponse
forall x. Rep ListAddonsResponse x -> ListAddonsResponse
forall x. ListAddonsResponse -> Rep ListAddonsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAddonsResponse x -> ListAddonsResponse
$cfrom :: forall x. ListAddonsResponse -> Rep ListAddonsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAddonsResponse' 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', 'listAddonsResponse_addons' - A list of available add-ons.
--
-- 'nextToken', 'listAddonsResponse_nextToken' - The @nextToken@ value returned from a previous paginated
-- @ListAddonsResponse@ 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', 'listAddonsResponse_httpStatus' - The response's http status code.
newListAddonsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAddonsResponse
newListAddonsResponse :: Int -> ListAddonsResponse
newListAddonsResponse Int
pHttpStatus_ =
  ListAddonsResponse' :: Maybe [Text] -> Maybe Text -> Int -> ListAddonsResponse
ListAddonsResponse'
    { $sel:addons:ListAddonsResponse' :: Maybe [Text]
addons = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAddonsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAddonsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of available add-ons.
listAddonsResponse_addons :: Lens.Lens' ListAddonsResponse (Prelude.Maybe [Prelude.Text])
listAddonsResponse_addons :: (Maybe [Text] -> f (Maybe [Text]))
-> ListAddonsResponse -> f ListAddonsResponse
listAddonsResponse_addons = (ListAddonsResponse -> Maybe [Text])
-> (ListAddonsResponse -> Maybe [Text] -> ListAddonsResponse)
-> Lens' ListAddonsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddonsResponse' {Maybe [Text]
addons :: Maybe [Text]
$sel:addons:ListAddonsResponse' :: ListAddonsResponse -> Maybe [Text]
addons} -> Maybe [Text]
addons) (\s :: ListAddonsResponse
s@ListAddonsResponse' {} Maybe [Text]
a -> ListAddonsResponse
s {$sel:addons:ListAddonsResponse' :: Maybe [Text]
addons = Maybe [Text]
a} :: ListAddonsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListAddonsResponse -> f ListAddonsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListAddonsResponse
-> f ListAddonsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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
-- @ListAddonsResponse@ 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.
listAddonsResponse_nextToken :: Lens.Lens' ListAddonsResponse (Prelude.Maybe Prelude.Text)
listAddonsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAddonsResponse -> f ListAddonsResponse
listAddonsResponse_nextToken = (ListAddonsResponse -> Maybe Text)
-> (ListAddonsResponse -> Maybe Text -> ListAddonsResponse)
-> Lens' ListAddonsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAddonsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAddonsResponse' :: ListAddonsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAddonsResponse
s@ListAddonsResponse' {} Maybe Text
a -> ListAddonsResponse
s {$sel:nextToken:ListAddonsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAddonsResponse)

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

instance Prelude.NFData ListAddonsResponse