{-# 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.CodeCommit.DeleteFile
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a specified file from a specified branch. A commit is created on
-- the branch that contains the revision. The file still exists in the
-- commits earlier to the commit that contains the deletion.
module Amazonka.CodeCommit.DeleteFile
  ( -- * Creating a Request
    DeleteFile (..),
    newDeleteFile,

    -- * Request Lenses
    deleteFile_commitMessage,
    deleteFile_email,
    deleteFile_keepEmptyFolders,
    deleteFile_name,
    deleteFile_repositoryName,
    deleteFile_branchName,
    deleteFile_filePath,
    deleteFile_parentCommitId,

    -- * Destructuring the Response
    DeleteFileResponse (..),
    newDeleteFileResponse,

    -- * Response Lenses
    deleteFileResponse_httpStatus,
    deleteFileResponse_commitId,
    deleteFileResponse_blobId,
    deleteFileResponse_treeId,
    deleteFileResponse_filePath,
  )
where

import Amazonka.CodeCommit.Types
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

-- | /See:/ 'newDeleteFile' smart constructor.
data DeleteFile = DeleteFile'
  { -- | The commit message you want to include as part of deleting the file.
    -- Commit messages are limited to 256 KB. If no message is specified, a
    -- default message is used.
    DeleteFile -> Maybe Text
commitMessage :: Prelude.Maybe Prelude.Text,
    -- | The email address for the commit that deletes the file. If no email
    -- address is specified, the email address is left blank.
    DeleteFile -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | If a file is the only object in the folder or directory, specifies
    -- whether to delete the folder or directory that contains the file. By
    -- default, empty folders are deleted. This includes empty folders that are
    -- part of the directory structure. For example, if the path to a file is
    -- dir1\/dir2\/dir3\/dir4, and dir2 and dir3 are empty, deleting the last
    -- file in dir4 also deletes the empty folders dir4, dir3, and dir2.
    DeleteFile -> Maybe Bool
keepEmptyFolders :: Prelude.Maybe Prelude.Bool,
    -- | The name of the author of the commit that deletes the file. If no name
    -- is specified, the user\'s ARN is used as the author name and committer
    -- name.
    DeleteFile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository that contains the file to delete.
    DeleteFile -> Text
repositoryName :: Prelude.Text,
    -- | The name of the branch where the commit that deletes the file is made.
    DeleteFile -> Text
branchName :: Prelude.Text,
    -- | The fully qualified path to the file that to be deleted, including the
    -- full name and extension of that file. For example, \/examples\/file.md
    -- is a fully qualified path to a file named file.md in a folder named
    -- examples.
    DeleteFile -> Text
filePath :: Prelude.Text,
    -- | The ID of the commit that is the tip of the branch where you want to
    -- create the commit that deletes the file. This must be the HEAD commit
    -- for the branch. The commit that deletes the file is created from this
    -- commit ID.
    DeleteFile -> Text
parentCommitId :: Prelude.Text
  }
  deriving (DeleteFile -> DeleteFile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFile -> DeleteFile -> Bool
$c/= :: DeleteFile -> DeleteFile -> Bool
== :: DeleteFile -> DeleteFile -> Bool
$c== :: DeleteFile -> DeleteFile -> Bool
Prelude.Eq, ReadPrec [DeleteFile]
ReadPrec DeleteFile
Int -> ReadS DeleteFile
ReadS [DeleteFile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFile]
$creadListPrec :: ReadPrec [DeleteFile]
readPrec :: ReadPrec DeleteFile
$creadPrec :: ReadPrec DeleteFile
readList :: ReadS [DeleteFile]
$creadList :: ReadS [DeleteFile]
readsPrec :: Int -> ReadS DeleteFile
$creadsPrec :: Int -> ReadS DeleteFile
Prelude.Read, Int -> DeleteFile -> ShowS
[DeleteFile] -> ShowS
DeleteFile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFile] -> ShowS
$cshowList :: [DeleteFile] -> ShowS
show :: DeleteFile -> String
$cshow :: DeleteFile -> String
showsPrec :: Int -> DeleteFile -> ShowS
$cshowsPrec :: Int -> DeleteFile -> ShowS
Prelude.Show, forall x. Rep DeleteFile x -> DeleteFile
forall x. DeleteFile -> Rep DeleteFile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFile x -> DeleteFile
$cfrom :: forall x. DeleteFile -> Rep DeleteFile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFile' 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:
--
-- 'commitMessage', 'deleteFile_commitMessage' - The commit message you want to include as part of deleting the file.
-- Commit messages are limited to 256 KB. If no message is specified, a
-- default message is used.
--
-- 'email', 'deleteFile_email' - The email address for the commit that deletes the file. If no email
-- address is specified, the email address is left blank.
--
-- 'keepEmptyFolders', 'deleteFile_keepEmptyFolders' - If a file is the only object in the folder or directory, specifies
-- whether to delete the folder or directory that contains the file. By
-- default, empty folders are deleted. This includes empty folders that are
-- part of the directory structure. For example, if the path to a file is
-- dir1\/dir2\/dir3\/dir4, and dir2 and dir3 are empty, deleting the last
-- file in dir4 also deletes the empty folders dir4, dir3, and dir2.
--
-- 'name', 'deleteFile_name' - The name of the author of the commit that deletes the file. If no name
-- is specified, the user\'s ARN is used as the author name and committer
-- name.
--
-- 'repositoryName', 'deleteFile_repositoryName' - The name of the repository that contains the file to delete.
--
-- 'branchName', 'deleteFile_branchName' - The name of the branch where the commit that deletes the file is made.
--
-- 'filePath', 'deleteFile_filePath' - The fully qualified path to the file that to be deleted, including the
-- full name and extension of that file. For example, \/examples\/file.md
-- is a fully qualified path to a file named file.md in a folder named
-- examples.
--
-- 'parentCommitId', 'deleteFile_parentCommitId' - The ID of the commit that is the tip of the branch where you want to
-- create the commit that deletes the file. This must be the HEAD commit
-- for the branch. The commit that deletes the file is created from this
-- commit ID.
newDeleteFile ::
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'branchName'
  Prelude.Text ->
  -- | 'filePath'
  Prelude.Text ->
  -- | 'parentCommitId'
  Prelude.Text ->
  DeleteFile
newDeleteFile :: Text -> Text -> Text -> Text -> DeleteFile
newDeleteFile
  Text
pRepositoryName_
  Text
pBranchName_
  Text
pFilePath_
  Text
pParentCommitId_ =
    DeleteFile'
      { $sel:commitMessage:DeleteFile' :: Maybe Text
commitMessage = forall a. Maybe a
Prelude.Nothing,
        $sel:email:DeleteFile' :: Maybe Text
email = forall a. Maybe a
Prelude.Nothing,
        $sel:keepEmptyFolders:DeleteFile' :: Maybe Bool
keepEmptyFolders = forall a. Maybe a
Prelude.Nothing,
        $sel:name:DeleteFile' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:repositoryName:DeleteFile' :: Text
repositoryName = Text
pRepositoryName_,
        $sel:branchName:DeleteFile' :: Text
branchName = Text
pBranchName_,
        $sel:filePath:DeleteFile' :: Text
filePath = Text
pFilePath_,
        $sel:parentCommitId:DeleteFile' :: Text
parentCommitId = Text
pParentCommitId_
      }

-- | The commit message you want to include as part of deleting the file.
-- Commit messages are limited to 256 KB. If no message is specified, a
-- default message is used.
deleteFile_commitMessage :: Lens.Lens' DeleteFile (Prelude.Maybe Prelude.Text)
deleteFile_commitMessage :: Lens' DeleteFile (Maybe Text)
deleteFile_commitMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Maybe Text
commitMessage :: Maybe Text
$sel:commitMessage:DeleteFile' :: DeleteFile -> Maybe Text
commitMessage} -> Maybe Text
commitMessage) (\s :: DeleteFile
s@DeleteFile' {} Maybe Text
a -> DeleteFile
s {$sel:commitMessage:DeleteFile' :: Maybe Text
commitMessage = Maybe Text
a} :: DeleteFile)

