{-# 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.DeleteMobileDeviceAccessRule
(
DeleteMobileDeviceAccessRule (..),
newDeleteMobileDeviceAccessRule,
deleteMobileDeviceAccessRule_organizationId,
deleteMobileDeviceAccessRule_mobileDeviceAccessRuleId,
DeleteMobileDeviceAccessRuleResponse (..),
newDeleteMobileDeviceAccessRuleResponse,
deleteMobileDeviceAccessRuleResponse_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.WorkMail.Types
data DeleteMobileDeviceAccessRule = DeleteMobileDeviceAccessRule'
{
DeleteMobileDeviceAccessRule -> Text
organizationId :: Prelude.Text,
DeleteMobileDeviceAccessRule -> Text
mobileDeviceAccessRuleId :: Prelude.Text
}
deriving (DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool
(DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool)
-> (DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool)
-> Eq DeleteMobileDeviceAccessRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool
$c/= :: DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool
== :: DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool
$c== :: DeleteMobileDeviceAccessRule
-> DeleteMobileDeviceAccessRule -> Bool
Prelude.Eq, ReadPrec [DeleteMobileDeviceAccessRule]
ReadPrec DeleteMobileDeviceAccessRule
Int -> ReadS DeleteMobileDeviceAccessRule
ReadS [DeleteMobileDeviceAccessRule]
(Int -> ReadS DeleteMobileDeviceAccessRule)
-> ReadS [DeleteMobileDeviceAccessRule]
-> ReadPrec DeleteMobileDeviceAccessRule
-> ReadPrec [DeleteMobileDeviceAccessRule]
-> Read DeleteMobileDeviceAccessRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMobileDeviceAccessRule]
$creadListPrec :: ReadPrec [DeleteMobileDeviceAccessRule]
readPrec :: ReadPrec DeleteMobileDeviceAccessRule
$creadPrec :: ReadPrec DeleteMobileDeviceAccessRule
readList :: ReadS [DeleteMobileDeviceAccessRule]
$creadList :: ReadS [DeleteMobileDeviceAccessRule]
readsPrec :: Int -> ReadS DeleteMobileDeviceAccessRule
$creadsPrec :: Int -> ReadS DeleteMobileDeviceAccessRule
Prelude.Read, Int -> DeleteMobileDeviceAccessRule -> ShowS
[DeleteMobileDeviceAccessRule] -> ShowS
DeleteMobileDeviceAccessRule -> String
(Int -> DeleteMobileDeviceAccessRule -> ShowS)
-> (DeleteMobileDeviceAccessRule -> String)
-> ([DeleteMobileDeviceAccessRule] -> ShowS)
-> Show DeleteMobileDeviceAccessRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMobileDeviceAccessRule] -> ShowS
$cshowList :: [DeleteMobileDeviceAccessRule] -> ShowS
show :: DeleteMobileDeviceAccessRule -> String
$cshow :: DeleteMobileDeviceAccessRule -> String
showsPrec :: Int -> DeleteMobileDeviceAccessRule -> ShowS
$cshowsPrec :: Int -> DeleteMobileDeviceAccessRule -> ShowS
Prelude.Show, (forall x.
DeleteMobileDeviceAccessRule -> Rep DeleteMobileDeviceAccessRule x)
-> (forall x.
Rep DeleteMobileDeviceAccessRule x -> DeleteMobileDeviceAccessRule)
-> Generic DeleteMobileDeviceAccessRule
forall x.
Rep DeleteMobileDeviceAccessRule x -> DeleteMobileDeviceAccessRule
forall x.
DeleteMobileDeviceAccessRule -> Rep DeleteMobileDeviceAccessRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteMobileDeviceAccessRule x -> DeleteMobileDeviceAccessRule
$cfrom :: forall x.
DeleteMobileDeviceAccessRule -> Rep DeleteMobileDeviceAccessRule x
Prelude.Generic)
newDeleteMobileDeviceAccessRule ::
Prelude.Text ->
Prelude.Text ->
DeleteMobileDeviceAccessRule
newDeleteMobileDeviceAccessRule :: Text -> Text -> DeleteMobileDeviceAccessRule
newDeleteMobileDeviceAccessRule
Text
pOrganizationId_
Text
pMobileDeviceAccessRuleId_ =
DeleteMobileDeviceAccessRule' :: Text -> Text -> DeleteMobileDeviceAccessRule
DeleteMobileDeviceAccessRule'
{ $sel:organizationId:DeleteMobileDeviceAccessRule' :: Text
organizationId =
Text
pOrganizationId_,
$sel:mobileDeviceAccessRuleId:DeleteMobileDeviceAccessRule' :: Text
mobileDeviceAccessRuleId =
Text
pMobileDeviceAccessRuleId_
}
deleteMobileDeviceAccessRule_organizationId :: Lens.Lens' DeleteMobileDeviceAccessRule Prelude.Text
deleteMobileDeviceAccessRule_organizationId :: (Text -> f Text)
-> DeleteMobileDeviceAccessRule -> f DeleteMobileDeviceAccessRule
deleteMobileDeviceAccessRule_organizationId = (DeleteMobileDeviceAccessRule -> Text)
-> (DeleteMobileDeviceAccessRule
-> Text -> DeleteMobileDeviceAccessRule)
-> Lens
DeleteMobileDeviceAccessRule DeleteMobileDeviceAccessRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMobileDeviceAccessRule' {Text
organizationId :: Text
$sel:organizationId:DeleteMobileDeviceAccessRule' :: DeleteMobileDeviceAccessRule -> Text
organizationId} -> Text
organizationId) (\s :: DeleteMobileDeviceAccessRule
s@DeleteMobileDeviceAccessRule' {} Text
a -> DeleteMobileDeviceAccessRule
s {$sel:organizationId:DeleteMobileDeviceAccessRule' :: Text
organizationId = Text
a} :: DeleteMobileDeviceAccessRule)
deleteMobileDeviceAccessRule_mobileDeviceAccessRuleId :: Lens.Lens' DeleteMobileDeviceAccessRule Prelude.Text
deleteMobileDeviceAccessRule_mobileDeviceAccessRuleId :: (Text -> f Text)
-> DeleteMobileDeviceAccessRule -> f DeleteMobileDeviceAccessRule
deleteMobileDeviceAccessRule_mobileDeviceAccessRuleId = (DeleteMobileDeviceAccessRule -> Text)
-> (DeleteMobileDeviceAccessRule
-> Text -> DeleteMobileDeviceAccessRule)
-> Lens
DeleteMobileDeviceAccessRule DeleteMobileDeviceAccessRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMobileDeviceAccessRule' {Text
mobileDeviceAccessRuleId :: Text
$sel:mobileDeviceAccessRuleId:DeleteMobileDeviceAccessRule' :: DeleteMobileDeviceAccessRule -> Text
mobileDeviceAccessRuleId} -> Text
mobileDeviceAccessRuleId) (\s :: DeleteMobileDeviceAccessRule
s@DeleteMobileDeviceAccessRule' {} Text
a -> DeleteMobileDeviceAccessRule
s {$sel:mobileDeviceAccessRuleId:DeleteMobileDeviceAccessRule' :: Text
mobileDeviceAccessRuleId = Text
a} :: DeleteMobileDeviceAccessRule)
instance Core.AWSRequest DeleteMobileDeviceAccessRule where
type
AWSResponse DeleteMobileDeviceAccessRule =
DeleteMobileDeviceAccessRuleResponse
request :: DeleteMobileDeviceAccessRule
-> Request DeleteMobileDeviceAccessRule
request = Service
-> DeleteMobileDeviceAccessRule
-> Request DeleteMobileDeviceAccessRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteMobileDeviceAccessRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteMobileDeviceAccessRule)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteMobileDeviceAccessRule))
-> Logger
-> Service
-> Proxy DeleteMobileDeviceAccessRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteMobileDeviceAccessRule)))
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 -> DeleteMobileDeviceAccessRuleResponse
DeleteMobileDeviceAccessRuleResponse'
(Int -> DeleteMobileDeviceAccessRuleResponse)
-> Either String Int
-> Either String DeleteMobileDeviceAccessRuleResponse
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
DeleteMobileDeviceAccessRule
instance Prelude.NFData DeleteMobileDeviceAccessRule
instance Core.ToHeaders DeleteMobileDeviceAccessRule where
toHeaders :: DeleteMobileDeviceAccessRule -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteMobileDeviceAccessRule -> 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
"WorkMailService.DeleteMobileDeviceAccessRule" ::
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 DeleteMobileDeviceAccessRule where
toJSON :: DeleteMobileDeviceAccessRule -> Value
toJSON DeleteMobileDeviceAccessRule' {Text
mobileDeviceAccessRuleId :: Text
organizationId :: Text
$sel:mobileDeviceAccessRuleId:DeleteMobileDeviceAccessRule' :: DeleteMobileDeviceAccessRule -> Text
$sel:organizationId:DeleteMobileDeviceAccessRule' :: DeleteMobileDeviceAccessRule -> 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
"OrganizationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
organizationId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"MobileDeviceAccessRuleId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
mobileDeviceAccessRuleId
)
]
)
instance Core.ToPath DeleteMobileDeviceAccessRule where
toPath :: DeleteMobileDeviceAccessRule -> ByteString
toPath = ByteString -> DeleteMobileDeviceAccessRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteMobileDeviceAccessRule where
toQuery :: DeleteMobileDeviceAccessRule -> QueryString
toQuery = QueryString -> DeleteMobileDeviceAccessRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteMobileDeviceAccessRuleResponse = DeleteMobileDeviceAccessRuleResponse'
{
DeleteMobileDeviceAccessRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool
(DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool)
-> (DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool)
-> Eq DeleteMobileDeviceAccessRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool
$c/= :: DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool
== :: DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool
$c== :: DeleteMobileDeviceAccessRuleResponse
-> DeleteMobileDeviceAccessRuleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteMobileDeviceAccessRuleResponse]
ReadPrec DeleteMobileDeviceAccessRuleResponse
Int -> ReadS DeleteMobileDeviceAccessRuleResponse
ReadS [DeleteMobileDeviceAccessRuleResponse]
(Int -> ReadS DeleteMobileDeviceAccessRuleResponse)
-> ReadS [DeleteMobileDeviceAccessRuleResponse]
-> ReadPrec DeleteMobileDeviceAccessRuleResponse
-> ReadPrec [DeleteMobileDeviceAccessRuleResponse]
-> Read DeleteMobileDeviceAccessRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMobileDeviceAccessRuleResponse]
$creadListPrec :: ReadPrec [DeleteMobileDeviceAccessRuleResponse]
readPrec :: ReadPrec DeleteMobileDeviceAccessRuleResponse
$creadPrec :: ReadPrec DeleteMobileDeviceAccessRuleResponse
readList :: ReadS [DeleteMobileDeviceAccessRuleResponse]
$creadList :: ReadS [DeleteMobileDeviceAccessRuleResponse]
readsPrec :: Int -> ReadS DeleteMobileDeviceAccessRuleResponse
$creadsPrec :: Int -> ReadS DeleteMobileDeviceAccessRuleResponse
Prelude.Read, Int -> DeleteMobileDeviceAccessRuleResponse -> ShowS
[DeleteMobileDeviceAccessRuleResponse] -> ShowS
DeleteMobileDeviceAccessRuleResponse -> String
(Int -> DeleteMobileDeviceAccessRuleResponse -> ShowS)
-> (DeleteMobileDeviceAccessRuleResponse -> String)
-> ([DeleteMobileDeviceAccessRuleResponse] -> ShowS)
-> Show DeleteMobileDeviceAccessRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMobileDeviceAccessRuleResponse] -> ShowS
$cshowList :: [DeleteMobileDeviceAccessRuleResponse] -> ShowS
show :: DeleteMobileDeviceAccessRuleResponse -> String
$cshow :: DeleteMobileDeviceAccessRuleResponse -> String
showsPrec :: Int -> DeleteMobileDeviceAccessRuleResponse -> ShowS
$cshowsPrec :: Int -> DeleteMobileDeviceAccessRuleResponse -> ShowS
Prelude.Show, (forall x.
DeleteMobileDeviceAccessRuleResponse
-> Rep DeleteMobileDeviceAccessRuleResponse x)
-> (forall x.
Rep DeleteMobileDeviceAccessRuleResponse x
-> DeleteMobileDeviceAccessRuleResponse)
-> Generic DeleteMobileDeviceAccessRuleResponse
forall x.
Rep DeleteMobileDeviceAccessRuleResponse x
-> DeleteMobileDeviceAccessRuleResponse
forall x.
DeleteMobileDeviceAccessRuleResponse
-> Rep DeleteMobileDeviceAccessRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteMobileDeviceAccessRuleResponse x
-> DeleteMobileDeviceAccessRuleResponse
$cfrom :: forall x.
DeleteMobileDeviceAccessRuleResponse
-> Rep DeleteMobileDeviceAccessRuleResponse x
Prelude.Generic)
newDeleteMobileDeviceAccessRuleResponse ::
Prelude.Int ->
DeleteMobileDeviceAccessRuleResponse
newDeleteMobileDeviceAccessRuleResponse :: Int -> DeleteMobileDeviceAccessRuleResponse
newDeleteMobileDeviceAccessRuleResponse Int
pHttpStatus_ =
DeleteMobileDeviceAccessRuleResponse' :: Int -> DeleteMobileDeviceAccessRuleResponse
DeleteMobileDeviceAccessRuleResponse'
{ $sel:httpStatus:DeleteMobileDeviceAccessRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteMobileDeviceAccessRuleResponse_httpStatus :: Lens.Lens' DeleteMobileDeviceAccessRuleResponse Prelude.Int
deleteMobileDeviceAccessRuleResponse_httpStatus :: (Int -> f Int)
-> DeleteMobileDeviceAccessRuleResponse
-> f DeleteMobileDeviceAccessRuleResponse
deleteMobileDeviceAccessRuleResponse_httpStatus = (DeleteMobileDeviceAccessRuleResponse -> Int)
-> (DeleteMobileDeviceAccessRuleResponse
-> Int -> DeleteMobileDeviceAccessRuleResponse)
-> Lens
DeleteMobileDeviceAccessRuleResponse
DeleteMobileDeviceAccessRuleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMobileDeviceAccessRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteMobileDeviceAccessRuleResponse' :: DeleteMobileDeviceAccessRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteMobileDeviceAccessRuleResponse
s@DeleteMobileDeviceAccessRuleResponse' {} Int
a -> DeleteMobileDeviceAccessRuleResponse
s {$sel:httpStatus:DeleteMobileDeviceAccessRuleResponse' :: Int
httpStatus = Int
a} :: DeleteMobileDeviceAccessRuleResponse)
instance
Prelude.NFData
DeleteMobileDeviceAccessRuleResponse