{-# 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.WorkSpaces.DeleteConnectionAlias
(
DeleteConnectionAlias (..),
newDeleteConnectionAlias,
deleteConnectionAlias_aliasId,
DeleteConnectionAliasResponse (..),
newDeleteConnectionAliasResponse,
deleteConnectionAliasResponse_httpStatus,
)
where
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
import Amazonka.WorkSpaces.Types
data DeleteConnectionAlias = DeleteConnectionAlias'
{
DeleteConnectionAlias -> Text
aliasId :: Prelude.Text
}
deriving (DeleteConnectionAlias -> DeleteConnectionAlias -> Bool
(DeleteConnectionAlias -> DeleteConnectionAlias -> Bool)
-> (DeleteConnectionAlias -> DeleteConnectionAlias -> Bool)
-> Eq DeleteConnectionAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnectionAlias -> DeleteConnectionAlias -> Bool
$c/= :: DeleteConnectionAlias -> DeleteConnectionAlias -> Bool
== :: DeleteConnectionAlias -> DeleteConnectionAlias -> Bool
$c== :: DeleteConnectionAlias -> DeleteConnectionAlias -> Bool
Prelude.Eq, ReadPrec [DeleteConnectionAlias]
ReadPrec DeleteConnectionAlias
Int -> ReadS DeleteConnectionAlias
ReadS [DeleteConnectionAlias]
(Int -> ReadS DeleteConnectionAlias)
-> ReadS [DeleteConnectionAlias]
-> ReadPrec DeleteConnectionAlias
-> ReadPrec [DeleteConnectionAlias]
-> Read DeleteConnectionAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnectionAlias]
$creadListPrec :: ReadPrec [DeleteConnectionAlias]
readPrec :: ReadPrec DeleteConnectionAlias
$creadPrec :: ReadPrec DeleteConnectionAlias
readList :: ReadS [DeleteConnectionAlias]
$creadList :: ReadS [DeleteConnectionAlias]
readsPrec :: Int -> ReadS DeleteConnectionAlias
$creadsPrec :: Int -> ReadS DeleteConnectionAlias
Prelude.Read, Int -> DeleteConnectionAlias -> ShowS
[DeleteConnectionAlias] -> ShowS
DeleteConnectionAlias -> String
(Int -> DeleteConnectionAlias -> ShowS)
-> (DeleteConnectionAlias -> String)
-> ([DeleteConnectionAlias] -> ShowS)
-> Show DeleteConnectionAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnectionAlias] -> ShowS
$cshowList :: [DeleteConnectionAlias] -> ShowS
show :: DeleteConnectionAlias -> String
$cshow :: DeleteConnectionAlias -> String
showsPrec :: Int -> DeleteConnectionAlias -> ShowS
$cshowsPrec :: Int -> DeleteConnectionAlias -> ShowS
Prelude.Show, (forall x. DeleteConnectionAlias -> Rep DeleteConnectionAlias x)
-> (forall x. Rep DeleteConnectionAlias x -> DeleteConnectionAlias)
-> Generic DeleteConnectionAlias
forall x. Rep DeleteConnectionAlias x -> DeleteConnectionAlias
forall x. DeleteConnectionAlias -> Rep DeleteConnectionAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteConnectionAlias x -> DeleteConnectionAlias
$cfrom :: forall x. DeleteConnectionAlias -> Rep DeleteConnectionAlias x
Prelude.Generic)
newDeleteConnectionAlias ::
Prelude.Text ->
DeleteConnectionAlias
newDeleteConnectionAlias :: Text -> DeleteConnectionAlias
newDeleteConnectionAlias Text
pAliasId_ =
DeleteConnectionAlias' :: Text -> DeleteConnectionAlias
DeleteConnectionAlias' {$sel:aliasId:DeleteConnectionAlias' :: Text
aliasId = Text
pAliasId_}
deleteConnectionAlias_aliasId :: Lens.Lens' DeleteConnectionAlias Prelude.Text
deleteConnectionAlias_aliasId :: (Text -> f Text)
-> DeleteConnectionAlias -> f DeleteConnectionAlias
deleteConnectionAlias_aliasId = (DeleteConnectionAlias -> Text)
-> (DeleteConnectionAlias -> Text -> DeleteConnectionAlias)
-> Lens DeleteConnectionAlias DeleteConnectionAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionAlias' {Text
aliasId :: Text
$sel:aliasId:DeleteConnectionAlias' :: DeleteConnectionAlias -> Text
aliasId} -> Text
aliasId) (\s :: DeleteConnectionAlias
s@DeleteConnectionAlias' {} Text
a -> DeleteConnectionAlias
s {$sel:aliasId:DeleteConnectionAlias' :: Text
aliasId = Text
a} :: DeleteConnectionAlias)
instance Core.AWSRequest DeleteConnectionAlias where
type
AWSResponse DeleteConnectionAlias =
DeleteConnectionAliasResponse
request :: DeleteConnectionAlias -> Request DeleteConnectionAlias
request = Service -> DeleteConnectionAlias -> Request DeleteConnectionAlias
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteConnectionAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteConnectionAlias)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteConnectionAlias))
-> Logger
-> Service
-> Proxy DeleteConnectionAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteConnectionAlias)))
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 -> DeleteConnectionAliasResponse
DeleteConnectionAliasResponse'
(Int -> DeleteConnectionAliasResponse)
-> Either String Int -> Either String DeleteConnectionAliasResponse
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 DeleteConnectionAlias
instance Prelude.NFData DeleteConnectionAlias
instance Core.ToHeaders DeleteConnectionAlias where
toHeaders :: DeleteConnectionAlias -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteConnectionAlias -> 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
"WorkspacesService.DeleteConnectionAlias" ::
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 DeleteConnectionAlias where
toJSON :: DeleteConnectionAlias -> Value
toJSON DeleteConnectionAlias' {Text
aliasId :: Text
$sel:aliasId:DeleteConnectionAlias' :: DeleteConnectionAlias -> 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
"AliasId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
aliasId)]
)
instance Core.ToPath DeleteConnectionAlias where
toPath :: DeleteConnectionAlias -> ByteString
toPath = ByteString -> DeleteConnectionAlias -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteConnectionAlias where
toQuery :: DeleteConnectionAlias -> QueryString
toQuery = QueryString -> DeleteConnectionAlias -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteConnectionAliasResponse = DeleteConnectionAliasResponse'
{
DeleteConnectionAliasResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool
(DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool)
-> (DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool)
-> Eq DeleteConnectionAliasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool
$c/= :: DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool
== :: DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool
$c== :: DeleteConnectionAliasResponse
-> DeleteConnectionAliasResponse -> Bool
Prelude.Eq, ReadPrec [DeleteConnectionAliasResponse]
ReadPrec DeleteConnectionAliasResponse
Int -> ReadS DeleteConnectionAliasResponse
ReadS [DeleteConnectionAliasResponse]
(Int -> ReadS DeleteConnectionAliasResponse)
-> ReadS [DeleteConnectionAliasResponse]
-> ReadPrec DeleteConnectionAliasResponse
-> ReadPrec [DeleteConnectionAliasResponse]
-> Read DeleteConnectionAliasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnectionAliasResponse]
$creadListPrec :: ReadPrec [DeleteConnectionAliasResponse]
readPrec :: ReadPrec DeleteConnectionAliasResponse
$creadPrec :: ReadPrec DeleteConnectionAliasResponse
readList :: ReadS [DeleteConnectionAliasResponse]
$creadList :: ReadS [DeleteConnectionAliasResponse]
readsPrec :: Int -> ReadS DeleteConnectionAliasResponse
$creadsPrec :: Int -> ReadS DeleteConnectionAliasResponse
Prelude.Read, Int -> DeleteConnectionAliasResponse -> ShowS
[DeleteConnectionAliasResponse] -> ShowS
DeleteConnectionAliasResponse -> String
(Int -> DeleteConnectionAliasResponse -> ShowS)
-> (DeleteConnectionAliasResponse -> String)
-> ([DeleteConnectionAliasResponse] -> ShowS)
-> Show DeleteConnectionAliasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnectionAliasResponse] -> ShowS
$cshowList :: [DeleteConnectionAliasResponse] -> ShowS
show :: DeleteConnectionAliasResponse -> String
$cshow :: DeleteConnectionAliasResponse -> String
showsPrec :: Int -> DeleteConnectionAliasResponse -> ShowS
$cshowsPrec :: Int -> DeleteConnectionAliasResponse -> ShowS
Prelude.Show, (forall x.
DeleteConnectionAliasResponse
-> Rep DeleteConnectionAliasResponse x)
-> (forall x.
Rep DeleteConnectionAliasResponse x
-> DeleteConnectionAliasResponse)
-> Generic DeleteConnectionAliasResponse
forall x.
Rep DeleteConnectionAliasResponse x
-> DeleteConnectionAliasResponse
forall x.
DeleteConnectionAliasResponse
-> Rep DeleteConnectionAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConnectionAliasResponse x
-> DeleteConnectionAliasResponse
$cfrom :: forall x.
DeleteConnectionAliasResponse
-> Rep DeleteConnectionAliasResponse x
Prelude.Generic)
newDeleteConnectionAliasResponse ::
Prelude.Int ->
DeleteConnectionAliasResponse
newDeleteConnectionAliasResponse :: Int -> DeleteConnectionAliasResponse
newDeleteConnectionAliasResponse Int
pHttpStatus_ =
DeleteConnectionAliasResponse' :: Int -> DeleteConnectionAliasResponse
DeleteConnectionAliasResponse'
{ $sel:httpStatus:DeleteConnectionAliasResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteConnectionAliasResponse_httpStatus :: Lens.Lens' DeleteConnectionAliasResponse Prelude.Int
deleteConnectionAliasResponse_httpStatus :: (Int -> f Int)
-> DeleteConnectionAliasResponse -> f DeleteConnectionAliasResponse
deleteConnectionAliasResponse_httpStatus = (DeleteConnectionAliasResponse -> Int)
-> (DeleteConnectionAliasResponse
-> Int -> DeleteConnectionAliasResponse)
-> Lens
DeleteConnectionAliasResponse DeleteConnectionAliasResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectionAliasResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConnectionAliasResponse' :: DeleteConnectionAliasResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteConnectionAliasResponse
s@DeleteConnectionAliasResponse' {} Int
a -> DeleteConnectionAliasResponse
s {$sel:httpStatus:DeleteConnectionAliasResponse' :: Int
httpStatus = Int
a} :: DeleteConnectionAliasResponse)
instance Prelude.NFData DeleteConnectionAliasResponse