{-# 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.Backup.DeleteBackupPlan
(
DeleteBackupPlan (..),
newDeleteBackupPlan,
deleteBackupPlan_backupPlanId,
DeleteBackupPlanResponse (..),
newDeleteBackupPlanResponse,
deleteBackupPlanResponse_versionId,
deleteBackupPlanResponse_backupPlanId,
deleteBackupPlanResponse_backupPlanArn,
deleteBackupPlanResponse_deletionDate,
deleteBackupPlanResponse_httpStatus,
)
where
import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
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 DeleteBackupPlan = DeleteBackupPlan'
{
DeleteBackupPlan -> Text
backupPlanId :: Prelude.Text
}
deriving (DeleteBackupPlan -> DeleteBackupPlan -> Bool
(DeleteBackupPlan -> DeleteBackupPlan -> Bool)
-> (DeleteBackupPlan -> DeleteBackupPlan -> Bool)
-> Eq DeleteBackupPlan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBackupPlan -> DeleteBackupPlan -> Bool
$c/= :: DeleteBackupPlan -> DeleteBackupPlan -> Bool
== :: DeleteBackupPlan -> DeleteBackupPlan -> Bool
$c== :: DeleteBackupPlan -> DeleteBackupPlan -> Bool
Prelude.Eq, ReadPrec [DeleteBackupPlan]
ReadPrec DeleteBackupPlan
Int -> ReadS DeleteBackupPlan
ReadS [DeleteBackupPlan]
(Int -> ReadS DeleteBackupPlan)
-> ReadS [DeleteBackupPlan]
-> ReadPrec DeleteBackupPlan
-> ReadPrec [DeleteBackupPlan]
-> Read DeleteBackupPlan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBackupPlan]
$creadListPrec :: ReadPrec [DeleteBackupPlan]
readPrec :: ReadPrec DeleteBackupPlan
$creadPrec :: ReadPrec DeleteBackupPlan
readList :: ReadS [DeleteBackupPlan]
$creadList :: ReadS [DeleteBackupPlan]
readsPrec :: Int -> ReadS DeleteBackupPlan
$creadsPrec :: Int -> ReadS DeleteBackupPlan
Prelude.Read, Int -> DeleteBackupPlan -> ShowS
[DeleteBackupPlan] -> ShowS
DeleteBackupPlan -> String
(Int -> DeleteBackupPlan -> ShowS)
-> (DeleteBackupPlan -> String)
-> ([DeleteBackupPlan] -> ShowS)
-> Show DeleteBackupPlan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBackupPlan] -> ShowS
$cshowList :: [DeleteBackupPlan] -> ShowS
show :: DeleteBackupPlan -> String
$cshow :: DeleteBackupPlan -> String
showsPrec :: Int -> DeleteBackupPlan -> ShowS
$cshowsPrec :: Int -> DeleteBackupPlan -> ShowS
Prelude.Show, (forall x. DeleteBackupPlan -> Rep DeleteBackupPlan x)
-> (forall x. Rep DeleteBackupPlan x -> DeleteBackupPlan)
-> Generic DeleteBackupPlan
forall x. Rep DeleteBackupPlan x -> DeleteBackupPlan
forall x. DeleteBackupPlan -> Rep DeleteBackupPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBackupPlan x -> DeleteBackupPlan
$cfrom :: forall x. DeleteBackupPlan -> Rep DeleteBackupPlan x
Prelude.Generic)
newDeleteBackupPlan ::
Prelude.Text ->
DeleteBackupPlan
newDeleteBackupPlan :: Text -> DeleteBackupPlan
newDeleteBackupPlan Text
pBackupPlanId_ =
DeleteBackupPlan' :: Text -> DeleteBackupPlan
DeleteBackupPlan' {$sel:backupPlanId:DeleteBackupPlan' :: Text
backupPlanId = Text
pBackupPlanId_}
deleteBackupPlan_backupPlanId :: Lens.Lens' DeleteBackupPlan Prelude.Text
deleteBackupPlan_backupPlanId :: (Text -> f Text) -> DeleteBackupPlan -> f DeleteBackupPlan
deleteBackupPlan_backupPlanId = (DeleteBackupPlan -> Text)
-> (DeleteBackupPlan -> Text -> DeleteBackupPlan)
-> Lens DeleteBackupPlan DeleteBackupPlan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupPlan' {Text
backupPlanId :: Text
$sel:backupPlanId:DeleteBackupPlan' :: DeleteBackupPlan -> Text
backupPlanId} -> Text
backupPlanId) (\s :: DeleteBackupPlan
s@DeleteBackupPlan' {} Text
a -> DeleteBackupPlan
s {$sel:backupPlanId:DeleteBackupPlan' :: Text
backupPlanId = Text
a} :: DeleteBackupPlan)
instance Core.AWSRequest DeleteBackupPlan where
type
AWSResponse DeleteBackupPlan =
DeleteBackupPlanResponse
request :: DeleteBackupPlan -> Request DeleteBackupPlan
request = Service -> DeleteBackupPlan -> Request DeleteBackupPlan
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBackupPlan
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBackupPlan)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteBackupPlan))
-> Logger
-> Service
-> Proxy DeleteBackupPlan
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBackupPlan)))
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DeleteBackupPlanResponse
DeleteBackupPlanResponse'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DeleteBackupPlanResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Int -> DeleteBackupPlanResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VersionId")
Either
String
(Maybe Text
-> Maybe Text -> Maybe POSIX -> Int -> DeleteBackupPlanResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe POSIX -> Int -> DeleteBackupPlanResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BackupPlanId")
Either
String
(Maybe Text -> Maybe POSIX -> Int -> DeleteBackupPlanResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> DeleteBackupPlanResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BackupPlanArn")
Either String (Maybe POSIX -> Int -> DeleteBackupPlanResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DeleteBackupPlanResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeletionDate")
Either String (Int -> DeleteBackupPlanResponse)
-> Either String Int -> Either String DeleteBackupPlanResponse
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 DeleteBackupPlan
instance Prelude.NFData DeleteBackupPlan
instance Core.ToHeaders DeleteBackupPlan where
toHeaders :: DeleteBackupPlan -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteBackupPlan -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteBackupPlan where
toPath :: DeleteBackupPlan -> ByteString
toPath DeleteBackupPlan' {Text
backupPlanId :: Text
$sel:backupPlanId:DeleteBackupPlan' :: DeleteBackupPlan -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/backup/plans/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
backupPlanId]
instance Core.ToQuery DeleteBackupPlan where
toQuery :: DeleteBackupPlan -> QueryString
toQuery = QueryString -> DeleteBackupPlan -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteBackupPlanResponse = DeleteBackupPlanResponse'
{
DeleteBackupPlanResponse -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
DeleteBackupPlanResponse -> Maybe Text
backupPlanId :: Prelude.Maybe Prelude.Text,
DeleteBackupPlanResponse -> Maybe Text
backupPlanArn :: Prelude.Maybe Prelude.Text,
DeleteBackupPlanResponse -> Maybe POSIX
deletionDate :: Prelude.Maybe Core.POSIX,
DeleteBackupPlanResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool
(DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool)
-> (DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool)
-> Eq DeleteBackupPlanResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool
$c/= :: DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool
== :: DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool
$c== :: DeleteBackupPlanResponse -> DeleteBackupPlanResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBackupPlanResponse]
ReadPrec DeleteBackupPlanResponse
Int -> ReadS DeleteBackupPlanResponse
ReadS [DeleteBackupPlanResponse]
(Int -> ReadS DeleteBackupPlanResponse)
-> ReadS [DeleteBackupPlanResponse]
-> ReadPrec DeleteBackupPlanResponse
-> ReadPrec [DeleteBackupPlanResponse]
-> Read DeleteBackupPlanResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBackupPlanResponse]
$creadListPrec :: ReadPrec [DeleteBackupPlanResponse]
readPrec :: ReadPrec DeleteBackupPlanResponse
$creadPrec :: ReadPrec DeleteBackupPlanResponse
readList :: ReadS [DeleteBackupPlanResponse]
$creadList :: ReadS [DeleteBackupPlanResponse]
readsPrec :: Int -> ReadS DeleteBackupPlanResponse
$creadsPrec :: Int -> ReadS DeleteBackupPlanResponse
Prelude.Read, Int -> DeleteBackupPlanResponse -> ShowS
[DeleteBackupPlanResponse] -> ShowS
DeleteBackupPlanResponse -> String
(Int -> DeleteBackupPlanResponse -> ShowS)
-> (DeleteBackupPlanResponse -> String)
-> ([DeleteBackupPlanResponse] -> ShowS)
-> Show DeleteBackupPlanResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBackupPlanResponse] -> ShowS
$cshowList :: [DeleteBackupPlanResponse] -> ShowS
show :: DeleteBackupPlanResponse -> String
$cshow :: DeleteBackupPlanResponse -> String
showsPrec :: Int -> DeleteBackupPlanResponse -> ShowS
$cshowsPrec :: Int -> DeleteBackupPlanResponse -> ShowS
Prelude.Show, (forall x.
DeleteBackupPlanResponse -> Rep DeleteBackupPlanResponse x)
-> (forall x.
Rep DeleteBackupPlanResponse x -> DeleteBackupPlanResponse)
-> Generic DeleteBackupPlanResponse
forall x.
Rep DeleteBackupPlanResponse x -> DeleteBackupPlanResponse
forall x.
DeleteBackupPlanResponse -> Rep DeleteBackupPlanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteBackupPlanResponse x -> DeleteBackupPlanResponse
$cfrom :: forall x.
DeleteBackupPlanResponse -> Rep DeleteBackupPlanResponse x
Prelude.Generic)
newDeleteBackupPlanResponse ::
Prelude.Int ->
DeleteBackupPlanResponse
newDeleteBackupPlanResponse :: Int -> DeleteBackupPlanResponse
newDeleteBackupPlanResponse Int
pHttpStatus_ =
DeleteBackupPlanResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DeleteBackupPlanResponse
DeleteBackupPlanResponse'
{ $sel:versionId:DeleteBackupPlanResponse' :: Maybe Text
versionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:backupPlanId:DeleteBackupPlanResponse' :: Maybe Text
backupPlanId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:backupPlanArn:DeleteBackupPlanResponse' :: Maybe Text
backupPlanArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deletionDate:DeleteBackupPlanResponse' :: Maybe POSIX
deletionDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteBackupPlanResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteBackupPlanResponse_versionId :: Lens.Lens' DeleteBackupPlanResponse (Prelude.Maybe Prelude.Text)
deleteBackupPlanResponse_versionId :: (Maybe Text -> f (Maybe Text))
-> DeleteBackupPlanResponse -> f DeleteBackupPlanResponse
deleteBackupPlanResponse_versionId = (DeleteBackupPlanResponse -> Maybe Text)
-> (DeleteBackupPlanResponse
-> Maybe Text -> DeleteBackupPlanResponse)
-> Lens
DeleteBackupPlanResponse
DeleteBackupPlanResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupPlanResponse' {Maybe Text
versionId :: Maybe Text
$sel:versionId:DeleteBackupPlanResponse' :: DeleteBackupPlanResponse -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: DeleteBackupPlanResponse
s@DeleteBackupPlanResponse' {} Maybe Text
a -> DeleteBackupPlanResponse
s {$sel:versionId:DeleteBackupPlanResponse' :: Maybe Text
versionId = Maybe Text
a} :: DeleteBackupPlanResponse)
deleteBackupPlanResponse_backupPlanId :: Lens.Lens' DeleteBackupPlanResponse (Prelude.Maybe Prelude.Text)
deleteBackupPlanResponse_backupPlanId :: (Maybe Text -> f (Maybe Text))
-> DeleteBackupPlanResponse -> f DeleteBackupPlanResponse
deleteBackupPlanResponse_backupPlanId = (DeleteBackupPlanResponse -> Maybe Text)
-> (DeleteBackupPlanResponse
-> Maybe Text -> DeleteBackupPlanResponse)
-> Lens
DeleteBackupPlanResponse
DeleteBackupPlanResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupPlanResponse' {Maybe Text
backupPlanId :: Maybe Text
$sel:backupPlanId:DeleteBackupPlanResponse' :: DeleteBackupPlanResponse -> Maybe Text
backupPlanId} -> Maybe Text
backupPlanId) (\s :: DeleteBackupPlanResponse
s@DeleteBackupPlanResponse' {} Maybe Text
a -> DeleteBackupPlanResponse
s {$sel:backupPlanId:DeleteBackupPlanResponse' :: Maybe Text
backupPlanId = Maybe Text
a} :: DeleteBackupPlanResponse)
deleteBackupPlanResponse_backupPlanArn :: Lens.Lens' DeleteBackupPlanResponse (Prelude.Maybe Prelude.Text)
deleteBackupPlanResponse_backupPlanArn :: (Maybe Text -> f (Maybe Text))
-> DeleteBackupPlanResponse -> f DeleteBackupPlanResponse
deleteBackupPlanResponse_backupPlanArn = (DeleteBackupPlanResponse -> Maybe Text)
-> (DeleteBackupPlanResponse
-> Maybe Text -> DeleteBackupPlanResponse)
-> Lens
DeleteBackupPlanResponse
DeleteBackupPlanResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupPlanResponse' {Maybe Text
backupPlanArn :: Maybe Text
$sel:backupPlanArn:DeleteBackupPlanResponse' :: DeleteBackupPlanResponse -> Maybe Text
backupPlanArn} -> Maybe Text
backupPlanArn) (\s :: DeleteBackupPlanResponse
s@DeleteBackupPlanResponse' {} Maybe Text
a -> DeleteBackupPlanResponse
s {$sel:backupPlanArn:DeleteBackupPlanResponse' :: Maybe Text
backupPlanArn = Maybe Text
a} :: DeleteBackupPlanResponse)
deleteBackupPlanResponse_deletionDate :: Lens.Lens' DeleteBackupPlanResponse (Prelude.Maybe Prelude.UTCTime)
deleteBackupPlanResponse_deletionDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DeleteBackupPlanResponse -> f DeleteBackupPlanResponse
deleteBackupPlanResponse_deletionDate = (DeleteBackupPlanResponse -> Maybe POSIX)
-> (DeleteBackupPlanResponse
-> Maybe POSIX -> DeleteBackupPlanResponse)
-> Lens
DeleteBackupPlanResponse
DeleteBackupPlanResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupPlanResponse' {Maybe POSIX
deletionDate :: Maybe POSIX
$sel:deletionDate:DeleteBackupPlanResponse' :: DeleteBackupPlanResponse -> Maybe POSIX
deletionDate} -> Maybe POSIX
deletionDate) (\s :: DeleteBackupPlanResponse
s@DeleteBackupPlanResponse' {} Maybe POSIX
a -> DeleteBackupPlanResponse
s {$sel:deletionDate:DeleteBackupPlanResponse' :: Maybe POSIX
deletionDate = Maybe POSIX
a} :: DeleteBackupPlanResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> DeleteBackupPlanResponse -> f DeleteBackupPlanResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeleteBackupPlanResponse
-> f DeleteBackupPlanResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
deleteBackupPlanResponse_httpStatus :: Lens.Lens' DeleteBackupPlanResponse Prelude.Int
deleteBackupPlanResponse_httpStatus :: (Int -> f Int)
-> DeleteBackupPlanResponse -> f DeleteBackupPlanResponse
deleteBackupPlanResponse_httpStatus = (DeleteBackupPlanResponse -> Int)
-> (DeleteBackupPlanResponse -> Int -> DeleteBackupPlanResponse)
-> Lens DeleteBackupPlanResponse DeleteBackupPlanResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupPlanResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteBackupPlanResponse' :: DeleteBackupPlanResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteBackupPlanResponse
s@DeleteBackupPlanResponse' {} Int
a -> DeleteBackupPlanResponse
s {$sel:httpStatus:DeleteBackupPlanResponse' :: Int
httpStatus = Int
a} :: DeleteBackupPlanResponse)
instance Prelude.NFData DeleteBackupPlanResponse