{-# 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.Neptune.DescribePendingMaintenanceActions
-- 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 a list of resources (for example, DB instances) that have at
-- least one pending maintenance action.
--
-- This operation returns paginated results.
module Amazonka.Neptune.DescribePendingMaintenanceActions
  ( -- * Creating a Request
    DescribePendingMaintenanceActions (..),
    newDescribePendingMaintenanceActions,

    -- * Request Lenses
    describePendingMaintenanceActions_filters,
    describePendingMaintenanceActions_marker,
    describePendingMaintenanceActions_maxRecords,
    describePendingMaintenanceActions_resourceIdentifier,

    -- * Destructuring the Response
    DescribePendingMaintenanceActionsResponse (..),
    newDescribePendingMaintenanceActionsResponse,

    -- * Response Lenses
    describePendingMaintenanceActionsResponse_pendingMaintenanceActions,
    describePendingMaintenanceActionsResponse_marker,
    describePendingMaintenanceActionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribePendingMaintenanceActions' smart constructor.
data DescribePendingMaintenanceActions = DescribePendingMaintenanceActions'
  { -- | A filter that specifies one or more resources to return pending
    -- maintenance actions for.
    --
    -- Supported filters:
    --
    -- -   @db-cluster-id@ - Accepts DB cluster identifiers and DB cluster
    --     Amazon Resource Names (ARNs). The results list will only include
    --     pending maintenance actions for the DB clusters identified by these
    --     ARNs.
    --
    -- -   @db-instance-id@ - Accepts DB instance identifiers and DB instance
    --     ARNs. The results list will only include pending maintenance actions
    --     for the DB instances identified by these ARNs.
    DescribePendingMaintenanceActions -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous
    -- @DescribePendingMaintenanceActions@ request. If this parameter is
    -- specified, the response includes only records beyond the marker, up to a
    -- number of records specified by @MaxRecords@.
    DescribePendingMaintenanceActions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so that the remaining
    -- results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribePendingMaintenanceActions -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The ARN of a resource to return pending maintenance actions for.
    DescribePendingMaintenanceActions -> Maybe Text
resourceIdentifier :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribePendingMaintenanceActions
-> DescribePendingMaintenanceActions -> Bool
(DescribePendingMaintenanceActions
 -> DescribePendingMaintenanceActions -> Bool)
-> (DescribePendingMaintenanceActions
    -> DescribePendingMaintenanceActions -> Bool)
-> Eq DescribePendingMaintenanceActions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePendingMaintenanceActions
-> DescribePendingMaintenanceActions -> Bool
$c/= :: DescribePendingMaintenanceActions
-> DescribePendingMaintenanceActions -> Bool
== :: DescribePendingMaintenanceActions
-> DescribePendingMaintenanceActions -> Bool
$c== :: DescribePendingMaintenanceActions
-> DescribePendingMaintenanceActions -> Bool
Prelude.Eq, ReadPrec [DescribePendingMaintenanceActions]
ReadPrec DescribePendingMaintenanceActions
Int -> ReadS DescribePendingMaintenanceActions
ReadS [DescribePendingMaintenanceActions]
(Int -> ReadS DescribePendingMaintenanceActions)
-> ReadS [DescribePendingMaintenanceActions]
-> ReadPrec DescribePendingMaintenanceActions
-> ReadPrec [DescribePendingMaintenanceActions]
-> Read DescribePendingMaintenanceActions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePendingMaintenanceActions]
$creadListPrec :: ReadPrec [DescribePendingMaintenanceActions]
readPrec :: ReadPrec DescribePendingMaintenanceActions
$creadPrec :: ReadPrec DescribePendingMaintenanceActions
readList :: ReadS [DescribePendingMaintenanceActions]
$creadList :: ReadS [DescribePendingMaintenanceActions]
readsPrec :: Int -> ReadS DescribePendingMaintenanceActions
$creadsPrec :: Int -> ReadS DescribePendingMaintenanceActions
Prelude.Read, Int -> DescribePendingMaintenanceActions -> ShowS
[DescribePendingMaintenanceActions] -> ShowS
DescribePendingMaintenanceActions -> String
(Int -> DescribePendingMaintenanceActions -> ShowS)
-> (DescribePendingMaintenanceActions -> String)
-> ([DescribePendingMaintenanceActions] -> ShowS)
-> Show DescribePendingMaintenanceActions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePendingMaintenanceActions] -> ShowS
$cshowList :: [DescribePendingMaintenanceActions] -> ShowS
show :: DescribePendingMaintenanceActions -> String
$cshow :: DescribePendingMaintenanceActions -> String
showsPrec :: Int -> DescribePendingMaintenanceActions -> ShowS
$cshowsPrec :: Int -> DescribePendingMaintenanceActions -> ShowS
Prelude.Show, (forall x.
 DescribePendingMaintenanceActions
 -> Rep DescribePendingMaintenanceActions x)
-> (forall x.
    Rep DescribePendingMaintenanceActions x
    -> DescribePendingMaintenanceActions)
-> Generic DescribePendingMaintenanceActions
forall x.
Rep DescribePendingMaintenanceActions x
-> DescribePendingMaintenanceActions
forall x.
DescribePendingMaintenanceActions
-> Rep DescribePendingMaintenanceActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePendingMaintenanceActions x
-> DescribePendingMaintenanceActions
$cfrom :: forall x.
DescribePendingMaintenanceActions
-> Rep DescribePendingMaintenanceActions x
Prelude.Generic)

-- |
-- Create a value of 'DescribePendingMaintenanceActions' 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:
--
-- 'filters', 'describePendingMaintenanceActions_filters' - A filter that specifies one or more resources to return pending
-- maintenance actions for.
--
-- Supported filters:
--
-- -   @db-cluster-id@ - Accepts DB cluster identifiers and DB cluster
--     Amazon Resource Names (ARNs). The results list will only include
--     pending maintenance actions for the DB clusters identified by these
--     ARNs.
--
-- -   @db-instance-id@ - Accepts DB instance identifiers and DB instance
--     ARNs. The results list will only include pending maintenance actions
--     for the DB instances identified by these ARNs.
--
-- 'marker', 'describePendingMaintenanceActions_marker' - An optional pagination token provided by a previous
-- @DescribePendingMaintenanceActions@ request. If this parameter is
-- specified, the response includes only records beyond the marker, up to a
-- number of records specified by @MaxRecords@.
--
-- 'maxRecords', 'describePendingMaintenanceActions_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
--
-- 'resourceIdentifier', 'describePendingMaintenanceActions_resourceIdentifier' - The ARN of a resource to return pending maintenance actions for.
newDescribePendingMaintenanceActions ::
  DescribePendingMaintenanceActions
newDescribePendingMaintenanceActions :: DescribePendingMaintenanceActions
newDescribePendingMaintenanceActions =
  DescribePendingMaintenanceActions' :: Maybe [Filter]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> DescribePendingMaintenanceActions
DescribePendingMaintenanceActions'
    { $sel:filters:DescribePendingMaintenanceActions' :: Maybe [Filter]
filters =
        Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribePendingMaintenanceActions' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribePendingMaintenanceActions' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceIdentifier:DescribePendingMaintenanceActions' :: Maybe Text
resourceIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A filter that specifies one or more resources to return pending
-- maintenance actions for.
--
-- Supported filters:
--
-- -   @db-cluster-id@ - Accepts DB cluster identifiers and DB cluster
--     Amazon Resource Names (ARNs). The results list will only include
--     pending maintenance actions for the DB clusters identified by these
--     ARNs.
--
-- -   @db-instance-id@ - Accepts DB instance identifiers and DB instance
--     ARNs. The results list will only include pending maintenance actions
--     for the DB instances identified by these ARNs.
describePendingMaintenanceActions_filters :: Lens.Lens' DescribePendingMaintenanceActions (Prelude.Maybe [Filter])
describePendingMaintenanceActions_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribePendingMaintenanceActions
-> f DescribePendingMaintenanceActions
describePendingMaintenanceActions_filters = (DescribePendingMaintenanceActions -> Maybe [Filter])
-> (DescribePendingMaintenanceActions
    -> Maybe [Filter] -> DescribePendingMaintenanceActions)
-> Lens
     DescribePendingMaintenanceActions
     DescribePendingMaintenanceActions
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePendingMaintenanceActions' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribePendingMaintenanceActions
s@DescribePendingMaintenanceActions' {} Maybe [Filter]
a -> DescribePendingMaintenanceActions
s {$sel:filters:DescribePendingMaintenanceActions' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribePendingMaintenanceActions) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribePendingMaintenanceActions
 -> f DescribePendingMaintenanceActions)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribePendingMaintenanceActions
-> f DescribePendingMaintenanceActions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous
-- @DescribePendingMaintenanceActions@ request. If this parameter is
-- specified, the response includes only records beyond the marker, up to a
-- number of records specified by @MaxRecords@.
describePendingMaintenanceActions_marker :: Lens.Lens' DescribePendingMaintenanceActions (Prelude.Maybe Prelude.Text)
describePendingMaintenanceActions_marker :: (Maybe Text -> f (Maybe Text))
-> DescribePendingMaintenanceActions
-> f DescribePendingMaintenanceActions
describePendingMaintenanceActions_marker = (DescribePendingMaintenanceActions -> Maybe Text)
-> (DescribePendingMaintenanceActions
    -> Maybe Text -> DescribePendingMaintenanceActions)
-> Lens
     DescribePendingMaintenanceActions
     DescribePendingMaintenanceActions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePendingMaintenanceActions' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribePendingMaintenanceActions
s@DescribePendingMaintenanceActions' {} Maybe Text
a -> DescribePendingMaintenanceActions
s {$sel:marker:DescribePendingMaintenanceActions' :: Maybe Text
marker = Maybe Text
a} :: DescribePendingMaintenanceActions)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describePendingMaintenanceActions_maxRecords :: Lens.Lens' DescribePendingMaintenanceActions (Prelude.Maybe Prelude.Int)
describePendingMaintenanceActions_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribePendingMaintenanceActions
-> f DescribePendingMaintenanceActions
describePendingMaintenanceActions_maxRecords = (DescribePendingMaintenanceActions -> Maybe Int)
-> (DescribePendingMaintenanceActions
    -> Maybe Int -> DescribePendingMaintenanceActions)
