{-# 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 #-}
module Amazonka.ElastiCache.DescribeReservedCacheNodes
(
DescribeReservedCacheNodes (..),
newDescribeReservedCacheNodes,
describeReservedCacheNodes_cacheNodeType,
describeReservedCacheNodes_productDescription,
describeReservedCacheNodes_marker,
describeReservedCacheNodes_maxRecords,
describeReservedCacheNodes_reservedCacheNodeId,
describeReservedCacheNodes_offeringType,
describeReservedCacheNodes_duration,
describeReservedCacheNodes_reservedCacheNodesOfferingId,
DescribeReservedCacheNodesResponse (..),
newDescribeReservedCacheNodesResponse,
describeReservedCacheNodesResponse_marker,
describeReservedCacheNodesResponse_reservedCacheNodes,
describeReservedCacheNodesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeReservedCacheNodes = DescribeReservedCacheNodes'
{
DescribeReservedCacheNodes -> Maybe Text
cacheNodeType :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodes -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodes -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodes -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
DescribeReservedCacheNodes -> Maybe Text
reservedCacheNodeId :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodes -> Maybe Text
offeringType :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodes -> Maybe Text
duration :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodes -> Maybe Text
reservedCacheNodesOfferingId :: Prelude.Maybe Prelude.Text
}
deriving (DescribeReservedCacheNodes -> DescribeReservedCacheNodes -> Bool
(DescribeReservedCacheNodes -> DescribeReservedCacheNodes -> Bool)
-> (DescribeReservedCacheNodes
-> DescribeReservedCacheNodes -> Bool)
-> Eq DescribeReservedCacheNodes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReservedCacheNodes -> DescribeReservedCacheNodes -> Bool
$c/= :: DescribeReservedCacheNodes -> DescribeReservedCacheNodes -> Bool
== :: DescribeReservedCacheNodes -> DescribeReservedCacheNodes -> Bool
$c== :: DescribeReservedCacheNodes -> DescribeReservedCacheNodes -> Bool
Prelude.Eq, ReadPrec [DescribeReservedCacheNodes]
ReadPrec DescribeReservedCacheNodes
Int -> ReadS DescribeReservedCacheNodes
ReadS [DescribeReservedCacheNodes]
(Int -> ReadS DescribeReservedCacheNodes)
-> ReadS [DescribeReservedCacheNodes]
-> ReadPrec DescribeReservedCacheNodes
-> ReadPrec [DescribeReservedCacheNodes]
-> Read DescribeReservedCacheNodes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReservedCacheNodes]
$creadListPrec :: ReadPrec [DescribeReservedCacheNodes]
readPrec :: ReadPrec DescribeReservedCacheNodes
$creadPrec :: ReadPrec DescribeReservedCacheNodes
readList :: ReadS [DescribeReservedCacheNodes]
$creadList :: ReadS [DescribeReservedCacheNodes]
readsPrec :: Int -> ReadS DescribeReservedCacheNodes
$creadsPrec :: Int -> ReadS DescribeReservedCacheNodes
Prelude.Read, Int -> DescribeReservedCacheNodes -> ShowS
[DescribeReservedCacheNodes] -> ShowS
DescribeReservedCacheNodes -> String
(Int -> DescribeReservedCacheNodes -> ShowS)
-> (DescribeReservedCacheNodes -> String)
-> ([DescribeReservedCacheNodes] -> ShowS)
-> Show DescribeReservedCacheNodes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReservedCacheNodes] -> ShowS
$cshowList :: [DescribeReservedCacheNodes] -> ShowS
show :: DescribeReservedCacheNodes -> String
$cshow :: DescribeReservedCacheNodes -> String
showsPrec :: Int -> DescribeReservedCacheNodes -> ShowS
$cshowsPrec :: Int -> DescribeReservedCacheNodes -> ShowS
Prelude.Show, (forall x.
DescribeReservedCacheNodes -> Rep DescribeReservedCacheNodes x)
-> (forall x.
Rep DescribeReservedCacheNodes x -> DescribeReservedCacheNodes)
-> Generic DescribeReservedCacheNodes
forall x.
Rep DescribeReservedCacheNodes x -> DescribeReservedCacheNodes
forall x.
DescribeReservedCacheNodes -> Rep DescribeReservedCacheNodes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReservedCacheNodes x -> DescribeReservedCacheNodes
$cfrom :: forall x.
DescribeReservedCacheNodes -> Rep DescribeReservedCacheNodes x
Prelude.Generic)
newDescribeReservedCacheNodes ::
DescribeReservedCacheNodes
newDescribeReservedCacheNodes :: DescribeReservedCacheNodes
newDescribeReservedCacheNodes =
DescribeReservedCacheNodes' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DescribeReservedCacheNodes
DescribeReservedCacheNodes'
{ $sel:cacheNodeType:DescribeReservedCacheNodes' :: Maybe Text
cacheNodeType =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:productDescription:DescribeReservedCacheNodes' :: Maybe Text
productDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:marker:DescribeReservedCacheNodes' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxRecords:DescribeReservedCacheNodes' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:reservedCacheNodeId:DescribeReservedCacheNodes' :: Maybe Text
reservedCacheNodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:offeringType:DescribeReservedCacheNodes' :: Maybe Text
offeringType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:duration:DescribeReservedCacheNodes' :: Maybe Text
duration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reservedCacheNodesOfferingId:DescribeReservedCacheNodes' :: Maybe Text
reservedCacheNodesOfferingId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
describeReservedCacheNodes_cacheNodeType :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_cacheNodeType :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_cacheNodeType = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
cacheNodeType :: Maybe Text
$sel:cacheNodeType:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
cacheNodeType} -> Maybe Text
cacheNodeType) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:cacheNodeType:DescribeReservedCacheNodes' :: Maybe Text
cacheNodeType = Maybe Text
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_productDescription :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_productDescription :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_productDescription = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
productDescription :: Maybe Text
$sel:productDescription:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
productDescription} -> Maybe Text
productDescription) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:productDescription:DescribeReservedCacheNodes' :: Maybe Text
productDescription = Maybe Text
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_marker :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_marker = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:marker:DescribeReservedCacheNodes' :: Maybe Text
marker = Maybe Text
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_maxRecords :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Int)
describeReservedCacheNodes_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_maxRecords = (DescribeReservedCacheNodes -> Maybe Int)
-> (DescribeReservedCacheNodes
-> Maybe Int -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Int
a -> DescribeReservedCacheNodes
s {$sel:maxRecords:DescribeReservedCacheNodes' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_reservedCacheNodeId :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_reservedCacheNodeId :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_reservedCacheNodeId = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
reservedCacheNodeId :: Maybe Text
$sel:reservedCacheNodeId:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
reservedCacheNodeId} -> Maybe Text
reservedCacheNodeId) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:reservedCacheNodeId:DescribeReservedCacheNodes' :: Maybe Text
reservedCacheNodeId = Maybe Text
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_offeringType :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_offeringType :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_offeringType = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
offeringType :: Maybe Text
$sel:offeringType:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
offeringType} -> Maybe Text
offeringType) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:offeringType:DescribeReservedCacheNodes' :: Maybe Text
offeringType = Maybe Text
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_duration :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_duration :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_duration = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
duration :: Maybe Text
$sel:duration:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
duration} -> Maybe Text
duration) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:duration:DescribeReservedCacheNodes' :: Maybe Text
duration = Maybe Text
a} :: DescribeReservedCacheNodes)
describeReservedCacheNodes_reservedCacheNodesOfferingId :: Lens.Lens' DescribeReservedCacheNodes (Prelude.Maybe Prelude.Text)
describeReservedCacheNodes_reservedCacheNodesOfferingId :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodes -> f DescribeReservedCacheNodes
describeReservedCacheNodes_reservedCacheNodesOfferingId = (DescribeReservedCacheNodes -> Maybe Text)
-> (DescribeReservedCacheNodes
-> Maybe Text -> DescribeReservedCacheNodes)
-> Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodes' {Maybe Text
reservedCacheNodesOfferingId :: Maybe Text
$sel:reservedCacheNodesOfferingId:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
reservedCacheNodesOfferingId} -> Maybe Text
reservedCacheNodesOfferingId) (\s :: DescribeReservedCacheNodes
s@DescribeReservedCacheNodes' {} Maybe Text
a -> DescribeReservedCacheNodes
s {$sel:reservedCacheNodesOfferingId:DescribeReservedCacheNodes' :: Maybe Text
reservedCacheNodesOfferingId = Maybe Text
a} :: DescribeReservedCacheNodes)
instance Core.AWSPager DescribeReservedCacheNodes where
page :: DescribeReservedCacheNodes
-> AWSResponse DescribeReservedCacheNodes
-> Maybe DescribeReservedCacheNodes
page DescribeReservedCacheNodes
rq AWSResponse DescribeReservedCacheNodes
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeReservedCacheNodes
DescribeReservedCacheNodesResponse
rs
DescribeReservedCacheNodesResponse
-> Getting (First Text) DescribeReservedCacheNodesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeReservedCacheNodesResponse
-> Const (First Text) DescribeReservedCacheNodesResponse
Lens' DescribeReservedCacheNodesResponse (Maybe Text)
describeReservedCacheNodesResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeReservedCacheNodesResponse
-> Const (First Text) DescribeReservedCacheNodesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeReservedCacheNodesResponse 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 DescribeReservedCacheNodes
forall a. Maybe a
Prelude.Nothing
| Maybe [ReservedCacheNode] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeReservedCacheNodes
DescribeReservedCacheNodesResponse
rs
DescribeReservedCacheNodesResponse
-> Getting
(First [ReservedCacheNode])
DescribeReservedCacheNodesResponse
[ReservedCacheNode]
-> Maybe [ReservedCacheNode]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ReservedCacheNode]
-> Const (First [ReservedCacheNode]) (Maybe [ReservedCacheNode]))
-> DescribeReservedCacheNodesResponse
-> Const
(First [ReservedCacheNode]) DescribeReservedCacheNodesResponse
Lens'
DescribeReservedCacheNodesResponse (Maybe [ReservedCacheNode])
describeReservedCacheNodesResponse_reservedCacheNodes
((Maybe [ReservedCacheNode]
-> Const (First [ReservedCacheNode]) (Maybe [ReservedCacheNode]))
-> DescribeReservedCacheNodesResponse
-> Const
(First [ReservedCacheNode]) DescribeReservedCacheNodesResponse)
-> (([ReservedCacheNode]
-> Const (First [ReservedCacheNode]) [ReservedCacheNode])
-> Maybe [ReservedCacheNode]
-> Const (First [ReservedCacheNode]) (Maybe [ReservedCacheNode]))
-> Getting
(First [ReservedCacheNode])
DescribeReservedCacheNodesResponse
[ReservedCacheNode]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReservedCacheNode]
-> Const (First [ReservedCacheNode]) [ReservedCacheNode])
-> Maybe [ReservedCacheNode]
-> Const (First [ReservedCacheNode]) (Maybe [ReservedCacheNode])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeReservedCacheNodes
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeReservedCacheNodes -> Maybe DescribeReservedCacheNodes
forall a. a -> Maybe a
Prelude.Just (DescribeReservedCacheNodes -> Maybe DescribeReservedCacheNodes)
-> DescribeReservedCacheNodes -> Maybe DescribeReservedCacheNodes
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeReservedCacheNodes
rq
DescribeReservedCacheNodes
-> (DescribeReservedCacheNodes -> DescribeReservedCacheNodes)
-> DescribeReservedCacheNodes
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeReservedCacheNodes
-> Identity DescribeReservedCacheNodes
Lens
DescribeReservedCacheNodes
DescribeReservedCacheNodes
(Maybe Text)
(Maybe Text)
describeReservedCacheNodes_marker
((Maybe Text -> Identity (Maybe Text))
-> DescribeReservedCacheNodes
-> Identity DescribeReservedCacheNodes)
-> Maybe Text
-> DescribeReservedCacheNodes
-> DescribeReservedCacheNodes
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeReservedCacheNodes
DescribeReservedCacheNodesResponse
rs
DescribeReservedCacheNodesResponse
-> Getting (First Text) DescribeReservedCacheNodesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeReservedCacheNodesResponse
-> Const (First Text) DescribeReservedCacheNodesResponse
Lens' DescribeReservedCacheNodesResponse (Maybe Text)
describeReservedCacheNodesResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeReservedCacheNodesResponse
-> Const (First Text) DescribeReservedCacheNodesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeReservedCacheNodesResponse 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 DescribeReservedCacheNodes where
type
AWSResponse DescribeReservedCacheNodes =
DescribeReservedCacheNodesResponse
request :: DescribeReservedCacheNodes -> Request DescribeReservedCacheNodes
request = Service
-> DescribeReservedCacheNodes -> Request DescribeReservedCacheNodes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeReservedCacheNodes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReservedCacheNodes)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse DescribeReservedCacheNodes))
-> Logger
-> Service
-> Proxy DescribeReservedCacheNodes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReservedCacheNodes)))
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
"DescribeReservedCacheNodesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe [ReservedCacheNode]
-> Int
-> DescribeReservedCacheNodesResponse
DescribeReservedCacheNodesResponse'
(Maybe Text
-> Maybe [ReservedCacheNode]
-> Int
-> DescribeReservedCacheNodesResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [ReservedCacheNode]
-> Int -> DescribeReservedCacheNodesResponse)
forall (f :: * -> *) a b. Functor 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
(Maybe [ReservedCacheNode]
-> Int -> DescribeReservedCacheNodesResponse)
-> Either String (Maybe [ReservedCacheNode])
-> Either String (Int -> DescribeReservedCacheNodesResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ReservedCacheNodes"
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 [ReservedCacheNode]))
-> Either String (Maybe [ReservedCacheNode])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ReservedCacheNode])
-> [Node] -> Either String (Maybe [ReservedCacheNode])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ReservedCacheNode]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ReservedCacheNode")
)
Either String (Int -> DescribeReservedCacheNodesResponse)
-> Either String Int
-> Either String DescribeReservedCacheNodesResponse
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 DescribeReservedCacheNodes
instance Prelude.NFData DescribeReservedCacheNodes
instance Core.ToHeaders DescribeReservedCacheNodes where
toHeaders :: DescribeReservedCacheNodes -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeReservedCacheNodes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeReservedCacheNodes where
toPath :: DescribeReservedCacheNodes -> ByteString
toPath = ByteString -> DescribeReservedCacheNodes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeReservedCacheNodes where
toQuery :: DescribeReservedCacheNodes -> QueryString
toQuery DescribeReservedCacheNodes' {Maybe Int
Maybe Text
reservedCacheNodesOfferingId :: Maybe Text
duration :: Maybe Text
offeringType :: Maybe Text
reservedCacheNodeId :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
productDescription :: Maybe Text
cacheNodeType :: Maybe Text
$sel:reservedCacheNodesOfferingId:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
$sel:duration:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
$sel:offeringType:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
$sel:reservedCacheNodeId:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
$sel:maxRecords:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Int
$sel:marker:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
$sel:productDescription:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> Maybe Text
$sel:cacheNodeType:DescribeReservedCacheNodes' :: DescribeReservedCacheNodes -> 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
"DescribeReservedCacheNodes" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"CacheNodeType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
cacheNodeType,
ByteString
"ProductDescription" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
productDescription,
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
"ReservedCacheNodeId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
reservedCacheNodeId,
ByteString
"OfferingType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
offeringType,
ByteString
"Duration" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
duration,
ByteString
"ReservedCacheNodesOfferingId"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
reservedCacheNodesOfferingId
]
data DescribeReservedCacheNodesResponse = DescribeReservedCacheNodesResponse'
{
DescribeReservedCacheNodesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeReservedCacheNodesResponse -> Maybe [ReservedCacheNode]
reservedCacheNodes :: Prelude.Maybe [ReservedCacheNode],
DescribeReservedCacheNodesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool
(DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool)
-> (DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool)
-> Eq DescribeReservedCacheNodesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool
$c/= :: DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool
== :: DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool
$c== :: DescribeReservedCacheNodesResponse
-> DescribeReservedCacheNodesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReservedCacheNodesResponse]
ReadPrec DescribeReservedCacheNodesResponse
Int -> ReadS DescribeReservedCacheNodesResponse
ReadS [DescribeReservedCacheNodesResponse]
(Int -> ReadS DescribeReservedCacheNodesResponse)
-> ReadS [DescribeReservedCacheNodesResponse]
-> ReadPrec DescribeReservedCacheNodesResponse
-> ReadPrec [DescribeReservedCacheNodesResponse]
-> Read DescribeReservedCacheNodesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReservedCacheNodesResponse]
$creadListPrec :: ReadPrec [DescribeReservedCacheNodesResponse]
readPrec :: ReadPrec DescribeReservedCacheNodesResponse
$creadPrec :: ReadPrec DescribeReservedCacheNodesResponse
readList :: ReadS [DescribeReservedCacheNodesResponse]
$creadList :: ReadS [DescribeReservedCacheNodesResponse]
readsPrec :: Int -> ReadS DescribeReservedCacheNodesResponse
$creadsPrec :: Int -> ReadS DescribeReservedCacheNodesResponse
Prelude.Read, Int -> DescribeReservedCacheNodesResponse -> ShowS
[DescribeReservedCacheNodesResponse] -> ShowS
DescribeReservedCacheNodesResponse -> String
(Int -> DescribeReservedCacheNodesResponse -> ShowS)
-> (DescribeReservedCacheNodesResponse -> String)
-> ([DescribeReservedCacheNodesResponse] -> ShowS)
-> Show DescribeReservedCacheNodesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReservedCacheNodesResponse] -> ShowS
$cshowList :: [DescribeReservedCacheNodesResponse] -> ShowS
show :: DescribeReservedCacheNodesResponse -> String
$cshow :: DescribeReservedCacheNodesResponse -> String
showsPrec :: Int -> DescribeReservedCacheNodesResponse -> ShowS
$cshowsPrec :: Int -> DescribeReservedCacheNodesResponse -> ShowS
Prelude.Show, (forall x.
DescribeReservedCacheNodesResponse
-> Rep DescribeReservedCacheNodesResponse x)
-> (forall x.
Rep DescribeReservedCacheNodesResponse x
-> DescribeReservedCacheNodesResponse)
-> Generic DescribeReservedCacheNodesResponse
forall x.
Rep DescribeReservedCacheNodesResponse x
-> DescribeReservedCacheNodesResponse
forall x.
DescribeReservedCacheNodesResponse
-> Rep DescribeReservedCacheNodesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReservedCacheNodesResponse x
-> DescribeReservedCacheNodesResponse
$cfrom :: forall x.
DescribeReservedCacheNodesResponse
-> Rep DescribeReservedCacheNodesResponse x
Prelude.Generic)
newDescribeReservedCacheNodesResponse ::
Prelude.Int ->
DescribeReservedCacheNodesResponse
newDescribeReservedCacheNodesResponse :: Int -> DescribeReservedCacheNodesResponse
newDescribeReservedCacheNodesResponse Int
pHttpStatus_ =
DescribeReservedCacheNodesResponse' :: Maybe Text
-> Maybe [ReservedCacheNode]
-> Int
-> DescribeReservedCacheNodesResponse
DescribeReservedCacheNodesResponse'
{ $sel:marker:DescribeReservedCacheNodesResponse' :: Maybe Text
marker =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reservedCacheNodes:DescribeReservedCacheNodesResponse' :: Maybe [ReservedCacheNode]
reservedCacheNodes = Maybe [ReservedCacheNode]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeReservedCacheNodesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeReservedCacheNodesResponse_marker :: Lens.Lens' DescribeReservedCacheNodesResponse (Prelude.Maybe Prelude.Text)
describeReservedCacheNodesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeReservedCacheNodesResponse
-> f DescribeReservedCacheNodesResponse
describeReservedCacheNodesResponse_marker = (DescribeReservedCacheNodesResponse -> Maybe Text)
-> (DescribeReservedCacheNodesResponse
-> Maybe Text -> DescribeReservedCacheNodesResponse)
-> Lens' DescribeReservedCacheNodesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeReservedCacheNodesResponse' :: DescribeReservedCacheNodesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeReservedCacheNodesResponse
s@DescribeReservedCacheNodesResponse' {} Maybe Text
a -> DescribeReservedCacheNodesResponse
s {$sel:marker:DescribeReservedCacheNodesResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeReservedCacheNodesResponse)
describeReservedCacheNodesResponse_reservedCacheNodes :: Lens.Lens' DescribeReservedCacheNodesResponse (Prelude.Maybe [ReservedCacheNode])
describeReservedCacheNodesResponse_reservedCacheNodes :: (Maybe [ReservedCacheNode] -> f (Maybe [ReservedCacheNode]))
-> DescribeReservedCacheNodesResponse
-> f DescribeReservedCacheNodesResponse
describeReservedCacheNodesResponse_reservedCacheNodes = (DescribeReservedCacheNodesResponse -> Maybe [ReservedCacheNode])
-> (DescribeReservedCacheNodesResponse
-> Maybe [ReservedCacheNode] -> DescribeReservedCacheNodesResponse)
-> Lens'
DescribeReservedCacheNodesResponse (Maybe [ReservedCacheNode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodesResponse' {Maybe [ReservedCacheNode]
reservedCacheNodes :: Maybe [ReservedCacheNode]
$sel:reservedCacheNodes:DescribeReservedCacheNodesResponse' :: DescribeReservedCacheNodesResponse -> Maybe [ReservedCacheNode]
reservedCacheNodes} -> Maybe [ReservedCacheNode]
reservedCacheNodes) (\s :: DescribeReservedCacheNodesResponse
s@DescribeReservedCacheNodesResponse' {} Maybe [ReservedCacheNode]
a -> DescribeReservedCacheNodesResponse
s {$sel:reservedCacheNodes:DescribeReservedCacheNodesResponse' :: Maybe [ReservedCacheNode]
reservedCacheNodes = Maybe [ReservedCacheNode]
a} :: DescribeReservedCacheNodesResponse) ((Maybe [ReservedCacheNode] -> f (Maybe [ReservedCacheNode]))
-> DescribeReservedCacheNodesResponse
-> f DescribeReservedCacheNodesResponse)
-> ((Maybe [ReservedCacheNode] -> f (Maybe [ReservedCacheNode]))
-> Maybe [ReservedCacheNode] -> f (Maybe [ReservedCacheNode]))
-> (Maybe [ReservedCacheNode] -> f (Maybe [ReservedCacheNode]))
-> DescribeReservedCacheNodesResponse
-> f DescribeReservedCacheNodesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ReservedCacheNode]
[ReservedCacheNode]
[ReservedCacheNode]
[ReservedCacheNode]
-> Iso
(Maybe [ReservedCacheNode])
(Maybe [ReservedCacheNode])
(Maybe [ReservedCacheNode])
(Maybe [ReservedCacheNode])
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
[ReservedCacheNode]
[ReservedCacheNode]
[ReservedCacheNode]
[ReservedCacheNode]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeReservedCacheNodesResponse_httpStatus :: Lens.Lens' DescribeReservedCacheNodesResponse Prelude.Int
describeReservedCacheNodesResponse_httpStatus :: (Int -> f Int)
-> DescribeReservedCacheNodesResponse
-> f DescribeReservedCacheNodesResponse
describeReservedCacheNodesResponse_httpStatus = (DescribeReservedCacheNodesResponse -> Int)
-> (DescribeReservedCacheNodesResponse
-> Int -> DescribeReservedCacheNodesResponse)
-> Lens
DescribeReservedCacheNodesResponse
DescribeReservedCacheNodesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReservedCacheNodesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReservedCacheNodesResponse' :: DescribeReservedCacheNodesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReservedCacheNodesResponse
s@DescribeReservedCacheNodesResponse' {} Int
a -> DescribeReservedCacheNodesResponse
s {$sel:httpStatus:DescribeReservedCacheNodesResponse' :: Int
httpStatus = Int
a} :: DescribeReservedCacheNodesResponse)
instance
Prelude.NFData
DescribeReservedCacheNodesResponse