{-# 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.WorkDocs.DeleteCustomMetadata
(
DeleteCustomMetadata (..),
newDeleteCustomMetadata,
deleteCustomMetadata_authenticationToken,
deleteCustomMetadata_deleteAll,
deleteCustomMetadata_keys,
deleteCustomMetadata_versionId,
deleteCustomMetadata_resourceId,
DeleteCustomMetadataResponse (..),
newDeleteCustomMetadataResponse,
deleteCustomMetadataResponse_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.WorkDocs.Types
data DeleteCustomMetadata = DeleteCustomMetadata'
{
DeleteCustomMetadata -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
DeleteCustomMetadata -> Maybe Bool
deleteAll :: Prelude.Maybe Prelude.Bool,
DeleteCustomMetadata -> Maybe [Text]
keys :: Prelude.Maybe [Prelude.Text],
DeleteCustomMetadata -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
DeleteCustomMetadata -> Text
resourceId :: Prelude.Text
}
deriving (DeleteCustomMetadata -> DeleteCustomMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCustomMetadata -> DeleteCustomMetadata -> Bool
$c/= :: DeleteCustomMetadata -> DeleteCustomMetadata -> Bool
== :: DeleteCustomMetadata -> DeleteCustomMetadata -> Bool
$c== :: DeleteCustomMetadata -> DeleteCustomMetadata -> Bool
Prelude.Eq, Int -> DeleteCustomMetadata -> ShowS
[DeleteCustomMetadata] -> ShowS
DeleteCustomMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCustomMetadata] -> ShowS
$cshowList :: [DeleteCustomMetadata] -> ShowS
show :: DeleteCustomMetadata -> String
$cshow :: DeleteCustomMetadata -> String
showsPrec :: Int -> DeleteCustomMetadata -> ShowS
$cshowsPrec :: Int -> DeleteCustomMetadata -> ShowS
Prelude.Show, forall x. Rep DeleteCustomMetadata x -> DeleteCustomMetadata
forall x. DeleteCustomMetadata -> Rep DeleteCustomMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCustomMetadata x -> DeleteCustomMetadata
$cfrom :: forall x. DeleteCustomMetadata -> Rep DeleteCustomMetadata x
Prelude.Generic)
newDeleteCustomMetadata ::
Prelude.Text ->
DeleteCustomMetadata
newDeleteCustomMetadata :: Text -> DeleteCustomMetadata
newDeleteCustomMetadata Text
pResourceId_ =
DeleteCustomMetadata'
{ $sel:authenticationToken:DeleteCustomMetadata' :: Maybe (Sensitive Text)
authenticationToken =
forall a. Maybe a
Prelude.Nothing,
$sel:deleteAll:DeleteCustomMetadata' :: Maybe Bool
deleteAll = forall a. Maybe a
Prelude.Nothing,
$sel:keys:DeleteCustomMetadata' :: Maybe [Text]
keys = forall a. Maybe a
Prelude.Nothing,
$sel:versionId:DeleteCustomMetadata' :: Maybe Text
versionId = forall a. Maybe a
Prelude.Nothing,
$sel:resourceId:DeleteCustomMetadata' :: Text
resourceId = Text
pResourceId_
}
deleteCustomMetadata_authenticationToken :: Lens.Lens' DeleteCustomMetadata (Prelude.Maybe Prelude.Text)
deleteCustomMetadata_authenticationToken :: Lens' DeleteCustomMetadata (Maybe Text)
deleteCustomMetadata_authenticationToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomMetadata' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: DeleteCustomMetadata
s@DeleteCustomMetadata' {} Maybe (Sensitive Text)
a -> DeleteCustomMetadata
s {$sel:authenticationToken:DeleteCustomMetadata' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: DeleteCustomMetadata) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
deleteCustomMetadata_deleteAll :: Lens.Lens' DeleteCustomMetadata (Prelude.Maybe Prelude.Bool)
deleteCustomMetadata_deleteAll :: Lens' DeleteCustomMetadata (Maybe Bool)
deleteCustomMetadata_deleteAll = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomMetadata' {Maybe Bool
deleteAll :: Maybe Bool
$sel:deleteAll:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Bool
deleteAll} -> Maybe Bool
deleteAll) (\s :: DeleteCustomMetadata
s@DeleteCustomMetadata' {} Maybe Bool
a -> DeleteCustomMetadata
s {$sel:deleteAll:DeleteCustomMetadata' :: Maybe Bool
deleteAll = Maybe Bool
a} :: DeleteCustomMetadata)
deleteCustomMetadata_keys :: Lens.Lens' DeleteCustomMetadata (Prelude.Maybe [Prelude.Text])
deleteCustomMetadata_keys :: Lens' DeleteCustomMetadata (Maybe [Text])
deleteCustomMetadata_keys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomMetadata' {Maybe [Text]
keys :: Maybe [Text]
$sel:keys:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe [Text]
keys} -> Maybe [Text]
keys) (\s :: DeleteCustomMetadata
s@DeleteCustomMetadata' {} Maybe [Text]
a -> DeleteCustomMetadata
s {$sel:keys:DeleteCustomMetadata' :: Maybe [Text]
keys = Maybe [Text]
a} :: DeleteCustomMetadata) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteCustomMetadata_versionId :: Lens.Lens' DeleteCustomMetadata (Prelude.Maybe Prelude.Text)
deleteCustomMetadata_versionId :: Lens' DeleteCustomMetadata (Maybe Text)
deleteCustomMetadata_versionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomMetadata' {Maybe Text
versionId :: Maybe Text
$sel:versionId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: DeleteCustomMetadata
s@DeleteCustomMetadata' {} Maybe Text
a -> DeleteCustomMetadata
s {$sel:versionId:DeleteCustomMetadata' :: Maybe Text
versionId = Maybe Text
a} :: DeleteCustomMetadata)
deleteCustomMetadata_resourceId :: Lens.Lens' DeleteCustomMetadata Prelude.Text
deleteCustomMetadata_resourceId :: Lens' DeleteCustomMetadata Text
deleteCustomMetadata_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomMetadata' {Text
resourceId :: Text
$sel:resourceId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Text
resourceId} -> Text
resourceId) (\s :: DeleteCustomMetadata
s@DeleteCustomMetadata' {} Text
a -> DeleteCustomMetadata
s {$sel:resourceId:DeleteCustomMetadata' :: Text
resourceId = Text
a} :: DeleteCustomMetadata)
instance Core.AWSRequest DeleteCustomMetadata where
type
AWSResponse DeleteCustomMetadata =
DeleteCustomMetadataResponse
request :: (Service -> Service)
-> DeleteCustomMetadata -> Request DeleteCustomMetadata
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteCustomMetadata
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCustomMetadata)))
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 -> DeleteCustomMetadataResponse
DeleteCustomMetadataResponse'
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 DeleteCustomMetadata where
hashWithSalt :: Int -> DeleteCustomMetadata -> Int
hashWithSalt Int
_salt DeleteCustomMetadata' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Text
resourceId :: Text
versionId :: Maybe Text
keys :: Maybe [Text]
deleteAll :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:resourceId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Text
$sel:versionId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Text
$sel:keys:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe [Text]
$sel:deleteAll:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Bool
$sel:authenticationToken:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
authenticationToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteAll
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
keys
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
instance Prelude.NFData DeleteCustomMetadata where
rnf :: DeleteCustomMetadata -> ()
rnf DeleteCustomMetadata' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Text
resourceId :: Text
versionId :: Maybe Text
keys :: Maybe [Text]
deleteAll :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:resourceId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Text
$sel:versionId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Text
$sel:keys:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe [Text]
$sel:deleteAll:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Bool
$sel:authenticationToken:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
authenticationToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteAll
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
keys
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
instance Data.ToHeaders DeleteCustomMetadata where
toHeaders :: DeleteCustomMetadata -> ResponseHeaders
toHeaders DeleteCustomMetadata' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Text
resourceId :: Text
versionId :: Maybe Text
keys :: Maybe [Text]
deleteAll :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:resourceId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Text
$sel:versionId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Text
$sel:keys:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe [Text]
$sel:deleteAll:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Bool
$sel:authenticationToken:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Authentication" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe (Sensitive Text)
authenticationToken,
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/x-amz-json-1.1" :: Prelude.ByteString)
]
instance Data.ToPath DeleteCustomMetadata where
toPath :: DeleteCustomMetadata -> ByteString
toPath DeleteCustomMetadata' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Text
resourceId :: Text
versionId :: Maybe Text
keys :: Maybe [Text]
deleteAll :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:resourceId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Text
$sel:versionId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Text
$sel:keys:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe [Text]
$sel:deleteAll:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Bool
$sel:authenticationToken:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/api/v1/resources/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceId,
ByteString
"/customMetadata"
]
instance Data.ToQuery DeleteCustomMetadata where
toQuery :: DeleteCustomMetadata -> QueryString
toQuery DeleteCustomMetadata' {Maybe Bool
Maybe [Text]
Maybe Text
Maybe (Sensitive Text)
Text
resourceId :: Text
versionId :: Maybe Text
keys :: Maybe [Text]
deleteAll :: Maybe Bool
authenticationToken :: Maybe (Sensitive Text)
$sel:resourceId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Text
$sel:versionId:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Text
$sel:keys:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe [Text]
$sel:deleteAll:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe Bool
$sel:authenticationToken:DeleteCustomMetadata' :: DeleteCustomMetadata -> Maybe (Sensitive Text)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"deleteAll" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
deleteAll,
ByteString
"keys"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
keys),
ByteString
"versionId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
versionId
]
data DeleteCustomMetadataResponse = DeleteCustomMetadataResponse'
{
DeleteCustomMetadataResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteCustomMetadataResponse
-> DeleteCustomMetadataResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCustomMetadataResponse
-> DeleteCustomMetadataResponse -> Bool
$c/= :: DeleteCustomMetadataResponse
-> DeleteCustomMetadataResponse -> Bool
== :: DeleteCustomMetadataResponse
-> DeleteCustomMetadataResponse -> Bool
$c== :: DeleteCustomMetadataResponse
-> DeleteCustomMetadataResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCustomMetadataResponse]
ReadPrec DeleteCustomMetadataResponse
Int -> ReadS DeleteCustomMetadataResponse
ReadS [DeleteCustomMetadataResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCustomMetadataResponse]
$creadListPrec :: ReadPrec [DeleteCustomMetadataResponse]
readPrec :: ReadPrec DeleteCustomMetadataResponse
$creadPrec :: ReadPrec DeleteCustomMetadataResponse
readList :: ReadS [DeleteCustomMetadataResponse]
$creadList :: ReadS [DeleteCustomMetadataResponse]
readsPrec :: Int -> ReadS DeleteCustomMetadataResponse
$creadsPrec :: Int -> ReadS DeleteCustomMetadataResponse
Prelude.Read, Int -> DeleteCustomMetadataResponse -> ShowS
[DeleteCustomMetadataResponse] -> ShowS
DeleteCustomMetadataResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCustomMetadataResponse] -> ShowS
$cshowList :: [DeleteCustomMetadataResponse] -> ShowS
show :: DeleteCustomMetadataResponse -> String
$cshow :: DeleteCustomMetadataResponse -> String
showsPrec :: Int -> DeleteCustomMetadataResponse -> ShowS
$cshowsPrec :: Int -> DeleteCustomMetadataResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteCustomMetadataResponse x -> DeleteCustomMetadataResponse
forall x.
DeleteCustomMetadataResponse -> Rep DeleteCustomMetadataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCustomMetadataResponse x -> DeleteCustomMetadataResponse
$cfrom :: forall x.
DeleteCustomMetadataResponse -> Rep DeleteCustomMetadataResponse x
Prelude.Generic)
newDeleteCustomMetadataResponse ::
Prelude.Int ->
DeleteCustomMetadataResponse
newDeleteCustomMetadataResponse :: Int -> DeleteCustomMetadataResponse
newDeleteCustomMetadataResponse Int
pHttpStatus_ =
DeleteCustomMetadataResponse'
{ $sel:httpStatus:DeleteCustomMetadataResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteCustomMetadataResponse_httpStatus :: Lens.Lens' DeleteCustomMetadataResponse Prelude.Int
deleteCustomMetadataResponse_httpStatus :: Lens' DeleteCustomMetadataResponse Int
deleteCustomMetadataResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCustomMetadataResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCustomMetadataResponse' :: DeleteCustomMetadataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCustomMetadataResponse
s@DeleteCustomMetadataResponse' {} Int
a -> DeleteCustomMetadataResponse
s {$sel:httpStatus:DeleteCustomMetadataResponse' :: Int
httpStatus = Int
a} :: DeleteCustomMetadataResponse)
instance Prelude.NFData DeleteCustomMetadataResponse where
rnf :: DeleteCustomMetadataResponse -> ()
rnf DeleteCustomMetadataResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCustomMetadataResponse' :: DeleteCustomMetadataResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus