{-# 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.Mobile.Types.ProjectSummary
-- 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.Mobile.Types.ProjectSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information about an AWS Mobile Hub project.
--
-- /See:/ 'newProjectSummary' smart constructor.
data ProjectSummary = ProjectSummary'
  { -- | Name of the project.
    ProjectSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Unique project identifier.
    ProjectSummary -> Maybe Text
projectId :: Prelude.Maybe Prelude.Text
  }
  deriving (ProjectSummary -> ProjectSummary -> Bool
(ProjectSummary -> ProjectSummary -> Bool)
-> (ProjectSummary -> ProjectSummary -> Bool) -> Eq ProjectSummary
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]
(Int -> ReadS ProjectSummary)
-> ReadS [ProjectSummary]
-> ReadPrec ProjectSummary
-> ReadPrec [ProjectSummary]
-> Read 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
(Int -> ProjectSummary -> ShowS)
-> (ProjectSummary -> String)
-> ([ProjectSummary] -> ShowS)
-> Show ProjectSummary
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. ProjectSummary -> Rep ProjectSummary x)
-> (forall x. Rep ProjectSummary x -> ProjectSummary)
-> Generic ProjectSummary
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:
--
-- 'name', 'projectSummary_name' - Name of the project.
--
-- 'projectId', 'projectSummary_projectId' - Unique project identifier.
newProjectSummary ::
  ProjectSummary
newProjectSummary :: ProjectSummary
newProjectSummary =
  ProjectSummary' :: Maybe Text -> Maybe Text -> ProjectSummary
ProjectSummary'
    { $sel:name:ProjectSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:projectId:ProjectSummary' :: Maybe Text
projectId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Name of the project.
projectSummary_name :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.Text)
projectSummary_name :: (Maybe Text -> f (Maybe Text))
-> ProjectSummary -> f ProjectSummary
projectSummary_name = (ProjectSummary -> Maybe Text)
-> (ProjectSummary -> Maybe Text -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectSummary' {Maybe Text
name :: Maybe Text
$sel:name:ProjectSummary' :: ProjectSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ProjectSummary
s@ProjectSummary' {} Maybe Text
a -> ProjectSummary
s {$sel:name:ProjectSummary' :: Maybe Text
name = Maybe Text
a} :: ProjectSummary)

-- | Unique project identifier.
projectSummary_projectId :: Lens.Lens' ProjectSummary (Prelude.Maybe Prelude.Text)
projectSummary_projectId :: (Maybe Text -> f (Maybe Text))
-> ProjectSummary -> f ProjectSummary
projectSummary_projectId = (ProjectSummary -> Maybe Text)
-> (ProjectSummary -> Maybe Text -> ProjectSummary)
-> Lens ProjectSummary ProjectSummary (Maybe Text) (Maybe Text)
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 Core.FromJSON ProjectSummary where
  parseJSON :: Value -> Parser ProjectSummary
parseJSON =
    String
-> (Object -> Parser ProjectSummary)
-> Value
-> Parser ProjectSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProjectSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ProjectSummary
ProjectSummary'
            (Maybe Text -> Maybe Text -> ProjectSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ProjectSummary)
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
"name")
            Parser (Maybe Text -> ProjectSummary)
-> Parser (Maybe Text) -> Parser ProjectSummary
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
"projectId")
      )

instance Prelude.Hashable ProjectSummary

instance Prelude.NFData ProjectSummary