{-# 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.Redshift.DescribeReservedNodes
-- 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 the descriptions of the reserved nodes.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeReservedNodes
  ( -- * Creating a Request
    DescribeReservedNodes (..),
    newDescribeReservedNodes,

    -- * Request Lenses
    describeReservedNodes_reservedNodeId,
    describeReservedNodes_marker,
    describeReservedNodes_maxRecords,

    -- * Destructuring the Response
    DescribeReservedNodesResponse (..),
    newDescribeReservedNodesResponse,

    -- * Response Lenses
    describeReservedNodesResponse_reservedNodes,
    describeReservedNodesResponse_marker,
    describeReservedNodesResponse_httpStatus,
  )
where

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

-- |
--
-- /See:/ 'newDescribeReservedNodes' smart constructor.
data DescribeReservedNodes = DescribeReservedNodes'
  { -- | Identifier for the node reservation.
    DescribeReservedNodes -> Maybe Text
reservedNodeId :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeReservedNodes request
    -- exceed the value specified in @MaxRecords@, Amazon Web Services returns
    -- a value in the @Marker@ field of the response. You can retrieve the next
    -- set of response records by providing the returned marker value in the
    -- @Marker@ parameter and retrying the request.
    DescribeReservedNodes -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeReservedNodes -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeReservedNodes -> DescribeReservedNodes -> Bool
(DescribeReservedNodes -> DescribeReservedNodes -> Bool)
-> (DescribeReservedNodes -> DescribeReservedNodes -> Bool)
-> Eq DescribeReservedNodes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReservedNodes -> DescribeReservedNodes -> Bool
$c/= :: DescribeReservedNodes -> DescribeReservedNodes -> Bool
== :: DescribeReservedNodes -> DescribeReservedNodes -> Bool
$c== :: DescribeReservedNodes -> DescribeReservedNodes -> Bool
Prelude.Eq, ReadPrec [DescribeReservedNodes]
ReadPrec DescribeReservedNodes
Int -> ReadS DescribeReservedNodes
ReadS [DescribeReservedNodes]
(Int -> ReadS DescribeReservedNodes)
-> ReadS [DescribeReservedNodes]
-> ReadPrec DescribeReservedNodes
-> ReadPrec [DescribeReservedNodes]
-> Read DescribeReservedNodes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReservedNodes]
$creadListPrec :: ReadPrec [DescribeReservedNodes]
readPrec :: ReadPrec DescribeReservedNodes
$creadPrec :: ReadPrec DescribeReservedNodes
readList :: ReadS [DescribeReservedNodes]
$creadList :: ReadS [DescribeReservedNodes]
readsPrec :: Int -> ReadS DescribeReservedNodes
$creadsPrec :: Int -> ReadS DescribeReservedNodes
Prelude.Read, Int -> DescribeReservedNodes -> ShowS
[DescribeReservedNodes] -> ShowS
DescribeReservedNodes -> String
(Int -> DescribeReservedNodes -> ShowS)
-> (DescribeReservedNodes -> String)
-> ([DescribeReservedNodes] -> ShowS)
-> Show DescribeReservedNodes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReservedNodes] -> ShowS
$cshowList :: [DescribeReservedNodes] -> ShowS
show :: DescribeReservedNodes -> String
$cshow :: DescribeReservedNodes -> String
showsPrec :: Int -> DescribeReservedNodes -> ShowS
$cshowsPrec :: Int -> DescribeReservedNodes -> ShowS
Prelude.Show, (forall x. DescribeReservedNodes -> Rep DescribeReservedNodes x)
-> (forall x. Rep DescribeReservedNodes x -> DescribeReservedNodes)
-> Generic DescribeReservedNodes
forall x. Rep DescribeReservedNodes x -> DescribeReservedNodes
forall x. DescribeReservedNodes -> Rep DescribeReservedNodes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReservedNodes x -> DescribeReservedNodes
$cfrom :: forall x. DescribeReservedNodes -> Rep DescribeReservedNodes x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReservedNodes' 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:
--
-- 'reservedNodeId', 'describeReservedNodes_reservedNodeId' - Identifier for the node reservation.
--
-- 'marker', 'describeReservedNodes_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeReservedNodes request
-- exceed the value specified in @MaxRecords@, Amazon Web Services returns
-- a value in the @Marker@ field of the response. You can retrieve the next
-- set of response records by providing the returned marker value in the
-- @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeReservedNodes_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
newDescribeReservedNodes ::
  DescribeReservedNodes
newDescribeReservedNodes :: DescribeReservedNodes
newDescribeReservedNodes =
  DescribeReservedNodes' :: Maybe Text -> Maybe Text -> Maybe Int -> DescribeReservedNodes
DescribeReservedNodes'
    { $sel:reservedNodeId:DescribeReservedNodes' :: Maybe Text
reservedNodeId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeReservedNodes' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeReservedNodes' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Identifier for the node reservation.
describeReservedNodes_reservedNodeId :: Lens.Lens' DescribeReservedNodes (Prelude.Maybe Prelude.Text)
describeReservedNodes_reservedNodeId :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedNodes -> f DescribeReservedNodes
describeReservedNodes_reservedNodeId = (DescribeReservedNodes -> Maybe Text)
-> (DescribeReservedNodes -> Maybe Text -> DescribeReservedNodes)
-> Lens
     DescribeReservedNodes
     DescribeReservedNodes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedNodes' {Maybe Text
reservedNodeId :: Maybe Text
$sel:reservedNodeId:DescribeReservedNodes' :: DescribeReservedNodes -> Maybe Text
reservedNodeId} -> Maybe Text
reservedNodeId) (\s :: DescribeReservedNodes
s@DescribeReservedNodes' {} Maybe Text
a -> DescribeReservedNodes
s {$sel:reservedNodeId:DescribeReservedNodes' :: Maybe Text
reservedNodeId = Maybe Text
a} :: DescribeReservedNodes)

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeReservedNodes request
-- exceed the value specified in @MaxRecords@, Amazon Web Services returns
-- a value in the @Marker@ field of the response. You can retrieve the next
-- set of response records by providing the returned marker value in the
-- @Marker@ parameter and retrying the request.
describeReservedNodes_marker :: Lens.Lens' DescribeReservedNodes (Prelude.Maybe Prelude.Text)
describeReservedNodes_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedNodes -> f DescribeReservedNodes
describeReservedNodes_marker = (DescribeReservedNodes -> Maybe Text)
-> (DescribeReservedNodes -> Maybe Text -> DescribeReservedNodes)
-> Lens
     DescribeReservedNodes
     DescribeReservedNodes
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedNodes' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeReservedNodes' :: DescribeReservedNodes -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeReservedNodes
s@DescribeReservedNodes' {} Maybe Text
a -> DescribeReservedNodes
s {$sel:marker:DescribeReservedNodes' :: Maybe Text
marker = Maybe Text
a} :: DescribeReservedNodes)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeReservedNodes_maxRecords :: Lens.Lens' DescribeReservedNodes (Prelude.Maybe Prelude.Int)
describeReservedNodes_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeReservedNodes -> f DescribeReservedNodes
describeReservedNodes_maxRecords = (DescribeReservedNodes -> Maybe Int)
-> (DescribeReservedNodes -> Maybe Int -> DescribeReservedNodes)
-> Lens
     DescribeReservedNodes DescribeReservedNodes (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedNodes' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeReservedNodes' :: DescribeReservedNodes -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeReservedNodes
s@DescribeReservedNodes' {} Maybe Int
a -> DescribeReservedNodes
s {$sel:maxRecords:DescribeReservedNodes' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeReservedNodes)

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

instance Prelude.NFData DescribeReservedNodes

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

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

instance Core.ToQuery DescribeReservedNodes where
  toQuery :: DescribeReservedNodes -> QueryString
toQuery DescribeReservedNodes' {Maybe Int
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
reservedNodeId :: Maybe Text
$sel:maxRecords:DescribeReservedNodes' :: DescribeReservedNodes -> Maybe Int
$sel:marker:DescribeReservedNodes' :: DescribeReservedNodes -> Maybe Text
$sel:reservedNodeId:DescribeReservedNodes' :: DescribeReservedNodes -> 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
"DescribeReservedNodes" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ReservedNodeId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
reservedNodeId,
        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
      ]

-- |
--
-- /See:/ 'newDescribeReservedNodesResponse' smart constructor.
data DescribeReservedNodesResponse = DescribeReservedNodesResponse'
  { -- | The list of @ReservedNode@ objects.
    DescribeReservedNodesResponse -> Maybe [ReservedNode]
reservedNodes :: Prelude.Maybe [ReservedNode],
    -- | A value that indicates the starting point for the next set of response
    -- records in a subsequent request. If a value is returned in a response,
    -- you can retrieve the next set of records by providing this returned
    -- marker value in the @Marker@ parameter and retrying the command. If the
    -- @Marker@ field is empty, all response records have been retrieved for
    -- the request.
    DescribeReservedNodesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeReservedNodesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeReservedNodesResponse
-> DescribeReservedNodesResponse -> Bool
(DescribeReservedNodesResponse
 -> DescribeReservedNodesResponse -> Bool)
-> (DescribeReservedNodesResponse
    -> DescribeReservedNodesResponse -> Bool)
-> Eq DescribeReservedNodesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReservedNodesResponse
-> DescribeReservedNodesResponse -> Bool
$c/= :: DescribeReservedNodesResponse
-> DescribeReservedNodesResponse -> Bool
== :: DescribeReservedNodesResponse
-> DescribeReservedNodesResponse -> Bool
$c== :: DescribeReservedNodesResponse
-> DescribeReservedNodesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReservedNodesResponse]
ReadPrec DescribeReservedNodesResponse
Int -> ReadS DescribeReservedNodesResponse
ReadS [DescribeReservedNodesResponse]
(Int -> ReadS DescribeReservedNodesResponse)
-> ReadS [DescribeReservedNodesResponse]
-> ReadPrec DescribeReservedNodesResponse
-> ReadPrec [DescribeReservedNodesResponse]
-> Read DescribeReservedNodesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReservedNodesResponse]
$creadListPrec :: ReadPrec [DescribeReservedNodesResponse]
readPrec :: ReadPrec DescribeReservedNodesResponse
$creadPrec :: ReadPrec DescribeReservedNodesResponse
readList :: ReadS [DescribeReservedNodesResponse]
$creadList :: ReadS [DescribeReservedNodesResponse]
readsPrec :: Int -> ReadS DescribeReservedNodesResponse
$creadsPrec :: Int -> ReadS DescribeReservedNodesResponse
Prelude.Read, Int -> DescribeReservedNodesResponse -> ShowS
[DescribeReservedNodesResponse] -> ShowS
DescribeReservedNodesResponse -> String
(Int -> DescribeReservedNodesResponse -> ShowS)
-> (DescribeReservedNodesResponse -> String)
-> ([DescribeReservedNodesResponse] -> ShowS)
-> Show DescribeReservedNodesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReservedNodesResponse] -> ShowS
$cshowList :: [DescribeReservedNodesResponse] -> ShowS
show :: DescribeReservedNodesResponse -> String
$cshow :: DescribeReservedNodesResponse -> String
showsPrec :: Int -> DescribeReservedNodesResponse -> ShowS
$cshowsPrec :: Int -> DescribeReservedNodesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeReservedNodesResponse
 -> Rep DescribeReservedNodesResponse x)
-> (forall x.
    Rep DescribeReservedNodesResponse x
    -> DescribeReservedNodesResponse)
-> Generic DescribeReservedNodesResponse
forall x.
Rep DescribeReservedNodesResponse x
-> DescribeReservedNodesResponse
forall x.
DescribeReservedNodesResponse
-> Rep DescribeReservedNodesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReservedNodesResponse x
-> DescribeReservedNodesResponse
$cfrom :: forall x.
DescribeReservedNodesResponse
-> Rep DescribeReservedNodesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeReservedNodesResponse' 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:
--
-- 'reservedNodes', 'describeReservedNodesResponse_reservedNodes' - The list of @ReservedNode@ objects.
--
-- 'marker', 'describeReservedNodesResponse_marker' - A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
--
-- 'httpStatus', 'describeReservedNodesResponse_httpStatus' - The response's http status code.
newDescribeReservedNodesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeReservedNodesResponse
newDescribeReservedNodesResponse :: Int -> DescribeReservedNodesResponse
newDescribeReservedNodesResponse Int
pHttpStatus_ =
  DescribeReservedNodesResponse' :: Maybe [ReservedNode]
-> Maybe Text -> Int -> DescribeReservedNodesResponse
DescribeReservedNodesResponse'
    { $sel:reservedNodes:DescribeReservedNodesResponse' :: Maybe [ReservedNode]
reservedNodes =
        Maybe [ReservedNode]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeReservedNodesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeReservedNodesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of @ReservedNode@ objects.
describeReservedNodesResponse_reservedNodes :: Lens.Lens' DescribeReservedNodesResponse (Prelude.Maybe [ReservedNode])
describeReservedNodesResponse_reservedNodes :: (Maybe [ReservedNode] -> f (Maybe [ReservedNode]))
-> DescribeReservedNodesResponse -> f DescribeReservedNodesResponse
describeReservedNodesResponse_reservedNodes = (DescribeReservedNodesResponse -> Maybe [ReservedNode])
-> (DescribeReservedNodesResponse
    -> Maybe [ReservedNode] -> DescribeReservedNodesResponse)
-> Lens' DescribeReservedNodesResponse (Maybe [ReservedNode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedNodesResponse' {Maybe [ReservedNode]
reservedNodes :: Maybe [ReservedNode]
$sel:reservedNodes:DescribeReservedNodesResponse' :: DescribeReservedNodesResponse -> Maybe [ReservedNode]
reservedNodes} -> Maybe [ReservedNode]
reservedNodes) (\s :: DescribeReservedNodesResponse
s@DescribeReservedNodesResponse' {} Maybe [ReservedNode]
a -> DescribeReservedNodesResponse
s {$sel:reservedNodes:DescribeReservedNodesResponse' :: Maybe [ReservedNode]
reservedNodes = Maybe [ReservedNode]
a} :: DescribeReservedNodesResponse) ((Maybe [ReservedNode] -> f (Maybe [ReservedNode]))
 -> DescribeReservedNodesResponse
 -> f DescribeReservedNodesResponse)
-> ((Maybe [ReservedNode] -> f (Maybe [ReservedNode]))
    -> Maybe [ReservedNode] -> f (Maybe [ReservedNode]))
-> (Maybe [ReservedNode] -> f (Maybe [ReservedNode]))
-> DescribeReservedNodesResponse
-> f DescribeReservedNodesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ReservedNode] [ReservedNode] [ReservedNode] [ReservedNode]
-> Iso
     (Maybe [ReservedNode])
     (Maybe [ReservedNode])
     (Maybe [ReservedNode])
     (Maybe [ReservedNode])
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 [ReservedNode] [ReservedNode] [ReservedNode] [ReservedNode]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
describeReservedNodesResponse_marker :: Lens.Lens' DescribeReservedNodesResponse (Prelude.Maybe Prelude.Text)
describeReservedNodesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedNodesResponse -> f DescribeReservedNodesResponse
describeReservedNodesResponse_marker = (DescribeReservedNodesResponse -> Maybe Text)
-> (DescribeReservedNodesResponse
    -> Maybe Text -> DescribeReservedNodesResponse)
-> Lens' DescribeReservedNodesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedNodesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeReservedNodesResponse' :: DescribeReservedNodesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeReservedNodesResponse
s@DescribeReservedNodesResponse' {} Maybe Text
a -> DescribeReservedNodesResponse
s {$sel:marker:DescribeReservedNodesResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeReservedNodesResponse)

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

instance Prelude.NFData DescribeReservedNodesResponse