{-# 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.KinesisAnalyticsV2.DeleteApplicationSnapshot
(
DeleteApplicationSnapshot (..),
newDeleteApplicationSnapshot,
deleteApplicationSnapshot_applicationName,
deleteApplicationSnapshot_snapshotName,
deleteApplicationSnapshot_snapshotCreationTimestamp,
DeleteApplicationSnapshotResponse (..),
newDeleteApplicationSnapshotResponse,
deleteApplicationSnapshotResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisAnalyticsV2.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteApplicationSnapshot = DeleteApplicationSnapshot'
{
DeleteApplicationSnapshot -> Text
applicationName :: Prelude.Text,
DeleteApplicationSnapshot -> Text
snapshotName :: Prelude.Text,
DeleteApplicationSnapshot -> POSIX
snapshotCreationTimestamp :: Core.POSIX
}
deriving (DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool
(DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool)
-> (DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool)
-> Eq DeleteApplicationSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool
$c/= :: DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool
== :: DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool
$c== :: DeleteApplicationSnapshot -> DeleteApplicationSnapshot -> Bool
Prelude.Eq, ReadPrec [DeleteApplicationSnapshot]
ReadPrec DeleteApplicationSnapshot
Int -> ReadS DeleteApplicationSnapshot
ReadS [DeleteApplicationSnapshot]
(Int -> ReadS DeleteApplicationSnapshot)
-> ReadS [DeleteApplicationSnapshot]
-> ReadPrec DeleteApplicationSnapshot
-> ReadPrec [DeleteApplicationSnapshot]
-> Read DeleteApplicationSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApplicationSnapshot]
$creadListPrec :: ReadPrec [DeleteApplicationSnapshot]
readPrec :: ReadPrec DeleteApplicationSnapshot
$creadPrec :: ReadPrec DeleteApplicationSnapshot
readList :: ReadS [DeleteApplicationSnapshot]
$creadList :: ReadS [DeleteApplicationSnapshot]
readsPrec :: Int -> ReadS DeleteApplicationSnapshot
$creadsPrec :: Int -> ReadS DeleteApplicationSnapshot
Prelude.Read, Int -> DeleteApplicationSnapshot -> ShowS
[DeleteApplicationSnapshot] -> ShowS
DeleteApplicationSnapshot -> String
(Int -> DeleteApplicationSnapshot -> ShowS)
-> (DeleteApplicationSnapshot -> String)
-> ([DeleteApplicationSnapshot] -> ShowS)
-> Show DeleteApplicationSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApplicationSnapshot] -> ShowS
$cshowList :: [DeleteApplicationSnapshot] -> ShowS
show :: DeleteApplicationSnapshot -> String
$cshow :: DeleteApplicationSnapshot -> String
showsPrec :: Int -> DeleteApplicationSnapshot -> ShowS
$cshowsPrec :: Int -> DeleteApplicationSnapshot -> ShowS
Prelude.Show, (forall x.
DeleteApplicationSnapshot -> Rep DeleteApplicationSnapshot x)
-> (forall x.
Rep DeleteApplicationSnapshot x -> DeleteApplicationSnapshot)
-> Generic DeleteApplicationSnapshot
forall x.
Rep DeleteApplicationSnapshot x -> DeleteApplicationSnapshot
forall x.
DeleteApplicationSnapshot -> Rep DeleteApplicationSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteApplicationSnapshot x -> DeleteApplicationSnapshot
$cfrom :: forall x.
DeleteApplicationSnapshot -> Rep DeleteApplicationSnapshot x
Prelude.Generic)
newDeleteApplicationSnapshot ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
DeleteApplicationSnapshot
newDeleteApplicationSnapshot :: Text -> Text -> UTCTime -> DeleteApplicationSnapshot
newDeleteApplicationSnapshot
Text
pApplicationName_
Text
pSnapshotName_
UTCTime
pSnapshotCreationTimestamp_ =
DeleteApplicationSnapshot' :: Text -> Text -> POSIX -> DeleteApplicationSnapshot
DeleteApplicationSnapshot'
{ $sel:applicationName:DeleteApplicationSnapshot' :: Text
applicationName =
Text
pApplicationName_,
$sel:snapshotName:DeleteApplicationSnapshot' :: Text
snapshotName = Text
pSnapshotName_,
$sel:snapshotCreationTimestamp:DeleteApplicationSnapshot' :: POSIX
snapshotCreationTimestamp =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pSnapshotCreationTimestamp_
}
deleteApplicationSnapshot_applicationName :: Lens.Lens' DeleteApplicationSnapshot Prelude.Text
deleteApplicationSnapshot_applicationName :: (Text -> f Text)
-> DeleteApplicationSnapshot -> f DeleteApplicationSnapshot
deleteApplicationSnapshot_applicationName = (DeleteApplicationSnapshot -> Text)
-> (DeleteApplicationSnapshot -> Text -> DeleteApplicationSnapshot)
-> Lens
DeleteApplicationSnapshot DeleteApplicationSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplicationSnapshot' {Text
applicationName :: Text
$sel:applicationName:DeleteApplicationSnapshot' :: DeleteApplicationSnapshot -> Text
applicationName} -> Text
applicationName) (\s :: DeleteApplicationSnapshot
s@DeleteApplicationSnapshot' {} Text
a -> DeleteApplicationSnapshot
s {$sel:applicationName:DeleteApplicationSnapshot' :: Text
applicationName = Text
a} :: DeleteApplicationSnapshot)
deleteApplicationSnapshot_snapshotName :: Lens.Lens' DeleteApplicationSnapshot Prelude.Text
deleteApplicationSnapshot_snapshotName :: (Text -> f Text)
-> DeleteApplicationSnapshot -> f DeleteApplicationSnapshot
deleteApplicationSnapshot_snapshotName = (DeleteApplicationSnapshot -> Text)
-> (DeleteApplicationSnapshot -> Text -> DeleteApplicationSnapshot)
-> Lens
DeleteApplicationSnapshot DeleteApplicationSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplicationSnapshot' {Text
snapshotName :: Text
$sel:snapshotName:DeleteApplicationSnapshot' :: DeleteApplicationSnapshot -> Text
snapshotName} -> Text
snapshotName) (\s :: DeleteApplicationSnapshot
s@DeleteApplicationSnapshot' {} Text
a -> DeleteApplicationSnapshot
s {$sel:snapshotName:DeleteApplicationSnapshot' :: Text
snapshotName = Text
a} :: DeleteApplicationSnapshot)
deleteApplicationSnapshot_snapshotCreationTimestamp :: Lens.Lens' DeleteApplicationSnapshot Prelude.UTCTime
deleteApplicationSnapshot_snapshotCreationTimestamp :: (UTCTime -> f UTCTime)
-> DeleteApplicationSnapshot -> f DeleteApplicationSnapshot
deleteApplicationSnapshot_snapshotCreationTimestamp = (DeleteApplicationSnapshot -> POSIX)
-> (DeleteApplicationSnapshot
-> POSIX -> DeleteApplicationSnapshot)
-> Lens
DeleteApplicationSnapshot DeleteApplicationSnapshot POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplicationSnapshot' {POSIX
snapshotCreationTimestamp :: POSIX
$sel:snapshotCreationTimestamp:DeleteApplicationSnapshot' :: DeleteApplicationSnapshot -> POSIX
snapshotCreationTimestamp} -> POSIX
snapshotCreationTimestamp) (\s :: DeleteApplicationSnapshot
s@DeleteApplicationSnapshot' {} POSIX
a -> DeleteApplicationSnapshot
s {$sel:snapshotCreationTimestamp:DeleteApplicationSnapshot' :: POSIX
snapshotCreationTimestamp = POSIX
a} :: DeleteApplicationSnapshot) ((POSIX -> f POSIX)
-> DeleteApplicationSnapshot -> f DeleteApplicationSnapshot)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DeleteApplicationSnapshot
-> f DeleteApplicationSnapshot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.AWSRequest DeleteApplicationSnapshot where
type
AWSResponse DeleteApplicationSnapshot =
DeleteApplicationSnapshotResponse
request :: DeleteApplicationSnapshot -> Request DeleteApplicationSnapshot
request = Service
-> DeleteApplicationSnapshot -> Request DeleteApplicationSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteApplicationSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApplicationSnapshot)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteApplicationSnapshot))
-> Logger
-> Service
-> Proxy DeleteApplicationSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApplicationSnapshot)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteApplicationSnapshotResponse
DeleteApplicationSnapshotResponse'
(Int -> DeleteApplicationSnapshotResponse)
-> Either String Int
-> Either String DeleteApplicationSnapshotResponse
forall (f :: * -> *) a b. Functor 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 DeleteApplicationSnapshot
instance Prelude.NFData DeleteApplicationSnapshot
instance Core.ToHeaders DeleteApplicationSnapshot where
toHeaders :: DeleteApplicationSnapshot -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteApplicationSnapshot -> 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
"KinesisAnalytics_20180523.DeleteApplicationSnapshot" ::
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 DeleteApplicationSnapshot where
toJSON :: DeleteApplicationSnapshot -> Value
toJSON DeleteApplicationSnapshot' {Text
POSIX
snapshotCreationTimestamp :: POSIX
snapshotName :: Text
applicationName :: Text
$sel:snapshotCreationTimestamp:DeleteApplicationSnapshot' :: DeleteApplicationSnapshot -> POSIX
$sel:snapshotName:DeleteApplicationSnapshot' :: DeleteApplicationSnapshot -> Text
$sel:applicationName:DeleteApplicationSnapshot' :: DeleteApplicationSnapshot -> 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
"ApplicationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
applicationName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SnapshotName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
snapshotName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"SnapshotCreationTimestamp"
Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
snapshotCreationTimestamp
)
]
)
instance Core.ToPath DeleteApplicationSnapshot where
toPath :: DeleteApplicationSnapshot -> ByteString
toPath = ByteString -> DeleteApplicationSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteApplicationSnapshot where
toQuery :: DeleteApplicationSnapshot -> QueryString
toQuery = QueryString -> DeleteApplicationSnapshot -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteApplicationSnapshotResponse = DeleteApplicationSnapshotResponse'
{
DeleteApplicationSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool
(DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool)
-> (DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool)
-> Eq DeleteApplicationSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool
$c/= :: DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool
== :: DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool
$c== :: DeleteApplicationSnapshotResponse
-> DeleteApplicationSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [DeleteApplicationSnapshotResponse]
ReadPrec DeleteApplicationSnapshotResponse
Int -> ReadS DeleteApplicationSnapshotResponse
ReadS [DeleteApplicationSnapshotResponse]
(Int -> ReadS DeleteApplicationSnapshotResponse)
-> ReadS [DeleteApplicationSnapshotResponse]
-> ReadPrec DeleteApplicationSnapshotResponse
-> ReadPrec [DeleteApplicationSnapshotResponse]
-> Read DeleteApplicationSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApplicationSnapshotResponse]
$creadListPrec :: ReadPrec [DeleteApplicationSnapshotResponse]
readPrec :: ReadPrec DeleteApplicationSnapshotResponse
$creadPrec :: ReadPrec DeleteApplicationSnapshotResponse
readList :: ReadS [DeleteApplicationSnapshotResponse]
$creadList :: ReadS [DeleteApplicationSnapshotResponse]
readsPrec :: Int -> ReadS DeleteApplicationSnapshotResponse
$creadsPrec :: Int -> ReadS DeleteApplicationSnapshotResponse
Prelude.Read, Int -> DeleteApplicationSnapshotResponse -> ShowS
[DeleteApplicationSnapshotResponse] -> ShowS
DeleteApplicationSnapshotResponse -> String
(Int -> DeleteApplicationSnapshotResponse -> ShowS)
-> (DeleteApplicationSnapshotResponse -> String)
-> ([DeleteApplicationSnapshotResponse] -> ShowS)
-> Show DeleteApplicationSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApplicationSnapshotResponse] -> ShowS
$cshowList :: [DeleteApplicationSnapshotResponse] -> ShowS
show :: DeleteApplicationSnapshotResponse -> String
$cshow :: DeleteApplicationSnapshotResponse -> String
showsPrec :: Int -> DeleteApplicationSnapshotResponse -> ShowS
$cshowsPrec :: Int -> DeleteApplicationSnapshotResponse -> ShowS
Prelude.Show, (forall x.
DeleteApplicationSnapshotResponse
-> Rep DeleteApplicationSnapshotResponse x)
-> (forall x.
Rep DeleteApplicationSnapshotResponse x
-> DeleteApplicationSnapshotResponse)
-> Generic DeleteApplicationSnapshotResponse
forall x.
Rep DeleteApplicationSnapshotResponse x
-> DeleteApplicationSnapshotResponse
forall x.
DeleteApplicationSnapshotResponse
-> Rep DeleteApplicationSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteApplicationSnapshotResponse x
-> DeleteApplicationSnapshotResponse
$cfrom :: forall x.
DeleteApplicationSnapshotResponse
-> Rep DeleteApplicationSnapshotResponse x
Prelude.Generic)
newDeleteApplicationSnapshotResponse ::
Prelude.Int ->
DeleteApplicationSnapshotResponse
newDeleteApplicationSnapshotResponse :: Int -> DeleteApplicationSnapshotResponse
newDeleteApplicationSnapshotResponse Int
pHttpStatus_ =
DeleteApplicationSnapshotResponse' :: Int -> DeleteApplicationSnapshotResponse
DeleteApplicationSnapshotResponse'
{ $sel:httpStatus:DeleteApplicationSnapshotResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteApplicationSnapshotResponse_httpStatus :: Lens.Lens' DeleteApplicationSnapshotResponse Prelude.Int
deleteApplicationSnapshotResponse_httpStatus :: (Int -> f Int)
-> DeleteApplicationSnapshotResponse
-> f DeleteApplicationSnapshotResponse
deleteApplicationSnapshotResponse_httpStatus = (DeleteApplicationSnapshotResponse -> Int)
-> (DeleteApplicationSnapshotResponse
-> Int -> DeleteApplicationSnapshotResponse)
-> Lens
DeleteApplicationSnapshotResponse
DeleteApplicationSnapshotResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplicationSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteApplicationSnapshotResponse' :: DeleteApplicationSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteApplicationSnapshotResponse
s@DeleteApplicationSnapshotResponse' {} Int
a -> DeleteApplicationSnapshotResponse
s {$sel:httpStatus:DeleteApplicationSnapshotResponse' :: Int
httpStatus = Int
a} :: DeleteApplicationSnapshotResponse)
instance
Prelude.NFData
DeleteApplicationSnapshotResponse