{-# 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.AmplifyUiBuilder.Types.ThemeSummary
-- 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.AmplifyUiBuilder.Types.ThemeSummary 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

-- | Describes the basic information about a theme.
--
-- /See:/ 'newThemeSummary' smart constructor.
data ThemeSummary = ThemeSummary'
  { -- | The unique ID for the app associated with the theme summary.
    ThemeSummary -> Text
appId :: Prelude.Text,
    -- | The name of the backend environment that is part of the Amplify app.
    ThemeSummary -> Text
environmentName :: Prelude.Text,
    -- | The ID of the theme.
    ThemeSummary -> Text
id :: Prelude.Text,
    -- | The name of the theme.
    ThemeSummary -> Text
name :: Prelude.Text
  }
  deriving (ThemeSummary -> ThemeSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThemeSummary -> ThemeSummary -> Bool
$c/= :: ThemeSummary -> ThemeSummary -> Bool
== :: ThemeSummary -> ThemeSummary -> Bool
$c== :: ThemeSummary -> ThemeSummary -> Bool
Prelude.Eq, ReadPrec [ThemeSummary]
ReadPrec ThemeSummary
Int -> ReadS ThemeSummary
ReadS [ThemeSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThemeSummary]
$creadListPrec :: ReadPrec [ThemeSummary]
readPrec :: ReadPrec ThemeSummary
$creadPrec :: ReadPrec ThemeSummary
readList :: ReadS [ThemeSummary]
$creadList :: ReadS [ThemeSummary]
readsPrec :: Int -> ReadS ThemeSummary
$creadsPrec :: Int -> ReadS ThemeSummary
Prelude.Read, Int -> ThemeSummary -> ShowS
[ThemeSummary] -> ShowS
ThemeSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThemeSummary] -> ShowS
$cshowList :: [ThemeSummary] -> ShowS
show :: ThemeSummary -> String
$cshow :: ThemeSummary -> String
showsPrec :: Int -> ThemeSummary -> ShowS
$cshowsPrec :: Int -> ThemeSummary -> ShowS
Prelude.Show, forall x. Rep ThemeSummary x -> ThemeSummary
forall x. ThemeSummary -> Rep ThemeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThemeSummary x -> ThemeSummary
$cfrom :: forall x. ThemeSummary -> Rep ThemeSummary x
Prelude.Generic)

-- |
-- Create a value of 'ThemeSummary' 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:
--
-- 'appId', 'themeSummary_appId' - The unique ID for the app associated with the theme summary.
--
-- 'environmentName', 'themeSummary_environmentName' - The name of the backend environment that is part of the Amplify app.
--
-- 'id', 'themeSummary_id' - The ID of the theme.
--
-- 'name', 'themeSummary_name' - The name of the theme.
newThemeSummary ::
  -- | 'appId'
  Prelude.Text ->
  -- | 'environmentName'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ThemeSummary
newThemeSummary :: Text -> Text -> Text -> Text -> ThemeSummary
newThemeSummary Text
pAppId_ Text
pEnvironmentName_ Text
pId_ Text
pName_ =
  ThemeSummary'
    { $sel:appId:ThemeSummary' :: Text
appId = Text
pAppId_,
      $sel:environmentName:ThemeSummary' :: Text
environmentName = Text
pEnvironmentName_,
      $sel:id:ThemeSummary' :: Text
id = Text
pId_,
      $sel:name:ThemeSummary' :: Text
name = Text
pName_
    }

-- | The unique ID for the app associated with the theme summary.
themeSummary_appId :: Lens.Lens' ThemeSummary Prelude.Text
themeSummary_appId :: Lens' ThemeSummary Text
themeSummary_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Text
appId :: Text
$sel:appId:ThemeSummary' :: ThemeSummary -> Text
appId} -> Text
appId) (\s :: ThemeSummary
s@ThemeSummary' {} Text
a -> ThemeSummary
s {$sel:appId:ThemeSummary' :: Text
appId = Text
a} :: ThemeSummary)

-- | The name of the backend environment that is part of the Amplify app.
themeSummary_environmentName :: Lens.Lens' ThemeSummary Prelude.Text
themeSummary_environmentName :: Lens' ThemeSummary Text
themeSummary_environmentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Text
environmentName :: Text
$sel:environmentName:ThemeSummary' :: ThemeSummary -> Text
environmentName} -> Text
environmentName) (\s :: ThemeSummary
s@ThemeSummary' {} Text
a -> ThemeSummary
s {$sel:environmentName:ThemeSummary' :: Text
environmentName = Text
a} :: ThemeSummary)

-- | The ID of the theme.
themeSummary_id :: Lens.Lens' ThemeSummary Prelude.Text
themeSummary_id :: Lens' ThemeSummary Text
themeSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Text
id :: Text
$sel:id:ThemeSummary' :: ThemeSummary -> Text
id} -> Text
id) (\s :: ThemeSummary
s@ThemeSummary' {} Text
a -> ThemeSummary
s {$sel:id:ThemeSummary' :: Text
id = Text
a} :: ThemeSummary)

-- | The name of the theme.
themeSummary_name :: Lens.Lens' ThemeSummary Prelude.Text
themeSummary_name :: Lens' ThemeSummary Text
themeSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThemeSummary' {Text
name :: Text
$sel:name:ThemeSummary' :: ThemeSummary -> Text
name} -> Text
name) (\s :: ThemeSummary
s@ThemeSummary' {} Text
a -> ThemeSummary
s {$sel:name:ThemeSummary' :: Text
name = Text
a} :: ThemeSummary)

instance Data.FromJSON ThemeSummary where
  parseJSON :: Value -> Parser ThemeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ThemeSummary"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> ThemeSummary
ThemeSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"appId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"environmentName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"name")
      )

instance Prelude.Hashable ThemeSummary where
  hashWithSalt :: Int -> ThemeSummary -> Int
hashWithSalt Int
_salt ThemeSummary' {Text
name :: Text
id :: Text
environmentName :: Text
appId :: Text
$sel:name:ThemeSummary' :: ThemeSummary -> Text
$sel:id:ThemeSummary' :: ThemeSummary -> Text
$sel:environmentName:ThemeSummary' :: ThemeSummary -> Text
$sel:appId:ThemeSummary' :: ThemeSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
environmentName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ThemeSummary where
  rnf :: ThemeSummary -> ()
rnf ThemeSummary' {Text
name :: Text
id :: Text
environmentName :: Text
appId :: Text
$sel:name:ThemeSummary' :: ThemeSummary -> Text
$sel:id:ThemeSummary' :: ThemeSummary -> Text
$sel:environmentName:ThemeSummary' :: ThemeSummary -> Text
$sel:appId:ThemeSummary' :: ThemeSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
appId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
environmentName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name