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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(BuildNotDeleted -> BuildNotDeleted -> Bool)
-> (BuildNotDeleted -> BuildNotDeleted -> Bool)
-> Eq BuildNotDeleted
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]
(Int -> ReadS BuildNotDeleted)
-> ReadS [BuildNotDeleted]
-> ReadPrec BuildNotDeleted
-> ReadPrec [BuildNotDeleted]
-> Read 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
(Int -> BuildNotDeleted -> ShowS)
-> (BuildNotDeleted -> String)
-> ([BuildNotDeleted] -> ShowS)
-> Show BuildNotDeleted
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. BuildNotDeleted -> Rep BuildNotDeleted x)
-> (forall x. Rep BuildNotDeleted x -> BuildNotDeleted)
-> Generic BuildNotDeleted
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' :: Maybe Text -> Maybe Text -> BuildNotDeleted
BuildNotDeleted'
    { $sel:id:BuildNotDeleted' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusCode:BuildNotDeleted' :: Maybe Text
statusCode = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> BuildNotDeleted -> f BuildNotDeleted
buildNotDeleted_id = (BuildNotDeleted -> Maybe Text)
-> (BuildNotDeleted -> Maybe Text -> BuildNotDeleted)
-> Lens BuildNotDeleted BuildNotDeleted (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> BuildNotDeleted -> f BuildNotDeleted
buildNotDeleted_statusCode = (BuildNotDeleted -> Maybe Text)
-> (BuildNotDeleted -> Maybe Text -> BuildNotDeleted)
-> Lens BuildNotDeleted BuildNotDeleted (Maybe Text) (Maybe Text)
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 Core.FromJSON BuildNotDeleted where
  parseJSON :: Value -> Parser BuildNotDeleted
parseJSON =
    String
-> (Object -> Parser BuildNotDeleted)
-> Value
-> Parser BuildNotDeleted
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BuildNotDeleted"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> BuildNotDeleted
BuildNotDeleted'
            (Maybe Text -> Maybe Text -> BuildNotDeleted)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BuildNotDeleted)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
            Parser (Maybe Text -> BuildNotDeleted)
-> Parser (Maybe Text) -> Parser BuildNotDeleted
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusCode")
      )

instance Prelude.Hashable BuildNotDeleted

instance Prelude.NFData BuildNotDeleted