{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns details of the service updates
--
-- This operation returns paginated results.
module Amazonka.MemoryDb.DescribeServiceUpdates
  ( -- * Creating a Request
    DescribeServiceUpdates (..),
    newDescribeServiceUpdates,

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

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 list of cluster names to identify service updates to apply
    DescribeServiceUpdates -> Maybe [Text]
clusterNames :: 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,
    -- | 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 unique ID of the service update to describe.
    DescribeServiceUpdates -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text,
    -- | The status(es) of the service updates to filter on
    DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
status :: Prelude.Maybe [ServiceUpdateStatus]
  }
  deriving (DescribeServiceUpdates -> DescribeServiceUpdates -> Bool
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]
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
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. 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:
--
-- 'clusterNames', 'describeServiceUpdates_clusterNames' - The list of cluster names to identify service updates to apply
--
-- '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.
--
-- '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.
--
-- 'serviceUpdateName', 'describeServiceUpdates_serviceUpdateName' - The unique ID of the service update to describe.
--
-- 'status', 'describeServiceUpdates_status' - The status(es) of the service updates to filter on
newDescribeServiceUpdates ::
  DescribeServiceUpdates
newDescribeServiceUpdates :: DescribeServiceUpdates
newDescribeServiceUpdates =
  DescribeServiceUpdates'
    { $sel:clusterNames:DescribeServiceUpdates' :: Maybe [Text]
clusterNames =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeServiceUpdates' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeServiceUpdates' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdateName:DescribeServiceUpdates' :: Maybe Text
serviceUpdateName = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DescribeServiceUpdates' :: Maybe [ServiceUpdateStatus]
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The list of cluster names to identify service updates to apply
describeServiceUpdates_clusterNames :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe [Prelude.Text])
describeServiceUpdates_clusterNames :: Lens' DescribeServiceUpdates (Maybe [Text])
describeServiceUpdates_clusterNames = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' DescribeServiceUpdates (Maybe Int)
describeServiceUpdates_maxResults = 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)

-- | 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 :: Lens' DescribeServiceUpdates (Maybe Text)
describeServiceUpdates_nextToken = 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 unique ID of the service update to describe.
describeServiceUpdates_serviceUpdateName :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe Prelude.Text)
describeServiceUpdates_serviceUpdateName :: Lens' DescribeServiceUpdates (Maybe Text)
describeServiceUpdates_serviceUpdateName = 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 status(es) of the service updates to filter on
describeServiceUpdates_status :: Lens.Lens' DescribeServiceUpdates (Prelude.Maybe [ServiceUpdateStatus])
describeServiceUpdates_status :: Lens' DescribeServiceUpdates (Maybe [ServiceUpdateStatus])
describeServiceUpdates_status = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeServiceUpdates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeServiceUpdatesResponse (Maybe Text)
describeServiceUpdatesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeServiceUpdates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeServiceUpdatesResponse (Maybe [ServiceUpdate])
describeServiceUpdatesResponse_serviceUpdates
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeServiceUpdates
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeServiceUpdates (Maybe Text)
describeServiceUpdates_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeServiceUpdates
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeServiceUpdatesResponse (Maybe Text)
describeServiceUpdatesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeServiceUpdates where
  type
    AWSResponse DescribeServiceUpdates =
      DescribeServiceUpdatesResponse
  request :: (Service -> Service)
-> DescribeServiceUpdates -> Request DescribeServiceUpdates
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeServiceUpdates
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceUpdates)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ServiceUpdate] -> Int -> DescribeServiceUpdatesResponse
DescribeServiceUpdatesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ServiceUpdates" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeServiceUpdates where
  hashWithSalt :: Int -> DescribeServiceUpdates -> Int
hashWithSalt Int
_salt DescribeServiceUpdates' {Maybe Int
Maybe [Text]
Maybe [ServiceUpdateStatus]
Maybe Text
status :: Maybe [ServiceUpdateStatus]
serviceUpdateName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
clusterNames :: Maybe [Text]
$sel:status:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
$sel:serviceUpdateName:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:nextToken:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:maxResults:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Int
$sel:clusterNames:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
clusterNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceUpdateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ServiceUpdateStatus]
status

instance Prelude.NFData DescribeServiceUpdates where
  rnf :: DescribeServiceUpdates -> ()
rnf DescribeServiceUpdates' {Maybe Int
Maybe [Text]
Maybe [ServiceUpdateStatus]
Maybe Text
status :: Maybe [ServiceUpdateStatus]
serviceUpdateName :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
clusterNames :: Maybe [Text]
$sel:status:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [ServiceUpdateStatus]
$sel:serviceUpdateName:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:nextToken:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Text
$sel:maxResults:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe Int
$sel:clusterNames:DescribeServiceUpdates' :: DescribeServiceUpdates -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
clusterNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceUpdateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceUpdateStatus]
status

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

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

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

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

-- | /See:/ 'newDescribeServiceUpdatesResponse' smart constructor.
data DescribeServiceUpdatesResponse = DescribeServiceUpdatesResponse'
  { -- | 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,
    -- | A list of service updates
    DescribeServiceUpdatesResponse -> Maybe [ServiceUpdate]
serviceUpdates :: Prelude.Maybe [ServiceUpdate],
    -- | The response's http status code.
    DescribeServiceUpdatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeServiceUpdatesResponse
-> DescribeServiceUpdatesResponse -> Bool
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]
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
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.
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:
--
-- '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.
--
-- 'serviceUpdates', 'describeServiceUpdatesResponse_serviceUpdates' - A list of service updates
--
-- 'httpStatus', 'describeServiceUpdatesResponse_httpStatus' - The response's http status code.
newDescribeServiceUpdatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeServiceUpdatesResponse
newDescribeServiceUpdatesResponse :: Int -> DescribeServiceUpdatesResponse
newDescribeServiceUpdatesResponse Int
pHttpStatus_ =
  DescribeServiceUpdatesResponse'
    { $sel:nextToken:DescribeServiceUpdatesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdates:DescribeServiceUpdatesResponse' :: Maybe [ServiceUpdate]
serviceUpdates = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeServiceUpdatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: Lens' DescribeServiceUpdatesResponse (Maybe Text)
describeServiceUpdatesResponse_nextToken = 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)

-- | A list of service updates
describeServiceUpdatesResponse_serviceUpdates :: Lens.Lens' DescribeServiceUpdatesResponse (Prelude.Maybe [ServiceUpdate])
describeServiceUpdatesResponse_serviceUpdates :: Lens' DescribeServiceUpdatesResponse (Maybe [ServiceUpdate])
describeServiceUpdatesResponse_serviceUpdates = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeServiceUpdatesResponse_httpStatus :: Lens.Lens' DescribeServiceUpdatesResponse Prelude.Int
describeServiceUpdatesResponse_httpStatus :: Lens' DescribeServiceUpdatesResponse Int
describeServiceUpdatesResponse_httpStatus = 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
  where
  rnf :: DescribeServiceUpdatesResponse -> ()
rnf DescribeServiceUpdatesResponse' {Int
Maybe [ServiceUpdate]
Maybe Text
httpStatus :: Int
serviceUpdates :: Maybe [ServiceUpdate]
nextToken :: Maybe Text
$sel:httpStatus:DescribeServiceUpdatesResponse' :: DescribeServiceUpdatesResponse -> Int
$sel:serviceUpdates:DescribeServiceUpdatesResponse' :: DescribeServiceUpdatesResponse -> Maybe [ServiceUpdate]
$sel:nextToken:DescribeServiceUpdatesResponse' :: DescribeServiceUpdatesResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServiceUpdate]
serviceUpdates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus