{-# 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.Lightsail.StopRelationalDatabase
(
StopRelationalDatabase (..),
newStopRelationalDatabase,
stopRelationalDatabase_relationalDatabaseSnapshotName,
stopRelationalDatabase_relationalDatabaseName,
StopRelationalDatabaseResponse (..),
newStopRelationalDatabaseResponse,
stopRelationalDatabaseResponse_operations,
stopRelationalDatabaseResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StopRelationalDatabase = StopRelationalDatabase'
{
StopRelationalDatabase -> Maybe Text
relationalDatabaseSnapshotName :: Prelude.Maybe Prelude.Text,
StopRelationalDatabase -> Text
relationalDatabaseName :: Prelude.Text
}
deriving (StopRelationalDatabase -> StopRelationalDatabase -> Bool
(StopRelationalDatabase -> StopRelationalDatabase -> Bool)
-> (StopRelationalDatabase -> StopRelationalDatabase -> Bool)
-> Eq StopRelationalDatabase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRelationalDatabase -> StopRelationalDatabase -> Bool
$c/= :: StopRelationalDatabase -> StopRelationalDatabase -> Bool
== :: StopRelationalDatabase -> StopRelationalDatabase -> Bool
$c== :: StopRelationalDatabase -> StopRelationalDatabase -> Bool
Prelude.Eq, ReadPrec [StopRelationalDatabase]
ReadPrec StopRelationalDatabase
Int -> ReadS StopRelationalDatabase
ReadS [StopRelationalDatabase]
(Int -> ReadS StopRelationalDatabase)
-> ReadS [StopRelationalDatabase]
-> ReadPrec StopRelationalDatabase
-> ReadPrec [StopRelationalDatabase]
-> Read StopRelationalDatabase
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRelationalDatabase]
$creadListPrec :: ReadPrec [StopRelationalDatabase]
readPrec :: ReadPrec StopRelationalDatabase
$creadPrec :: ReadPrec StopRelationalDatabase
readList :: ReadS [StopRelationalDatabase]
$creadList :: ReadS [StopRelationalDatabase]
readsPrec :: Int -> ReadS StopRelationalDatabase
$creadsPrec :: Int -> ReadS StopRelationalDatabase
Prelude.Read, Int -> StopRelationalDatabase -> ShowS
[StopRelationalDatabase] -> ShowS
StopRelationalDatabase -> String
(Int -> StopRelationalDatabase -> ShowS)
-> (StopRelationalDatabase -> String)
-> ([StopRelationalDatabase] -> ShowS)
-> Show StopRelationalDatabase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRelationalDatabase] -> ShowS
$cshowList :: [StopRelationalDatabase] -> ShowS
show :: StopRelationalDatabase -> String
$cshow :: StopRelationalDatabase -> String
showsPrec :: Int -> StopRelationalDatabase -> ShowS
$cshowsPrec :: Int -> StopRelationalDatabase -> ShowS
Prelude.Show, (forall x. StopRelationalDatabase -> Rep StopRelationalDatabase x)
-> (forall x.
Rep StopRelationalDatabase x -> StopRelationalDatabase)
-> Generic StopRelationalDatabase
forall x. Rep StopRelationalDatabase x -> StopRelationalDatabase
forall x. StopRelationalDatabase -> Rep StopRelationalDatabase x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopRelationalDatabase x -> StopRelationalDatabase
$cfrom :: forall x. StopRelationalDatabase -> Rep StopRelationalDatabase x
Prelude.Generic)
newStopRelationalDatabase ::
Prelude.Text ->
StopRelationalDatabase
newStopRelationalDatabase :: Text -> StopRelationalDatabase
newStopRelationalDatabase Text
pRelationalDatabaseName_ =
StopRelationalDatabase' :: Maybe Text -> Text -> StopRelationalDatabase
StopRelationalDatabase'
{ $sel:relationalDatabaseSnapshotName:StopRelationalDatabase' :: Maybe Text
relationalDatabaseSnapshotName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:relationalDatabaseName:StopRelationalDatabase' :: Text
relationalDatabaseName = Text
pRelationalDatabaseName_
}
stopRelationalDatabase_relationalDatabaseSnapshotName :: Lens.Lens' StopRelationalDatabase (Prelude.Maybe Prelude.Text)
stopRelationalDatabase_relationalDatabaseSnapshotName :: (Maybe Text -> f (Maybe Text))
-> StopRelationalDatabase -> f StopRelationalDatabase
stopRelationalDatabase_relationalDatabaseSnapshotName = (StopRelationalDatabase -> Maybe Text)
-> (StopRelationalDatabase -> Maybe Text -> StopRelationalDatabase)
-> Lens
StopRelationalDatabase
StopRelationalDatabase
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRelationalDatabase' {Maybe Text
relationalDatabaseSnapshotName :: Maybe Text
$sel:relationalDatabaseSnapshotName:StopRelationalDatabase' :: StopRelationalDatabase -> Maybe Text
relationalDatabaseSnapshotName} -> Maybe Text
relationalDatabaseSnapshotName) (\s :: StopRelationalDatabase
s@StopRelationalDatabase' {} Maybe Text
a -> StopRelationalDatabase
s {$sel:relationalDatabaseSnapshotName:StopRelationalDatabase' :: Maybe Text
relationalDatabaseSnapshotName = Maybe Text
a} :: StopRelationalDatabase)
stopRelationalDatabase_relationalDatabaseName :: Lens.Lens' StopRelationalDatabase Prelude.Text
stopRelationalDatabase_relationalDatabaseName :: (Text -> f Text)
-> StopRelationalDatabase -> f StopRelationalDatabase
stopRelationalDatabase_relationalDatabaseName = (StopRelationalDatabase -> Text)
-> (StopRelationalDatabase -> Text -> StopRelationalDatabase)
-> Lens StopRelationalDatabase StopRelationalDatabase Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRelationalDatabase' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:StopRelationalDatabase' :: StopRelationalDatabase -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: StopRelationalDatabase
s@StopRelationalDatabase' {} Text
a -> StopRelationalDatabase
s {$sel:relationalDatabaseName:StopRelationalDatabase' :: Text
relationalDatabaseName = Text
a} :: StopRelationalDatabase)
instance Core.AWSRequest StopRelationalDatabase where
type
AWSResponse StopRelationalDatabase =
StopRelationalDatabaseResponse
request :: StopRelationalDatabase -> Request StopRelationalDatabase
request = Service -> StopRelationalDatabase -> Request StopRelationalDatabase
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopRelationalDatabase
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopRelationalDatabase)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopRelationalDatabase))
-> Logger
-> Service
-> Proxy StopRelationalDatabase
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopRelationalDatabase)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [Operation] -> Int -> StopRelationalDatabaseResponse
StopRelationalDatabaseResponse'
(Maybe [Operation] -> Int -> StopRelationalDatabaseResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> StopRelationalDatabaseResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Operation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operations" Either String (Maybe (Maybe [Operation]))
-> Maybe [Operation] -> Either String (Maybe [Operation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Operation]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> StopRelationalDatabaseResponse)
-> Either String Int
-> Either String StopRelationalDatabaseResponse
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 StopRelationalDatabase
instance Prelude.NFData StopRelationalDatabase
instance Core.ToHeaders StopRelationalDatabase where
toHeaders :: StopRelationalDatabase -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopRelationalDatabase -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.StopRelationalDatabase" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StopRelationalDatabase where
toJSON :: StopRelationalDatabase -> Value
toJSON StopRelationalDatabase' {Maybe Text
Text
relationalDatabaseName :: Text
relationalDatabaseSnapshotName :: Maybe Text
$sel:relationalDatabaseName:StopRelationalDatabase' :: StopRelationalDatabase -> Text
$sel:relationalDatabaseSnapshotName:StopRelationalDatabase' :: StopRelationalDatabase -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"relationalDatabaseSnapshotName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
relationalDatabaseSnapshotName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"relationalDatabaseName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseName
)
]
)
instance Core.ToPath StopRelationalDatabase where
toPath :: StopRelationalDatabase -> ByteString
toPath = ByteString -> StopRelationalDatabase -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopRelationalDatabase where
toQuery :: StopRelationalDatabase -> QueryString
toQuery = QueryString -> StopRelationalDatabase -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopRelationalDatabaseResponse = StopRelationalDatabaseResponse'
{
StopRelationalDatabaseResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
StopRelationalDatabaseResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool
(StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool)
-> (StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool)
-> Eq StopRelationalDatabaseResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool
$c/= :: StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool
== :: StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool
$c== :: StopRelationalDatabaseResponse
-> StopRelationalDatabaseResponse -> Bool
Prelude.Eq, ReadPrec [StopRelationalDatabaseResponse]
ReadPrec StopRelationalDatabaseResponse
Int -> ReadS StopRelationalDatabaseResponse
ReadS [StopRelationalDatabaseResponse]
(Int -> ReadS StopRelationalDatabaseResponse)
-> ReadS [StopRelationalDatabaseResponse]
-> ReadPrec StopRelationalDatabaseResponse
-> ReadPrec [StopRelationalDatabaseResponse]
-> Read StopRelationalDatabaseResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRelationalDatabaseResponse]
$creadListPrec :: ReadPrec [StopRelationalDatabaseResponse]
readPrec :: ReadPrec StopRelationalDatabaseResponse
$creadPrec :: ReadPrec StopRelationalDatabaseResponse
readList :: ReadS [StopRelationalDatabaseResponse]
$creadList :: ReadS [StopRelationalDatabaseResponse]
readsPrec :: Int -> ReadS StopRelationalDatabaseResponse
$creadsPrec :: Int -> ReadS StopRelationalDatabaseResponse
Prelude.Read, Int -> StopRelationalDatabaseResponse -> ShowS
[StopRelationalDatabaseResponse] -> ShowS
StopRelationalDatabaseResponse -> String
(Int -> StopRelationalDatabaseResponse -> ShowS)
-> (StopRelationalDatabaseResponse -> String)
-> ([StopRelationalDatabaseResponse] -> ShowS)
-> Show StopRelationalDatabaseResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRelationalDatabaseResponse] -> ShowS
$cshowList :: [StopRelationalDatabaseResponse] -> ShowS
show :: StopRelationalDatabaseResponse -> String
$cshow :: StopRelationalDatabaseResponse -> String
showsPrec :: Int -> StopRelationalDatabaseResponse -> ShowS
$cshowsPrec :: Int -> StopRelationalDatabaseResponse -> ShowS
Prelude.Show, (forall x.
StopRelationalDatabaseResponse
-> Rep StopRelationalDatabaseResponse x)
-> (forall x.
Rep StopRelationalDatabaseResponse x
-> StopRelationalDatabaseResponse)
-> Generic StopRelationalDatabaseResponse
forall x.
Rep StopRelationalDatabaseResponse x
-> StopRelationalDatabaseResponse
forall x.
StopRelationalDatabaseResponse
-> Rep StopRelationalDatabaseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopRelationalDatabaseResponse x
-> StopRelationalDatabaseResponse
$cfrom :: forall x.
StopRelationalDatabaseResponse
-> Rep StopRelationalDatabaseResponse x
Prelude.Generic)
newStopRelationalDatabaseResponse ::
Prelude.Int ->
StopRelationalDatabaseResponse
newStopRelationalDatabaseResponse :: Int -> StopRelationalDatabaseResponse
newStopRelationalDatabaseResponse Int
pHttpStatus_ =
StopRelationalDatabaseResponse' :: Maybe [Operation] -> Int -> StopRelationalDatabaseResponse
StopRelationalDatabaseResponse'
{ $sel:operations:StopRelationalDatabaseResponse' :: Maybe [Operation]
operations =
Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopRelationalDatabaseResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopRelationalDatabaseResponse_operations :: Lens.Lens' StopRelationalDatabaseResponse (Prelude.Maybe [Operation])
stopRelationalDatabaseResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> StopRelationalDatabaseResponse
-> f StopRelationalDatabaseResponse
stopRelationalDatabaseResponse_operations = (StopRelationalDatabaseResponse -> Maybe [Operation])
-> (StopRelationalDatabaseResponse
-> Maybe [Operation] -> StopRelationalDatabaseResponse)
-> Lens
StopRelationalDatabaseResponse
StopRelationalDatabaseResponse
(Maybe [Operation])
(Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRelationalDatabaseResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:StopRelationalDatabaseResponse' :: StopRelationalDatabaseResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: StopRelationalDatabaseResponse
s@StopRelationalDatabaseResponse' {} Maybe [Operation]
a -> StopRelationalDatabaseResponse
s {$sel:operations:StopRelationalDatabaseResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: StopRelationalDatabaseResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
-> StopRelationalDatabaseResponse
-> f StopRelationalDatabaseResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
-> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> StopRelationalDatabaseResponse
-> f StopRelationalDatabaseResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Operation] [Operation] [Operation] [Operation]
-> Iso
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
(Maybe [Operation])
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 [Operation] [Operation] [Operation] [Operation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
stopRelationalDatabaseResponse_httpStatus :: Lens.Lens' StopRelationalDatabaseResponse Prelude.Int
stopRelationalDatabaseResponse_httpStatus :: (Int -> f Int)
-> StopRelationalDatabaseResponse
-> f StopRelationalDatabaseResponse
stopRelationalDatabaseResponse_httpStatus = (StopRelationalDatabaseResponse -> Int)
-> (StopRelationalDatabaseResponse
-> Int -> StopRelationalDatabaseResponse)
-> Lens
StopRelationalDatabaseResponse
StopRelationalDatabaseResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRelationalDatabaseResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopRelationalDatabaseResponse' :: StopRelationalDatabaseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopRelationalDatabaseResponse
s@StopRelationalDatabaseResponse' {} Int
a -> StopRelationalDatabaseResponse
s {$sel:httpStatus:StopRelationalDatabaseResponse' :: Int
httpStatus = Int
a} :: StopRelationalDatabaseResponse)
instance
Prelude.NFData
StopRelationalDatabaseResponse