{-# 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.DMS.ModifyReplicationSubnetGroup
(
ModifyReplicationSubnetGroup (..),
newModifyReplicationSubnetGroup,
modifyReplicationSubnetGroup_replicationSubnetGroupDescription,
modifyReplicationSubnetGroup_replicationSubnetGroupIdentifier,
modifyReplicationSubnetGroup_subnetIds,
ModifyReplicationSubnetGroupResponse (..),
newModifyReplicationSubnetGroupResponse,
modifyReplicationSubnetGroupResponse_replicationSubnetGroup,
modifyReplicationSubnetGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ModifyReplicationSubnetGroup = ModifyReplicationSubnetGroup'
{
ModifyReplicationSubnetGroup -> Maybe Text
replicationSubnetGroupDescription :: Prelude.Maybe Prelude.Text,
ModifyReplicationSubnetGroup -> Text
replicationSubnetGroupIdentifier :: Prelude.Text,
ModifyReplicationSubnetGroup -> [Text]
subnetIds :: [Prelude.Text]
}
deriving (ModifyReplicationSubnetGroup
-> ModifyReplicationSubnetGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyReplicationSubnetGroup
-> ModifyReplicationSubnetGroup -> Bool
$c/= :: ModifyReplicationSubnetGroup
-> ModifyReplicationSubnetGroup -> Bool
== :: ModifyReplicationSubnetGroup
-> ModifyReplicationSubnetGroup -> Bool
$c== :: ModifyReplicationSubnetGroup
-> ModifyReplicationSubnetGroup -> Bool
Prelude.Eq, ReadPrec [ModifyReplicationSubnetGroup]
ReadPrec ModifyReplicationSubnetGroup
Int -> ReadS ModifyReplicationSubnetGroup
ReadS [ModifyReplicationSubnetGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyReplicationSubnetGroup]
$creadListPrec :: ReadPrec [ModifyReplicationSubnetGroup]
readPrec :: ReadPrec ModifyReplicationSubnetGroup
$creadPrec :: ReadPrec ModifyReplicationSubnetGroup
readList :: ReadS [ModifyReplicationSubnetGroup]
$creadList :: ReadS [ModifyReplicationSubnetGroup]
readsPrec :: Int -> ReadS ModifyReplicationSubnetGroup
$creadsPrec :: Int -> ReadS ModifyReplicationSubnetGroup
Prelude.Read, Int -> ModifyReplicationSubnetGroup -> ShowS
[ModifyReplicationSubnetGroup] -> ShowS
ModifyReplicationSubnetGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyReplicationSubnetGroup] -> ShowS
$cshowList :: [ModifyReplicationSubnetGroup] -> ShowS
show :: ModifyReplicationSubnetGroup -> String
$cshow :: ModifyReplicationSubnetGroup -> String
showsPrec :: Int -> ModifyReplicationSubnetGroup -> ShowS
$cshowsPrec :: Int -> ModifyReplicationSubnetGroup -> ShowS
Prelude.Show, forall x.
Rep ModifyReplicationSubnetGroup x -> ModifyReplicationSubnetGroup
forall x.
ModifyReplicationSubnetGroup -> Rep ModifyReplicationSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyReplicationSubnetGroup x -> ModifyReplicationSubnetGroup
$cfrom :: forall x.
ModifyReplicationSubnetGroup -> Rep ModifyReplicationSubnetGroup x
Prelude.Generic)
newModifyReplicationSubnetGroup ::
Prelude.Text ->
ModifyReplicationSubnetGroup
newModifyReplicationSubnetGroup :: Text -> ModifyReplicationSubnetGroup
newModifyReplicationSubnetGroup
Text
pReplicationSubnetGroupIdentifier_ =
ModifyReplicationSubnetGroup'
{ $sel:replicationSubnetGroupDescription:ModifyReplicationSubnetGroup' :: Maybe Text
replicationSubnetGroupDescription =
forall a. Maybe a
Prelude.Nothing,
$sel:replicationSubnetGroupIdentifier:ModifyReplicationSubnetGroup' :: Text
replicationSubnetGroupIdentifier =
Text
pReplicationSubnetGroupIdentifier_,
$sel:subnetIds:ModifyReplicationSubnetGroup' :: [Text]
subnetIds = forall a. Monoid a => a
Prelude.mempty
}
modifyReplicationSubnetGroup_replicationSubnetGroupDescription :: Lens.Lens' ModifyReplicationSubnetGroup (Prelude.Maybe Prelude.Text)
modifyReplicationSubnetGroup_replicationSubnetGroupDescription :: Lens' ModifyReplicationSubnetGroup (Maybe Text)
modifyReplicationSubnetGroup_replicationSubnetGroupDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReplicationSubnetGroup' {Maybe Text
replicationSubnetGroupDescription :: Maybe Text
$sel:replicationSubnetGroupDescription:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Maybe Text
replicationSubnetGroupDescription} -> Maybe Text
replicationSubnetGroupDescription) (\s :: ModifyReplicationSubnetGroup
s@ModifyReplicationSubnetGroup' {} Maybe Text
a -> ModifyReplicationSubnetGroup
s {$sel:replicationSubnetGroupDescription:ModifyReplicationSubnetGroup' :: Maybe Text
replicationSubnetGroupDescription = Maybe Text
a} :: ModifyReplicationSubnetGroup)
modifyReplicationSubnetGroup_replicationSubnetGroupIdentifier :: Lens.Lens' ModifyReplicationSubnetGroup Prelude.Text
modifyReplicationSubnetGroup_replicationSubnetGroupIdentifier :: Lens' ModifyReplicationSubnetGroup Text
modifyReplicationSubnetGroup_replicationSubnetGroupIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReplicationSubnetGroup' {Text
replicationSubnetGroupIdentifier :: Text
$sel:replicationSubnetGroupIdentifier:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Text
replicationSubnetGroupIdentifier} -> Text
replicationSubnetGroupIdentifier) (\s :: ModifyReplicationSubnetGroup
s@ModifyReplicationSubnetGroup' {} Text
a -> ModifyReplicationSubnetGroup
s {$sel:replicationSubnetGroupIdentifier:ModifyReplicationSubnetGroup' :: Text
replicationSubnetGroupIdentifier = Text
a} :: ModifyReplicationSubnetGroup)
modifyReplicationSubnetGroup_subnetIds :: Lens.Lens' ModifyReplicationSubnetGroup [Prelude.Text]
modifyReplicationSubnetGroup_subnetIds :: Lens' ModifyReplicationSubnetGroup [Text]
modifyReplicationSubnetGroup_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReplicationSubnetGroup' {[Text]
subnetIds :: [Text]
$sel:subnetIds:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> [Text]
subnetIds} -> [Text]
subnetIds) (\s :: ModifyReplicationSubnetGroup
s@ModifyReplicationSubnetGroup' {} [Text]
a -> ModifyReplicationSubnetGroup
s {$sel:subnetIds:ModifyReplicationSubnetGroup' :: [Text]
subnetIds = [Text]
a} :: ModifyReplicationSubnetGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ModifyReplicationSubnetGroup where
type
AWSResponse ModifyReplicationSubnetGroup =
ModifyReplicationSubnetGroupResponse
request :: (Service -> Service)
-> ModifyReplicationSubnetGroup
-> Request ModifyReplicationSubnetGroup
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 ModifyReplicationSubnetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyReplicationSubnetGroup)))
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 ReplicationSubnetGroup
-> Int -> ModifyReplicationSubnetGroupResponse
ModifyReplicationSubnetGroupResponse'
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
"ReplicationSubnetGroup")
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
ModifyReplicationSubnetGroup
where
hashWithSalt :: Int -> ModifyReplicationSubnetGroup -> Int
hashWithSalt Int
_salt ModifyReplicationSubnetGroup' {[Text]
Maybe Text
Text
subnetIds :: [Text]
replicationSubnetGroupIdentifier :: Text
replicationSubnetGroupDescription :: Maybe Text
$sel:subnetIds:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> [Text]
$sel:replicationSubnetGroupIdentifier:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Text
$sel:replicationSubnetGroupDescription:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationSubnetGroupDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
replicationSubnetGroupIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
subnetIds
instance Prelude.NFData ModifyReplicationSubnetGroup where
rnf :: ModifyReplicationSubnetGroup -> ()
rnf ModifyReplicationSubnetGroup' {[Text]
Maybe Text
Text
subnetIds :: [Text]
replicationSubnetGroupIdentifier :: Text
replicationSubnetGroupDescription :: Maybe Text
$sel:subnetIds:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> [Text]
$sel:replicationSubnetGroupIdentifier:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Text
$sel:replicationSubnetGroupDescription:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationSubnetGroupDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
replicationSubnetGroupIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
subnetIds
instance Data.ToHeaders ModifyReplicationSubnetGroup where
toHeaders :: ModifyReplicationSubnetGroup -> 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
"AmazonDMSv20160101.ModifyReplicationSubnetGroup" ::
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 ModifyReplicationSubnetGroup where
toJSON :: ModifyReplicationSubnetGroup -> Value
toJSON ModifyReplicationSubnetGroup' {[Text]
Maybe Text
Text
subnetIds :: [Text]
replicationSubnetGroupIdentifier :: Text
replicationSubnetGroupDescription :: Maybe Text
$sel:subnetIds:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> [Text]
$sel:replicationSubnetGroupIdentifier:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Text
$sel:replicationSubnetGroupDescription:ModifyReplicationSubnetGroup' :: ModifyReplicationSubnetGroup -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ReplicationSubnetGroupDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
replicationSubnetGroupDescription,
forall a. a -> Maybe a
Prelude.Just
( Key
"ReplicationSubnetGroupIdentifier"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
replicationSubnetGroupIdentifier
),
forall a. a -> Maybe a
Prelude.Just (Key
"SubnetIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
subnetIds)
]
)
instance Data.ToPath ModifyReplicationSubnetGroup where
toPath :: ModifyReplicationSubnetGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ModifyReplicationSubnetGroup where
toQuery :: ModifyReplicationSubnetGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ModifyReplicationSubnetGroupResponse = ModifyReplicationSubnetGroupResponse'
{
ModifyReplicationSubnetGroupResponse
-> Maybe ReplicationSubnetGroup
replicationSubnetGroup :: Prelude.Maybe ReplicationSubnetGroup,
ModifyReplicationSubnetGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyReplicationSubnetGroupResponse
-> ModifyReplicationSubnetGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyReplicationSubnetGroupResponse
-> ModifyReplicationSubnetGroupResponse -> Bool
$c/= :: ModifyReplicationSubnetGroupResponse
-> ModifyReplicationSubnetGroupResponse -> Bool
== :: ModifyReplicationSubnetGroupResponse
-> ModifyReplicationSubnetGroupResponse -> Bool
$c== :: ModifyReplicationSubnetGroupResponse
-> ModifyReplicationSubnetGroupResponse -> Bool
Prelude.Eq, ReadPrec [ModifyReplicationSubnetGroupResponse]
ReadPrec ModifyReplicationSubnetGroupResponse
Int -> ReadS ModifyReplicationSubnetGroupResponse
ReadS [ModifyReplicationSubnetGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyReplicationSubnetGroupResponse]
$creadListPrec :: ReadPrec [ModifyReplicationSubnetGroupResponse]
readPrec :: ReadPrec ModifyReplicationSubnetGroupResponse
$creadPrec :: ReadPrec ModifyReplicationSubnetGroupResponse
readList :: ReadS [ModifyReplicationSubnetGroupResponse]
$creadList :: ReadS [ModifyReplicationSubnetGroupResponse]
readsPrec :: Int -> ReadS ModifyReplicationSubnetGroupResponse
$creadsPrec :: Int -> ReadS ModifyReplicationSubnetGroupResponse
Prelude.Read, Int -> ModifyReplicationSubnetGroupResponse -> ShowS
[ModifyReplicationSubnetGroupResponse] -> ShowS
ModifyReplicationSubnetGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyReplicationSubnetGroupResponse] -> ShowS
$cshowList :: [ModifyReplicationSubnetGroupResponse] -> ShowS
show :: ModifyReplicationSubnetGroupResponse -> String
$cshow :: ModifyReplicationSubnetGroupResponse -> String
showsPrec :: Int -> ModifyReplicationSubnetGroupResponse -> ShowS
$cshowsPrec :: Int -> ModifyReplicationSubnetGroupResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyReplicationSubnetGroupResponse x
-> ModifyReplicationSubnetGroupResponse
forall x.
ModifyReplicationSubnetGroupResponse
-> Rep ModifyReplicationSubnetGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyReplicationSubnetGroupResponse x
-> ModifyReplicationSubnetGroupResponse
$cfrom :: forall x.
ModifyReplicationSubnetGroupResponse
-> Rep ModifyReplicationSubnetGroupResponse x
Prelude.Generic)
newModifyReplicationSubnetGroupResponse ::
Prelude.Int ->
ModifyReplicationSubnetGroupResponse
newModifyReplicationSubnetGroupResponse :: Int -> ModifyReplicationSubnetGroupResponse
newModifyReplicationSubnetGroupResponse Int
pHttpStatus_ =
ModifyReplicationSubnetGroupResponse'
{ $sel:replicationSubnetGroup:ModifyReplicationSubnetGroupResponse' :: Maybe ReplicationSubnetGroup
replicationSubnetGroup =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyReplicationSubnetGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyReplicationSubnetGroupResponse_replicationSubnetGroup :: Lens.Lens' ModifyReplicationSubnetGroupResponse (Prelude.Maybe ReplicationSubnetGroup)
modifyReplicationSubnetGroupResponse_replicationSubnetGroup :: Lens'
ModifyReplicationSubnetGroupResponse (Maybe ReplicationSubnetGroup)
modifyReplicationSubnetGroupResponse_replicationSubnetGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReplicationSubnetGroupResponse' {Maybe ReplicationSubnetGroup
replicationSubnetGroup :: Maybe ReplicationSubnetGroup
$sel:replicationSubnetGroup:ModifyReplicationSubnetGroupResponse' :: ModifyReplicationSubnetGroupResponse
-> Maybe ReplicationSubnetGroup
replicationSubnetGroup} -> Maybe ReplicationSubnetGroup
replicationSubnetGroup) (\s :: ModifyReplicationSubnetGroupResponse
s@ModifyReplicationSubnetGroupResponse' {} Maybe ReplicationSubnetGroup
a -> ModifyReplicationSubnetGroupResponse
s {$sel:replicationSubnetGroup:ModifyReplicationSubnetGroupResponse' :: Maybe ReplicationSubnetGroup
replicationSubnetGroup = Maybe ReplicationSubnetGroup
a} :: ModifyReplicationSubnetGroupResponse)
modifyReplicationSubnetGroupResponse_httpStatus :: Lens.Lens' ModifyReplicationSubnetGroupResponse Prelude.Int
modifyReplicationSubnetGroupResponse_httpStatus :: Lens' ModifyReplicationSubnetGroupResponse Int
modifyReplicationSubnetGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyReplicationSubnetGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyReplicationSubnetGroupResponse' :: ModifyReplicationSubnetGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyReplicationSubnetGroupResponse
s@ModifyReplicationSubnetGroupResponse' {} Int
a -> ModifyReplicationSubnetGroupResponse
s {$sel:httpStatus:ModifyReplicationSubnetGroupResponse' :: Int
httpStatus = Int
a} :: ModifyReplicationSubnetGroupResponse)
instance
Prelude.NFData
ModifyReplicationSubnetGroupResponse
where
rnf :: ModifyReplicationSubnetGroupResponse -> ()
rnf ModifyReplicationSubnetGroupResponse' {Int
Maybe ReplicationSubnetGroup
httpStatus :: Int
replicationSubnetGroup :: Maybe ReplicationSubnetGroup
$sel:httpStatus:ModifyReplicationSubnetGroupResponse' :: ModifyReplicationSubnetGroupResponse -> Int
$sel:replicationSubnetGroup:ModifyReplicationSubnetGroupResponse' :: ModifyReplicationSubnetGroupResponse
-> Maybe ReplicationSubnetGroup
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplicationSubnetGroup
replicationSubnetGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus