{-# 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.MemoryDb.ListAllowedNodeTypeUpdates
(
ListAllowedNodeTypeUpdates (..),
newListAllowedNodeTypeUpdates,
listAllowedNodeTypeUpdates_clusterName,
ListAllowedNodeTypeUpdatesResponse (..),
newListAllowedNodeTypeUpdatesResponse,
listAllowedNodeTypeUpdatesResponse_scaleDownNodeTypes,
listAllowedNodeTypeUpdatesResponse_scaleUpNodeTypes,
listAllowedNodeTypeUpdatesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MemoryDb.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListAllowedNodeTypeUpdates = ListAllowedNodeTypeUpdates'
{
ListAllowedNodeTypeUpdates -> Text
clusterName :: Prelude.Text
}
deriving (ListAllowedNodeTypeUpdates -> ListAllowedNodeTypeUpdates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAllowedNodeTypeUpdates -> ListAllowedNodeTypeUpdates -> Bool
$c/= :: ListAllowedNodeTypeUpdates -> ListAllowedNodeTypeUpdates -> Bool
== :: ListAllowedNodeTypeUpdates -> ListAllowedNodeTypeUpdates -> Bool
$c== :: ListAllowedNodeTypeUpdates -> ListAllowedNodeTypeUpdates -> Bool
Prelude.Eq, ReadPrec [ListAllowedNodeTypeUpdates]
ReadPrec ListAllowedNodeTypeUpdates
Int -> ReadS ListAllowedNodeTypeUpdates
ReadS [ListAllowedNodeTypeUpdates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAllowedNodeTypeUpdates]
$creadListPrec :: ReadPrec [ListAllowedNodeTypeUpdates]
readPrec :: ReadPrec ListAllowedNodeTypeUpdates
$creadPrec :: ReadPrec ListAllowedNodeTypeUpdates
readList :: ReadS [ListAllowedNodeTypeUpdates]
$creadList :: ReadS [ListAllowedNodeTypeUpdates]
readsPrec :: Int -> ReadS ListAllowedNodeTypeUpdates
$creadsPrec :: Int -> ReadS ListAllowedNodeTypeUpdates
Prelude.Read, Int -> ListAllowedNodeTypeUpdates -> ShowS
[ListAllowedNodeTypeUpdates] -> ShowS
ListAllowedNodeTypeUpdates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAllowedNodeTypeUpdates] -> ShowS
$cshowList :: [ListAllowedNodeTypeUpdates] -> ShowS
show :: ListAllowedNodeTypeUpdates -> String
$cshow :: ListAllowedNodeTypeUpdates -> String
showsPrec :: Int -> ListAllowedNodeTypeUpdates -> ShowS
$cshowsPrec :: Int -> ListAllowedNodeTypeUpdates -> ShowS
Prelude.Show, forall x.
Rep ListAllowedNodeTypeUpdates x -> ListAllowedNodeTypeUpdates
forall x.
ListAllowedNodeTypeUpdates -> Rep ListAllowedNodeTypeUpdates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAllowedNodeTypeUpdates x -> ListAllowedNodeTypeUpdates
$cfrom :: forall x.
ListAllowedNodeTypeUpdates -> Rep ListAllowedNodeTypeUpdates x
Prelude.Generic)
newListAllowedNodeTypeUpdates ::
Prelude.Text ->
ListAllowedNodeTypeUpdates
newListAllowedNodeTypeUpdates :: Text -> ListAllowedNodeTypeUpdates
newListAllowedNodeTypeUpdates Text
pClusterName_ =
ListAllowedNodeTypeUpdates'
{ $sel:clusterName:ListAllowedNodeTypeUpdates' :: Text
clusterName =
Text
pClusterName_
}
listAllowedNodeTypeUpdates_clusterName :: Lens.Lens' ListAllowedNodeTypeUpdates Prelude.Text
listAllowedNodeTypeUpdates_clusterName :: Lens' ListAllowedNodeTypeUpdates Text
listAllowedNodeTypeUpdates_clusterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAllowedNodeTypeUpdates' {Text
clusterName :: Text
$sel:clusterName:ListAllowedNodeTypeUpdates' :: ListAllowedNodeTypeUpdates -> Text
clusterName} -> Text
clusterName) (\s :: ListAllowedNodeTypeUpdates
s@ListAllowedNodeTypeUpdates' {} Text
a -> ListAllowedNodeTypeUpdates
s {$sel:clusterName:ListAllowedNodeTypeUpdates' :: Text
clusterName = Text
a} :: ListAllowedNodeTypeUpdates)
instance Core.AWSRequest ListAllowedNodeTypeUpdates where
type
AWSResponse ListAllowedNodeTypeUpdates =
ListAllowedNodeTypeUpdatesResponse
request :: (Service -> Service)
-> ListAllowedNodeTypeUpdates -> Request ListAllowedNodeTypeUpdates
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAllowedNodeTypeUpdates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListAllowedNodeTypeUpdates)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [Text]
-> Maybe [Text] -> Int -> ListAllowedNodeTypeUpdatesResponse
ListAllowedNodeTypeUpdatesResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ScaleDownNodeTypes"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ScaleUpNodeTypes"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListAllowedNodeTypeUpdates where
hashWithSalt :: Int -> ListAllowedNodeTypeUpdates -> Int
hashWithSalt Int
_salt ListAllowedNodeTypeUpdates' {Text
clusterName :: Text
$sel:clusterName:ListAllowedNodeTypeUpdates' :: ListAllowedNodeTypeUpdates -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterName
instance Prelude.NFData ListAllowedNodeTypeUpdates where
rnf :: ListAllowedNodeTypeUpdates -> ()
rnf ListAllowedNodeTypeUpdates' {Text
clusterName :: Text
$sel:clusterName:ListAllowedNodeTypeUpdates' :: ListAllowedNodeTypeUpdates -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
clusterName
instance Data.ToHeaders ListAllowedNodeTypeUpdates where
toHeaders :: ListAllowedNodeTypeUpdates -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonMemoryDB.ListAllowedNodeTypeUpdates" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListAllowedNodeTypeUpdates where
toJSON :: ListAllowedNodeTypeUpdates -> Value
toJSON ListAllowedNodeTypeUpdates' {Text
clusterName :: Text
$sel:clusterName:ListAllowedNodeTypeUpdates' :: ListAllowedNodeTypeUpdates -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ClusterName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clusterName)]
)
instance Data.ToPath ListAllowedNodeTypeUpdates where
toPath :: ListAllowedNodeTypeUpdates -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListAllowedNodeTypeUpdates where
toQuery :: ListAllowedNodeTypeUpdates -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListAllowedNodeTypeUpdatesResponse = ListAllowedNodeTypeUpdatesResponse'
{
ListAllowedNodeTypeUpdatesResponse -> Maybe [Text]
scaleDownNodeTypes :: Prelude.Maybe [Prelude.Text],
ListAllowedNodeTypeUpdatesResponse -> Maybe [Text]
scaleUpNodeTypes :: Prelude.Maybe [Prelude.Text],
ListAllowedNodeTypeUpdatesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAllowedNodeTypeUpdatesResponse
-> ListAllowedNodeTypeUpdatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAllowedNodeTypeUpdatesResponse
-> ListAllowedNodeTypeUpdatesResponse -> Bool
$c/= :: ListAllowedNodeTypeUpdatesResponse
-> ListAllowedNodeTypeUpdatesResponse -> Bool
== :: ListAllowedNodeTypeUpdatesResponse
-> ListAllowedNodeTypeUpdatesResponse -> Bool
$c== :: ListAllowedNodeTypeUpdatesResponse
-> ListAllowedNodeTypeUpdatesResponse -> Bool
Prelude.Eq, ReadPrec [ListAllowedNodeTypeUpdatesResponse]
ReadPrec ListAllowedNodeTypeUpdatesResponse
Int -> ReadS ListAllowedNodeTypeUpdatesResponse
ReadS [ListAllowedNodeTypeUpdatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAllowedNodeTypeUpdatesResponse]
$creadListPrec :: ReadPrec [ListAllowedNodeTypeUpdatesResponse]
readPrec :: ReadPrec ListAllowedNodeTypeUpdatesResponse
$creadPrec :: ReadPrec ListAllowedNodeTypeUpdatesResponse
readList :: ReadS [ListAllowedNodeTypeUpdatesResponse]
$creadList :: ReadS [ListAllowedNodeTypeUpdatesResponse]
readsPrec :: Int -> ReadS ListAllowedNodeTypeUpdatesResponse
$creadsPrec :: Int -> ReadS ListAllowedNodeTypeUpdatesResponse
Prelude.Read, Int -> ListAllowedNodeTypeUpdatesResponse -> ShowS
[ListAllowedNodeTypeUpdatesResponse] -> ShowS
ListAllowedNodeTypeUpdatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAllowedNodeTypeUpdatesResponse] -> ShowS
$cshowList :: [ListAllowedNodeTypeUpdatesResponse] -> ShowS
show :: ListAllowedNodeTypeUpdatesResponse -> String
$cshow :: ListAllowedNodeTypeUpdatesResponse -> String
showsPrec :: Int -> ListAllowedNodeTypeUpdatesResponse -> ShowS
$cshowsPrec :: Int -> ListAllowedNodeTypeUpdatesResponse -> ShowS
Prelude.Show, forall x.
Rep ListAllowedNodeTypeUpdatesResponse x
-> ListAllowedNodeTypeUpdatesResponse
forall x.
ListAllowedNodeTypeUpdatesResponse
-> Rep ListAllowedNodeTypeUpdatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAllowedNodeTypeUpdatesResponse x
-> ListAllowedNodeTypeUpdatesResponse
$cfrom :: forall x.
ListAllowedNodeTypeUpdatesResponse
-> Rep ListAllowedNodeTypeUpdatesResponse x
Prelude.Generic)
newListAllowedNodeTypeUpdatesResponse ::
Prelude.Int ->
ListAllowedNodeTypeUpdatesResponse
newListAllowedNodeTypeUpdatesResponse :: Int -> ListAllowedNodeTypeUpdatesResponse
newListAllowedNodeTypeUpdatesResponse Int
pHttpStatus_ =
ListAllowedNodeTypeUpdatesResponse'
{ $sel:scaleDownNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: Maybe [Text]
scaleDownNodeTypes =
forall a. Maybe a
Prelude.Nothing,
$sel:scaleUpNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: Maybe [Text]
scaleUpNodeTypes = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAllowedNodeTypeUpdatesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAllowedNodeTypeUpdatesResponse_scaleDownNodeTypes :: Lens.Lens' ListAllowedNodeTypeUpdatesResponse (Prelude.Maybe [Prelude.Text])
listAllowedNodeTypeUpdatesResponse_scaleDownNodeTypes :: Lens' ListAllowedNodeTypeUpdatesResponse (Maybe [Text])
listAllowedNodeTypeUpdatesResponse_scaleDownNodeTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAllowedNodeTypeUpdatesResponse' {Maybe [Text]
scaleDownNodeTypes :: Maybe [Text]
$sel:scaleDownNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: ListAllowedNodeTypeUpdatesResponse -> Maybe [Text]
scaleDownNodeTypes} -> Maybe [Text]
scaleDownNodeTypes) (\s :: ListAllowedNodeTypeUpdatesResponse
s@ListAllowedNodeTypeUpdatesResponse' {} Maybe [Text]
a -> ListAllowedNodeTypeUpdatesResponse
s {$sel:scaleDownNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: Maybe [Text]
scaleDownNodeTypes = Maybe [Text]
a} :: ListAllowedNodeTypeUpdatesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAllowedNodeTypeUpdatesResponse_scaleUpNodeTypes :: Lens.Lens' ListAllowedNodeTypeUpdatesResponse (Prelude.Maybe [Prelude.Text])
listAllowedNodeTypeUpdatesResponse_scaleUpNodeTypes :: Lens' ListAllowedNodeTypeUpdatesResponse (Maybe [Text])
listAllowedNodeTypeUpdatesResponse_scaleUpNodeTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAllowedNodeTypeUpdatesResponse' {Maybe [Text]
scaleUpNodeTypes :: Maybe [Text]
$sel:scaleUpNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: ListAllowedNodeTypeUpdatesResponse -> Maybe [Text]
scaleUpNodeTypes} -> Maybe [Text]
scaleUpNodeTypes) (\s :: ListAllowedNodeTypeUpdatesResponse
s@ListAllowedNodeTypeUpdatesResponse' {} Maybe [Text]
a -> ListAllowedNodeTypeUpdatesResponse
s {$sel:scaleUpNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: Maybe [Text]
scaleUpNodeTypes = Maybe [Text]
a} :: ListAllowedNodeTypeUpdatesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAllowedNodeTypeUpdatesResponse_httpStatus :: Lens.Lens' ListAllowedNodeTypeUpdatesResponse Prelude.Int
listAllowedNodeTypeUpdatesResponse_httpStatus :: Lens' ListAllowedNodeTypeUpdatesResponse Int
listAllowedNodeTypeUpdatesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAllowedNodeTypeUpdatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAllowedNodeTypeUpdatesResponse' :: ListAllowedNodeTypeUpdatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAllowedNodeTypeUpdatesResponse
s@ListAllowedNodeTypeUpdatesResponse' {} Int
a -> ListAllowedNodeTypeUpdatesResponse
s {$sel:httpStatus:ListAllowedNodeTypeUpdatesResponse' :: Int
httpStatus = Int
a} :: ListAllowedNodeTypeUpdatesResponse)
instance
Prelude.NFData
ListAllowedNodeTypeUpdatesResponse
where
rnf :: ListAllowedNodeTypeUpdatesResponse -> ()
rnf ListAllowedNodeTypeUpdatesResponse' {Int
Maybe [Text]
httpStatus :: Int
scaleUpNodeTypes :: Maybe [Text]
scaleDownNodeTypes :: Maybe [Text]
$sel:httpStatus:ListAllowedNodeTypeUpdatesResponse' :: ListAllowedNodeTypeUpdatesResponse -> Int
$sel:scaleUpNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: ListAllowedNodeTypeUpdatesResponse -> Maybe [Text]
$sel:scaleDownNodeTypes:ListAllowedNodeTypeUpdatesResponse' :: ListAllowedNodeTypeUpdatesResponse -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
scaleDownNodeTypes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
scaleUpNodeTypes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus