{-# 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.ElastiCache.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
--
-- This operation returns paginated results.
module Amazonka.ElastiCache.DescribeServiceUpdates
  ( -- * Creating a Request
    DescribeServiceUpdates (..),
    newDescribeServiceUpdates,

    -- * Request Lenses
    describeServiceUpdates_serviceUpdateName,
    describeServiceUpdates_marker,
    describeServiceUpdates_maxRecords,
    describeServiceUpdates_serviceUpdateStatus,

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

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

import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.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:/ 'newDescribeServiceUpdates' smart constructor.
data DescribeServiceUpdates = DescribeServiceUpdates'
  { -- | The unique ID of the service update
    DescribeServiceUpdates -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text,
    -- | An optional marker returned from a prior request. Use this marker for
    -- pagination of results from this operation. If this parameter is
    -- specified, the response includes only records beyond the marker, up to
    -- the value specified by @MaxRecords@.
    DescribeServiceUpdates -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response
    DescribeServiceUpdates -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The status of the service update
    DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
serviceUpdateStatus :: Prelude.Maybe [ServiceUpdateStatus]
  }
  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:
--
-- 'serviceUpdateName', 'describeServiceUpdates_serviceUpdateName' - The unique ID of the service update
--
-- 'marker', 'describeServiceUpdates_marker' - An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeServiceUpdates_maxRecords' - The maximum number of records to include in the response
--
-- 'serviceUpdateStatus', 'describeServiceUpdates_serviceUpdateStatus' - The status of the service update
newDescribeServiceUpdates ::
  DescribeServiceUpdates
newDescribeServiceUpdates :: DescribeServiceUpdates
newDescribeServiceUpdates =
  DescribeServiceUpdates' :: Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe [ServiceUpdateStatus]
-> DescribeServiceUpdates
DescribeServiceUpdates'
    { $sel:serviceUpdateName:DescribeServiceUpdates' :: Maybe Text
serviceUpdateName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeServiceUpdates' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeServiceUpdates' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdateStatus:DescribeServiceUpdates' :: Maybe [ServiceUpdateStatus]
serviceUpdateStatus = Maybe [ServiceUpdateStatus]
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique ID of the service update
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)

-- | An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
describeServiceUpdates_marker :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe Prelude.Text)
describeServiceUpdates_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_marker = (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
marker :: Maybe Text
$sel:marker:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe Text
a -> DescribeServiceUpdates
s {$sel:marker:DescribeServiceUpdates' :: Maybe Text
marker = Maybe Text
a} :: DescribeServiceUpdates)

-- | The maximum number of records to include in the response
describeServiceUpdates_maxRecords :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe Prelude.Int)
describeServiceUpdates_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_maxRecords = (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
maxRecords :: Maybe Int
$sel:maxRecords:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe Int
a -> DescribeServiceUpdates
s {$sel:maxRecords:DescribeServiceUpdates' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeServiceUpdates)

-- | The status of the service update
describeServiceUpdates_serviceUpdateStatus :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe [ServiceUpdateStatus])
describeServiceUpdates_serviceUpdateStatus :: (Maybe [ServiceUpdateStatus] -> f (Maybe [ServiceUpdateStatus]))
-> DescribeServiceUpdates -> f DescribeServiceUpdates
describeServiceUpdates_serviceUpdateStatus = (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]
serviceUpdateStatus :: Maybe [ServiceUpdateStatus]
$sel:serviceUpdateStatus:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
serviceUpdateStatus} -> Maybe [ServiceUpdateStatus]
serviceUpdateStatus) (\s :: DescribeServiceUpdates
s@DescribeServiceUpdates' {} Maybe [ServiceUpdateStatus]
a -> DescribeServiceUpdates
s {$sel:serviceUpdateStatus:DescribeServiceUpdates' :: Maybe [ServiceUpdateStatus]
serviceUpdateStatus = 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

instance Core.AWSPager DescribeServiceUpdates where
  page :: DescribeServiceUpdates
-> AWSResponse DescribeServiceUpdates
-> Maybe DescribeServiceUpdates
page DescribeServiceUpdates
rq AWSResponse DescribeServiceUpdates
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeServiceUpdates
DescribeServiceUpdatesResponse
rs
            DescribeServiceUpdatesResponse
-> Getting (First Text) DescribeServiceUpdatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeServiceUpdatesResponse
-> Const (First Text) DescribeServiceUpdatesResponse
Lens' DescribeServiceUpdatesResponse (Maybe Text)
describeServiceUpdatesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeServiceUpdatesResponse
 -> Const (First Text) DescribeServiceUpdatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeServiceUpdatesResponse 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 DescribeServiceUpdates
forall a. Maybe a
Prelude.Nothing
    | Maybe [ServiceUpdate] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeServiceUpdates
DescribeServiceUpdatesResponse
rs
            DescribeServiceUpdatesResponse
-> Getting
     (First [ServiceUpdate])
     DescribeServiceUpdatesResponse
     [ServiceUpdate]
-> Maybe [ServiceUpdate]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ServiceUpdate]
 -> Const (First [ServiceUpdate]) (Maybe [ServiceUpdate]))
-> DescribeServiceUpdatesResponse
-> Const (First [ServiceUpdate]) DescribeServiceUpdatesResponse
Lens' DescribeServiceUpdatesResponse (Maybe [ServiceUpdate])
describeServiceUpdatesResponse_serviceUpdates
              ((Maybe [ServiceUpdate]
  -> Const (First [ServiceUpdate]) (Maybe [ServiceUpdate]))
 -> DescribeServiceUpdatesResponse
 -> Const (First [ServiceUpdate]) DescribeServiceUpdatesResponse)
-> (([ServiceUpdate]
     -> Const (First [ServiceUpdate]) [ServiceUpdate])
    -> Maybe [ServiceUpdate]
    -> Const (First [ServiceUpdate]) (Maybe [ServiceUpdate]))
-> Getting
     (First [ServiceUpdate])
     DescribeServiceUpdatesResponse
     [ServiceUpdate]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ServiceUpdate] -> Const (First [ServiceUpdate]) [ServiceUpdate])
-> Maybe [ServiceUpdate]
-> Const (First [ServiceUpdate]) (Maybe [ServiceUpdate])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeServiceUpdates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeServiceUpdates -> Maybe DescribeServiceUpdates
forall a. a -> Maybe a
Prelude.Just (DescribeServiceUpdates -> Maybe DescribeServiceUpdates)
-> DescribeServiceUpdates -> Maybe DescribeServiceUpdates
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeServiceUpdates
rq
          DescribeServiceUpdates
-> (DescribeServiceUpdates -> DescribeServiceUpdates)
-> DescribeServiceUpdates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeServiceUpdates -> Identity DescribeServiceUpdates
Lens
  DescribeServiceUpdates
  DescribeServiceUpdates
  (Maybe Text)
  (Maybe Text)
describeServiceUpdates_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeServiceUpdates -> Identity DescribeServiceUpdates)
-> Maybe Text -> DescribeServiceUpdates -> DescribeServiceUpdates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeServiceUpdates
DescribeServiceUpdatesResponse
rs
          DescribeServiceUpdatesResponse
-> Getting (First Text) DescribeServiceUpdatesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeServiceUpdatesResponse
-> Const (First Text) DescribeServiceUpdatesResponse
Lens' DescribeServiceUpdatesResponse (Maybe Text)
describeServiceUpdatesResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeServiceUpdatesResponse
 -> Const (First Text) DescribeServiceUpdatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeServiceUpdatesResponse 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 DescribeServiceUpdates where
  type
    AWSResponse DescribeServiceUpdates =
      DescribeServiceUpdatesResponse
  request :: DescribeServiceUpdates -> Request DescribeServiceUpdates
request = Service -> DescribeServiceUpdates -> Request DescribeServiceUpdates
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeServiceUpdates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceUpdates)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeServiceUpdates))
-> Logger
-> Service
-> Proxy DescribeServiceUpdates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceUpdates)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeServiceUpdatesResult"
      ( \Int
s ResponseHeaders
h [Node]
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.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ServiceUpdates" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [ServiceUpdate]))
-> Either String (Maybe [ServiceUpdate])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ServiceUpdate])
-> [Node] -> Either String (Maybe [ServiceUpdate])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ServiceUpdate]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ServiceUpdate")
                        )
            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.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            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
forall a. Monoid a => a
Prelude.mempty

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 DescribeServiceUpdates' {Maybe Int
Maybe [ServiceUpdateStatus]
Maybe Text
serviceUpdateStatus :: Maybe [ServiceUpdateStatus]
maxRecords :: Maybe Int
marker :: Maybe Text
serviceUpdateName :: Maybe Text
$sel:serviceUpdateStatus:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
$sel:maxRecords:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Int
$sel:marker:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:serviceUpdateName:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeServiceUpdates" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"ServiceUpdateName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
serviceUpdateName,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords,
        ByteString
"ServiceUpdateStatus"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [ServiceUpdateStatus] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([ServiceUpdateStatus] -> QueryString)
-> Maybe [ServiceUpdateStatus] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ServiceUpdateStatus]
serviceUpdateStatus
            )
      ]

-- | /See:/ 'newDescribeServiceUpdatesResponse' smart constructor.
data DescribeServiceUpdatesResponse = DescribeServiceUpdatesResponse'
  { -- | A list of service updates
    DescribeServiceUpdatesResponse -> Maybe [ServiceUpdate]
serviceUpdates :: Prelude.Maybe [ServiceUpdate],
    -- | An optional marker returned from a prior request. Use this marker for
    -- pagination of results from this operation. If this parameter is
    -- specified, the response includes only records beyond the marker, up to
    -- the value specified by @MaxRecords@.
    DescribeServiceUpdatesResponse -> Maybe Text
marker :: 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
--
-- 'marker', 'describeServiceUpdatesResponse_marker' - An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
--
-- '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:marker:DescribeServiceUpdatesResponse' :: Maybe Text
marker = 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 (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 marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by @MaxRecords@.
describeServiceUpdatesResponse_marker :: Lens.Lens' DescribeServiceUpdatesResponse (Prelude.Maybe Prelude.Text)
describeServiceUpdatesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceUpdatesResponse
-> f DescribeServiceUpdatesResponse
describeServiceUpdatesResponse_marker = (DescribeServiceUpdatesResponse -> Maybe Text)
-> (DescribeServiceUpdatesResponse
    -> Maybe Text -> DescribeServiceUpdatesResponse)
-> Lens' DescribeServiceUpdatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceUpdatesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeServiceUpdatesResponse' :: DescribeServiceUpdatesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeServiceUpdatesResponse
s@DescribeServiceUpdatesResponse' {} Maybe Text
a -> DescribeServiceUpdatesResponse
s {$sel:marker:DescribeServiceUpdatesResponse' :: Maybe Text
marker = 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