{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.DeleteFileEntry
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeCommit.Types.DeleteFileEntry 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

-- | A file that is deleted as part of a commit.
--
-- /See:/ 'newDeleteFileEntry' smart constructor.
data DeleteFileEntry = DeleteFileEntry'
  { -- | The full path of the file to be deleted, including the name of the file.
    DeleteFileEntry -> Text
filePath :: Prelude.Text
  }
  deriving (DeleteFileEntry -> DeleteFileEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFileEntry -> DeleteFileEntry -> Bool
$c/= :: DeleteFileEntry -> DeleteFileEntry -> Bool
== :: DeleteFileEntry -> DeleteFileEntry -> Bool
$c== :: DeleteFileEntry -> DeleteFileEntry -> Bool
Prelude.Eq, ReadPrec [DeleteFileEntry]
ReadPrec DeleteFileEntry
Int -> ReadS DeleteFileEntry
ReadS [DeleteFileEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteFileEntry]
$creadListPrec :: ReadPrec [DeleteFileEntry]
readPrec :: ReadPrec DeleteFileEntry
$creadPrec :: ReadPrec DeleteFileEntry
readList :: ReadS [DeleteFileEntry]
$creadList :: ReadS [DeleteFileEntry]
readsPrec :: Int -> ReadS DeleteFileEntry
$creadsPrec :: Int -> ReadS DeleteFileEntry
Prelude.Read, Int -> DeleteFileEntry -> ShowS
[DeleteFileEntry] -> ShowS
DeleteFileEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFileEntry] -> ShowS
$cshowList :: [DeleteFileEntry] -> ShowS
show :: DeleteFileEntry -> String
$cshow :: DeleteFileEntry -> String
showsPrec :: Int -> DeleteFileEntry -> ShowS
$cshowsPrec :: Int -> DeleteFileEntry -> ShowS
Prelude.Show, forall x. Rep DeleteFileEntry x -> DeleteFileEntry
forall x. DeleteFileEntry -> Rep DeleteFileEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFileEntry x -> DeleteFileEntry
$cfrom :: forall x. DeleteFileEntry -> Rep DeleteFileEntry x
Prelude.Generic)

-- |
-- Create a value of 'DeleteFileEntry' 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:
--
-- 'filePath', 'deleteFileEntry_filePath' - The full path of the file to be deleted, including the name of the file.
newDeleteFileEntry ::
  -- | 'filePath'
  Prelude.Text ->
  DeleteFileEntry
newDeleteFileEntry :: Text -> DeleteFileEntry
newDeleteFileEntry Text
pFilePath_ =
  DeleteFileEntry' {$sel:filePath:DeleteFileEntry' :: Text
filePath = Text
pFilePath_}

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

instance Prelude.Hashable DeleteFileEntry where
  hashWithSalt :: Int -> DeleteFileEntry -> Int
hashWithSalt Int
_salt DeleteFileEntry' {Text
filePath :: Text
$sel:filePath:DeleteFileEntry' :: DeleteFileEntry -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
filePath

instance Prelude.NFData DeleteFileEntry where
  rnf :: DeleteFileEntry -> ()
rnf DeleteFileEntry' {Text
filePath :: Text
$sel:filePath:DeleteFileEntry' :: DeleteFileEntry -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
filePath

instance Data.ToJSON DeleteFileEntry where
  toJSON :: DeleteFileEntry -> Value
toJSON DeleteFileEntry' {Text
filePath :: Text
$sel:filePath:DeleteFileEntry' :: DeleteFileEntry -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"filePath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
filePath)]
      )