-- | The email address for the commit that deletes the file. If no email
-- address is specified, the email address is left blank.
deleteFile_email :: Lens.Lens' DeleteFile (Prelude.Maybe Prelude.Text)
deleteFile_email :: Lens' DeleteFile (Maybe Text)
deleteFile_email = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Maybe Text
email :: Maybe Text
$sel:email:DeleteFile' :: DeleteFile -> Maybe Text
email} -> Maybe Text
email) (\s :: DeleteFile
s@DeleteFile' {} Maybe Text
a -> DeleteFile
s {$sel:email:DeleteFile' :: Maybe Text
email = Maybe Text
a} :: DeleteFile)

-- | If a file is the only object in the folder or directory, specifies
-- whether to delete the folder or directory that contains the file. By
-- default, empty folders are deleted. This includes empty folders that are
-- part of the directory structure. For example, if the path to a file is
-- dir1\/dir2\/dir3\/dir4, and dir2 and dir3 are empty, deleting the last
-- file in dir4 also deletes the empty folders dir4, dir3, and dir2.
deleteFile_keepEmptyFolders :: Lens.Lens' DeleteFile (Prelude.Maybe Prelude.Bool)
deleteFile_keepEmptyFolders :: Lens' DeleteFile (Maybe Bool)
deleteFile_keepEmptyFolders = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Maybe Bool
keepEmptyFolders :: Maybe Bool
$sel:keepEmptyFolders:DeleteFile' :: DeleteFile -> Maybe Bool
keepEmptyFolders} -> Maybe Bool
keepEmptyFolders) (\s :: DeleteFile
s@DeleteFile' {} Maybe Bool
a -> DeleteFile
s {$sel:keepEmptyFolders:DeleteFile' :: Maybe Bool
keepEmptyFolders = Maybe Bool
a} :: DeleteFile)

-- | The name of the author of the commit that deletes the file. If no name
-- is specified, the user\'s ARN is used as the author name and committer
-- name.
deleteFile_name :: Lens.Lens' DeleteFile (Prelude.Maybe Prelude.Text)
deleteFile_name :: Lens' DeleteFile (Maybe Text)
deleteFile_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Maybe Text
name :: Maybe Text
$sel:name:DeleteFile' :: DeleteFile -> Maybe Text
name} -> Maybe Text
name) (\s :: DeleteFile
s@DeleteFile' {} Maybe Text
a -> DeleteFile
s {$sel:name:DeleteFile' :: Maybe Text
name = Maybe Text
a} :: DeleteFile)

-- | The name of the repository that contains the file to delete.
deleteFile_repositoryName :: Lens.Lens' DeleteFile Prelude.Text
deleteFile_repositoryName :: Lens' DeleteFile Text
deleteFile_repositoryName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Text
repositoryName :: Text
$sel:repositoryName:DeleteFile' :: DeleteFile -> Text
repositoryName} -> Text
repositoryName) (\s :: DeleteFile
s@DeleteFile' {} Text
a -> DeleteFile
s {$sel:repositoryName:DeleteFile' :: Text
repositoryName = Text
a} :: DeleteFile)

-- | The name of the branch where the commit that deletes the file is made.
deleteFile_branchName :: Lens.Lens' DeleteFile Prelude.Text
deleteFile_branchName :: Lens' DeleteFile Text
deleteFile_branchName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Text
branchName :: Text
$sel:branchName:DeleteFile' :: DeleteFile -> Text
branchName} -> Text
branchName) (\s :: DeleteFile
s@DeleteFile' {} Text
a -> DeleteFile
s {$sel:branchName:DeleteFile' :: Text
branchName = Text
a} :: DeleteFile)

-- | The fully qualified path to the file that to be deleted, including the
-- full name and extension of that file. For example, \/examples\/file.md
-- is a fully qualified path to a file named file.md in a folder named
-- examples.
deleteFile_filePath :: Lens.Lens' DeleteFile Prelude.Text
deleteFile_filePath :: Lens' DeleteFile Text
deleteFile_filePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Text
filePath :: Text
$sel:filePath:DeleteFile' :: DeleteFile -> Text
filePath} -> Text
filePath) (\s :: DeleteFile
s@DeleteFile' {} Text
a -> DeleteFile
s {$sel:filePath:DeleteFile' :: Text
filePath = Text
a} :: DeleteFile)

-- | The ID of the commit that is the tip of the branch where you want to
-- create the commit that deletes the file. This must be the HEAD commit
-- for the branch. The commit that deletes the file is created from this
-- commit ID.
deleteFile_parentCommitId :: Lens.Lens' DeleteFile Prelude.Text
deleteFile_parentCommitId :: Lens' DeleteFile Text
deleteFile_parentCommitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFile' {Text
parentCommitId :: Text
$sel:parentCommitId:DeleteFile' :: DeleteFile -> Text
parentCommitId} -> Text
parentCommitId) (\s :: DeleteFile
s@DeleteFile' {} Text
a -> DeleteFile
s {$sel:parentCommitId:DeleteFile' :: Text
parentCommitId = Text
a} :: DeleteFile)

instance Core.AWSRequest DeleteFile where
  type AWSResponse DeleteFile = DeleteFileResponse
  request :: (Service -> Service) -> DeleteFile -> Request DeleteFile
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteFile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteFile)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> Text -> Text -> Text -> DeleteFileResponse
DeleteFileResponse'
            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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"commitId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"blobId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"treeId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"filePath")
      )

instance Prelude.Hashable DeleteFile where
  hashWithSalt :: Int -> DeleteFile -> Int
hashWithSalt Int
_salt DeleteFile' {Maybe Bool
Maybe Text
Text
parentCommitId :: Text
filePath :: Text
branchName :: Text
repositoryName :: Text
name :: Maybe Text
keepEmptyFolders :: Maybe Bool
email :: Maybe Text
commitMessage :: Maybe Text
$sel:parentCommitId:DeleteFile' :: DeleteFile -> Text
$sel:filePath:DeleteFile' :: DeleteFile -> Text
$sel:branchName:DeleteFile' :: DeleteFile -> Text
$sel:repositoryName:DeleteFile' :: DeleteFile -> Text
$sel:name:DeleteFile' :: DeleteFile -> Maybe Text
$sel:keepEmptyFolders:DeleteFile' :: DeleteFile -> Maybe Bool
$sel:email:DeleteFile' :: DeleteFile -> Maybe Text
$sel:commitMessage:DeleteFile' :: DeleteFile -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
commitMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
email
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
keepEmptyFolders
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repositoryName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
branchName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
filePath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
parentCommitId

instance Prelude.NFData DeleteFile where
  rnf :: DeleteFile -> ()
rnf DeleteFile' {Maybe Bool
Maybe Text
Text
parentCommitId :: Text
filePath :: Text
branchName :: Text
repositoryName :: Text
name :: Maybe Text
keepEmptyFolders :: Maybe Bool
email :: Maybe Text
commitMessage :: Maybe Text
$sel:parentCommitId:DeleteFile' :: DeleteFile -> Text
$sel:filePath:DeleteFile' :: DeleteFile -> Text
$sel:branchName:DeleteFile' :: DeleteFile -> Text
$sel:repositoryName:DeleteFile' :: DeleteFile -> Text
$sel:name:DeleteFile' :: DeleteFile -> Maybe Text
$sel:keepEmptyFolders:DeleteFile' :: DeleteFile -> Maybe Bool
$sel:email:DeleteFile' :: DeleteFile -> Maybe Text
$sel:commitMessage:DeleteFile' :: DeleteFile -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
commitMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
email
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
keepEmptyFolders
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
repositoryName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
branchName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
filePath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
parentCommitId

instance Data.ToHeaders DeleteFile where
  toHeaders :: DeleteFile -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeCommit_20150413.DeleteFile" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteFile where
  toJSON :: DeleteFile -> Value
toJSON DeleteFile' {Maybe Bool
Maybe Text
Text
parentCommitId :: Text
filePath :: Text
branchName :: Text
repositoryName :: Text
name :: Maybe Text
keepEmptyFolders :: Maybe Bool
email :: Maybe Text
commitMessage :: Maybe Text
$sel:parentCommitId:DeleteFile' :: DeleteFile -> Text
$sel:filePath:DeleteFile' :: DeleteFile -> Text
$sel:branchName:DeleteFile' :: DeleteFile -> Text
$sel:repositoryName:DeleteFile' :: DeleteFile -> Text
$sel:name:DeleteFile' :: DeleteFile -> Maybe Text
$sel:keepEmptyFolders:DeleteFile' :: DeleteFile -> Maybe Bool
$sel:email:DeleteFile' :: DeleteFile -> Maybe Text
$sel:commitMessage:DeleteFile' :: DeleteFile -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"commitMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
commitMessage,
            (Key
"email" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
email,
            (Key
"keepEmptyFolders" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
keepEmptyFolders,
            (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"repositoryName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
repositoryName),
            forall a. a -> Maybe a
Prelude.Just (Key
"branchName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
branchName),
            forall a. a -> Maybe a
Prelude.Just (Key
"filePath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
filePath),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"parentCommitId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
parentCommitId)
          ]
      )

instance Data.ToPath DeleteFile where
  toPath :: DeleteFile -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDeleteFileResponse' smart constructor.
data DeleteFileResponse = DeleteFileResponse'
  { -- | The response's http status code.
    DeleteFileResponse -> Int
httpStatus :: Prelude.Int,
    -- | The full commit ID of the commit that contains the change that deletes
    -- the file.
    DeleteFileResponse -> Text
commitId :: Prelude.Text,
    -- | The blob ID removed from the tree as part of deleting the file.
    DeleteFileResponse -> Text
blobId :: Prelude.Text,
    -- | The full SHA-1 pointer of the tree information for the commit that
    -- contains the delete file change.
    DeleteFileResponse -> Text
treeId :: Prelude.Text,
    -- | The fully qualified path to the file to be deleted, including the full
    -- name and extension of that file.
    DeleteFileResponse -> Text
filePath :: Prelude.Text
  }
  deriving (DeleteFileResponse -> DeleteFileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFileResponse -> DeleteFileResponse -> Bool
$c/= :: DeleteFileResponse -> DeleteFileResponse -> Bool
== :: DeleteFileResponse -> DeleteFileResponse -> Bool
$c== :: DeleteFileResponse -> DeleteFileResponse -> Bool
Prelude.Eq, ReadPrec [DeleteFileResponse]
ReadPrec DeleteFileResponse
Int -> ReadS DeleteFileResponse
ReadS [DeleteFileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFileResponse]
$creadListPrec :: ReadPrec [DeleteFileResponse]
readPrec :: ReadPrec DeleteFileResponse
$creadPrec :: ReadPrec DeleteFileResponse
readList :: ReadS [DeleteFileResponse]
$creadList :: ReadS [DeleteFileResponse]
readsPrec :: Int -> ReadS DeleteFileResponse
$creadsPrec :: Int -> ReadS DeleteFileResponse
Prelude.Read, Int -> DeleteFileResponse -> ShowS
[DeleteFileResponse] -> ShowS
DeleteFileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFileResponse] -> ShowS
$cshowList :: [DeleteFileResponse] -> ShowS
show :: DeleteFileResponse -> String
$cshow :: DeleteFileResponse -> String
showsPrec :: Int -> DeleteFileResponse -> ShowS
$cshowsPrec :: Int -> DeleteFileResponse -> ShowS
Prelude.Show, forall x. Rep DeleteFileResponse x -> DeleteFileResponse
forall x. DeleteFileResponse -> Rep DeleteFileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFileResponse x -> DeleteFileResponse
$cfrom :: forall x. DeleteFileResponse -> Rep DeleteFileResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFileResponse' 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:
--
-- 'httpStatus', 'deleteFileResponse_httpStatus' - The response's http status code.
--
-- 'commitId', 'deleteFileResponse_commitId' - The full commit ID of the commit that contains the change that deletes
-- the file.
--
-- 'blobId', 'deleteFileResponse_blobId' - The blob ID removed from the tree as part of deleting the file.
--
-- 'treeId', 'deleteFileResponse_treeId' - The full SHA-1 pointer of the tree information for the commit that
-- contains the delete file change.
--
-- 'filePath', 'deleteFileResponse_filePath' - The fully qualified path to the file to be deleted, including the full
-- name and extension of that file.
newDeleteFileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'commitId'
  Prelude.Text ->
  -- | 'blobId'
  Prelude.Text ->
  -- | 'treeId'
  Prelude.Text ->
  -- | 'filePath'
  Prelude.Text ->
  DeleteFileResponse
newDeleteFileResponse :: Int -> Text -> Text -> Text -> Text -> DeleteFileResponse
newDeleteFileResponse
  Int
pHttpStatus_
  Text
pCommitId_
  Text
pBlobId_
  Text
pTreeId_
  Text
pFilePath_ =
    DeleteFileResponse'
      { $sel:httpStatus:DeleteFileResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:commitId:DeleteFileResponse' :: Text
commitId = Text
pCommitId_,
        $sel:blobId:DeleteFileResponse' :: Text
blobId = Text
pBlobId_,
        $sel:treeId:DeleteFileResponse' :: Text
treeId = Text
pTreeId_,
        $sel:filePath:DeleteFileResponse' :: Text
filePath = Text
pFilePath_
      }

-- | The response's http status code.
deleteFileResponse_httpStatus :: Lens.Lens' DeleteFileResponse Prelude.Int
deleteFileResponse_httpStatus :: Lens' DeleteFileResponse Int
deleteFileResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteFileResponse' :: DeleteFileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteFileResponse
s@DeleteFileResponse' {} Int
a -> DeleteFileResponse
s {$sel:httpStatus:DeleteFileResponse' :: Int
httpStatus = Int
a} :: DeleteFileResponse)

-- | The full commit ID of the commit that contains the change that deletes
-- the file.
deleteFileResponse_commitId :: Lens.Lens' DeleteFileResponse Prelude.Text
deleteFileResponse_commitId :: Lens' DeleteFileResponse Text
deleteFileResponse_commitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileResponse' {Text
commitId :: Text
$sel:commitId:DeleteFileResponse' :: DeleteFileResponse -> Text
commitId} -> Text
commitId) (\s :: DeleteFileResponse
s@DeleteFileResponse' {} Text
a -> DeleteFileResponse
s {$sel:commitId:DeleteFileResponse' :: Text
commitId = Text
a} :: DeleteFileResponse)

-- | The blob ID removed from the tree as part of deleting the file.
deleteFileResponse_blobId :: Lens.Lens' DeleteFileResponse Prelude.Text
deleteFileResponse_blobId :: Lens' DeleteFileResponse Text
deleteFileResponse_blobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileResponse' {Text
blobId :: Text
$sel:blobId:DeleteFileResponse' :: DeleteFileResponse -> Text
blobId} -> Text
blobId) (\s :: DeleteFileResponse
s@DeleteFileResponse' {} Text
a -> DeleteFileResponse
s {$sel:blobId:DeleteFileResponse' :: Text
blobId = Text
a} :: DeleteFileResponse)

-- | The full SHA-1 pointer of the tree information for the commit that
-- contains the delete file change.
deleteFileResponse_treeId :: Lens.Lens' DeleteFileResponse Prelude.Text
deleteFileResponse_treeId :: Lens' DeleteFileResponse Text
deleteFileResponse_treeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileResponse' {Text
treeId :: Text
$sel:treeId:DeleteFileResponse' :: DeleteFileResponse -> Text
treeId} -> Text
treeId) (\s :: DeleteFileResponse
s@DeleteFileResponse' {} Text
a -> DeleteFileResponse
s {$sel:treeId:DeleteFileResponse' :: Text
treeId = Text
a} :: DeleteFileResponse)

-- | The fully qualified path to the file to be deleted, including the full
-- name and extension of that file.
deleteFileResponse_filePath :: Lens.Lens' DeleteFileResponse Prelude.Text
deleteFileResponse_filePath :: Lens' DeleteFileResponse Text
deleteFileResponse_filePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteFileResponse' {Text
filePath :: Text
$sel:filePath:DeleteFileResponse' :: DeleteFileResponse -> Text
filePath} -> Text
filePath) (\s :: DeleteFileResponse
s@DeleteFileResponse' {} Text
a -> DeleteFileResponse
s {$sel:filePath:DeleteFileResponse' :: Text
filePath = Text
a} :: DeleteFileResponse)

instance Prelude.NFData DeleteFileResponse where
  rnf :: DeleteFileResponse -> ()
rnf DeleteFileResponse' {Int
Text
filePath :: Text
treeId :: Text
blobId :: Text
commitId :: Text
httpStatus :: Int
$sel:filePath:DeleteFileResponse' :: DeleteFileResponse -> Text
$sel:treeId:DeleteFileResponse' :: DeleteFileResponse -> Text
$sel:blobId:DeleteFileResponse' :: DeleteFileResponse -> Text
$sel:commitId:DeleteFileResponse' :: DeleteFileResponse -> Text
$sel:httpStatus:DeleteFileResponse' :: DeleteFileResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
commitId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
blobId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
treeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
filePath