{-# 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.CodeStar.Types.ProjectSummary
-- 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.CodeStar.Types.ProjectSummary 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 the metadata for a project.
--
-- /See:/ 'newProjectSummary' smart constructor.
data ProjectSummary = ProjectSummary'
  { -- | The Amazon Resource Name (ARN) of the project.
    ProjectSummary -> Maybe Text
projectArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the project.
    ProjectSummary -> Maybe Text
projectId :: Prelude.Maybe Prelude.Text
  }
  deriving (ProjectSummary -> ProjectSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectSummary -> ProjectSummary -> Bool
$c/= :: ProjectSummary -> ProjectSummary -> Bool
== :: ProjectSummary -> ProjectSummary -> Bool
$c== :: ProjectSummary -> ProjectSummary -> Bool
Prelude.Eq, ReadPrec [ProjectSummary]
ReadPrec ProjectSummary
Int -> ReadS ProjectSummary
ReadS [ProjectSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectSummary]
$creadListPrec :: ReadPrec [ProjectSummary]
readPrec :: ReadPrec ProjectSummary
$creadPrec :: ReadPrec ProjectSummary
readList :: ReadS [ProjectSummary]
$creadList :: ReadS [ProjectSummary]
readsPrec :: Int -> ReadS ProjectSummary
$creadsPrec :: Int -> ReadS ProjectSummary
Prelude.Read, Int -> ProjectSummary -> ShowS
[ProjectSummary] -> ShowS
ProjectSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectSummary] -> ShowS
$cshowList :: [ProjectSummary] -> ShowS
show :: ProjectSummary -> String
$cshow :: ProjectSummary -> String
showsPrec :: Int -> ProjectSummary -> ShowS
$cshowsPrec :: Int -> ProjectSummary -> ShowS
Prelude.Show, forall x. Rep ProjectSummary x -> ProjectSummary
forall x. ProjectSummary -> Rep ProjectSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectSummary x -> ProjectSummary
$cfrom :: forall x. ProjectSummary -> Rep ProjectSummary x
Prelude.Generic)

-- |
-- Create a value of 'ProjectSummary' 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:
--
-- 'projectArn', 'projectSummary_projectArn' - The Amazon Resource Name (ARN) of the project.
--
-- 'projectId', 'projectSummary_projectId' - The ID of the project.
newProjectSummary ::
  ProjectSummary
newProjectSummary :: ProjectSummary
newProjectSummary =
  ProjectSummary'
    { $sel:projectArn:ProjectSummary' :: Maybe Text
projectArn = forall a. Maybe a
Prelude.Nothing,
      $sel:projectId:ProjectSummary' :: Maybe Text
projectId = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the project.
projectSummary_projectArn :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.Text)
projectSummary_projectArn :: Lens' ProjectSummary (Maybe Text)
projectSummary_projectArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Maybe Text
projectArn :: Maybe Text
$sel:projectArn:ProjectSummary' :: ProjectSummary -> Maybe Text
projectArn} -> Maybe Text
projectArn) (\s :: ProjectSummary
s@ProjectSummary' {} Maybe Text
a -> ProjectSummary
s {$sel:projectArn:ProjectSummary' :: Maybe Text
projectArn = Maybe Text
a} :: ProjectSummary)

-- | The ID of the project.
projectSummary_projectId :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.Text)
projectSummary_projectId :: Lens' ProjectSummary (Maybe Text)
projectSummary_projectId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Maybe Text
projectId :: Maybe Text
$sel:projectId:ProjectSummary' :: ProjectSummary -> Maybe Text
projectId} -> Maybe Text
projectId) (\s :: ProjectSummary
s@ProjectSummary' {} Maybe Text
a -> ProjectSummary
s {$sel:projectId:ProjectSummary' :: Maybe Text
projectId = Maybe Text
a} :: ProjectSummary)

instance Data.FromJSON ProjectSummary where
  parseJSON :: Value -> Parser ProjectSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProjectSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ProjectSummary
ProjectSummary'
            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
"projectArn")
            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
"projectId")
      )

instance Prelude.Hashable ProjectSummary where
  hashWithSalt :: Int -> ProjectSummary -> Int
hashWithSalt Int
_salt ProjectSummary' {Maybe Text
projectId :: Maybe Text
projectArn :: Maybe Text
$sel:projectId:ProjectSummary' :: ProjectSummary -> Maybe Text
$sel:projectArn:ProjectSummary' :: ProjectSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
projectArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
projectId

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