{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:instanceSnapshotName:DeleteInstanceSnapshot' :: Text
instanceSnapshotName =
Text
pInstanceSnapshotName_
}
deleteInstanceSnapshot_instanceSnapshotName :: Lens.Lens' DeleteInstanceSnapshot Prelude.Text
deleteInstanceSnapshot_instanceSnapshotName :: Lens' DeleteInstanceSnapshot Text
deleteInstanceSnapshot_instanceSnapshotName = 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 :: (Service -> Service)
-> DeleteInstanceSnapshot -> Request DeleteInstanceSnapshot
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 DeleteInstanceSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInstanceSnapshot)))
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 [Operation] -> Int -> DeleteInstanceSnapshotResponse
DeleteInstanceSnapshotResponse'
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
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 DeleteInstanceSnapshot where
hashWithSalt :: Int -> DeleteInstanceSnapshot -> Int
hashWithSalt Int
_salt DeleteInstanceSnapshot' {Text
instanceSnapshotName :: Text
$sel:instanceSnapshotName:DeleteInstanceSnapshot' :: DeleteInstanceSnapshot -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceSnapshotName
instance Prelude.NFData DeleteInstanceSnapshot where
rnf :: DeleteInstanceSnapshot -> ()
rnf DeleteInstanceSnapshot' {Text
instanceSnapshotName :: Text
$sel:instanceSnapshotName:DeleteInstanceSnapshot' :: DeleteInstanceSnapshot -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
instanceSnapshotName
instance Data.ToHeaders DeleteInstanceSnapshot where
toHeaders :: DeleteInstanceSnapshot -> 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
"Lightsail_20161128.DeleteInstanceSnapshot" ::
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 DeleteInstanceSnapshot where
toJSON :: DeleteInstanceSnapshot -> Value
toJSON DeleteInstanceSnapshot' {Text
instanceSnapshotName :: Text
$sel:instanceSnapshotName:DeleteInstanceSnapshot' :: DeleteInstanceSnapshot -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"instanceSnapshotName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceSnapshotName
)
]
)
instance Data.ToPath DeleteInstanceSnapshot where
toPath :: DeleteInstanceSnapshot -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteInstanceSnapshot where
toQuery :: DeleteInstanceSnapshot -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:operations:DeleteInstanceSnapshotResponse' :: Maybe [Operation]
operations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteInstanceSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteInstanceSnapshotResponse_operations :: Lens.Lens' DeleteInstanceSnapshotResponse (Prelude.Maybe [Operation])
deleteInstanceSnapshotResponse_operations :: Lens' DeleteInstanceSnapshotResponse (Maybe [Operation])
deleteInstanceSnapshotResponse_operations = 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) 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
deleteInstanceSnapshotResponse_httpStatus :: Lens.Lens' DeleteInstanceSnapshotResponse Prelude.Int
deleteInstanceSnapshotResponse_httpStatus :: Lens' DeleteInstanceSnapshotResponse Int
deleteInstanceSnapshotResponse_httpStatus = 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
where
rnf :: DeleteInstanceSnapshotResponse -> ()
rnf DeleteInstanceSnapshotResponse' {Int
Maybe [Operation]
httpStatus :: Int
operations :: Maybe [Operation]
$sel:httpStatus:DeleteInstanceSnapshotResponse' :: DeleteInstanceSnapshotResponse -> Int
$sel:operations:DeleteInstanceSnapshotResponse' :: DeleteInstanceSnapshotResponse -> Maybe [Operation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus