{-# 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.ModifyCacheSubnetGroup
(
ModifyCacheSubnetGroup (..),
newModifyCacheSubnetGroup,
modifyCacheSubnetGroup_cacheSubnetGroupDescription,
modifyCacheSubnetGroup_subnetIds,
modifyCacheSubnetGroup_cacheSubnetGroupName,
ModifyCacheSubnetGroupResponse (..),
newModifyCacheSubnetGroupResponse,
modifyCacheSubnetGroupResponse_cacheSubnetGroup,
modifyCacheSubnetGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ModifyCacheSubnetGroup = ModifyCacheSubnetGroup'
{
ModifyCacheSubnetGroup -> Maybe Text
cacheSubnetGroupDescription :: Prelude.Maybe Prelude.Text,
ModifyCacheSubnetGroup -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
ModifyCacheSubnetGroup -> Text
cacheSubnetGroupName :: Prelude.Text
}
deriving (ModifyCacheSubnetGroup -> ModifyCacheSubnetGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCacheSubnetGroup -> ModifyCacheSubnetGroup -> Bool
$c/= :: ModifyCacheSubnetGroup -> ModifyCacheSubnetGroup -> Bool
== :: ModifyCacheSubnetGroup -> ModifyCacheSubnetGroup -> Bool
$c== :: ModifyCacheSubnetGroup -> ModifyCacheSubnetGroup -> Bool
Prelude.Eq, ReadPrec [ModifyCacheSubnetGroup]
ReadPrec ModifyCacheSubnetGroup
Int -> ReadS ModifyCacheSubnetGroup
ReadS [ModifyCacheSubnetGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCacheSubnetGroup]
$creadListPrec :: ReadPrec [ModifyCacheSubnetGroup]
readPrec :: ReadPrec ModifyCacheSubnetGroup
$creadPrec :: ReadPrec ModifyCacheSubnetGroup
readList :: ReadS [ModifyCacheSubnetGroup]
$creadList :: ReadS [ModifyCacheSubnetGroup]
readsPrec :: Int -> ReadS ModifyCacheSubnetGroup
$creadsPrec :: Int -> ReadS ModifyCacheSubnetGroup
Prelude.Read, Int -> ModifyCacheSubnetGroup -> ShowS
[ModifyCacheSubnetGroup] -> ShowS
ModifyCacheSubnetGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCacheSubnetGroup] -> ShowS
$cshowList :: [ModifyCacheSubnetGroup] -> ShowS
show :: ModifyCacheSubnetGroup -> String
$cshow :: ModifyCacheSubnetGroup -> String
showsPrec :: Int -> ModifyCacheSubnetGroup -> ShowS
$cshowsPrec :: Int -> ModifyCacheSubnetGroup -> ShowS
Prelude.Show, forall x. Rep ModifyCacheSubnetGroup x -> ModifyCacheSubnetGroup
forall x. ModifyCacheSubnetGroup -> Rep ModifyCacheSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyCacheSubnetGroup x -> ModifyCacheSubnetGroup
$cfrom :: forall x. ModifyCacheSubnetGroup -> Rep ModifyCacheSubnetGroup x
Prelude.Generic)
newModifyCacheSubnetGroup ::
Prelude.Text ->
ModifyCacheSubnetGroup
newModifyCacheSubnetGroup :: Text -> ModifyCacheSubnetGroup
newModifyCacheSubnetGroup Text
pCacheSubnetGroupName_ =
ModifyCacheSubnetGroup'
{ $sel:cacheSubnetGroupDescription:ModifyCacheSubnetGroup' :: Maybe Text
cacheSubnetGroupDescription =
forall a. Maybe a
Prelude.Nothing,
$sel:subnetIds:ModifyCacheSubnetGroup' :: Maybe [Text]
subnetIds = forall a. Maybe a
Prelude.Nothing,
$sel:cacheSubnetGroupName:ModifyCacheSubnetGroup' :: Text
cacheSubnetGroupName = Text
pCacheSubnetGroupName_
}
modifyCacheSubnetGroup_cacheSubnetGroupDescription :: Lens.Lens' ModifyCacheSubnetGroup (Prelude.Maybe Prelude.Text)
modifyCacheSubnetGroup_cacheSubnetGroupDescription :: Lens' ModifyCacheSubnetGroup (Maybe Text)
modifyCacheSubnetGroup_cacheSubnetGroupDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheSubnetGroup' {Maybe Text
cacheSubnetGroupDescription :: Maybe Text
$sel:cacheSubnetGroupDescription:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe Text
cacheSubnetGroupDescription} -> Maybe Text
cacheSubnetGroupDescription) (\s :: ModifyCacheSubnetGroup
s@ModifyCacheSubnetGroup' {} Maybe Text
a -> ModifyCacheSubnetGroup
s {$sel:cacheSubnetGroupDescription:ModifyCacheSubnetGroup' :: Maybe Text
cacheSubnetGroupDescription = Maybe Text
a} :: ModifyCacheSubnetGroup)
modifyCacheSubnetGroup_subnetIds :: Lens.Lens' ModifyCacheSubnetGroup (Prelude.Maybe [Prelude.Text])
modifyCacheSubnetGroup_subnetIds :: Lens' ModifyCacheSubnetGroup (Maybe [Text])
modifyCacheSubnetGroup_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheSubnetGroup' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: ModifyCacheSubnetGroup
s@ModifyCacheSubnetGroup' {} Maybe [Text]
a -> ModifyCacheSubnetGroup
s {$sel:subnetIds:ModifyCacheSubnetGroup' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: ModifyCacheSubnetGroup) 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
modifyCacheSubnetGroup_cacheSubnetGroupName :: Lens.Lens' ModifyCacheSubnetGroup Prelude.Text
modifyCacheSubnetGroup_cacheSubnetGroupName :: Lens' ModifyCacheSubnetGroup Text
modifyCacheSubnetGroup_cacheSubnetGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheSubnetGroup' {Text
cacheSubnetGroupName :: Text
$sel:cacheSubnetGroupName:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Text
cacheSubnetGroupName} -> Text
cacheSubnetGroupName) (\s :: ModifyCacheSubnetGroup
s@ModifyCacheSubnetGroup' {} Text
a -> ModifyCacheSubnetGroup
s {$sel:cacheSubnetGroupName:ModifyCacheSubnetGroup' :: Text
cacheSubnetGroupName = Text
a} :: ModifyCacheSubnetGroup)
instance Core.AWSRequest ModifyCacheSubnetGroup where
type
AWSResponse ModifyCacheSubnetGroup =
ModifyCacheSubnetGroupResponse
request :: (Service -> Service)
-> ModifyCacheSubnetGroup -> Request ModifyCacheSubnetGroup
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifyCacheSubnetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyCacheSubnetGroup)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ModifyCacheSubnetGroupResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe CacheSubnetGroup -> Int -> ModifyCacheSubnetGroupResponse
ModifyCacheSubnetGroupResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheSubnetGroup")
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 ModifyCacheSubnetGroup where
hashWithSalt :: Int -> ModifyCacheSubnetGroup -> Int
hashWithSalt Int
_salt ModifyCacheSubnetGroup' {Maybe [Text]
Maybe Text
Text
cacheSubnetGroupName :: Text
subnetIds :: Maybe [Text]
cacheSubnetGroupDescription :: Maybe Text
$sel:cacheSubnetGroupName:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Text
$sel:subnetIds:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe [Text]
$sel:cacheSubnetGroupDescription:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheSubnetGroupDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnetIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cacheSubnetGroupName
instance Prelude.NFData ModifyCacheSubnetGroup where
rnf :: ModifyCacheSubnetGroup -> ()
rnf ModifyCacheSubnetGroup' {Maybe [Text]
Maybe Text
Text
cacheSubnetGroupName :: Text
subnetIds :: Maybe [Text]
cacheSubnetGroupDescription :: Maybe Text
$sel:cacheSubnetGroupName:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Text
$sel:subnetIds:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe [Text]
$sel:cacheSubnetGroupDescription:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheSubnetGroupDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnetIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cacheSubnetGroupName
instance Data.ToHeaders ModifyCacheSubnetGroup where
toHeaders :: ModifyCacheSubnetGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ModifyCacheSubnetGroup where
toPath :: ModifyCacheSubnetGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ModifyCacheSubnetGroup where
toQuery :: ModifyCacheSubnetGroup -> QueryString
toQuery ModifyCacheSubnetGroup' {Maybe [Text]
Maybe Text
Text
cacheSubnetGroupName :: Text
subnetIds :: Maybe [Text]
cacheSubnetGroupDescription :: Maybe Text
$sel:cacheSubnetGroupName:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Text
$sel:subnetIds:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe [Text]
$sel:cacheSubnetGroupDescription:ModifyCacheSubnetGroup' :: ModifyCacheSubnetGroup -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyCacheSubnetGroup" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
ByteString
"CacheSubnetGroupDescription"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
cacheSubnetGroupDescription,
ByteString
"SubnetIds"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SubnetIdentifier"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnetIds
),
ByteString
"CacheSubnetGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
cacheSubnetGroupName
]
data ModifyCacheSubnetGroupResponse = ModifyCacheSubnetGroupResponse'
{ ModifyCacheSubnetGroupResponse -> Maybe CacheSubnetGroup
cacheSubnetGroup :: Prelude.Maybe CacheSubnetGroup,
ModifyCacheSubnetGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyCacheSubnetGroupResponse
-> ModifyCacheSubnetGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyCacheSubnetGroupResponse
-> ModifyCacheSubnetGroupResponse -> Bool
$c/= :: ModifyCacheSubnetGroupResponse
-> ModifyCacheSubnetGroupResponse -> Bool
== :: ModifyCacheSubnetGroupResponse
-> ModifyCacheSubnetGroupResponse -> Bool
$c== :: ModifyCacheSubnetGroupResponse
-> ModifyCacheSubnetGroupResponse -> Bool
Prelude.Eq, ReadPrec [ModifyCacheSubnetGroupResponse]
ReadPrec ModifyCacheSubnetGroupResponse
Int -> ReadS ModifyCacheSubnetGroupResponse
ReadS [ModifyCacheSubnetGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyCacheSubnetGroupResponse]
$creadListPrec :: ReadPrec [ModifyCacheSubnetGroupResponse]
readPrec :: ReadPrec ModifyCacheSubnetGroupResponse
$creadPrec :: ReadPrec ModifyCacheSubnetGroupResponse
readList :: ReadS [ModifyCacheSubnetGroupResponse]
$creadList :: ReadS [ModifyCacheSubnetGroupResponse]
readsPrec :: Int -> ReadS ModifyCacheSubnetGroupResponse
$creadsPrec :: Int -> ReadS ModifyCacheSubnetGroupResponse
Prelude.Read, Int -> ModifyCacheSubnetGroupResponse -> ShowS
[ModifyCacheSubnetGroupResponse] -> ShowS
ModifyCacheSubnetGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyCacheSubnetGroupResponse] -> ShowS
$cshowList :: [ModifyCacheSubnetGroupResponse] -> ShowS
show :: ModifyCacheSubnetGroupResponse -> String
$cshow :: ModifyCacheSubnetGroupResponse -> String
showsPrec :: Int -> ModifyCacheSubnetGroupResponse -> ShowS
$cshowsPrec :: Int -> ModifyCacheSubnetGroupResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyCacheSubnetGroupResponse x
-> ModifyCacheSubnetGroupResponse
forall x.
ModifyCacheSubnetGroupResponse
-> Rep ModifyCacheSubnetGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyCacheSubnetGroupResponse x
-> ModifyCacheSubnetGroupResponse
$cfrom :: forall x.
ModifyCacheSubnetGroupResponse
-> Rep ModifyCacheSubnetGroupResponse x
Prelude.Generic)
newModifyCacheSubnetGroupResponse ::
Prelude.Int ->
ModifyCacheSubnetGroupResponse
newModifyCacheSubnetGroupResponse :: Int -> ModifyCacheSubnetGroupResponse
newModifyCacheSubnetGroupResponse Int
pHttpStatus_ =
ModifyCacheSubnetGroupResponse'
{ $sel:cacheSubnetGroup:ModifyCacheSubnetGroupResponse' :: Maybe CacheSubnetGroup
cacheSubnetGroup =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyCacheSubnetGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyCacheSubnetGroupResponse_cacheSubnetGroup :: Lens.Lens' ModifyCacheSubnetGroupResponse (Prelude.Maybe CacheSubnetGroup)
modifyCacheSubnetGroupResponse_cacheSubnetGroup :: Lens' ModifyCacheSubnetGroupResponse (Maybe CacheSubnetGroup)
modifyCacheSubnetGroupResponse_cacheSubnetGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheSubnetGroupResponse' {Maybe CacheSubnetGroup
cacheSubnetGroup :: Maybe CacheSubnetGroup
$sel:cacheSubnetGroup:ModifyCacheSubnetGroupResponse' :: ModifyCacheSubnetGroupResponse -> Maybe CacheSubnetGroup
cacheSubnetGroup} -> Maybe CacheSubnetGroup
cacheSubnetGroup) (\s :: ModifyCacheSubnetGroupResponse
s@ModifyCacheSubnetGroupResponse' {} Maybe CacheSubnetGroup
a -> ModifyCacheSubnetGroupResponse
s {$sel:cacheSubnetGroup:ModifyCacheSubnetGroupResponse' :: Maybe CacheSubnetGroup
cacheSubnetGroup = Maybe CacheSubnetGroup
a} :: ModifyCacheSubnetGroupResponse)
modifyCacheSubnetGroupResponse_httpStatus :: Lens.Lens' ModifyCacheSubnetGroupResponse Prelude.Int
modifyCacheSubnetGroupResponse_httpStatus :: Lens' ModifyCacheSubnetGroupResponse Int
modifyCacheSubnetGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyCacheSubnetGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyCacheSubnetGroupResponse' :: ModifyCacheSubnetGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyCacheSubnetGroupResponse
s@ModifyCacheSubnetGroupResponse' {} Int
a -> ModifyCacheSubnetGroupResponse
s {$sel:httpStatus:ModifyCacheSubnetGroupResponse' :: Int
httpStatus = Int
a} :: ModifyCacheSubnetGroupResponse)
instance
Prelude.NFData
ModifyCacheSubnetGroupResponse
where
rnf :: ModifyCacheSubnetGroupResponse -> ()
rnf ModifyCacheSubnetGroupResponse' {Int
Maybe CacheSubnetGroup
httpStatus :: Int
cacheSubnetGroup :: Maybe CacheSubnetGroup
$sel:httpStatus:ModifyCacheSubnetGroupResponse' :: ModifyCacheSubnetGroupResponse -> Int
$sel:cacheSubnetGroup:ModifyCacheSubnetGroupResponse' :: ModifyCacheSubnetGroupResponse -> Maybe CacheSubnetGroup
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CacheSubnetGroup
cacheSubnetGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus