{-# 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.Transfer.DeleteAccess
(
DeleteAccess (..),
newDeleteAccess,
deleteAccess_serverId,
deleteAccess_externalId,
DeleteAccessResponse (..),
newDeleteAccessResponse,
)
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.Transfer.Types
data DeleteAccess = DeleteAccess'
{
DeleteAccess -> Text
serverId :: Prelude.Text,
DeleteAccess -> Text
externalId :: Prelude.Text
}
deriving (DeleteAccess -> DeleteAccess -> Bool
(DeleteAccess -> DeleteAccess -> Bool)
-> (DeleteAccess -> DeleteAccess -> Bool) -> Eq DeleteAccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccess -> DeleteAccess -> Bool
$c/= :: DeleteAccess -> DeleteAccess -> Bool
== :: DeleteAccess -> DeleteAccess -> Bool
$c== :: DeleteAccess -> DeleteAccess -> Bool
Prelude.Eq, ReadPrec [DeleteAccess]
ReadPrec DeleteAccess
Int -> ReadS DeleteAccess
ReadS [DeleteAccess]
(Int -> ReadS DeleteAccess)
-> ReadS [DeleteAccess]
-> ReadPrec DeleteAccess
-> ReadPrec [DeleteAccess]
-> Read DeleteAccess
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccess]
$creadListPrec :: ReadPrec [DeleteAccess]
readPrec :: ReadPrec DeleteAccess
$creadPrec :: ReadPrec DeleteAccess
readList :: ReadS [DeleteAccess]
$creadList :: ReadS [DeleteAccess]
readsPrec :: Int -> ReadS DeleteAccess
$creadsPrec :: Int -> ReadS DeleteAccess
Prelude.Read, Int -> DeleteAccess -> ShowS
[DeleteAccess] -> ShowS
DeleteAccess -> String
(Int -> DeleteAccess -> ShowS)
-> (DeleteAccess -> String)
-> ([DeleteAccess] -> ShowS)
-> Show DeleteAccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccess] -> ShowS
$cshowList :: [DeleteAccess] -> ShowS
show :: DeleteAccess -> String
$cshow :: DeleteAccess -> String
showsPrec :: Int -> DeleteAccess -> ShowS
$cshowsPrec :: Int -> DeleteAccess -> ShowS
Prelude.Show, (forall x. DeleteAccess -> Rep DeleteAccess x)
-> (forall x. Rep DeleteAccess x -> DeleteAccess)
-> Generic DeleteAccess
forall x. Rep DeleteAccess x -> DeleteAccess
forall x. DeleteAccess -> Rep DeleteAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccess x -> DeleteAccess
$cfrom :: forall x. DeleteAccess -> Rep DeleteAccess x
Prelude.Generic)
newDeleteAccess ::
Prelude.Text ->
Prelude.Text ->
DeleteAccess
newDeleteAccess :: Text -> Text -> DeleteAccess
newDeleteAccess Text
pServerId_ Text
pExternalId_ =
DeleteAccess' :: Text -> Text -> DeleteAccess
DeleteAccess'
{ $sel:serverId:DeleteAccess' :: Text
serverId = Text
pServerId_,
$sel:externalId:DeleteAccess' :: Text
externalId = Text
pExternalId_
}
deleteAccess_serverId :: Lens.Lens' DeleteAccess Prelude.Text
deleteAccess_serverId :: (Text -> f Text) -> DeleteAccess -> f DeleteAccess
deleteAccess_serverId = (DeleteAccess -> Text)
-> (DeleteAccess -> Text -> DeleteAccess)
-> Lens DeleteAccess DeleteAccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccess' {Text
serverId :: Text
$sel:serverId:DeleteAccess' :: DeleteAccess -> Text
serverId} -> Text
serverId) (\s :: DeleteAccess
s@DeleteAccess' {} Text
a -> DeleteAccess
s {$sel:serverId:DeleteAccess' :: Text
serverId = Text
a} :: DeleteAccess)
deleteAccess_externalId :: Lens.Lens' DeleteAccess Prelude.Text
deleteAccess_externalId :: (Text -> f Text) -> DeleteAccess -> f DeleteAccess
deleteAccess_externalId = (DeleteAccess -> Text)
-> (DeleteAccess -> Text -> DeleteAccess)
-> Lens DeleteAccess DeleteAccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccess' {Text
externalId :: Text
$sel:externalId:DeleteAccess' :: DeleteAccess -> Text
externalId} -> Text
externalId) (\s :: DeleteAccess
s@DeleteAccess' {} Text
a -> DeleteAccess
s {$sel:externalId:DeleteAccess' :: Text
externalId = Text
a} :: DeleteAccess)
instance Core.AWSRequest DeleteAccess where
type AWSResponse DeleteAccess = DeleteAccessResponse
request :: DeleteAccess -> Request DeleteAccess
request = Service -> DeleteAccess -> Request DeleteAccess
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAccess
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAccess)))
response = AWSResponse DeleteAccess
-> Logger
-> Service
-> Proxy DeleteAccess
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAccess)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteAccess
DeleteAccessResponse
DeleteAccessResponse'
instance Prelude.Hashable DeleteAccess
instance Prelude.NFData DeleteAccess
instance Core.ToHeaders DeleteAccess where
toHeaders :: DeleteAccess -> [Header]
toHeaders =
[Header] -> DeleteAccess -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"TransferService.DeleteAccess" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteAccess where
toJSON :: DeleteAccess -> Value
toJSON DeleteAccess' {Text
externalId :: Text
serverId :: Text
$sel:externalId:DeleteAccess' :: DeleteAccess -> Text
$sel:serverId:DeleteAccess' :: DeleteAccess -> 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
"ServerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ExternalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
externalId)
]
)
instance Core.ToPath DeleteAccess where
toPath :: DeleteAccess -> ByteString
toPath = ByteString -> DeleteAccess -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteAccess where
toQuery :: DeleteAccess -> QueryString
toQuery = QueryString -> DeleteAccess -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAccessResponse = DeleteAccessResponse'
{
}
deriving (DeleteAccessResponse -> DeleteAccessResponse -> Bool
(DeleteAccessResponse -> DeleteAccessResponse -> Bool)
-> (DeleteAccessResponse -> DeleteAccessResponse -> Bool)
-> Eq DeleteAccessResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccessResponse -> DeleteAccessResponse -> Bool
$c/= :: DeleteAccessResponse -> DeleteAccessResponse -> Bool
== :: DeleteAccessResponse -> DeleteAccessResponse -> Bool
$c== :: DeleteAccessResponse -> DeleteAccessResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAccessResponse]
ReadPrec DeleteAccessResponse
Int -> ReadS DeleteAccessResponse
ReadS [DeleteAccessResponse]
(Int -> ReadS DeleteAccessResponse)
-> ReadS [DeleteAccessResponse]
-> ReadPrec DeleteAccessResponse
-> ReadPrec [DeleteAccessResponse]
-> Read DeleteAccessResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccessResponse]
$creadListPrec :: ReadPrec [DeleteAccessResponse]
readPrec :: ReadPrec DeleteAccessResponse
$creadPrec :: ReadPrec DeleteAccessResponse
readList :: ReadS [DeleteAccessResponse]
$creadList :: ReadS [DeleteAccessResponse]
readsPrec :: Int -> ReadS DeleteAccessResponse
$creadsPrec :: Int -> ReadS DeleteAccessResponse
Prelude.Read, Int -> DeleteAccessResponse -> ShowS
[DeleteAccessResponse] -> ShowS
DeleteAccessResponse -> String
(Int -> DeleteAccessResponse -> ShowS)
-> (DeleteAccessResponse -> String)
-> ([DeleteAccessResponse] -> ShowS)
-> Show DeleteAccessResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccessResponse] -> ShowS
$cshowList :: [DeleteAccessResponse] -> ShowS
show :: DeleteAccessResponse -> String
$cshow :: DeleteAccessResponse -> String
showsPrec :: Int -> DeleteAccessResponse -> ShowS
$cshowsPrec :: Int -> DeleteAccessResponse -> ShowS
Prelude.Show, (forall x. DeleteAccessResponse -> Rep DeleteAccessResponse x)
-> (forall x. Rep DeleteAccessResponse x -> DeleteAccessResponse)
-> Generic DeleteAccessResponse
forall x. Rep DeleteAccessResponse x -> DeleteAccessResponse
forall x. DeleteAccessResponse -> Rep DeleteAccessResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccessResponse x -> DeleteAccessResponse
$cfrom :: forall x. DeleteAccessResponse -> Rep DeleteAccessResponse x
Prelude.Generic)
newDeleteAccessResponse ::
DeleteAccessResponse
newDeleteAccessResponse :: DeleteAccessResponse
newDeleteAccessResponse = DeleteAccessResponse
DeleteAccessResponse'
instance Prelude.NFData DeleteAccessResponse