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