{-# 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.MemoryDb.DescribeServiceUpdates
-- 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 details of the service updates
module Amazonka.MemoryDb.DescribeServiceUpdates
  ( -- * Creating a Request
    DescribeServiceUpdates (..),
    newDescribeServiceUpdates,

    -- * Request Lenses
    describeServiceUpdates_status,
    describeServiceUpdates_serviceUpdateName,
    describeServiceUpdates_clusterNames,
    describeServiceUpdates_nextToken,
    describeServiceUpdates_maxResults,

    -- * Destructuring the Response
    DescribeServiceUpdatesResponse (..),
    newDescribeServiceUpdatesResponse,

    -- * Response Lenses
    describeServiceUpdatesResponse_serviceUpdates,
    describeServiceUpdatesResponse_nextToken,
    describeServiceUpdatesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeServiceUpdates' smart constructor.
data DescribeServiceUpdates = DescribeServiceUpdates'
  { -- | The status(es) of the service updates to filter on
    DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
status :: Prelude.Maybe [ServiceUpdateStatus],
    -- | The unique ID of the service update to describe.
    DescribeServiceUpdates -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text,
    -- | The list of cluster names to identify service updates to apply
    DescribeServiceUpdates -> Maybe [Text]
clusterNames :: Prelude.Maybe [Prelude.Text],
    -- | An optional argument to pass in case the total number of records exceeds
    -- the value of MaxResults. If nextToken is returned, there are more
    -- results available. The value of nextToken is a unique pagination token
    -- for each page. Make the call again using the returned token to retrieve
    -- the next page. Keep all other arguments unchanged.
    DescribeServiceUpdates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified MaxResults value, a token is included
    -- in the response so that the remaining results can be retrieved.
    DescribeServiceUpdates -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeServiceUpdates -> DescribeServiceUpdates -> Bool
(DescribeServiceUpdates -> DescribeServiceUpdates -> Bool)
-> (DescribeServiceUpdates -> DescribeServiceUpdates -> Bool)
-> Eq DescribeServiceUpdates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeServiceUpdates -> DescribeServiceUpdates -> Bool
$c/= :: DescribeServiceUpdates -> DescribeServiceUpdates -> Bool
== :: DescribeServiceUpdates -> DescribeServiceUpdates -> Bool
$c== :: DescribeServiceUpdates -> DescribeServiceUpdates -> Bool
Prelude.Eq, ReadPrec [DescribeServiceUpdates]
ReadPrec DescribeServiceUpdates
Int -> ReadS DescribeServiceUpdates
ReadS [DescribeServiceUpdates]
(Int -> ReadS DescribeServiceUpdates)
-> ReadS [DescribeServiceUpdates]
-> ReadPrec DescribeServiceUpdates
-> ReadPrec [DescribeServiceUpdates]
-> Read DescribeServiceUpdates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeServiceUpdates]
$creadListPrec :: ReadPrec [DescribeServiceUpdates]
readPrec :: ReadPrec DescribeServiceUpdates
$creadPrec :: ReadPrec DescribeServiceUpdates
readList :: ReadS [DescribeServiceUpdates]
$creadList :: ReadS [DescribeServiceUpdates]
readsPrec :: Int -> ReadS DescribeServiceUpdates
$creadsPrec :: Int -> ReadS DescribeServiceUpdates
Prelude.Read, Int -> DescribeServiceUpdates -> ShowS
[DescribeServiceUpdates] -> ShowS
DescribeServiceUpdates -> String
(Int -> DescribeServiceUpdates -> ShowS)
-> (DescribeServiceUpdates -> String)
-> ([DescribeServiceUpdates] -> ShowS)
-> Show DescribeServiceUpdates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeServiceUpdates] -> ShowS
$cshowList :: [DescribeServiceUpdates] -> ShowS
show :: DescribeServiceUpdates -> String
$cshow :: DescribeServiceUpdates -> String
showsPrec :: Int -> DescribeServiceUpdates -> ShowS
$cshowsPrec :: Int -> DescribeServiceUpdates -> ShowS
Prelude.Show, (forall x. DescribeServiceUpdates -> Rep DescribeServiceUpdates x)
-> (forall x.
    Rep DescribeServiceUpdates x -> DescribeServiceUpdates)
-> Generic DescribeServiceUpdates
forall x. Rep DescribeServiceUpdates x -> DescribeServiceUpdates
forall x. DescribeServiceUpdates -> Rep DescribeServiceUpdates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeServiceUpdates x -> DescribeServiceUpdates
$cfrom :: forall x. DescribeServiceUpdates -> Rep DescribeServiceUpdates x
Prelude.Generic)

-- |
-- Create a value of 'DescribeServiceUpdates' 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:
--
-- 'status', 'describeServiceUpdates_status' - The status(es) of the service updates to filter on
--
-- 'serviceUpdateName', 'describeServiceUpdates_serviceUpdateName' - The unique ID of the service update to describe.
--
-- 'clusterNames', 'describeServiceUpdates_clusterNames' - The list of cluster names to identify service updates to apply
--
-- 'nextToken', 'describeServiceUpdates_nextToken' - An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
--
-- 'maxResults', 'describeServiceUpdates_maxResults' - The maximum number of records to include in the response. If more
-- records exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
newDescribeServiceUpdates ::
  DescribeServiceUpdates
newDescribeServiceUpdates :: DescribeServiceUpdates
newDescribeServiceUpdates =
  DescribeServiceUpdates' :: Maybe [ServiceUpdateStatus]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> DescribeServiceUpdates
DescribeServiceUpdates'
    { $sel:status:DescribeServiceUpdates' :: Maybe [ServiceUpdateStatus]
status = Maybe [ServiceUpdateStatus]
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdateName:DescribeServiceUpdates' :: Maybe Text
serviceUpdateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterNames:DescribeServiceUpdates' :: Maybe [Text]
clusterNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeServiceUpdates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeServiceUpdates' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The status(es) of the service updates to filter on
describeServiceUpdates_status :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe [ServiceUpdateStatus])
describeServiceUpdates_status :: (Maybe [ServiceUpdateStatus] -> f (Maybe [ServiceUpdateStatus]))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_status = (DescribeServiceUpdates -> Maybe [ServiceUpdateStatus])
-> (DescribeServiceUpdates
    -> Maybe [ServiceUpdateStatus] -> DescribeServiceUpdates)
-> Lens
     DescribeServiceUpdates
     DescribeServiceUpdates
     (Maybe [ServiceUpdateStatus])
     (Maybe [ServiceUpdateStatus])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdates' {Maybe [ServiceUpdateStatus]
status :: Maybe [ServiceUpdateStatus]
$sel:status:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
status} -> Maybe [ServiceUpdateStatus]
status) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe [ServiceUpdateStatus]
a -> DescribeServiceUpdates
s {$sel:status:DescribeServiceUpdates' :: Maybe [ServiceUpdateStatus]
status = Maybe [ServiceUpdateStatus]
a} :: DescribeServiceUpdates) ((Maybe [ServiceUpdateStatus] -> f (Maybe [ServiceUpdateStatus]))
 -> DescribeServiceUpdates -> f DescribeServiceUpdates)
-> ((Maybe [ServiceUpdateStatus]
     -> f (Maybe [ServiceUpdateStatus]))
    -> Maybe [ServiceUpdateStatus] -> f (Maybe [ServiceUpdateStatus]))
-> (Maybe [ServiceUpdateStatus] -> f (Maybe [ServiceUpdateStatus]))
-> DescribeServiceUpdates
-> f DescribeServiceUpdates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ServiceUpdateStatus]
  [ServiceUpdateStatus]
  [ServiceUpdateStatus]
  [ServiceUpdateStatus]
-> Iso
     (Maybe [ServiceUpdateStatus])
     (Maybe [ServiceUpdateStatus])
     (Maybe [ServiceUpdateStatus])
     (Maybe [ServiceUpdateStatus])
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
  [ServiceUpdateStatus]
  [ServiceUpdateStatus]
  [ServiceUpdateStatus]
  [ServiceUpdateStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique ID of the service update to describe.
describeServiceUpdates_serviceUpdateName :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe Prelude.Text)
describeServiceUpdates_serviceUpdateName :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_serviceUpdateName = (DescribeServiceUpdates -> Maybe Text)
-> (DescribeServiceUpdates -> Maybe Text -> DescribeServiceUpdates)
-> Lens
     DescribeServiceUpdates
     DescribeServiceUpdates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdates' {Maybe Text
serviceUpdateName :: Maybe Text
$sel:serviceUpdateName:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
serviceUpdateName} -> Maybe Text
serviceUpdateName) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe Text
a -> DescribeServiceUpdates
s {$sel:serviceUpdateName:DescribeServiceUpdates' :: Maybe Text
serviceUpdateName = Maybe Text
a} :: DescribeServiceUpdates)

-- | The list of cluster names to identify service updates to apply
describeServiceUpdates_clusterNames :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe [Prelude.Text])
describeServiceUpdates_clusterNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_clusterNames = (DescribeServiceUpdates -> Maybe [Text])
-> (DescribeServiceUpdates
    -> Maybe [Text] -> DescribeServiceUpdates)
-> Lens
     DescribeServiceUpdates
     DescribeServiceUpdates
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdates' {Maybe [Text]
clusterNames :: Maybe [Text]
$sel:clusterNames:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [Text]
clusterNames} -> Maybe [Text]
clusterNames) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe [Text]
a -> DescribeServiceUpdates
s {$sel:clusterNames:DescribeServiceUpdates' :: Maybe [Text]
clusterNames = Maybe [Text]
a} :: DescribeServiceUpdates) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeServiceUpdates -> f DescribeServiceUpdates)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeServiceUpdates
-> f DescribeServiceUpdates
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

-- | An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
describeServiceUpdates_nextToken :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe Prelude.Text)
describeServiceUpdates_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_nextToken = (DescribeServiceUpdates -> Maybe Text)
-> (DescribeServiceUpdates -> Maybe Text -> DescribeServiceUpdates)
-> Lens
     DescribeServiceUpdates
     DescribeServiceUpdates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe Text
a -> DescribeServiceUpdates
s {$sel:nextToken:DescribeServiceUpdates' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeServiceUpdates)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
describeServiceUpdates_maxResults :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe Prelude.Int)
describeServiceUpdates_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_maxResults = (DescribeServiceUpdates -> Maybe Int)
-> (DescribeServiceUpdates -> Maybe Int -> DescribeServiceUpdates)
-> Lens
     DescribeServiceUpdates
     DescribeServiceUpdates
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdates' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe Int
a -> DescribeServiceUpdates
s {$sel:maxResults:DescribeServiceUpdates' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeServiceUpdates)

instance Core.AWSRequest DescribeServiceUpdates where
  type
    AWSResponse DescribeServiceUpdates =
      DescribeServiceUpdatesResponse
  request :: DescribeServiceUpdates -> Request DescribeServiceUpdates
request = Service -> DescribeServiceUpdates -> Request DescribeServiceUpdates
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeServiceUpdates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceUpdates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeServiceUpdates))
-> Logger
-> Service
-> Proxy DescribeServiceUpdates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceUpdates)))
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 [ServiceUpdate]
-> Maybe Text -> Int -> DescribeServiceUpdatesResponse
DescribeServiceUpdatesResponse'
            (Maybe [ServiceUpdate]
 -> Maybe Text -> Int -> DescribeServiceUpdatesResponse)
-> Either String (Maybe [ServiceUpdate])
-> Either
     String (Maybe Text -> Int -> DescribeServiceUpdatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ServiceUpdate]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ServiceUpdates" Either String (Maybe (Maybe [ServiceUpdate]))
-> Maybe [ServiceUpdate] -> Either String (Maybe [ServiceUpdate])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ServiceUpdate]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeServiceUpdatesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeServiceUpdatesResponse)
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 -> DescribeServiceUpdatesResponse)
-> Either String Int
-> Either String DescribeServiceUpdatesResponse
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 DescribeServiceUpdates

instance Prelude.NFData DescribeServiceUpdates

instance Core.ToHeaders DescribeServiceUpdates where
  toHeaders :: DescribeServiceUpdates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeServiceUpdates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonMemoryDB.DescribeServiceUpdates" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeServiceUpdates where
  toJSON :: DescribeServiceUpdates -> Value
toJSON DescribeServiceUpdates' {Maybe Int
Maybe [Text]
Maybe [ServiceUpdateStatus]
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
clusterNames :: Maybe [Text]
serviceUpdateName :: Maybe Text
status :: Maybe [ServiceUpdateStatus]
$sel:maxResults:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Int
$sel:nextToken:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:clusterNames:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [Text]
$sel:serviceUpdateName:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:status:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> [ServiceUpdateStatus] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ServiceUpdateStatus] -> Pair)
-> Maybe [ServiceUpdateStatus] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ServiceUpdateStatus]
status,
            (Text
"ServiceUpdateName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serviceUpdateName,
            (Text
"ClusterNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
clusterNames,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newDescribeServiceUpdatesResponse' smart constructor.
data DescribeServiceUpdatesResponse = DescribeServiceUpdatesResponse'
  { -- | A list of service updates
    DescribeServiceUpdatesResponse -> Maybe [ServiceUpdate]
serviceUpdates :: Prelude.Maybe [ServiceUpdate],
    -- | An optional argument to pass in case the total number of records exceeds
    -- the value of MaxResults. If nextToken is returned, there are more
    -- results available. The value of nextToken is a unique pagination token
    -- for each page. Make the call again using the returned token to retrieve
    -- the next page. Keep all other arguments unchanged.
    DescribeServiceUpdatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeServiceUpdatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeServiceUpdatesResponse
-> DescribeServiceUpdatesResponse -> Bool
(DescribeServiceUpdatesResponse
 -> DescribeServiceUpdatesResponse -> Bool)
-> (DescribeServiceUpdatesResponse
    -> DescribeServiceUpdatesResponse -> Bool)
-> Eq DescribeServiceUpdatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeServiceUpdatesResponse
-> DescribeServiceUpdatesResponse -> Bool
$c/= :: DescribeServiceUpdatesResponse
-> DescribeServiceUpdatesResponse -> Bool
== :: DescribeServiceUpdatesResponse
-> DescribeServiceUpdatesResponse -> Bool
$c== :: DescribeServiceUpdatesResponse
-> DescribeServiceUpdatesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeServiceUpdatesResponse]
ReadPrec DescribeServiceUpdatesResponse
Int -> ReadS DescribeServiceUpdatesResponse
ReadS [DescribeServiceUpdatesResponse]
(Int -> ReadS DescribeServiceUpdatesResponse)
-> ReadS [DescribeServiceUpdatesResponse]
-> ReadPrec DescribeServiceUpdatesResponse
-> ReadPrec [DescribeServiceUpdatesResponse]
-> Read DescribeServiceUpdatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeServiceUpdatesResponse]
$creadListPrec :: ReadPrec [DescribeServiceUpdatesResponse]
readPrec :: ReadPrec DescribeServiceUpdatesResponse
$creadPrec :: ReadPrec DescribeServiceUpdatesResponse
readList :: ReadS [DescribeServiceUpdatesResponse]
$creadList :: ReadS [DescribeServiceUpdatesResponse]
readsPrec :: Int -> ReadS DescribeServiceUpdatesResponse
$creadsPrec :: Int -> ReadS DescribeServiceUpdatesResponse
Prelude.Read, Int -> DescribeServiceUpdatesResponse -> ShowS
[DescribeServiceUpdatesResponse] -> ShowS
DescribeServiceUpdatesResponse -> String
(Int -> DescribeServiceUpdatesResponse -> ShowS)
-> (DescribeServiceUpdatesResponse -> String)
-> ([DescribeServiceUpdatesResponse] -> ShowS)
-> Show DescribeServiceUpdatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeServiceUpdatesResponse] -> ShowS
$cshowList :: [DescribeServiceUpdatesResponse] -> ShowS
show :: DescribeServiceUpdatesResponse -> String
$cshow :: DescribeServiceUpdatesResponse -> String
showsPrec :: Int -> DescribeServiceUpdatesResponse -> ShowS
$cshowsPrec :: Int -> DescribeServiceUpdatesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeServiceUpdatesResponse
 -> Rep DescribeServiceUpdatesResponse x)
-> (forall x.
    Rep DescribeServiceUpdatesResponse x
    -> DescribeServiceUpdatesResponse)
-> Generic DescribeServiceUpdatesResponse
forall x.
Rep DescribeServiceUpdatesResponse x
-> DescribeServiceUpdatesResponse
forall x.
DescribeServiceUpdatesResponse
-> Rep DescribeServiceUpdatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeServiceUpdatesResponse x
-> DescribeServiceUpdatesResponse
$cfrom :: forall x.
DescribeServiceUpdatesResponse
-> Rep DescribeServiceUpdatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeServiceUpdatesResponse' 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:
--
-- 'serviceUpdates', 'describeServiceUpdatesResponse_serviceUpdates' - A list of service updates
--
-- 'nextToken', 'describeServiceUpdatesResponse_nextToken' - An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
--
-- 'httpStatus', 'describeServiceUpdatesResponse_httpStatus' - The response's http status code.
newDescribeServiceUpdatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeServiceUpdatesResponse
newDescribeServiceUpdatesResponse :: Int -> DescribeServiceUpdatesResponse
newDescribeServiceUpdatesResponse Int
pHttpStatus_ =
  DescribeServiceUpdatesResponse' :: Maybe [ServiceUpdate]
-> Maybe Text -> Int -> DescribeServiceUpdatesResponse
DescribeServiceUpdatesResponse'
    { $sel:serviceUpdates:DescribeServiceUpdatesResponse' :: Maybe [ServiceUpdate]
serviceUpdates =
        Maybe [ServiceUpdate]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeServiceUpdatesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeServiceUpdatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of service updates
describeServiceUpdatesResponse_serviceUpdates :: Lens.Lens' DescribeServiceUpdatesResponse (Prelude.Maybe [ServiceUpdate])
describeServiceUpdatesResponse_serviceUpdates :: (Maybe [ServiceUpdate] -> f (Maybe [ServiceUpdate]))
-> DescribeServiceUpdatesResponse
-> f DescribeServiceUpdatesResponse
describeServiceUpdatesResponse_serviceUpdates = (DescribeServiceUpdatesResponse -> Maybe [ServiceUpdate])
-> (DescribeServiceUpdatesResponse
    -> Maybe [ServiceUpdate] -> DescribeServiceUpdatesResponse)
-> Lens
     DescribeServiceUpdatesResponse
     DescribeServiceUpdatesResponse
     (Maybe [ServiceUpdate])
     (Maybe [ServiceUpdate])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdatesResponse' {Maybe [ServiceUpdate]
serviceUpdates :: Maybe [ServiceUpdate]
$sel:serviceUpdates:DescribeServiceUpdatesResponse' :: DescribeServiceUpdatesResponse -> Maybe [ServiceUpdate]
serviceUpdates} -> Maybe [ServiceUpdate]
serviceUpdates) (\s :: DescribeServiceUpdatesResponse
s@DescribeServiceUpdatesResponse' {} Maybe [ServiceUpdate]
a -> DescribeServiceUpdatesResponse
s {$sel:serviceUpdates:DescribeServiceUpdatesResponse' :: Maybe [ServiceUpdate]
serviceUpdates = Maybe [ServiceUpdate]
a} :: DescribeServiceUpdatesResponse) ((Maybe [ServiceUpdate] -> f (Maybe [ServiceUpdate]))
 -> DescribeServiceUpdatesResponse
 -> f DescribeServiceUpdatesResponse)
-> ((Maybe [ServiceUpdate] -> f (Maybe [ServiceUpdate]))
    -> Maybe [ServiceUpdate] -> f (Maybe [ServiceUpdate]))
-> (Maybe [ServiceUpdate] -> f (Maybe [ServiceUpdate]))
-> DescribeServiceUpdatesResponse
-> f DescribeServiceUpdatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ServiceUpdate] [ServiceUpdate] [ServiceUpdate] [ServiceUpdate]
-> Iso
     (Maybe [ServiceUpdate])
     (Maybe [ServiceUpdate])
     (Maybe [ServiceUpdate])
     (Maybe [ServiceUpdate])
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
  [ServiceUpdate] [ServiceUpdate] [ServiceUpdate] [ServiceUpdate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
describeServiceUpdatesResponse_nextToken :: Lens.Lens' DescribeServiceUpdatesResponse (Prelude.Maybe Prelude.Text)
describeServiceUpdatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceUpdatesResponse
-> f DescribeServiceUpdatesResponse
describeServiceUpdatesResponse_nextToken = (DescribeServiceUpdatesResponse -> Maybe Text)
-> (DescribeServiceUpdatesResponse
    -> Maybe Text -> DescribeServiceUpdatesResponse)
-> Lens
     DescribeServiceUpdatesResponse
     DescribeServiceUpdatesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeServiceUpdatesResponse' :: DescribeServiceUpdatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeServiceUpdatesResponse
s@DescribeServiceUpdatesResponse' {} Maybe Text
a -> DescribeServiceUpdatesResponse
s {$sel:nextToken:DescribeServiceUpdatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeServiceUpdatesResponse)

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

instance
  Prelude.NFData
    DescribeServiceUpdatesResponse