{-# 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.ListUpdates
-- 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 updates associated with an Amazon EKS cluster or managed node
-- group in your Amazon Web Services account, in the specified Region.
--
-- This operation returns paginated results.
module Amazonka.EKS.ListUpdates
  ( -- * Creating a Request
    ListUpdates (..),
    newListUpdates,

    -- * Request Lenses
    listUpdates_addonName,
    listUpdates_nextToken,
    listUpdates_nodegroupName,
    listUpdates_maxResults,
    listUpdates_name,

    -- * Destructuring the Response
    ListUpdatesResponse (..),
    newListUpdatesResponse,

    -- * Response Lenses
    listUpdatesResponse_nextToken,
    listUpdatesResponse_updateIds,
    listUpdatesResponse_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:/ 'newListUpdates' smart constructor.
data ListUpdates = ListUpdates'
  { -- | The names of the installed add-ons that have available updates.
    ListUpdates -> Maybe Text
addonName :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ value returned from a previous paginated @ListUpdates@
    -- request 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.
    ListUpdates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon EKS managed node group to list updates for.
    ListUpdates -> Maybe Text
nodegroupName :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of update results returned by @ListUpdates@ in
    -- paginated output. When you use this parameter, @ListUpdates@ 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 @ListUpdates@ request with the returned
    -- @nextToken@ value. This value can be between 1 and 100. If you don\'t
    -- use this parameter, @ListUpdates@ returns up to 100 results and a
    -- @nextToken@ value if applicable.
    ListUpdates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the Amazon EKS cluster to list updates for.
    ListUpdates -> Text
name :: Prelude.Text
  }
  deriving (ListUpdates -> ListUpdates -> Bool
(ListUpdates -> ListUpdates -> Bool)
-> (ListUpdates -> ListUpdates -> Bool) -> Eq ListUpdates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUpdates -> ListUpdates -> Bool
$c/= :: ListUpdates -> ListUpdates -> Bool
== :: ListUpdates -> ListUpdates -> Bool
$c== :: ListUpdates -> ListUpdates -> Bool
Prelude.Eq, ReadPrec [ListUpdates]
ReadPrec ListUpdates
Int -> ReadS ListUpdates
ReadS [ListUpdates]
(Int -> ReadS ListUpdates)
-> ReadS [ListUpdates]
-> ReadPrec ListUpdates
-> ReadPrec [ListUpdates]
-> Read ListUpdates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUpdates]
$creadListPrec :: ReadPrec [ListUpdates]
readPrec :: ReadPrec ListUpdates
$creadPrec :: ReadPrec ListUpdates
readList :: ReadS [ListUpdates]
$creadList :: ReadS [ListUpdates]
readsPrec :: Int -> ReadS ListUpdates
$creadsPrec :: Int -> ReadS ListUpdates
Prelude.Read, Int -> ListUpdates -> ShowS
[ListUpdates] -> ShowS
ListUpdates -> String
(Int -> ListUpdates -> ShowS)
-> (ListUpdates -> String)
-> ([ListUpdates] -> ShowS)
-> Show ListUpdates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUpdates] -> ShowS
$cshowList :: [ListUpdates] -> ShowS
show :: ListUpdates -> String
$cshow :: ListUpdates -> String
showsPrec :: Int -> ListUpdates -> ShowS
$cshowsPrec :: Int -> ListUpdates -> ShowS
Prelude.Show, (forall x. ListUpdates -> Rep ListUpdates x)
-> (forall x. Rep ListUpdates x -> ListUpdates)
-> Generic ListUpdates
forall x. Rep ListUpdates x -> ListUpdates
forall x. ListUpdates -> Rep ListUpdates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUpdates x -> ListUpdates
$cfrom :: forall x. ListUpdates -> Rep ListUpdates x
Prelude.Generic)

-- |
-- Create a value of 'ListUpdates' 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', 'listUpdates_addonName' - The names of the installed add-ons that have available updates.
--
-- 'nextToken', 'listUpdates_nextToken' - The @nextToken@ value returned from a previous paginated @ListUpdates@
-- request 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.
--
-- 'nodegroupName', 'listUpdates_nodegroupName' - The name of the Amazon EKS managed node group to list updates for.
--
-- 'maxResults', 'listUpdates_maxResults' - The maximum number of update results returned by @ListUpdates@ in
-- paginated output. When you use this parameter, @ListUpdates@ 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 @ListUpdates@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListUpdates@ returns up to 100 results and a
-- @nextToken@ value if applicable.
--
-- 'name', 'listUpdates_name' - The name of the Amazon EKS cluster to list updates for.
newListUpdates ::
  -- | 'name'
  Prelude.Text ->
  ListUpdates
newListUpdates :: Text -> ListUpdates
newListUpdates Text
pName_ =
  ListUpdates' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Natural -> Text -> ListUpdates
ListUpdates'
    { $sel:addonName:ListUpdates' :: Maybe Text
addonName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListUpdates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nodegroupName:ListUpdates' :: Maybe Text
nodegroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListUpdates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListUpdates' :: Text
name = Text
pName_
    }

-- | The names of the installed add-ons that have available updates.
listUpdates_addonName :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Text)
listUpdates_addonName :: (Maybe Text -> f (Maybe Text)) -> ListUpdates -> f ListUpdates
listUpdates_addonName = (ListUpdates -> Maybe Text)
-> (ListUpdates -> Maybe Text -> ListUpdates)
-> Lens ListUpdates ListUpdates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Text
addonName :: Maybe Text
$sel:addonName:ListUpdates' :: ListUpdates -> Maybe Text
addonName} -> Maybe Text
addonName) (\s :: ListUpdates
s@ListUpdates' {} Maybe Text
a -> ListUpdates
s {$sel:addonName:ListUpdates' :: Maybe Text
addonName = Maybe Text
a} :: ListUpdates)

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

-- | The name of the Amazon EKS managed node group to list updates for.
listUpdates_nodegroupName :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Text)
listUpdates_nodegroupName :: (Maybe Text -> f (Maybe Text)) -> ListUpdates -> f ListUpdates
listUpdates_nodegroupName = (ListUpdates -> Maybe Text)
-> (ListUpdates -> Maybe Text -> ListUpdates)
-> Lens ListUpdates ListUpdates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Text
nodegroupName :: Maybe Text
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
nodegroupName} -> Maybe Text
nodegroupName) (\s :: ListUpdates
s@ListUpdates' {} Maybe Text
a -> ListUpdates
s {$sel:nodegroupName:ListUpdates' :: Maybe Text
nodegroupName = Maybe Text
a} :: ListUpdates)

-- | The maximum number of update results returned by @ListUpdates@ in
-- paginated output. When you use this parameter, @ListUpdates@ 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 @ListUpdates@ request with the returned
-- @nextToken@ value. This value can be between 1 and 100. If you don\'t
-- use this parameter, @ListUpdates@ returns up to 100 results and a
-- @nextToken@ value if applicable.
listUpdates_maxResults :: Lens.Lens' ListUpdates (Prelude.Maybe Prelude.Natural)
listUpdates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListUpdates -> f ListUpdates
listUpdates_maxResults = (ListUpdates -> Maybe Natural)
-> (ListUpdates -> Maybe Natural -> ListUpdates)
-> Lens ListUpdates ListUpdates (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListUpdates
s@ListUpdates' {} Maybe Natural
a -> ListUpdates
s {$sel:maxResults:ListUpdates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListUpdates)

-- | The name of the Amazon EKS cluster to list updates for.
listUpdates_name :: Lens.Lens' ListUpdates Prelude.Text
listUpdates_name :: (Text -> f Text) -> ListUpdates -> f ListUpdates
listUpdates_name = (ListUpdates -> Text)
-> (ListUpdates -> Text -> ListUpdates)
-> Lens ListUpdates ListUpdates Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdates' {Text
name :: Text
$sel:name:ListUpdates' :: ListUpdates -> Text
name} -> Text
name) (\s :: ListUpdates
s@ListUpdates' {} Text
a -> ListUpdates
s {$sel:name:ListUpdates' :: Text
name = Text
a} :: ListUpdates)

instance Core.AWSPager ListUpdates where
  page :: ListUpdates -> AWSResponse ListUpdates -> Maybe ListUpdates
page ListUpdates
rq AWSResponse ListUpdates
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUpdates
ListUpdatesResponse
rs
            ListUpdatesResponse
-> Getting (First Text) ListUpdatesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUpdatesResponse -> Const (First Text) ListUpdatesResponse
Lens' ListUpdatesResponse (Maybe Text)
listUpdatesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUpdatesResponse -> Const (First Text) ListUpdatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUpdatesResponse 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 ListUpdates
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUpdates
ListUpdatesResponse
rs
            ListUpdatesResponse
-> Getting (First [Text]) ListUpdatesResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListUpdatesResponse -> Const (First [Text]) ListUpdatesResponse
Lens' ListUpdatesResponse (Maybe [Text])
listUpdatesResponse_updateIds ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListUpdatesResponse -> Const (First [Text]) ListUpdatesResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListUpdatesResponse [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 ListUpdates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListUpdates -> Maybe ListUpdates
forall a. a -> Maybe a
Prelude.Just (ListUpdates -> Maybe ListUpdates)
-> ListUpdates -> Maybe ListUpdates
forall a b. (a -> b) -> a -> b
Prelude.$
        ListUpdates
rq
          ListUpdates -> (ListUpdates -> ListUpdates) -> ListUpdates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListUpdates -> Identity ListUpdates
Lens ListUpdates ListUpdates (Maybe Text) (Maybe Text)
listUpdates_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListUpdates -> Identity ListUpdates)
-> Maybe Text -> ListUpdates -> ListUpdates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUpdates
ListUpdatesResponse
rs
          ListUpdatesResponse
