{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.WorkDocs.DeleteFolderContents
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the contents of the specified folder.
module Amazonka.WorkDocs.DeleteFolderContents
  ( -- * Creating a Request
    DeleteFolderContents (..),
    newDeleteFolderContents,

    -- * Request Lenses
    deleteFolderContents_authenticationToken,
    deleteFolderContents_folderId,

    -- * Destructuring the Response
    DeleteFolderContentsResponse (..),
    newDeleteFolderContentsResponse,
  )
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.WorkDocs.Types

-- | /See:/ 'newDeleteFolderContents' smart constructor.
data DeleteFolderContents = DeleteFolderContents'
  { -- | Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    DeleteFolderContents -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The ID of the folder.
    DeleteFolderContents -> Text
folderId :: Prelude.Text
  }
  deriving (DeleteFolderContents -> DeleteFolderContents -> Bool
(DeleteFolderContents -> DeleteFolderContents -> Bool)
-> (DeleteFolderContents -> DeleteFolderContents -> Bool)
-> Eq DeleteFolderContents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFolderContents -> DeleteFolderContents -> Bool
$c/= :: DeleteFolderContents -> DeleteFolderContents -> Bool
== :: DeleteFolderContents -> DeleteFolderContents -> Bool
$c== :: DeleteFolderContents -> DeleteFolderContents -> Bool
Prelude.Eq, Int -> DeleteFolderContents -> ShowS
[DeleteFolderContents] -> ShowS
DeleteFolderContents -> String
(Int -> DeleteFolderContents -> ShowS)
-> (DeleteFolderContents -> String)
-> ([DeleteFolderContents] -> ShowS)
-> Show DeleteFolderContents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFolderContents] -> ShowS
$cshowList :: [DeleteFolderContents] -> ShowS
show :: DeleteFolderContents -> String
$cshow :: DeleteFolderContents -> String
showsPrec :: Int -> DeleteFolderContents -> ShowS
$cshowsPrec :: Int -> DeleteFolderContents -> ShowS
Prelude.Show, (forall x. DeleteFolderContents -> Rep DeleteFolderContents x)
-> (forall x. Rep DeleteFolderContents x -> DeleteFolderContents)
-> Generic DeleteFolderContents
forall x. Rep DeleteFolderContents x -> DeleteFolderContents
forall x. DeleteFolderContents -> Rep DeleteFolderContents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFolderContents x -> DeleteFolderContents
$cfrom :: forall x. DeleteFolderContents -> Rep DeleteFolderContents x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFolderContents' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authenticationToken', 'deleteFolderContents_authenticationToken' - Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'folderId', 'deleteFolderContents_folderId' - The ID of the folder.
newDeleteFolderContents ::
  -- | 'folderId'
  Prelude.Text ->
  DeleteFolderContents
newDeleteFolderContents :: Text -> DeleteFolderContents
newDeleteFolderContents Text
pFolderId_ =
  DeleteFolderContents' :: Maybe (Sensitive Text) -> Text -> DeleteFolderContents
DeleteFolderContents'
    { $sel:authenticationToken:DeleteFolderContents' :: Maybe (Sensitive Text)
authenticationToken =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:folderId:DeleteFolderContents' :: Text
folderId = Text
pFolderId_
    }

-- | Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
deleteFolderContents_authenticationToken :: Lens.Lens' DeleteFolderContents (Prelude.Maybe Prelude.Text)
deleteFolderContents_authenticationToken :: (Maybe Text -> f (Maybe Text))
-> DeleteFolderContents -> f DeleteFolderContents
deleteFolderContents_authenticationToken = (DeleteFolderContents -> Maybe (Sensitive Text))
-> (DeleteFolderContents
    -> Maybe (Sensitive Text) -> DeleteFolderContents)
-> Lens
     DeleteFolderContents
     DeleteFolderContents
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolderContents' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:DeleteFolderContents' :: DeleteFolderContents -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: DeleteFolderContents
s@DeleteFolderContents' {} Maybe (Sensitive Text)
a -> DeleteFolderContents
s {$sel:authenticationToken:DeleteFolderContents' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: DeleteFolderContents) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> DeleteFolderContents -> f DeleteFolderContents)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> DeleteFolderContents
-> f DeleteFolderContents
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The ID of the folder.
deleteFolderContents_folderId :: Lens.Lens' DeleteFolderContents Prelude.Text
deleteFolderContents_folderId :: (Text -> f Text) -> DeleteFolderContents -> f DeleteFolderContents
deleteFolderContents_folderId = (DeleteFolderContents -> Text)
-> (DeleteFolderContents -> Text -> DeleteFolderContents)
-> Lens DeleteFolderContents DeleteFolderContents Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFolderContents' {Text
folderId :: Text
$sel:folderId:DeleteFolderContents' :: DeleteFolderContents -> Text
folderId} -> Text
folderId) (\s :: DeleteFolderContents
s@DeleteFolderContents' {} Text
a -> DeleteFolderContents
s {$sel:folderId:DeleteFolderContents' :: Text
folderId = Text
a} :: DeleteFolderContents)

instance Core.AWSRequest DeleteFolderContents where
  type
    AWSResponse DeleteFolderContents =
      DeleteFolderContentsResponse
  request :: DeleteFolderContents -> Request DeleteFolderContents
request = Service -> DeleteFolderContents -> Request DeleteFolderContents
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteFolderContents
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteFolderContents)))
response =
    AWSResponse DeleteFolderContents
-> Logger
-> Service
-> Proxy DeleteFolderContents
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteFolderContents)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteFolderContents
DeleteFolderContentsResponse
DeleteFolderContentsResponse'

instance Prelude.Hashable DeleteFolderContents

instance Prelude.NFData DeleteFolderContents

instance Core.ToHeaders DeleteFolderContents where
  toHeaders :: DeleteFolderContents -> [Header]
toHeaders DeleteFolderContents' {Maybe (Sensitive Text)
Text
folderId :: Text
authenticationToken :: Maybe (Sensitive Text)
$sel:folderId:DeleteFolderContents' :: DeleteFolderContents -> Text
$sel:authenticationToken:DeleteFolderContents' :: DeleteFolderContents -> Maybe (Sensitive Text)
..} =
    [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Authentication" HeaderName -> Maybe (Sensitive Text) -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe (Sensitive Text)
authenticationToken,
        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.ToPath DeleteFolderContents where
  toPath :: DeleteFolderContents -> ByteString
toPath DeleteFolderContents' {Maybe (Sensitive Text)
Text
folderId :: Text
authenticationToken :: Maybe (Sensitive Text)
$sel:folderId:DeleteFolderContents' :: DeleteFolderContents -> Text
$sel:authenticationToken:DeleteFolderContents' :: DeleteFolderContents -> Maybe (Sensitive Text)
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/api/v1/folders/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
folderId, ByteString
"/contents"]

instance Core.ToQuery DeleteFolderContents where
  toQuery :: DeleteFolderContents -> QueryString
toQuery = QueryString -> DeleteFolderContents -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteFolderContentsResponse' smart constructor.
data DeleteFolderContentsResponse = DeleteFolderContentsResponse'
  {
  }
  deriving (DeleteFolderContentsResponse
-> DeleteFolderContentsResponse -> Bool
(DeleteFolderContentsResponse
 -> DeleteFolderContentsResponse -> Bool)
-> (DeleteFolderContentsResponse
    -> DeleteFolderContentsResponse -> Bool)
-> Eq DeleteFolderContentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFolderContentsResponse
-> DeleteFolderContentsResponse -> Bool
$c/= :: DeleteFolderContentsResponse
-> DeleteFolderContentsResponse -> Bool
== :: DeleteFolderContentsResponse
-> DeleteFolderContentsResponse -> Bool
$c== :: DeleteFolderContentsResponse
-> DeleteFolderContentsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFolderContentsResponse]
ReadPrec DeleteFolderContentsResponse
Int -> ReadS DeleteFolderContentsResponse
ReadS [DeleteFolderContentsResponse]
(Int -> ReadS DeleteFolderContentsResponse)
-> ReadS [DeleteFolderContentsResponse]
-> ReadPrec DeleteFolderContentsResponse
-> ReadPrec [DeleteFolderContentsResponse]
-> Read DeleteFolderContentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFolderContentsResponse]
$creadListPrec :: ReadPrec [DeleteFolderContentsResponse]
readPrec :: ReadPrec DeleteFolderContentsResponse
$creadPrec :: ReadPrec DeleteFolderContentsResponse
readList :: ReadS [DeleteFolderContentsResponse]
$creadList :: ReadS [DeleteFolderContentsResponse]
readsPrec :: Int -> ReadS DeleteFolderContentsResponse
$creadsPrec :: Int -> ReadS DeleteFolderContentsResponse
Prelude.Read, Int -> DeleteFolderContentsResponse -> ShowS
[DeleteFolderContentsResponse] -> ShowS
DeleteFolderContentsResponse -> String
(Int -> DeleteFolderContentsResponse -> ShowS)
-> (DeleteFolderContentsResponse -> String)
-> ([DeleteFolderContentsResponse] -> ShowS)
-> Show DeleteFolderContentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFolderContentsResponse] -> ShowS
$cshowList :: [DeleteFolderContentsResponse] -> ShowS
show :: DeleteFolderContentsResponse -> String
$cshow :: DeleteFolderContentsResponse -> String
showsPrec :: Int -> DeleteFolderContentsResponse -> ShowS
$cshowsPrec :: Int -> DeleteFolderContentsResponse -> ShowS
Prelude.Show, (forall x.
 DeleteFolderContentsResponse -> Rep DeleteFolderContentsResponse x)
-> (forall x.
    Rep DeleteFolderContentsResponse x -> DeleteFolderContentsResponse)
-> Generic DeleteFolderContentsResponse
forall x.
Rep DeleteFolderContentsResponse x -> DeleteFolderContentsResponse
forall x.
DeleteFolderContentsResponse -> Rep DeleteFolderContentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteFolderContentsResponse x -> DeleteFolderContentsResponse
$cfrom :: forall x.
DeleteFolderContentsResponse -> Rep DeleteFolderContentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFolderContentsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newDeleteFolderContentsResponse ::
  DeleteFolderContentsResponse
newDeleteFolderContentsResponse :: DeleteFolderContentsResponse
newDeleteFolderContentsResponse =
  DeleteFolderContentsResponse
DeleteFolderContentsResponse'

instance Prelude.NFData DeleteFolderContentsResponse