{-# 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.WorkMail.DeleteAlias
(
DeleteAlias (..),
newDeleteAlias,
deleteAlias_organizationId,
deleteAlias_entityId,
deleteAlias_alias,
DeleteAliasResponse (..),
newDeleteAliasResponse,
deleteAliasResponse_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.WorkMail.Types
data DeleteAlias = DeleteAlias'
{
DeleteAlias -> Text
organizationId :: Prelude.Text,
DeleteAlias -> Text
entityId :: Prelude.Text,
DeleteAlias -> Text
alias :: Prelude.Text
}
deriving (DeleteAlias -> DeleteAlias -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAlias -> DeleteAlias -> Bool
$c/= :: DeleteAlias -> DeleteAlias -> Bool
== :: DeleteAlias -> DeleteAlias -> Bool
$c== :: DeleteAlias -> DeleteAlias -> Bool
Prelude.Eq, ReadPrec [DeleteAlias]
ReadPrec DeleteAlias
Int -> ReadS DeleteAlias
ReadS [DeleteAlias]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAlias]
$creadListPrec :: ReadPrec [DeleteAlias]
readPrec :: ReadPrec DeleteAlias
$creadPrec :: ReadPrec DeleteAlias
readList :: ReadS [DeleteAlias]
$creadList :: ReadS [DeleteAlias]
readsPrec :: Int -> ReadS DeleteAlias
$creadsPrec :: Int -> ReadS DeleteAlias
Prelude.Read, Int -> DeleteAlias -> ShowS
[DeleteAlias] -> ShowS
DeleteAlias -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAlias] -> ShowS
$cshowList :: [DeleteAlias] -> ShowS
show :: DeleteAlias -> String
$cshow :: DeleteAlias -> String
showsPrec :: Int -> DeleteAlias -> ShowS
$cshowsPrec :: Int -> DeleteAlias -> ShowS
Prelude.Show, forall x. Rep DeleteAlias x -> DeleteAlias
forall x. DeleteAlias -> Rep DeleteAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAlias x -> DeleteAlias
$cfrom :: forall x. DeleteAlias -> Rep DeleteAlias x
Prelude.Generic)
newDeleteAlias ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteAlias
newDeleteAlias :: Text -> Text -> Text -> DeleteAlias
newDeleteAlias Text
pOrganizationId_ Text
pEntityId_ Text
pAlias_ =
DeleteAlias'
{ $sel:organizationId:DeleteAlias' :: Text
organizationId = Text
pOrganizationId_,
$sel:entityId:DeleteAlias' :: Text
entityId = Text
pEntityId_,
$sel:alias:DeleteAlias' :: Text
alias = Text
pAlias_
}
deleteAlias_organizationId :: Lens.Lens' DeleteAlias Prelude.Text
deleteAlias_organizationId :: Lens' DeleteAlias Text
deleteAlias_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlias' {Text
organizationId :: Text
$sel:organizationId:DeleteAlias' :: DeleteAlias -> Text
organizationId} -> Text
organizationId) (\s :: DeleteAlias
s@DeleteAlias' {} Text
a -> DeleteAlias
s {$sel:organizationId:DeleteAlias' :: Text
organizationId = Text
a} :: DeleteAlias)
deleteAlias_entityId :: Lens.Lens' DeleteAlias Prelude.Text
deleteAlias_entityId :: Lens' DeleteAlias Text
deleteAlias_entityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlias' {Text
entityId :: Text
$sel:entityId:DeleteAlias' :: DeleteAlias -> Text
entityId} -> Text
entityId) (\s :: DeleteAlias
s@DeleteAlias' {} Text
a -> DeleteAlias
s {$sel:entityId:DeleteAlias' :: Text
entityId = Text
a} :: DeleteAlias)
deleteAlias_alias :: Lens.Lens' DeleteAlias Prelude.Text
deleteAlias_alias :: Lens' DeleteAlias Text
deleteAlias_alias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAlias' {Text
alias :: Text
$sel:alias:DeleteAlias' :: DeleteAlias -> Text
alias} -> Text
alias) (\s :: DeleteAlias
s@DeleteAlias' {} Text
a -> DeleteAlias
s {$sel:alias:DeleteAlias' :: Text
alias = Text
a} :: DeleteAlias)
instance Core.AWSRequest DeleteAlias where
type AWSResponse DeleteAlias = DeleteAliasResponse
request :: (Service -> Service) -> DeleteAlias -> Request DeleteAlias
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAlias)))
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 -> DeleteAliasResponse
DeleteAliasResponse'
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 DeleteAlias where
hashWithSalt :: Int -> DeleteAlias -> Int
hashWithSalt Int
_salt DeleteAlias' {Text
alias :: Text
entityId :: Text
organizationId :: Text
$sel:alias:DeleteAlias' :: DeleteAlias -> Text
$sel:entityId:DeleteAlias' :: DeleteAlias -> Text
$sel:organizationId:DeleteAlias' :: DeleteAlias -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
entityId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alias
instance Prelude.NFData DeleteAlias where
rnf :: DeleteAlias -> ()
rnf DeleteAlias' {Text
alias :: Text
entityId :: Text
organizationId :: Text
$sel:alias:DeleteAlias' :: DeleteAlias -> Text
$sel:entityId:DeleteAlias' :: DeleteAlias -> Text
$sel:organizationId:DeleteAlias' :: DeleteAlias -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
entityId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alias
instance Data.ToHeaders DeleteAlias where
toHeaders :: DeleteAlias -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.DeleteAlias" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteAlias where
toJSON :: DeleteAlias -> Value
toJSON DeleteAlias' {Text
alias :: Text
entityId :: Text
organizationId :: Text
$sel:alias:DeleteAlias' :: DeleteAlias -> Text
$sel:entityId:DeleteAlias' :: DeleteAlias -> Text
$sel:organizationId:DeleteAlias' :: DeleteAlias -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
forall a. a -> Maybe a
Prelude.Just (Key
"EntityId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
entityId),
forall a. a -> Maybe a
Prelude.Just (Key
"Alias" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
alias)
]
)
instance Data.ToPath DeleteAlias where
toPath :: DeleteAlias -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteAlias where
toQuery :: DeleteAlias -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteAliasResponse = DeleteAliasResponse'
{
DeleteAliasResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteAliasResponse -> DeleteAliasResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAliasResponse -> DeleteAliasResponse -> Bool
$c/= :: DeleteAliasResponse -> DeleteAliasResponse -> Bool
== :: DeleteAliasResponse -> DeleteAliasResponse -> Bool
$c== :: DeleteAliasResponse -> DeleteAliasResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAliasResponse]
ReadPrec DeleteAliasResponse
Int -> ReadS DeleteAliasResponse
ReadS [DeleteAliasResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAliasResponse]
$creadListPrec :: ReadPrec [DeleteAliasResponse]
readPrec :: ReadPrec DeleteAliasResponse
$creadPrec :: ReadPrec DeleteAliasResponse
readList :: ReadS [DeleteAliasResponse]
$creadList :: ReadS [DeleteAliasResponse]
readsPrec :: Int -> ReadS DeleteAliasResponse
$creadsPrec :: Int -> ReadS DeleteAliasResponse
Prelude.Read, Int -> DeleteAliasResponse -> ShowS
[DeleteAliasResponse] -> ShowS
DeleteAliasResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAliasResponse] -> ShowS
$cshowList :: [DeleteAliasResponse] -> ShowS
show :: DeleteAliasResponse -> String
$cshow :: DeleteAliasResponse -> String
showsPrec :: Int -> DeleteAliasResponse -> ShowS
$cshowsPrec :: Int -> DeleteAliasResponse -> ShowS
Prelude.Show, forall x. Rep DeleteAliasResponse x -> DeleteAliasResponse
forall x. DeleteAliasResponse -> Rep DeleteAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAliasResponse x -> DeleteAliasResponse
$cfrom :: forall x. DeleteAliasResponse -> Rep DeleteAliasResponse x
Prelude.Generic)
newDeleteAliasResponse ::
Prelude.Int ->
DeleteAliasResponse
newDeleteAliasResponse :: Int -> DeleteAliasResponse
newDeleteAliasResponse Int
pHttpStatus_ =
DeleteAliasResponse' {$sel:httpStatus:DeleteAliasResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteAliasResponse_httpStatus :: Lens.Lens' DeleteAliasResponse Prelude.Int
deleteAliasResponse_httpStatus :: Lens' DeleteAliasResponse Int
deleteAliasResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAliasResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAliasResponse' :: DeleteAliasResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAliasResponse
s@DeleteAliasResponse' {} Int
a -> DeleteAliasResponse
s {$sel:httpStatus:DeleteAliasResponse' :: Int
httpStatus = Int
a} :: DeleteAliasResponse)
instance Prelude.NFData DeleteAliasResponse where
rnf :: DeleteAliasResponse -> ()
rnf DeleteAliasResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAliasResponse' :: DeleteAliasResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus