{-# 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.CodeBuild.Types.BuildNotDeleted
-- 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.CodeBuild.Types.BuildNotDeleted 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

-- | Information about a build that could not be successfully deleted.
--
-- /See:/ 'newBuildNotDeleted' smart constructor.
data BuildNotDeleted = BuildNotDeleted'
  { -- | The ID of the build that could not be successfully deleted.
    BuildNotDeleted -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Additional information about the build that could not be successfully
    -- deleted.
    BuildNotDeleted -> Maybe Text
statusCode :: Prelude.Maybe Prelude.Text
  }
  deriving (BuildNotDeleted -> BuildNotDeleted -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BuildNotDeleted -> BuildNotDeleted -> Bool
$c/= :: BuildNotDeleted -> BuildNotDeleted -> Bool
== :: BuildNotDeleted -> BuildNotDeleted -> Bool
$c== :: BuildNotDeleted -> BuildNotDeleted -> Bool
Prelude.Eq, ReadPrec [BuildNotDeleted]
ReadPrec BuildNotDeleted
Int -> ReadS BuildNotDeleted
ReadS [BuildNotDeleted]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BuildNotDeleted]
$creadListPrec :: ReadPrec [BuildNotDeleted]
readPrec :: ReadPrec BuildNotDeleted
$creadPrec :: ReadPrec BuildNotDeleted
readList :: ReadS [BuildNotDeleted]
$creadList :: ReadS [BuildNotDeleted]
readsPrec :: Int -> ReadS BuildNotDeleted
$creadsPrec :: Int -> ReadS BuildNotDeleted
Prelude.Read, Int -> BuildNotDeleted -> ShowS
[BuildNotDeleted] -> ShowS
BuildNotDeleted -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BuildNotDeleted] -> ShowS
$cshowList :: [BuildNotDeleted] -> ShowS
show :: BuildNotDeleted -> String
$cshow :: BuildNotDeleted -> String
showsPrec :: Int -> BuildNotDeleted -> ShowS
$cshowsPrec :: Int -> BuildNotDeleted -> ShowS
Prelude.Show, forall x. Rep BuildNotDeleted x -> BuildNotDeleted
forall x. BuildNotDeleted -> Rep BuildNotDeleted x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BuildNotDeleted x -> BuildNotDeleted
$cfrom :: forall x. BuildNotDeleted -> Rep BuildNotDeleted x
Prelude.Generic)

-- |
-- Create a value of 'BuildNotDeleted' 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:
--
-- 'id', 'buildNotDeleted_id' - The ID of the build that could not be successfully deleted.
--
-- 'statusCode', 'buildNotDeleted_statusCode' - Additional information about the build that could not be successfully
-- deleted.
newBuildNotDeleted ::
  BuildNotDeleted
newBuildNotDeleted :: BuildNotDeleted
newBuildNotDeleted =
  BuildNotDeleted'
    { $sel:id:BuildNotDeleted' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:BuildNotDeleted' :: Maybe Text
statusCode = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the build that could not be successfully deleted.
buildNotDeleted_id :: Lens.Lens' BuildNotDeleted (Prelude.Maybe Prelude.Text)
buildNotDeleted_id :: Lens' BuildNotDeleted (Maybe Text)
buildNotDeleted_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildNotDeleted' {Maybe Text
id :: Maybe Text
$sel:id:BuildNotDeleted' :: BuildNotDeleted -> Maybe Text
id} -> Maybe Text
id) (\s :: BuildNotDeleted
s@BuildNotDeleted' {} Maybe Text
a -> BuildNotDeleted
s {$sel:id:BuildNotDeleted' :: Maybe Text
id = Maybe Text
a} :: BuildNotDeleted)

-- | Additional information about the build that could not be successfully
-- deleted.
buildNotDeleted_statusCode :: Lens.Lens' BuildNotDeleted (Prelude.Maybe Prelude.Text)
buildNotDeleted_statusCode :: Lens' BuildNotDeleted (Maybe Text)
buildNotDeleted_statusCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BuildNotDeleted' {Maybe Text
statusCode :: Maybe Text
$sel:statusCode:BuildNotDeleted' :: BuildNotDeleted -> Maybe Text
statusCode} -> Maybe Text
statusCode) (\s :: BuildNotDeleted
s@BuildNotDeleted' {} Maybe Text
a -> BuildNotDeleted
s {$sel:statusCode:BuildNotDeleted' :: Maybe Text
statusCode = Maybe Text
a} :: BuildNotDeleted)

instance Data.FromJSON BuildNotDeleted where
  parseJSON :: Value -> Parser BuildNotDeleted
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BuildNotDeleted"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> BuildNotDeleted
BuildNotDeleted'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"statusCode")
      )

instance Prelude.Hashable BuildNotDeleted where
  hashWithSalt :: Int -> BuildNotDeleted -> Int
hashWithSalt Int
_salt BuildNotDeleted' {Maybe Text
statusCode :: Maybe Text
id :: Maybe Text
$sel:statusCode:BuildNotDeleted' :: BuildNotDeleted -> Maybe Text
$sel:id:BuildNotDeleted' :: BuildNotDeleted -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusCode

instance Prelude.NFData BuildNotDeleted where
  rnf :: BuildNotDeleted -> ()
rnf BuildNotDeleted' {Maybe Text
statusCode :: Maybe Text
id :: Maybe Text
$sel:statusCode:BuildNotDeleted' :: BuildNotDeleted -> Maybe Text
$sel:id:BuildNotDeleted' :: BuildNotDeleted -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusCode