{-# 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.WorkSpacesWeb.DeletePortal
(
DeletePortal (..),
newDeletePortal,
deletePortal_portalArn,
DeletePortalResponse (..),
newDeletePortalResponse,
deletePortalResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkSpacesWeb.Types
data DeletePortal = DeletePortal'
{
DeletePortal -> Text
portalArn :: Prelude.Text
}
deriving (DeletePortal -> DeletePortal -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePortal -> DeletePortal -> Bool
$c/= :: DeletePortal -> DeletePortal -> Bool
== :: DeletePortal -> DeletePortal -> Bool
$c== :: DeletePortal -> DeletePortal -> Bool
Prelude.Eq, ReadPrec [DeletePortal]
ReadPrec DeletePortal
Int -> ReadS DeletePortal
ReadS [DeletePortal]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePortal]
$creadListPrec :: ReadPrec [DeletePortal]
readPrec :: ReadPrec DeletePortal
$creadPrec :: ReadPrec DeletePortal
readList :: ReadS [DeletePortal]
$creadList :: ReadS [DeletePortal]
readsPrec :: Int -> ReadS DeletePortal
$creadsPrec :: Int -> ReadS DeletePortal
Prelude.Read, Int -> DeletePortal -> ShowS
[DeletePortal] -> ShowS
DeletePortal -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePortal] -> ShowS
$cshowList :: [DeletePortal] -> ShowS
show :: DeletePortal -> String
$cshow :: DeletePortal -> String
showsPrec :: Int -> DeletePortal -> ShowS
$cshowsPrec :: Int -> DeletePortal -> ShowS
Prelude.Show, forall x. Rep DeletePortal x -> DeletePortal
forall x. DeletePortal -> Rep DeletePortal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePortal x -> DeletePortal
$cfrom :: forall x. DeletePortal -> Rep DeletePortal x
Prelude.Generic)
newDeletePortal ::
Prelude.Text ->
DeletePortal
newDeletePortal :: Text -> DeletePortal
newDeletePortal Text
pPortalArn_ =
DeletePortal' {$sel:portalArn:DeletePortal' :: Text
portalArn = Text
pPortalArn_}
deletePortal_portalArn :: Lens.Lens' DeletePortal Prelude.Text
deletePortal_portalArn :: Lens' DeletePortal Text
deletePortal_portalArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePortal' {Text
portalArn :: Text
$sel:portalArn:DeletePortal' :: DeletePortal -> Text
portalArn} -> Text
portalArn) (\s :: DeletePortal
s@DeletePortal' {} Text
a -> DeletePortal
s {$sel:portalArn:DeletePortal' :: Text
portalArn = Text
a} :: DeletePortal)
instance Core.AWSRequest DeletePortal where
type AWSResponse DeletePortal = DeletePortalResponse
request :: (Service -> Service) -> DeletePortal -> Request DeletePortal
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeletePortal
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeletePortal)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeletePortalResponse
DeletePortalResponse'
forall (f :: * -> *) a b. Functor 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 DeletePortal where
hashWithSalt :: Int -> DeletePortal -> Int
hashWithSalt Int
_salt DeletePortal' {Text
portalArn :: Text
$sel:portalArn:DeletePortal' :: DeletePortal -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portalArn
instance Prelude.NFData DeletePortal where
rnf :: DeletePortal -> ()
rnf DeletePortal' {Text
portalArn :: Text
$sel:portalArn:DeletePortal' :: DeletePortal -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
portalArn
instance Data.ToHeaders DeletePortal where
toHeaders :: DeletePortal -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeletePortal where
toPath :: DeletePortal -> ByteString
toPath DeletePortal' {Text
portalArn :: Text
$sel:portalArn:DeletePortal' :: DeletePortal -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/portals/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
portalArn]
instance Data.ToQuery DeletePortal where
toQuery :: DeletePortal -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeletePortalResponse = DeletePortalResponse'
{
DeletePortalResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeletePortalResponse -> DeletePortalResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePortalResponse -> DeletePortalResponse -> Bool
$c/= :: DeletePortalResponse -> DeletePortalResponse -> Bool
== :: DeletePortalResponse -> DeletePortalResponse -> Bool
$c== :: DeletePortalResponse -> DeletePortalResponse -> Bool
Prelude.Eq, ReadPrec [DeletePortalResponse]
ReadPrec DeletePortalResponse
Int -> ReadS DeletePortalResponse
ReadS [DeletePortalResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePortalResponse]
$creadListPrec :: ReadPrec [DeletePortalResponse]
readPrec :: ReadPrec DeletePortalResponse
$creadPrec :: ReadPrec DeletePortalResponse
readList :: ReadS [DeletePortalResponse]
$creadList :: ReadS [DeletePortalResponse]
readsPrec :: Int -> ReadS DeletePortalResponse
$creadsPrec :: Int -> ReadS DeletePortalResponse
Prelude.Read, Int -> DeletePortalResponse -> ShowS
[DeletePortalResponse] -> ShowS
DeletePortalResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePortalResponse] -> ShowS
$cshowList :: [DeletePortalResponse] -> ShowS
show :: DeletePortalResponse -> String
$cshow :: DeletePortalResponse -> String
showsPrec :: Int -> DeletePortalResponse -> ShowS
$cshowsPrec :: Int -> DeletePortalResponse -> ShowS
Prelude.Show, forall x. Rep DeletePortalResponse x -> DeletePortalResponse
forall x. DeletePortalResponse -> Rep DeletePortalResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePortalResponse x -> DeletePortalResponse
$cfrom :: forall x. DeletePortalResponse -> Rep DeletePortalResponse x
Prelude.Generic)
newDeletePortalResponse ::
Prelude.Int ->
DeletePortalResponse
newDeletePortalResponse :: Int -> DeletePortalResponse
newDeletePortalResponse Int
pHttpStatus_ =
DeletePortalResponse' {$sel:httpStatus:DeletePortalResponse' :: Int
httpStatus = Int
pHttpStatus_}
deletePortalResponse_httpStatus :: Lens.Lens' DeletePortalResponse Prelude.Int
deletePortalResponse_httpStatus :: Lens' DeletePortalResponse Int
deletePortalResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePortalResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePortalResponse' :: DeletePortalResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeletePortalResponse
s@DeletePortalResponse' {} Int
a -> DeletePortalResponse
s {$sel:httpStatus:DeletePortalResponse' :: Int
httpStatus = Int
a} :: DeletePortalResponse)
instance Prelude.NFData DeletePortalResponse where
rnf :: DeletePortalResponse -> ()
rnf DeletePortalResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePortalResponse' :: DeletePortalResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus