{-# 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.DeleteInstanceSnapshot
(
DeleteInstanceSnapshot (..),
newDeleteInstanceSnapshot,
deleteInstanceSnapshot_instanceSnapshotName,
DeleteInstanceSnapshotResponse (..),
newDeleteInstanceSnapshotResponse,
deleteInstanceSnapshotResponse_operations,
deleteInstanceSnapshotResponse_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 DeleteInstanceSnapshot = DeleteInstanceSnapshot'
{
DeleteInstanceSnapshot -> Text
instanceSnapshotName :: Prelude.Text
}
deriving (DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool
(DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool)
-> (DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool)
-> Eq DeleteInstanceSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool
$c/= :: DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool
== :: DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool
$c== :: DeleteInstanceSnapshot -> DeleteInstanceSnapshot -> Bool
Prelude.Eq, ReadPrec [DeleteInstanceSnapshot]
ReadPrec DeleteInstanceSnapshot
Int -> ReadS DeleteInstanceSnapshot
ReadS [DeleteInstanceSnapshot]
(Int -> ReadS DeleteInstanceSnapshot)
-> ReadS [DeleteInstanceSnapshot]
-> ReadPrec DeleteInstanceSnapshot
-> ReadPrec [DeleteInstanceSnapshot]
-> Read DeleteInstanceSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInstanceSnapshot]
$creadListPrec :: ReadPrec [DeleteInstanceSnapshot]
readPrec :: ReadPrec DeleteInstanceSnapshot
$creadPrec :: ReadPrec DeleteInstanceSnapshot
readList :: ReadS [DeleteInstanceSnapshot]
$creadList :: ReadS [DeleteInstanceSnapshot]
readsPrec :: Int -> ReadS DeleteInstanceSnapshot
$creadsPrec :: Int -> ReadS DeleteInstanceSnapshot
Prelude.Read, Int -> DeleteInstanceSnapshot -> ShowS
[DeleteInstanceSnapshot] -> ShowS
DeleteInstanceSnapshot -> String
(Int -> DeleteInstanceSnapshot -> ShowS)
-> (DeleteInstanceSnapshot -> String)
-> ([DeleteInstanceSnapshot] -> ShowS)
-> Show DeleteInstanceSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInstanceSnapshot] -> ShowS
$cshowList :: [DeleteInstanceSnapshot] -> ShowS
show :: DeleteInstanceSnapshot -> String
$cshow :: DeleteInstanceSnapshot -> String
showsPrec :: Int -> DeleteInstanceSnapshot -> ShowS
$cshowsPrec :: Int -> DeleteInstanceSnapshot -> ShowS
Prelude.Show, (forall x. DeleteInstanceSnapshot -> Rep DeleteInstanceSnapshot x)
-> (forall x.
Rep DeleteInstanceSnapshot x -> DeleteInstanceSnapshot)
-> Generic DeleteInstanceSnapshot
forall x. Rep DeleteInstanceSnapshot x -> DeleteInstanceSnapshot
forall x. DeleteInstanceSnapshot -> Rep DeleteInstanceSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteInstanceSnapshot x -> DeleteInstanceSnapshot
$cfrom :: forall x. DeleteInstanceSnapshot -> Rep DeleteInstanceSnapshot x
Prelude.Generic)
newDeleteInstanceSnapshot ::
Prelude.Text ->
DeleteInstanceSnapshot
newDeleteInstanceSnapshot :: Text -> DeleteInstanceSnapshot
newDeleteInstanceSnapshot Text
pInstanceSnapshotName_ =
DeleteInstanceSnapshot' :: Text -> DeleteInstanceSnapshot
DeleteInstanceSnapshot'
{ $sel:instanceSnapshotName:DeleteInstanceSnapshot' :: Text
instanceSnapshotName =
Text
pInstanceSnapshotName_
}
deleteInstanceSnapshot_instanceSnapshotName :: Lens.Lens' DeleteInstanceSnapshot Prelude.Text
deleteInstanceSnapshot_instanceSnapshotName :: (Text -> f Text)
-> DeleteInstanceSnapshot -> f DeleteInstanceSnapshot
deleteInstanceSnapshot_instanceSnapshotName = (DeleteInstanceSnapshot -> Text)
-> (DeleteInstanceSnapshot -> Text -> DeleteInstanceSnapshot)
-> Lens DeleteInstanceSnapshot DeleteInstanceSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceSnapshot' {Text
instanceSnapshotName :: Text
$sel:instanceSnapshotName:DeleteInstanceSnapshot' :: DeleteInstanceSnapshot -> Text
instanceSnapshotName} -> Text
instanceSnapshotName) (\s :: DeleteInstanceSnapshot
s@DeleteInstanceSnapshot' {} Text
a -> DeleteInstanceSnapshot
s {$sel:instanceSnapshotName:DeleteInstanceSnapshot' :: Text
instanceSnapshotName = Text
a} :: DeleteInstanceSnapshot)
instance Core.AWSRequest DeleteInstanceSnapshot where
type
AWSResponse DeleteInstanceSnapshot =
DeleteInstanceSnapshotResponse
request :: DeleteInstanceSnapshot -> Request DeleteInstanceSnapshot
request = Service -> DeleteInstanceSnapshot -> Request DeleteInstanceSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteInstanceSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInstanceSnapshot)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteInstanceSnapshot))
-> Logger
-> Service
-> Proxy DeleteInstanceSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInstanceSnapshot)))
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 -> DeleteInstanceSnapshotResponse
DeleteInstanceSnapshotResponse'
(Maybe [Operation] -> Int -> DeleteInstanceSnapshotResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> DeleteInstanceSnapshotResponse)
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 -> DeleteInstanceSnapshotResponse)
-> Either String Int
-> Either String DeleteInstanceSnapshotResponse
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 DeleteInstanceSnapshot
instance Prelude.NFData DeleteInstanceSnapshot
instance Core.ToHeaders DeleteInstanceSnapshot where
toHeaders :: DeleteInstanceSnapshot -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteInstanceSnapshot -> 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.DeleteInstanceSnapshot" ::
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 DeleteInstanceSnapshot where
toJSON :: DeleteInstanceSnapshot -> Value
toJSON DeleteInstanceSnapshot' {Text
instanceSnapshotName :: Text
$sel:instanceSnapshotName:DeleteInstanceSnapshot' :: DeleteInstanceSnapshot -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"instanceSnapshotName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceSnapshotName
)
]
)
instance Core.ToPath DeleteInstanceSnapshot where
toPath :: DeleteInstanceSnapshot -> ByteString
toPath = ByteString -> DeleteInstanceSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteInstanceSnapshot where
toQuery :: DeleteInstanceSnapshot -> QueryString
toQuery = QueryString -> DeleteInstanceSnapshot -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteInstanceSnapshotResponse = DeleteInstanceSnapshotResponse'
{
DeleteInstanceSnapshotResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
DeleteInstanceSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool
(DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool)
-> (DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool)
-> Eq DeleteInstanceSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool
$c/= :: DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool
== :: DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool
$c== :: DeleteInstanceSnapshotResponse
-> DeleteInstanceSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [DeleteInstanceSnapshotResponse]
ReadPrec DeleteInstanceSnapshotResponse
Int -> ReadS DeleteInstanceSnapshotResponse
ReadS [DeleteInstanceSnapshotResponse]
(Int -> ReadS DeleteInstanceSnapshotResponse)
-> ReadS [DeleteInstanceSnapshotResponse]
-> ReadPrec DeleteInstanceSnapshotResponse
-> ReadPrec [DeleteInstanceSnapshotResponse]
-> Read DeleteInstanceSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInstanceSnapshotResponse]
$creadListPrec :: ReadPrec [DeleteInstanceSnapshotResponse]
readPrec :: ReadPrec DeleteInstanceSnapshotResponse
$creadPrec :: ReadPrec DeleteInstanceSnapshotResponse
readList :: ReadS [DeleteInstanceSnapshotResponse]
$creadList :: ReadS [DeleteInstanceSnapshotResponse]
readsPrec :: Int -> ReadS DeleteInstanceSnapshotResponse
$creadsPrec :: Int -> ReadS DeleteInstanceSnapshotResponse
Prelude.Read, Int -> DeleteInstanceSnapshotResponse -> ShowS
[DeleteInstanceSnapshotResponse] -> ShowS
DeleteInstanceSnapshotResponse -> String
(Int -> DeleteInstanceSnapshotResponse -> ShowS)
-> (DeleteInstanceSnapshotResponse -> String)
-> ([DeleteInstanceSnapshotResponse] -> ShowS)
-> Show DeleteInstanceSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInstanceSnapshotResponse] -> ShowS
$cshowList :: [DeleteInstanceSnapshotResponse] -> ShowS
show :: DeleteInstanceSnapshotResponse -> String
$cshow :: DeleteInstanceSnapshotResponse -> String
showsPrec :: Int -> DeleteInstanceSnapshotResponse -> ShowS
$cshowsPrec :: Int -> DeleteInstanceSnapshotResponse -> ShowS
Prelude.Show, (forall x.
DeleteInstanceSnapshotResponse
-> Rep DeleteInstanceSnapshotResponse x)
-> (forall x.
Rep DeleteInstanceSnapshotResponse x
-> DeleteInstanceSnapshotResponse)
-> Generic DeleteInstanceSnapshotResponse
forall x.
Rep DeleteInstanceSnapshotResponse x
-> DeleteInstanceSnapshotResponse
forall x.
DeleteInstanceSnapshotResponse
-> Rep DeleteInstanceSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteInstanceSnapshotResponse x
-> DeleteInstanceSnapshotResponse
$cfrom :: forall x.
DeleteInstanceSnapshotResponse
-> Rep DeleteInstanceSnapshotResponse x
Prelude.Generic)
newDeleteInstanceSnapshotResponse ::
Prelude.Int ->
DeleteInstanceSnapshotResponse
newDeleteInstanceSnapshotResponse :: Int -> DeleteInstanceSnapshotResponse
newDeleteInstanceSnapshotResponse Int
pHttpStatus_ =
DeleteInstanceSnapshotResponse' :: Maybe [Operation] -> Int -> DeleteInstanceSnapshotResponse
DeleteInstanceSnapshotResponse'
{ $sel:operations:DeleteInstanceSnapshotResponse' :: Maybe [Operation]
operations =
Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteInstanceSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteInstanceSnapshotResponse_operations :: Lens.Lens' DeleteInstanceSnapshotResponse (Prelude.Maybe [Operation])
deleteInstanceSnapshotResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> DeleteInstanceSnapshotResponse
-> f DeleteInstanceSnapshotResponse
deleteInstanceSnapshotResponse_operations = (DeleteInstanceSnapshotResponse -> Maybe [Operation])
-> (DeleteInstanceSnapshotResponse
-> Maybe [Operation] -> DeleteInstanceSnapshotResponse)
-> Lens
DeleteInstanceSnapshotResponse
DeleteInstanceSnapshotResponse
(Maybe [Operation])
(Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceSnapshotResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:DeleteInstanceSnapshotResponse' :: DeleteInstanceSnapshotResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: DeleteInstanceSnapshotResponse
s@DeleteInstanceSnapshotResponse' {} Maybe [Operation]
a -> DeleteInstanceSnapshotResponse
s {$sel:operations:DeleteInstanceSnapshotResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: DeleteInstanceSnapshotResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
-> DeleteInstanceSnapshotResponse
-> f DeleteInstanceSnapshotResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
-> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> DeleteInstanceSnapshotResponse
-> f DeleteInstanceSnapshotResponse
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
deleteInstanceSnapshotResponse_httpStatus :: Lens.Lens' DeleteInstanceSnapshotResponse Prelude.Int
deleteInstanceSnapshotResponse_httpStatus :: (Int -> f Int)
-> DeleteInstanceSnapshotResponse
-> f DeleteInstanceSnapshotResponse
deleteInstanceSnapshotResponse_httpStatus = (DeleteInstanceSnapshotResponse -> Int)
-> (DeleteInstanceSnapshotResponse
-> Int -> DeleteInstanceSnapshotResponse)
-> Lens
DeleteInstanceSnapshotResponse
DeleteInstanceSnapshotResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteInstanceSnapshotResponse' :: DeleteInstanceSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteInstanceSnapshotResponse
s@DeleteInstanceSnapshotResponse' {} Int
a -> DeleteInstanceSnapshotResponse
s {$sel:httpStatus:DeleteInstanceSnapshotResponse' :: Int
httpStatus = Int
a} :: DeleteInstanceSnapshotResponse)
instance
Prelude.NFData
DeleteInstanceSnapshotResponse