-> Lens
     DescribePendingMaintenanceActions
     DescribePendingMaintenanceActions
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePendingMaintenanceActions' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribePendingMaintenanceActions
s@DescribePendingMaintenanceActions' {} Maybe Int
a -> DescribePendingMaintenanceActions
s {$sel:maxRecords:DescribePendingMaintenanceActions' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribePendingMaintenanceActions)

-- | The ARN of a resource to return pending maintenance actions for.
describePendingMaintenanceActions_resourceIdentifier :: Lens.Lens' DescribePendingMaintenanceActions (Prelude.Maybe Prelude.Text)
describePendingMaintenanceActions_resourceIdentifier :: (Maybe Text -> f (Maybe Text))
-> DescribePendingMaintenanceActions
-> f DescribePendingMaintenanceActions
describePendingMaintenanceActions_resourceIdentifier = (DescribePendingMaintenanceActions -> Maybe Text)
-> (DescribePendingMaintenanceActions
    -> Maybe Text -> DescribePendingMaintenanceActions)
-> Lens
     DescribePendingMaintenanceActions
     DescribePendingMaintenanceActions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePendingMaintenanceActions' {Maybe Text
resourceIdentifier :: Maybe Text
$sel:resourceIdentifier:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe Text
resourceIdentifier} -> Maybe Text
resourceIdentifier) (\s :: DescribePendingMaintenanceActions
s@DescribePendingMaintenanceActions' {} Maybe Text
a -> DescribePendingMaintenanceActions
s {$sel:resourceIdentifier:DescribePendingMaintenanceActions' :: Maybe Text
resourceIdentifier = Maybe Text
a} :: DescribePendingMaintenanceActions)

instance
  Core.AWSPager
    DescribePendingMaintenanceActions
  where
  page :: DescribePendingMaintenanceActions
-> AWSResponse DescribePendingMaintenanceActions
-> Maybe DescribePendingMaintenanceActions
page DescribePendingMaintenanceActions
rq AWSResponse DescribePendingMaintenanceActions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribePendingMaintenanceActions
DescribePendingMaintenanceActionsResponse
rs
            DescribePendingMaintenanceActionsResponse
-> Getting
     (First Text) DescribePendingMaintenanceActionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribePendingMaintenanceActionsResponse
-> Const (First Text) DescribePendingMaintenanceActionsResponse
Lens' DescribePendingMaintenanceActionsResponse (Maybe Text)
describePendingMaintenanceActionsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribePendingMaintenanceActionsResponse
 -> Const (First Text) DescribePendingMaintenanceActionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) DescribePendingMaintenanceActionsResponse 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 DescribePendingMaintenanceActions
forall a. Maybe a
Prelude.Nothing
    | Maybe [ResourcePendingMaintenanceActions] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribePendingMaintenanceActions
DescribePendingMaintenanceActionsResponse
rs
            DescribePendingMaintenanceActionsResponse
-> Getting
     (First [ResourcePendingMaintenanceActions])
     DescribePendingMaintenanceActionsResponse
     [ResourcePendingMaintenanceActions]
-> Maybe [ResourcePendingMaintenanceActions]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ResourcePendingMaintenanceActions]
 -> Const
      (First [ResourcePendingMaintenanceActions])
      (Maybe [ResourcePendingMaintenanceActions]))
-> DescribePendingMaintenanceActionsResponse
-> Const
     (First [ResourcePendingMaintenanceActions])
     DescribePendingMaintenanceActionsResponse
Lens'
  DescribePendingMaintenanceActionsResponse
  (Maybe [ResourcePendingMaintenanceActions])
describePendingMaintenanceActionsResponse_pendingMaintenanceActions
              ((Maybe [ResourcePendingMaintenanceActions]
  -> Const
       (First [ResourcePendingMaintenanceActions])
       (Maybe [ResourcePendingMaintenanceActions]))
 -> DescribePendingMaintenanceActionsResponse
 -> Const
      (First [ResourcePendingMaintenanceActions])
      DescribePendingMaintenanceActionsResponse)
-> (([ResourcePendingMaintenanceActions]
     -> Const
          (First [ResourcePendingMaintenanceActions])
          [ResourcePendingMaintenanceActions])
    -> Maybe [ResourcePendingMaintenanceActions]
    -> Const
         (First [ResourcePendingMaintenanceActions])
         (Maybe [ResourcePendingMaintenanceActions]))
-> Getting
     (First [ResourcePendingMaintenanceActions])
     DescribePendingMaintenanceActionsResponse
     [ResourcePendingMaintenanceActions]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResourcePendingMaintenanceActions]
 -> Const
      (First [ResourcePendingMaintenanceActions])
      [ResourcePendingMaintenanceActions])
-> Maybe [ResourcePendingMaintenanceActions]
-> Const
     (First [ResourcePendingMaintenanceActions])
     (Maybe [ResourcePendingMaintenanceActions])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribePendingMaintenanceActions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribePendingMaintenanceActions
-> Maybe DescribePendingMaintenanceActions
forall a. a -> Maybe a
Prelude.Just (DescribePendingMaintenanceActions
 -> Maybe DescribePendingMaintenanceActions)
-> DescribePendingMaintenanceActions
-> Maybe DescribePendingMaintenanceActions
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribePendingMaintenanceActions
rq
          DescribePendingMaintenanceActions
-> (DescribePendingMaintenanceActions
    -> DescribePendingMaintenanceActions)
-> DescribePendingMaintenanceActions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribePendingMaintenanceActions
-> Identity DescribePendingMaintenanceActions
Lens
  DescribePendingMaintenanceActions
  DescribePendingMaintenanceActions
  (Maybe Text)
  (Maybe Text)
describePendingMaintenanceActions_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribePendingMaintenanceActions
 -> Identity DescribePendingMaintenanceActions)
-> Maybe Text
-> DescribePendingMaintenanceActions
-> DescribePendingMaintenanceActions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribePendingMaintenanceActions
DescribePendingMaintenanceActionsResponse
rs
          DescribePendingMaintenanceActionsResponse
-> Getting
     (First Text) DescribePendingMaintenanceActionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribePendingMaintenanceActionsResponse
-> Const (First Text) DescribePendingMaintenanceActionsResponse
Lens' DescribePendingMaintenanceActionsResponse (Maybe Text)
describePendingMaintenanceActionsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribePendingMaintenanceActionsResponse
 -> Const (First Text) DescribePendingMaintenanceActionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) DescribePendingMaintenanceActionsResponse 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
    DescribePendingMaintenanceActions
  where
  type
    AWSResponse DescribePendingMaintenanceActions =
      DescribePendingMaintenanceActionsResponse
  request :: DescribePendingMaintenanceActions
-> Request DescribePendingMaintenanceActions
request = Service
-> DescribePendingMaintenanceActions
-> Request DescribePendingMaintenanceActions
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribePendingMaintenanceActions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribePendingMaintenanceActions)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribePendingMaintenanceActions))
-> Logger
-> Service
-> Proxy DescribePendingMaintenanceActions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribePendingMaintenanceActions)))
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
"DescribePendingMaintenanceActionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [ResourcePendingMaintenanceActions]
-> Maybe Text -> Int -> DescribePendingMaintenanceActionsResponse
DescribePendingMaintenanceActionsResponse'
            (Maybe [ResourcePendingMaintenanceActions]
 -> Maybe Text -> Int -> DescribePendingMaintenanceActionsResponse)
-> Either String (Maybe [ResourcePendingMaintenanceActions])
-> Either
     String
     (Maybe Text -> Int -> DescribePendingMaintenanceActionsResponse)
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
"PendingMaintenanceActions"
                            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 [ResourcePendingMaintenanceActions]))
-> Either String (Maybe [ResourcePendingMaintenanceActions])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ResourcePendingMaintenanceActions])
-> [Node]
-> Either String (Maybe [ResourcePendingMaintenanceActions])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                              ( Text -> [Node] -> Either String [ResourcePendingMaintenanceActions]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList
                                  Text
"ResourcePendingMaintenanceActions"
                              )
                        )
              Either
  String
  (Maybe Text -> Int -> DescribePendingMaintenanceActionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribePendingMaintenanceActionsResponse)
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 -> DescribePendingMaintenanceActionsResponse)
-> Either String Int
-> Either String DescribePendingMaintenanceActionsResponse
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
    DescribePendingMaintenanceActions

instance
  Prelude.NFData
    DescribePendingMaintenanceActions

instance
  Core.ToHeaders
    DescribePendingMaintenanceActions
  where
  toHeaders :: DescribePendingMaintenanceActions -> ResponseHeaders
toHeaders = ResponseHeaders
-> DescribePendingMaintenanceActions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance
  Core.ToQuery
    DescribePendingMaintenanceActions
  where
  toQuery :: DescribePendingMaintenanceActions -> QueryString
toQuery DescribePendingMaintenanceActions' {Maybe Int
Maybe [Filter]
Maybe Text
resourceIdentifier :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:resourceIdentifier:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe Text
$sel:maxRecords:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe Int
$sel:marker:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe Text
$sel:filters:DescribePendingMaintenanceActions' :: DescribePendingMaintenanceActions -> Maybe [Filter]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribePendingMaintenanceActions" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"Filters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Filter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Filter" ([Filter] -> QueryString) -> Maybe [Filter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        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
"ResourceIdentifier" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resourceIdentifier
      ]

-- | /See:/ 'newDescribePendingMaintenanceActionsResponse' smart constructor.
data DescribePendingMaintenanceActionsResponse = DescribePendingMaintenanceActionsResponse'
  { -- | A list of the pending maintenance actions for the resource.
    DescribePendingMaintenanceActionsResponse
-> Maybe [ResourcePendingMaintenanceActions]
pendingMaintenanceActions :: Prelude.Maybe [ResourcePendingMaintenanceActions],
    -- | An optional pagination token provided by a previous
    -- @DescribePendingMaintenanceActions@ request. If this parameter is
    -- specified, the response includes only records beyond the marker, up to a
    -- number of records specified by @MaxRecords@.
    DescribePendingMaintenanceActionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribePendingMaintenanceActionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribePendingMaintenanceActionsResponse
-> DescribePendingMaintenanceActionsResponse -> Bool
(DescribePendingMaintenanceActionsResponse
 -> DescribePendingMaintenanceActionsResponse -> Bool)
-> (DescribePendingMaintenanceActionsResponse
    -> DescribePendingMaintenanceActionsResponse -> Bool)
-> Eq DescribePendingMaintenanceActionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePendingMaintenanceActionsResponse
-> DescribePendingMaintenanceActionsResponse -> Bool
$c/= :: DescribePendingMaintenanceActionsResponse
-> DescribePendingMaintenanceActionsResponse -> Bool
== :: DescribePendingMaintenanceActionsResponse
-> DescribePendingMaintenanceActionsResponse -> Bool
$c== :: DescribePendingMaintenanceActionsResponse
-> DescribePendingMaintenanceActionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribePendingMaintenanceActionsResponse]
ReadPrec DescribePendingMaintenanceActionsResponse
Int -> ReadS DescribePendingMaintenanceActionsResponse
ReadS [DescribePendingMaintenanceActionsResponse]
(Int -> ReadS DescribePendingMaintenanceActionsResponse)
-> ReadS [DescribePendingMaintenanceActionsResponse]
-> ReadPrec DescribePendingMaintenanceActionsResponse
-> ReadPrec [DescribePendingMaintenanceActionsResponse]
-> Read DescribePendingMaintenanceActionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePendingMaintenanceActionsResponse]
$creadListPrec :: ReadPrec [DescribePendingMaintenanceActionsResponse]
readPrec :: ReadPrec DescribePendingMaintenanceActionsResponse
$creadPrec :: ReadPrec DescribePendingMaintenanceActionsResponse
readList :: ReadS [DescribePendingMaintenanceActionsResponse]
$creadList :: ReadS [DescribePendingMaintenanceActionsResponse]
readsPrec :: Int -> ReadS DescribePendingMaintenanceActionsResponse
$creadsPrec :: Int -> ReadS DescribePendingMaintenanceActionsResponse
Prelude.Read, Int -> DescribePendingMaintenanceActionsResponse -> ShowS
[DescribePendingMaintenanceActionsResponse] -> ShowS
DescribePendingMaintenanceActionsResponse -> String
(Int -> DescribePendingMaintenanceActionsResponse -> ShowS)
-> (DescribePendingMaintenanceActionsResponse -> String)
-> ([DescribePendingMaintenanceActionsResponse] -> ShowS)
-> Show DescribePendingMaintenanceActionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePendingMaintenanceActionsResponse] -> ShowS
$cshowList :: [DescribePendingMaintenanceActionsResponse] -> ShowS
show :: DescribePendingMaintenanceActionsResponse -> String
$cshow :: DescribePendingMaintenanceActionsResponse -> String
showsPrec :: Int -> DescribePendingMaintenanceActionsResponse -> ShowS
$cshowsPrec :: Int -> DescribePendingMaintenanceActionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribePendingMaintenanceActionsResponse
 -> Rep DescribePendingMaintenanceActionsResponse x)
-> (forall x.
    Rep DescribePendingMaintenanceActionsResponse x
    -> DescribePendingMaintenanceActionsResponse)
-> Generic DescribePendingMaintenanceActionsResponse
forall x.
Rep DescribePendingMaintenanceActionsResponse x
-> DescribePendingMaintenanceActionsResponse
forall x.
DescribePendingMaintenanceActionsResponse
-> Rep DescribePendingMaintenanceActionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePendingMaintenanceActionsResponse x
-> DescribePendingMaintenanceActionsResponse
$cfrom :: forall x.
DescribePendingMaintenanceActionsResponse
-> Rep DescribePendingMaintenanceActionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribePendingMaintenanceActionsResponse' 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:
--
-- 'pendingMaintenanceActions', 'describePendingMaintenanceActionsResponse_pendingMaintenanceActions' - A list of the pending maintenance actions for the resource.
--
-- 'marker', 'describePendingMaintenanceActionsResponse_marker' - An optional pagination token provided by a previous
-- @DescribePendingMaintenanceActions@ request. If this parameter is
-- specified, the response includes only records beyond the marker, up to a
-- number of records specified by @MaxRecords@.
--
-- 'httpStatus', 'describePendingMaintenanceActionsResponse_httpStatus' - The response's http status code.
newDescribePendingMaintenanceActionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribePendingMaintenanceActionsResponse
newDescribePendingMaintenanceActionsResponse :: Int -> DescribePendingMaintenanceActionsResponse
newDescribePendingMaintenanceActionsResponse
  Int
pHttpStatus_ =
    DescribePendingMaintenanceActionsResponse' :: Maybe [ResourcePendingMaintenanceActions]
-> Maybe Text -> Int -> DescribePendingMaintenanceActionsResponse
DescribePendingMaintenanceActionsResponse'
      { $sel:pendingMaintenanceActions:DescribePendingMaintenanceActionsResponse' :: Maybe [ResourcePendingMaintenanceActions]
pendingMaintenanceActions =
          Maybe [ResourcePendingMaintenanceActions]
forall a. Maybe a
Prelude.Nothing,
        $sel:marker:DescribePendingMaintenanceActionsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribePendingMaintenanceActionsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A list of the pending maintenance actions for the resource.
describePendingMaintenanceActionsResponse_pendingMaintenanceActions :: Lens.Lens' DescribePendingMaintenanceActionsResponse (Prelude.Maybe [ResourcePendingMaintenanceActions])
describePendingMaintenanceActionsResponse_pendingMaintenanceActions :: (Maybe [ResourcePendingMaintenanceActions]
 -> f (Maybe [ResourcePendingMaintenanceActions]))
-> DescribePendingMaintenanceActionsResponse
-> f DescribePendingMaintenanceActionsResponse
describePendingMaintenanceActionsResponse_pendingMaintenanceActions = (DescribePendingMaintenanceActionsResponse
 -> Maybe [ResourcePendingMaintenanceActions])
-> (DescribePendingMaintenanceActionsResponse
    -> Maybe [ResourcePendingMaintenanceActions]
    -> DescribePendingMaintenanceActionsResponse)
-> Lens'
     DescribePendingMaintenanceActionsResponse
     (Maybe [ResourcePendingMaintenanceActions])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePendingMaintenanceActionsResponse' {Maybe [ResourcePendingMaintenanceActions]
pendingMaintenanceActions :: Maybe [ResourcePendingMaintenanceActions]
$sel:pendingMaintenanceActions:DescribePendingMaintenanceActionsResponse' :: DescribePendingMaintenanceActionsResponse
-> Maybe [ResourcePendingMaintenanceActions]
pendingMaintenanceActions} -> Maybe [ResourcePendingMaintenanceActions]
pendingMaintenanceActions) (\s :: DescribePendingMaintenanceActionsResponse
s@DescribePendingMaintenanceActionsResponse' {} Maybe [ResourcePendingMaintenanceActions]
a -> DescribePendingMaintenanceActionsResponse
s {$sel:pendingMaintenanceActions:DescribePendingMaintenanceActionsResponse' :: Maybe [ResourcePendingMaintenanceActions]
pendingMaintenanceActions = Maybe [ResourcePendingMaintenanceActions]
a} :: DescribePendingMaintenanceActionsResponse) ((Maybe [ResourcePendingMaintenanceActions]
  -> f (Maybe [ResourcePendingMaintenanceActions]))
 -> DescribePendingMaintenanceActionsResponse
 -> f DescribePendingMaintenanceActionsResponse)
-> ((Maybe [ResourcePendingMaintenanceActions]
     -> f (Maybe [ResourcePendingMaintenanceActions]))
    -> Maybe [ResourcePendingMaintenanceActions]
    -> f (Maybe [ResourcePendingMaintenanceActions]))
-> (Maybe [ResourcePendingMaintenanceActions]
    -> f (Maybe [ResourcePendingMaintenanceActions]))
-> DescribePendingMaintenanceActionsResponse
-> f DescribePendingMaintenanceActionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourcePendingMaintenanceActions]
  [ResourcePendingMaintenanceActions]
  [ResourcePendingMaintenanceActions]
  [ResourcePendingMaintenanceActions]
-> Iso
     (Maybe [ResourcePendingMaintenanceActions])
     (Maybe [ResourcePendingMaintenanceActions])
     (Maybe [ResourcePendingMaintenanceActions])
     (Maybe [ResourcePendingMaintenanceActions])
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
  [ResourcePendingMaintenanceActions]
  [ResourcePendingMaintenanceActions]
  [ResourcePendingMaintenanceActions]
  [ResourcePendingMaintenanceActions]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous
-- @DescribePendingMaintenanceActions@ request. If this parameter is
-- specified, the response includes only records beyond the marker, up to a
-- number of records specified by @MaxRecords@.
describePendingMaintenanceActionsResponse_marker :: Lens.Lens' DescribePendingMaintenanceActionsResponse (Prelude.Maybe Prelude.Text)
describePendingMaintenanceActionsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribePendingMaintenanceActionsResponse
-> f DescribePendingMaintenanceActionsResponse
describePendingMaintenanceActionsResponse_marker = (DescribePendingMaintenanceActionsResponse -> Maybe Text)
-> (DescribePendingMaintenanceActionsResponse
    -> Maybe Text -> DescribePendingMaintenanceActionsResponse)
-> Lens' DescribePendingMaintenanceActionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePendingMaintenanceActionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribePendingMaintenanceActionsResponse' :: DescribePendingMaintenanceActionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribePendingMaintenanceActionsResponse
s@DescribePendingMaintenanceActionsResponse' {} Maybe Text
a -> DescribePendingMaintenanceActionsResponse
s {$sel:marker:DescribePendingMaintenanceActionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribePendingMaintenanceActionsResponse)

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

instance
  Prelude.NFData
    DescribePendingMaintenanceActionsResponse