-> Getting (First Text) ListUpdatesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUpdatesResponse -> Const (First Text) ListUpdatesResponse
Lens' ListUpdatesResponse (Maybe Text)
listUpdatesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUpdatesResponse -> Const (First Text) ListUpdatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUpdatesResponse 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 ListUpdates where
  type AWSResponse ListUpdates = ListUpdatesResponse
  request :: ListUpdates -> Request ListUpdates
request = Service -> ListUpdates -> Request ListUpdates
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUpdates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUpdates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListUpdates))
-> Logger
-> Service
-> Proxy ListUpdates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUpdates)))
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 -> ListUpdatesResponse
ListUpdatesResponse'
            (Maybe Text -> Maybe [Text] -> Int -> ListUpdatesResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Text] -> Int -> ListUpdatesResponse)
forall (f :: * -> *) a b. Functor 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 (Maybe [Text] -> Int -> ListUpdatesResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListUpdatesResponse)
forall (f :: * -> *) a b. Applicative f => 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
"updateIds" 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 (Int -> ListUpdatesResponse)
-> Either String Int -> Either String ListUpdatesResponse
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 ListUpdates

instance Prelude.NFData ListUpdates

instance Core.ToHeaders ListUpdates where
  toHeaders :: ListUpdates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUpdates -> 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 ListUpdates where
  toPath :: ListUpdates -> ByteString
toPath ListUpdates' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nodegroupName :: Maybe Text
nextToken :: Maybe Text
addonName :: Maybe Text
$sel:name:ListUpdates' :: ListUpdates -> Text
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
$sel:addonName:ListUpdates' :: ListUpdates -> 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
name, ByteString
"/updates"]

instance Core.ToQuery ListUpdates where
  toQuery :: ListUpdates -> QueryString
toQuery ListUpdates' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nodegroupName :: Maybe Text
nextToken :: Maybe Text
addonName :: Maybe Text
$sel:name:ListUpdates' :: ListUpdates -> Text
$sel:maxResults:ListUpdates' :: ListUpdates -> Maybe Natural
$sel:nodegroupName:ListUpdates' :: ListUpdates -> Maybe Text
$sel:nextToken:ListUpdates' :: ListUpdates -> Maybe Text
$sel:addonName:ListUpdates' :: ListUpdates -> 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
"nodegroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nodegroupName,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListUpdatesResponse' smart constructor.
data ListUpdatesResponse = ListUpdatesResponse'
  { -- | The @nextToken@ value to include in a future @ListUpdates@ request. When
    -- the results of a @ListUpdates@ request exceed @maxResults@, you can use
    -- this value to retrieve the next page of results. This value is @null@
    -- when there are no more results to return.
    ListUpdatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of all the updates for the specified cluster and Region.
    ListUpdatesResponse -> Maybe [Text]
updateIds :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListUpdatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUpdatesResponse -> ListUpdatesResponse -> Bool
(ListUpdatesResponse -> ListUpdatesResponse -> Bool)
-> (ListUpdatesResponse -> ListUpdatesResponse -> Bool)
-> Eq ListUpdatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
$c/= :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
== :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
$c== :: ListUpdatesResponse -> ListUpdatesResponse -> Bool
Prelude.Eq, ReadPrec [ListUpdatesResponse]
ReadPrec ListUpdatesResponse
Int -> ReadS ListUpdatesResponse
ReadS [ListUpdatesResponse]
(Int -> ReadS ListUpdatesResponse)
-> ReadS [ListUpdatesResponse]
-> ReadPrec ListUpdatesResponse
-> ReadPrec [ListUpdatesResponse]
-> Read ListUpdatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUpdatesResponse]
$creadListPrec :: ReadPrec [ListUpdatesResponse]
readPrec :: ReadPrec ListUpdatesResponse
$creadPrec :: ReadPrec ListUpdatesResponse
readList :: ReadS [ListUpdatesResponse]
$creadList :: ReadS [ListUpdatesResponse]
readsPrec :: Int -> ReadS ListUpdatesResponse
$creadsPrec :: Int -> ReadS ListUpdatesResponse
Prelude.Read, Int -> ListUpdatesResponse -> ShowS
[ListUpdatesResponse] -> ShowS
ListUpdatesResponse -> String
(Int -> ListUpdatesResponse -> ShowS)
-> (ListUpdatesResponse -> String)
-> ([ListUpdatesResponse] -> ShowS)
-> Show ListUpdatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUpdatesResponse] -> ShowS
$cshowList :: [ListUpdatesResponse] -> ShowS
show :: ListUpdatesResponse -> String
$cshow :: ListUpdatesResponse -> String
showsPrec :: Int -> ListUpdatesResponse -> ShowS
$cshowsPrec :: Int -> ListUpdatesResponse -> ShowS
Prelude.Show, (forall x. ListUpdatesResponse -> Rep ListUpdatesResponse x)
-> (forall x. Rep ListUpdatesResponse x -> ListUpdatesResponse)
-> Generic ListUpdatesResponse
forall x. Rep ListUpdatesResponse x -> ListUpdatesResponse
forall x. ListUpdatesResponse -> Rep ListUpdatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUpdatesResponse x -> ListUpdatesResponse
$cfrom :: forall x. ListUpdatesResponse -> Rep ListUpdatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUpdatesResponse' 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', 'listUpdatesResponse_nextToken' - The @nextToken@ value to include in a future @ListUpdates@ request. When
-- the results of a @ListUpdates@ request exceed @maxResults@, you can use
-- this value to retrieve the next page of results. This value is @null@
-- when there are no more results to return.
--
-- 'updateIds', 'listUpdatesResponse_updateIds' - A list of all the updates for the specified cluster and Region.
--
-- 'httpStatus', 'listUpdatesResponse_httpStatus' - The response's http status code.
newListUpdatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUpdatesResponse
newListUpdatesResponse :: Int -> ListUpdatesResponse
newListUpdatesResponse Int
pHttpStatus_ =
  ListUpdatesResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListUpdatesResponse
ListUpdatesResponse'
    { $sel:nextToken:ListUpdatesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updateIds:ListUpdatesResponse' :: Maybe [Text]
updateIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUpdatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @nextToken@ value to include in a future @ListUpdates@ request. When
-- the results of a @ListUpdates@ request exceed @maxResults@, you can use
-- this value to retrieve the next page of results. This value is @null@
-- when there are no more results to return.
listUpdatesResponse_nextToken :: Lens.Lens' ListUpdatesResponse (Prelude.Maybe Prelude.Text)
listUpdatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUpdatesResponse -> f ListUpdatesResponse
listUpdatesResponse_nextToken = (ListUpdatesResponse -> Maybe Text)
-> (ListUpdatesResponse -> Maybe Text -> ListUpdatesResponse)
-> Lens' ListUpdatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUpdatesResponse' :: ListUpdatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUpdatesResponse
s@ListUpdatesResponse' {} Maybe Text
a -> ListUpdatesResponse
s {$sel:nextToken:ListUpdatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUpdatesResponse)

-- | A list of all the updates for the specified cluster and Region.
listUpdatesResponse_updateIds :: Lens.Lens' ListUpdatesResponse (Prelude.Maybe [Prelude.Text])
listUpdatesResponse_updateIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListUpdatesResponse -> f ListUpdatesResponse
listUpdatesResponse_updateIds = (ListUpdatesResponse -> Maybe [Text])
-> (ListUpdatesResponse -> Maybe [Text] -> ListUpdatesResponse)
-> Lens' ListUpdatesResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdatesResponse' {Maybe [Text]
updateIds :: Maybe [Text]
$sel:updateIds:ListUpdatesResponse' :: ListUpdatesResponse -> Maybe [Text]
updateIds} -> Maybe [Text]
updateIds) (\s :: ListUpdatesResponse
s@ListUpdatesResponse' {} Maybe [Text]
a -> ListUpdatesResponse
s {$sel:updateIds:ListUpdatesResponse' :: Maybe [Text]
updateIds = Maybe [Text]
a} :: ListUpdatesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListUpdatesResponse -> f ListUpdatesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListUpdatesResponse
-> f ListUpdatesResponse
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 response's http status code.
listUpdatesResponse_httpStatus :: Lens.Lens' ListUpdatesResponse Prelude.Int
listUpdatesResponse_httpStatus :: (Int -> f Int) -> ListUpdatesResponse -> f ListUpdatesResponse
listUpdatesResponse_httpStatus = (ListUpdatesResponse -> Int)
-> (ListUpdatesResponse -> Int -> ListUpdatesResponse)
-> Lens ListUpdatesResponse ListUpdatesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUpdatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListUpdatesResponse' :: ListUpdatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListUpdatesResponse
s@ListUpdatesResponse' {} Int
a -> ListUpdatesResponse
s {$sel:httpStatus:ListUpdatesResponse' :: Int
httpStatus = Int
a} :: ListUpdatesResponse)

instance Prelude.NFData ListUpdatesResponse