{-# 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-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)
module Amazonka.CodeCommit.Types.DeleteFileEntry where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(DeleteFileEntry -> DeleteFileEntry -> Bool)
-> (DeleteFileEntry -> DeleteFileEntry -> Bool)
-> Eq DeleteFileEntry
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]
(Int -> ReadS DeleteFileEntry)
-> ReadS [DeleteFileEntry]
-> ReadPrec DeleteFileEntry
-> ReadPrec [DeleteFileEntry]
-> Read 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
(Int -> DeleteFileEntry -> ShowS)
-> (DeleteFileEntry -> String)
-> ([DeleteFileEntry] -> ShowS)
-> Show DeleteFileEntry
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. DeleteFileEntry -> Rep DeleteFileEntry x)
-> (forall x. Rep DeleteFileEntry x -> DeleteFileEntry)
-> Generic DeleteFileEntry
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' :: Text -> DeleteFileEntry
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 :: (Text -> f Text) -> DeleteFileEntry -> f DeleteFileEntry
deleteFileEntry_filePath = (DeleteFileEntry -> Text)
-> (DeleteFileEntry -> Text -> DeleteFileEntry)
-> Lens DeleteFileEntry DeleteFileEntry Text Text
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

instance Prelude.NFData DeleteFileEntry

instance Core.ToJSON DeleteFileEntry where
  toJSON :: DeleteFileEntry -> Value
toJSON DeleteFileEntry' {Text
filePath :: Text
$sel:filePath:DeleteFileEntry' :: DeleteFileEntry -> 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
"filePath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
filePath)]
      )