{-# 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.Panorama.DeletePackage
(
DeletePackage (..),
newDeletePackage,
deletePackage_forceDelete,
deletePackage_packageId,
DeletePackageResponse (..),
newDeletePackageResponse,
deletePackageResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeletePackage = DeletePackage'
{
DeletePackage -> Maybe Bool
forceDelete :: Prelude.Maybe Prelude.Bool,
DeletePackage -> Text
packageId :: Prelude.Text
}
deriving (DeletePackage -> DeletePackage -> Bool
(DeletePackage -> DeletePackage -> Bool)
-> (DeletePackage -> DeletePackage -> Bool) -> Eq DeletePackage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePackage -> DeletePackage -> Bool
$c/= :: DeletePackage -> DeletePackage -> Bool
== :: DeletePackage -> DeletePackage -> Bool
$c== :: DeletePackage -> DeletePackage -> Bool
Prelude.Eq, ReadPrec [DeletePackage]
ReadPrec DeletePackage
Int -> ReadS DeletePackage
ReadS [DeletePackage]
(Int -> ReadS DeletePackage)
-> ReadS [DeletePackage]
-> ReadPrec DeletePackage
-> ReadPrec [DeletePackage]
-> Read DeletePackage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePackage]
$creadListPrec :: ReadPrec [DeletePackage]
readPrec :: ReadPrec DeletePackage
$creadPrec :: ReadPrec DeletePackage
readList :: ReadS [DeletePackage]
$creadList :: ReadS [DeletePackage]
readsPrec :: Int -> ReadS DeletePackage
$creadsPrec :: Int -> ReadS DeletePackage
Prelude.Read, Int -> DeletePackage -> ShowS
[DeletePackage] -> ShowS
DeletePackage -> String
(Int -> DeletePackage -> ShowS)
-> (DeletePackage -> String)
-> ([DeletePackage] -> ShowS)
-> Show DeletePackage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePackage] -> ShowS
$cshowList :: [DeletePackage] -> ShowS
show :: DeletePackage -> String
$cshow :: DeletePackage -> String
showsPrec :: Int -> DeletePackage -> ShowS
$cshowsPrec :: Int -> DeletePackage -> ShowS
Prelude.Show, (forall x. DeletePackage -> Rep DeletePackage x)
-> (forall x. Rep DeletePackage x -> DeletePackage)
-> Generic DeletePackage
forall x. Rep DeletePackage x -> DeletePackage
forall x. DeletePackage -> Rep DeletePackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePackage x -> DeletePackage
$cfrom :: forall x. DeletePackage -> Rep DeletePackage x
Prelude.Generic)
newDeletePackage ::
Prelude.Text ->
DeletePackage
newDeletePackage :: Text -> DeletePackage
newDeletePackage Text
pPackageId_ =
DeletePackage' :: Maybe Bool -> Text -> DeletePackage
DeletePackage'
{ $sel:forceDelete:DeletePackage' :: Maybe Bool
forceDelete = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:packageId:DeletePackage' :: Text
packageId = Text
pPackageId_
}
deletePackage_forceDelete :: Lens.Lens' DeletePackage (Prelude.Maybe Prelude.Bool)
deletePackage_forceDelete :: (Maybe Bool -> f (Maybe Bool)) -> DeletePackage -> f DeletePackage
deletePackage_forceDelete = (DeletePackage -> Maybe Bool)
-> (DeletePackage -> Maybe Bool -> DeletePackage)
-> Lens DeletePackage DeletePackage (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePackage' {Maybe Bool
forceDelete :: Maybe Bool
$sel:forceDelete:DeletePackage' :: DeletePackage -> Maybe Bool
forceDelete} -> Maybe Bool
forceDelete) (\s :: DeletePackage
s@DeletePackage' {} Maybe Bool
a -> DeletePackage
s {$sel:forceDelete:DeletePackage' :: Maybe Bool
forceDelete = Maybe Bool
a} :: DeletePackage)
deletePackage_packageId :: Lens.Lens' DeletePackage Prelude.Text
deletePackage_packageId :: (Text -> f Text) -> DeletePackage -> f DeletePackage
deletePackage_packageId = (DeletePackage -> Text)
-> (DeletePackage -> Text -> DeletePackage)
-> Lens DeletePackage DeletePackage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePackage' {Text
packageId :: Text
$sel:packageId:DeletePackage' :: DeletePackage -> Text
packageId} -> Text
packageId) (\s :: DeletePackage
s@DeletePackage' {} Text
a -> DeletePackage
s {$sel:packageId:DeletePackage' :: Text
packageId = Text
a} :: DeletePackage)
instance Core.AWSRequest DeletePackage where
type
AWSResponse DeletePackage =
DeletePackageResponse
request :: DeletePackage -> Request DeletePackage
request = Service -> DeletePackage -> Request DeletePackage
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeletePackage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePackage)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeletePackage))
-> Logger
-> Service
-> Proxy DeletePackage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePackage)))
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 -> DeletePackageResponse
DeletePackageResponse'
(Int -> DeletePackageResponse)
-> Either String Int -> Either String DeletePackageResponse
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 DeletePackage
instance Prelude.NFData DeletePackage
instance Core.ToHeaders DeletePackage where
toHeaders :: DeletePackage -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeletePackage -> 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 DeletePackage where
toPath :: DeletePackage -> ByteString
toPath DeletePackage' {Maybe Bool
Text
packageId :: Text
forceDelete :: Maybe Bool
$sel:packageId:DeletePackage' :: DeletePackage -> Text
$sel:forceDelete:DeletePackage' :: DeletePackage -> Maybe Bool
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/packages/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
packageId]
instance Core.ToQuery DeletePackage where
toQuery :: DeletePackage -> QueryString
toQuery DeletePackage' {Maybe Bool
Text
packageId :: Text
forceDelete :: Maybe Bool
$sel:packageId:DeletePackage' :: DeletePackage -> Text
$sel:forceDelete:DeletePackage' :: DeletePackage -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"ForceDelete" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
forceDelete]
data DeletePackageResponse = DeletePackageResponse'
{
DeletePackageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeletePackageResponse -> DeletePackageResponse -> Bool
(DeletePackageResponse -> DeletePackageResponse -> Bool)
-> (DeletePackageResponse -> DeletePackageResponse -> Bool)
-> Eq DeletePackageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePackageResponse -> DeletePackageResponse -> Bool
$c/= :: DeletePackageResponse -> DeletePackageResponse -> Bool
== :: DeletePackageResponse -> DeletePackageResponse -> Bool
$c== :: DeletePackageResponse -> DeletePackageResponse -> Bool
Prelude.Eq, ReadPrec [DeletePackageResponse]
ReadPrec DeletePackageResponse
Int -> ReadS DeletePackageResponse
ReadS [DeletePackageResponse]
(Int -> ReadS DeletePackageResponse)
-> ReadS [DeletePackageResponse]
-> ReadPrec DeletePackageResponse
-> ReadPrec [DeletePackageResponse]
-> Read DeletePackageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePackageResponse]
$creadListPrec :: ReadPrec [DeletePackageResponse]
readPrec :: ReadPrec DeletePackageResponse
$creadPrec :: ReadPrec DeletePackageResponse
readList :: ReadS [DeletePackageResponse]
$creadList :: ReadS [DeletePackageResponse]
readsPrec :: Int -> ReadS DeletePackageResponse
$creadsPrec :: Int -> ReadS DeletePackageResponse
Prelude.Read, Int -> DeletePackageResponse -> ShowS
[DeletePackageResponse] -> ShowS
DeletePackageResponse -> String
(Int -> DeletePackageResponse -> ShowS)
-> (DeletePackageResponse -> String)
-> ([DeletePackageResponse] -> ShowS)
-> Show DeletePackageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePackageResponse] -> ShowS
$cshowList :: [DeletePackageResponse] -> ShowS
show :: DeletePackageResponse -> String
$cshow :: DeletePackageResponse -> String
showsPrec :: Int -> DeletePackageResponse -> ShowS
$cshowsPrec :: Int -> DeletePackageResponse -> ShowS
Prelude.Show, (forall x. DeletePackageResponse -> Rep DeletePackageResponse x)
-> (forall x. Rep DeletePackageResponse x -> DeletePackageResponse)
-> Generic DeletePackageResponse
forall x. Rep DeletePackageResponse x -> DeletePackageResponse
forall x. DeletePackageResponse -> Rep DeletePackageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePackageResponse x -> DeletePackageResponse
$cfrom :: forall x. DeletePackageResponse -> Rep DeletePackageResponse x
Prelude.Generic)
newDeletePackageResponse ::
Prelude.Int ->
DeletePackageResponse
newDeletePackageResponse :: Int -> DeletePackageResponse
newDeletePackageResponse Int
pHttpStatus_ =
DeletePackageResponse' :: Int -> DeletePackageResponse
DeletePackageResponse' {$sel:httpStatus:DeletePackageResponse' :: Int
httpStatus = Int
pHttpStatus_}
deletePackageResponse_httpStatus :: Lens.Lens' DeletePackageResponse Prelude.Int
deletePackageResponse_httpStatus :: (Int -> f Int) -> DeletePackageResponse -> f DeletePackageResponse
deletePackageResponse_httpStatus = (DeletePackageResponse -> Int)
-> (DeletePackageResponse -> Int -> DeletePackageResponse)
-> Lens DeletePackageResponse DeletePackageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePackageResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePackageResponse' :: DeletePackageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeletePackageResponse
s@DeletePackageResponse' {} Int
a -> DeletePackageResponse
s {$sel:httpStatus:DeletePackageResponse' :: Int
httpStatus = Int
a} :: DeletePackageResponse)
instance Prelude.NFData DeletePackageResponse