{-# 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.DeleteBackupSelection
(
DeleteBackupSelection (..),
newDeleteBackupSelection,
deleteBackupSelection_backupPlanId,
deleteBackupSelection_selectionId,
DeleteBackupSelectionResponse (..),
newDeleteBackupSelectionResponse,
)
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 DeleteBackupSelection = DeleteBackupSelection'
{
DeleteBackupSelection -> Text
backupPlanId :: Prelude.Text,
DeleteBackupSelection -> Text
selectionId :: Prelude.Text
}
deriving (DeleteBackupSelection -> DeleteBackupSelection -> Bool
(DeleteBackupSelection -> DeleteBackupSelection -> Bool)
-> (DeleteBackupSelection -> DeleteBackupSelection -> Bool)
-> Eq DeleteBackupSelection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBackupSelection -> DeleteBackupSelection -> Bool
$c/= :: DeleteBackupSelection -> DeleteBackupSelection -> Bool
== :: DeleteBackupSelection -> DeleteBackupSelection -> Bool
$c== :: DeleteBackupSelection -> DeleteBackupSelection -> Bool
Prelude.Eq, ReadPrec [DeleteBackupSelection]
ReadPrec DeleteBackupSelection
Int -> ReadS DeleteBackupSelection
ReadS [DeleteBackupSelection]
(Int -> ReadS DeleteBackupSelection)
-> ReadS [DeleteBackupSelection]
-> ReadPrec DeleteBackupSelection
-> ReadPrec [DeleteBackupSelection]
-> Read DeleteBackupSelection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBackupSelection]
$creadListPrec :: ReadPrec [DeleteBackupSelection]
readPrec :: ReadPrec DeleteBackupSelection
$creadPrec :: ReadPrec DeleteBackupSelection
readList :: ReadS [DeleteBackupSelection]
$creadList :: ReadS [DeleteBackupSelection]
readsPrec :: Int -> ReadS DeleteBackupSelection
$creadsPrec :: Int -> ReadS DeleteBackupSelection
Prelude.Read, Int -> DeleteBackupSelection -> ShowS
[DeleteBackupSelection] -> ShowS
DeleteBackupSelection -> String
(Int -> DeleteBackupSelection -> ShowS)
-> (DeleteBackupSelection -> String)
-> ([DeleteBackupSelection] -> ShowS)
-> Show DeleteBackupSelection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBackupSelection] -> ShowS
$cshowList :: [DeleteBackupSelection] -> ShowS
show :: DeleteBackupSelection -> String
$cshow :: DeleteBackupSelection -> String
showsPrec :: Int -> DeleteBackupSelection -> ShowS
$cshowsPrec :: Int -> DeleteBackupSelection -> ShowS
Prelude.Show, (forall x. DeleteBackupSelection -> Rep DeleteBackupSelection x)
-> (forall x. Rep DeleteBackupSelection x -> DeleteBackupSelection)
-> Generic DeleteBackupSelection
forall x. Rep DeleteBackupSelection x -> DeleteBackupSelection
forall x. DeleteBackupSelection -> Rep DeleteBackupSelection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBackupSelection x -> DeleteBackupSelection
$cfrom :: forall x. DeleteBackupSelection -> Rep DeleteBackupSelection x
Prelude.Generic)
newDeleteBackupSelection ::
Prelude.Text ->
Prelude.Text ->
DeleteBackupSelection
newDeleteBackupSelection :: Text -> Text -> DeleteBackupSelection
newDeleteBackupSelection Text
pBackupPlanId_ Text
pSelectionId_ =
DeleteBackupSelection' :: Text -> Text -> DeleteBackupSelection
DeleteBackupSelection'
{ $sel:backupPlanId:DeleteBackupSelection' :: Text
backupPlanId =
Text
pBackupPlanId_,
$sel:selectionId:DeleteBackupSelection' :: Text
selectionId = Text
pSelectionId_
}
deleteBackupSelection_backupPlanId :: Lens.Lens' DeleteBackupSelection Prelude.Text
deleteBackupSelection_backupPlanId :: (Text -> f Text)
-> DeleteBackupSelection -> f DeleteBackupSelection
deleteBackupSelection_backupPlanId = (DeleteBackupSelection -> Text)
-> (DeleteBackupSelection -> Text -> DeleteBackupSelection)
-> Lens DeleteBackupSelection DeleteBackupSelection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupSelection' {Text
backupPlanId :: Text
$sel:backupPlanId:DeleteBackupSelection' :: DeleteBackupSelection -> Text
backupPlanId} -> Text
backupPlanId) (\s :: DeleteBackupSelection
s@DeleteBackupSelection' {} Text
a -> DeleteBackupSelection
s {$sel:backupPlanId:DeleteBackupSelection' :: Text
backupPlanId = Text
a} :: DeleteBackupSelection)
deleteBackupSelection_selectionId :: Lens.Lens' DeleteBackupSelection Prelude.Text
deleteBackupSelection_selectionId :: (Text -> f Text)
-> DeleteBackupSelection -> f DeleteBackupSelection
deleteBackupSelection_selectionId = (DeleteBackupSelection -> Text)
-> (DeleteBackupSelection -> Text -> DeleteBackupSelection)
-> Lens DeleteBackupSelection DeleteBackupSelection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBackupSelection' {Text
selectionId :: Text
$sel:selectionId:DeleteBackupSelection' :: DeleteBackupSelection -> Text
selectionId} -> Text
selectionId) (\s :: DeleteBackupSelection
s@DeleteBackupSelection' {} Text
a -> DeleteBackupSelection
s {$sel:selectionId:DeleteBackupSelection' :: Text
selectionId = Text
a} :: DeleteBackupSelection)
instance Core.AWSRequest DeleteBackupSelection where
type
AWSResponse DeleteBackupSelection =
DeleteBackupSelectionResponse
request :: DeleteBackupSelection -> Request DeleteBackupSelection
request = Service -> DeleteBackupSelection -> Request DeleteBackupSelection
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBackupSelection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteBackupSelection)))
response =
AWSResponse DeleteBackupSelection
-> Logger
-> Service
-> Proxy DeleteBackupSelection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteBackupSelection)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteBackupSelection
DeleteBackupSelectionResponse
DeleteBackupSelectionResponse'
instance Prelude.Hashable DeleteBackupSelection
instance Prelude.NFData DeleteBackupSelection
instance Core.ToHeaders DeleteBackupSelection where
toHeaders :: DeleteBackupSelection -> [Header]
toHeaders =
[Header] -> DeleteBackupSelection -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteBackupSelection where
toPath :: DeleteBackupSelection -> ByteString
toPath DeleteBackupSelection' {Text
selectionId :: Text
backupPlanId :: Text
$sel:selectionId:DeleteBackupSelection' :: DeleteBackupSelection -> Text
$sel:backupPlanId:DeleteBackupSelection' :: DeleteBackupSelection -> 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,
ByteString
"/selections/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
selectionId
]
instance Core.ToQuery DeleteBackupSelection where
toQuery :: DeleteBackupSelection -> QueryString
toQuery = QueryString -> DeleteBackupSelection -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteBackupSelectionResponse = DeleteBackupSelectionResponse'
{
}
deriving (DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool
(DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool)
-> (DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool)
-> Eq DeleteBackupSelectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool
$c/= :: DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool
== :: DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool
$c== :: DeleteBackupSelectionResponse
-> DeleteBackupSelectionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBackupSelectionResponse]
ReadPrec DeleteBackupSelectionResponse
Int -> ReadS DeleteBackupSelectionResponse
ReadS [DeleteBackupSelectionResponse]
(Int -> ReadS DeleteBackupSelectionResponse)
-> ReadS [DeleteBackupSelectionResponse]
-> ReadPrec DeleteBackupSelectionResponse
-> ReadPrec [DeleteBackupSelectionResponse]
-> Read DeleteBackupSelectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBackupSelectionResponse]
$creadListPrec :: ReadPrec [DeleteBackupSelectionResponse]
readPrec :: ReadPrec DeleteBackupSelectionResponse
$creadPrec :: ReadPrec DeleteBackupSelectionResponse
readList :: ReadS [DeleteBackupSelectionResponse]
$creadList :: ReadS [DeleteBackupSelectionResponse]
readsPrec :: Int -> ReadS DeleteBackupSelectionResponse
$creadsPrec :: Int -> ReadS DeleteBackupSelectionResponse
Prelude.Read, Int -> DeleteBackupSelectionResponse -> ShowS
[DeleteBackupSelectionResponse] -> ShowS
DeleteBackupSelectionResponse -> String
(Int -> DeleteBackupSelectionResponse -> ShowS)
-> (DeleteBackupSelectionResponse -> String)
-> ([DeleteBackupSelectionResponse] -> ShowS)
-> Show DeleteBackupSelectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBackupSelectionResponse] -> ShowS
$cshowList :: [DeleteBackupSelectionResponse] -> ShowS
show :: DeleteBackupSelectionResponse -> String
$cshow :: DeleteBackupSelectionResponse -> String
showsPrec :: Int -> DeleteBackupSelectionResponse -> ShowS
$cshowsPrec :: Int -> DeleteBackupSelectionResponse -> ShowS
Prelude.Show, (forall x.
DeleteBackupSelectionResponse
-> Rep DeleteBackupSelectionResponse x)
-> (forall x.
Rep DeleteBackupSelectionResponse x
-> DeleteBackupSelectionResponse)
-> Generic DeleteBackupSelectionResponse
forall x.
Rep DeleteBackupSelectionResponse x
-> DeleteBackupSelectionResponse
forall x.
DeleteBackupSelectionResponse
-> Rep DeleteBackupSelectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteBackupSelectionResponse x
-> DeleteBackupSelectionResponse
$cfrom :: forall x.
DeleteBackupSelectionResponse
-> Rep DeleteBackupSelectionResponse x
Prelude.Generic)
newDeleteBackupSelectionResponse ::
DeleteBackupSelectionResponse
newDeleteBackupSelectionResponse :: DeleteBackupSelectionResponse
newDeleteBackupSelectionResponse =
DeleteBackupSelectionResponse
DeleteBackupSelectionResponse'
instance Prelude.NFData DeleteBackupSelectionResponse