{-# 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.Neptune.CreateDBSubnetGroup
(
CreateDBSubnetGroup (..),
newCreateDBSubnetGroup,
createDBSubnetGroup_tags,
createDBSubnetGroup_dbSubnetGroupName,
createDBSubnetGroup_dbSubnetGroupDescription,
createDBSubnetGroup_subnetIds,
CreateDBSubnetGroupResponse (..),
newCreateDBSubnetGroupResponse,
createDBSubnetGroupResponse_dbSubnetGroup,
createDBSubnetGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Neptune.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateDBSubnetGroup = CreateDBSubnetGroup'
{
CreateDBSubnetGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDBSubnetGroup -> Text
dbSubnetGroupName :: Prelude.Text,
CreateDBSubnetGroup -> Text
dbSubnetGroupDescription :: Prelude.Text,
CreateDBSubnetGroup -> [Text]
subnetIds :: [Prelude.Text]
}
deriving (CreateDBSubnetGroup -> CreateDBSubnetGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDBSubnetGroup -> CreateDBSubnetGroup -> Bool
$c/= :: CreateDBSubnetGroup -> CreateDBSubnetGroup -> Bool
== :: CreateDBSubnetGroup -> CreateDBSubnetGroup -> Bool
$c== :: CreateDBSubnetGroup -> CreateDBSubnetGroup -> Bool
Prelude.Eq, ReadPrec [CreateDBSubnetGroup]
ReadPrec CreateDBSubnetGroup
Int -> ReadS CreateDBSubnetGroup
ReadS [CreateDBSubnetGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDBSubnetGroup]
$creadListPrec :: ReadPrec [CreateDBSubnetGroup]
readPrec :: ReadPrec CreateDBSubnetGroup
$creadPrec :: ReadPrec CreateDBSubnetGroup
readList :: ReadS [CreateDBSubnetGroup]
$creadList :: ReadS [CreateDBSubnetGroup]
readsPrec :: Int -> ReadS CreateDBSubnetGroup
$creadsPrec :: Int -> ReadS CreateDBSubnetGroup
Prelude.Read, Int -> CreateDBSubnetGroup -> ShowS
[CreateDBSubnetGroup] -> ShowS
CreateDBSubnetGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDBSubnetGroup] -> ShowS
$cshowList :: [CreateDBSubnetGroup] -> ShowS
show :: CreateDBSubnetGroup -> String
$cshow :: CreateDBSubnetGroup -> String
showsPrec :: Int -> CreateDBSubnetGroup -> ShowS
$cshowsPrec :: Int -> CreateDBSubnetGroup -> ShowS
Prelude.Show, forall x. Rep CreateDBSubnetGroup x -> CreateDBSubnetGroup
forall x. CreateDBSubnetGroup -> Rep CreateDBSubnetGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDBSubnetGroup x -> CreateDBSubnetGroup
$cfrom :: forall x. CreateDBSubnetGroup -> Rep CreateDBSubnetGroup x
Prelude.Generic)
newCreateDBSubnetGroup ::
Prelude.Text ->
Prelude.Text ->
CreateDBSubnetGroup
newCreateDBSubnetGroup :: Text -> Text -> CreateDBSubnetGroup
newCreateDBSubnetGroup
Text
pDBSubnetGroupName_
Text
pDBSubnetGroupDescription_ =
CreateDBSubnetGroup'
{ $sel:tags:CreateDBSubnetGroup' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:dbSubnetGroupName:CreateDBSubnetGroup' :: Text
dbSubnetGroupName = Text
pDBSubnetGroupName_,
$sel:dbSubnetGroupDescription:CreateDBSubnetGroup' :: Text
dbSubnetGroupDescription =
Text
pDBSubnetGroupDescription_,
$sel:subnetIds:CreateDBSubnetGroup' :: [Text]
subnetIds = forall a. Monoid a => a
Prelude.mempty
}
createDBSubnetGroup_tags :: Lens.Lens' CreateDBSubnetGroup (Prelude.Maybe [Tag])
createDBSubnetGroup_tags :: Lens' CreateDBSubnetGroup (Maybe [Tag])
createDBSubnetGroup_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBSubnetGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDBSubnetGroup
s@CreateDBSubnetGroup' {} Maybe [Tag]
a -> CreateDBSubnetGroup
s {$sel:tags:CreateDBSubnetGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDBSubnetGroup) 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
createDBSubnetGroup_dbSubnetGroupName :: Lens.Lens' CreateDBSubnetGroup Prelude.Text
createDBSubnetGroup_dbSubnetGroupName :: Lens' CreateDBSubnetGroup Text
createDBSubnetGroup_dbSubnetGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBSubnetGroup' {Text
dbSubnetGroupName :: Text
$sel:dbSubnetGroupName:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
dbSubnetGroupName} -> Text
dbSubnetGroupName) (\s :: CreateDBSubnetGroup
s@CreateDBSubnetGroup' {} Text
a -> CreateDBSubnetGroup
s {$sel:dbSubnetGroupName:CreateDBSubnetGroup' :: Text
dbSubnetGroupName = Text
a} :: CreateDBSubnetGroup)
createDBSubnetGroup_dbSubnetGroupDescription :: Lens.Lens' CreateDBSubnetGroup Prelude.Text
createDBSubnetGroup_dbSubnetGroupDescription :: Lens' CreateDBSubnetGroup Text
createDBSubnetGroup_dbSubnetGroupDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBSubnetGroup' {Text
dbSubnetGroupDescription :: Text
$sel:dbSubnetGroupDescription:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
dbSubnetGroupDescription} -> Text
dbSubnetGroupDescription) (\s :: CreateDBSubnetGroup
s@CreateDBSubnetGroup' {} Text
a -> CreateDBSubnetGroup
s {$sel:dbSubnetGroupDescription:CreateDBSubnetGroup' :: Text
dbSubnetGroupDescription = Text
a} :: CreateDBSubnetGroup)
createDBSubnetGroup_subnetIds :: Lens.Lens' CreateDBSubnetGroup [Prelude.Text]
createDBSubnetGroup_subnetIds :: Lens' CreateDBSubnetGroup [Text]
createDBSubnetGroup_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBSubnetGroup' {[Text]
subnetIds :: [Text]
$sel:subnetIds:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> [Text]
subnetIds} -> [Text]
subnetIds) (\s :: CreateDBSubnetGroup
s@CreateDBSubnetGroup' {} [Text]
a -> CreateDBSubnetGroup
s {$sel:subnetIds:CreateDBSubnetGroup' :: [Text]
subnetIds = [Text]
a} :: CreateDBSubnetGroup) 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 CreateDBSubnetGroup where
type
AWSResponse CreateDBSubnetGroup =
CreateDBSubnetGroupResponse
request :: (Service -> Service)
-> CreateDBSubnetGroup -> Request CreateDBSubnetGroup
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 CreateDBSubnetGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDBSubnetGroup)))
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
"CreateDBSubnetGroupResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBSubnetGroup -> Int -> CreateDBSubnetGroupResponse
CreateDBSubnetGroupResponse'
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
"DBSubnetGroup")
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 CreateDBSubnetGroup where
hashWithSalt :: Int -> CreateDBSubnetGroup -> Int
hashWithSalt Int
_salt CreateDBSubnetGroup' {[Text]
Maybe [Tag]
Text
subnetIds :: [Text]
dbSubnetGroupDescription :: Text
dbSubnetGroupName :: Text
tags :: Maybe [Tag]
$sel:subnetIds:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> [Text]
$sel:dbSubnetGroupDescription:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
$sel:dbSubnetGroupName:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
$sel:tags:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Maybe [Tag]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dbSubnetGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dbSubnetGroupDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
subnetIds
instance Prelude.NFData CreateDBSubnetGroup where
rnf :: CreateDBSubnetGroup -> ()
rnf CreateDBSubnetGroup' {[Text]
Maybe [Tag]
Text
subnetIds :: [Text]
dbSubnetGroupDescription :: Text
dbSubnetGroupName :: Text
tags :: Maybe [Tag]
$sel:subnetIds:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> [Text]
$sel:dbSubnetGroupDescription:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
$sel:dbSubnetGroupName:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
$sel:tags:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Maybe [Tag]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dbSubnetGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dbSubnetGroupDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
subnetIds
instance Data.ToHeaders CreateDBSubnetGroup where
toHeaders :: CreateDBSubnetGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateDBSubnetGroup where
toPath :: CreateDBSubnetGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateDBSubnetGroup where
toQuery :: CreateDBSubnetGroup -> QueryString
toQuery CreateDBSubnetGroup' {[Text]
Maybe [Tag]
Text
subnetIds :: [Text]
dbSubnetGroupDescription :: Text
dbSubnetGroupName :: Text
tags :: Maybe [Tag]
$sel:subnetIds:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> [Text]
$sel:dbSubnetGroupDescription:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
$sel:dbSubnetGroupName:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Text
$sel:tags:CreateDBSubnetGroup' :: CreateDBSubnetGroup -> Maybe [Tag]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateDBSubnetGroup" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"Tags"
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
"Tag" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
ByteString
"DBSubnetGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
dbSubnetGroupName,
ByteString
"DBSubnetGroupDescription"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
dbSubnetGroupDescription,
ByteString
"SubnetIds"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SubnetIdentifier" [Text]
subnetIds
]
data CreateDBSubnetGroupResponse = CreateDBSubnetGroupResponse'
{ CreateDBSubnetGroupResponse -> Maybe DBSubnetGroup
dbSubnetGroup :: Prelude.Maybe DBSubnetGroup,
CreateDBSubnetGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDBSubnetGroupResponse -> CreateDBSubnetGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDBSubnetGroupResponse -> CreateDBSubnetGroupResponse -> Bool
$c/= :: CreateDBSubnetGroupResponse -> CreateDBSubnetGroupResponse -> Bool
== :: CreateDBSubnetGroupResponse -> CreateDBSubnetGroupResponse -> Bool
$c== :: CreateDBSubnetGroupResponse -> CreateDBSubnetGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateDBSubnetGroupResponse]
ReadPrec CreateDBSubnetGroupResponse
Int -> ReadS CreateDBSubnetGroupResponse
ReadS [CreateDBSubnetGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDBSubnetGroupResponse]
$creadListPrec :: ReadPrec [CreateDBSubnetGroupResponse]
readPrec :: ReadPrec CreateDBSubnetGroupResponse
$creadPrec :: ReadPrec CreateDBSubnetGroupResponse
readList :: ReadS [CreateDBSubnetGroupResponse]
$creadList :: ReadS [CreateDBSubnetGroupResponse]
readsPrec :: Int -> ReadS CreateDBSubnetGroupResponse
$creadsPrec :: Int -> ReadS CreateDBSubnetGroupResponse
Prelude.Read, Int -> CreateDBSubnetGroupResponse -> ShowS
[CreateDBSubnetGroupResponse] -> ShowS
CreateDBSubnetGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDBSubnetGroupResponse] -> ShowS
$cshowList :: [CreateDBSubnetGroupResponse] -> ShowS
show :: CreateDBSubnetGroupResponse -> String
$cshow :: CreateDBSubnetGroupResponse -> String
showsPrec :: Int -> CreateDBSubnetGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateDBSubnetGroupResponse -> ShowS
Prelude.Show, forall x.
Rep CreateDBSubnetGroupResponse x -> CreateDBSubnetGroupResponse
forall x.
CreateDBSubnetGroupResponse -> Rep CreateDBSubnetGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDBSubnetGroupResponse x -> CreateDBSubnetGroupResponse
$cfrom :: forall x.
CreateDBSubnetGroupResponse -> Rep CreateDBSubnetGroupResponse x
Prelude.Generic)
newCreateDBSubnetGroupResponse ::
Prelude.Int ->
CreateDBSubnetGroupResponse
newCreateDBSubnetGroupResponse :: Int -> CreateDBSubnetGroupResponse
newCreateDBSubnetGroupResponse Int
pHttpStatus_ =
CreateDBSubnetGroupResponse'
{ $sel:dbSubnetGroup:CreateDBSubnetGroupResponse' :: Maybe DBSubnetGroup
dbSubnetGroup =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDBSubnetGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDBSubnetGroupResponse_dbSubnetGroup :: Lens.Lens' CreateDBSubnetGroupResponse (Prelude.Maybe DBSubnetGroup)
createDBSubnetGroupResponse_dbSubnetGroup :: Lens' CreateDBSubnetGroupResponse (Maybe DBSubnetGroup)
createDBSubnetGroupResponse_dbSubnetGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBSubnetGroupResponse' {Maybe DBSubnetGroup
dbSubnetGroup :: Maybe DBSubnetGroup
$sel:dbSubnetGroup:CreateDBSubnetGroupResponse' :: CreateDBSubnetGroupResponse -> Maybe DBSubnetGroup
dbSubnetGroup} -> Maybe DBSubnetGroup
dbSubnetGroup) (\s :: CreateDBSubnetGroupResponse
s@CreateDBSubnetGroupResponse' {} Maybe DBSubnetGroup
a -> CreateDBSubnetGroupResponse
s {$sel:dbSubnetGroup:CreateDBSubnetGroupResponse' :: Maybe DBSubnetGroup
dbSubnetGroup = Maybe DBSubnetGroup
a} :: CreateDBSubnetGroupResponse)
createDBSubnetGroupResponse_httpStatus :: Lens.Lens' CreateDBSubnetGroupResponse Prelude.Int
createDBSubnetGroupResponse_httpStatus :: Lens' CreateDBSubnetGroupResponse Int
createDBSubnetGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDBSubnetGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDBSubnetGroupResponse' :: CreateDBSubnetGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDBSubnetGroupResponse
s@CreateDBSubnetGroupResponse' {} Int
a -> CreateDBSubnetGroupResponse
s {$sel:httpStatus:CreateDBSubnetGroupResponse' :: Int
httpStatus = Int
a} :: CreateDBSubnetGroupResponse)
instance Prelude.NFData CreateDBSubnetGroupResponse where
rnf :: CreateDBSubnetGroupResponse -> ()
rnf CreateDBSubnetGroupResponse' {Int
Maybe DBSubnetGroup
httpStatus :: Int
dbSubnetGroup :: Maybe DBSubnetGroup
$sel:httpStatus:CreateDBSubnetGroupResponse' :: CreateDBSubnetGroupResponse -> Int
$sel:dbSubnetGroup:CreateDBSubnetGroupResponse' :: CreateDBSubnetGroupResponse -> Maybe DBSubnetGroup
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DBSubnetGroup
dbSubnetGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus