{-# 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.GamesParks.Types.StageSummary
-- 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.GamesParks.Types.StageSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GamesParks.Types.StageState
import qualified Amazonka.Prelude as Prelude

-- | The summary of the properties of a stage.
--
-- /See:/ 'newStageSummary' smart constructor.
data StageSummary = StageSummary'
  { -- | The description of the stage.
    StageSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The game key associated with the stage.
    --
    -- The game key is a unique identifier that the game client uses to connect
    -- to the GameSparks backend.
    StageSummary -> Maybe Text
gameKey :: Prelude.Maybe Prelude.Text,
    -- | The name of the stage.
    StageSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The state of the stage.
    StageSummary -> Maybe StageState
state :: Prelude.Maybe StageState,
    -- | The tags associated with the stage.
    StageSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (StageSummary -> StageSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StageSummary -> StageSummary -> Bool
$c/= :: StageSummary -> StageSummary -> Bool
== :: StageSummary -> StageSummary -> Bool
$c== :: StageSummary -> StageSummary -> Bool
Prelude.Eq, ReadPrec [StageSummary]
ReadPrec StageSummary
Int -> ReadS StageSummary
ReadS [StageSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StageSummary]
$creadListPrec :: ReadPrec [StageSummary]
readPrec :: ReadPrec StageSummary
$creadPrec :: ReadPrec StageSummary
readList :: ReadS [StageSummary]
$creadList :: ReadS [StageSummary]
readsPrec :: Int -> ReadS StageSummary
$creadsPrec :: Int -> ReadS StageSummary
Prelude.Read, Int -> StageSummary -> ShowS
[StageSummary] -> ShowS
StageSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StageSummary] -> ShowS
$cshowList :: [StageSummary] -> ShowS
show :: StageSummary -> String
$cshow :: StageSummary -> String
showsPrec :: Int -> StageSummary -> ShowS
$cshowsPrec :: Int -> StageSummary -> ShowS
Prelude.Show, forall x. Rep StageSummary x -> StageSummary
forall x. StageSummary -> Rep StageSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StageSummary x -> StageSummary
$cfrom :: forall x. StageSummary -> Rep StageSummary x
Prelude.Generic)

-- |
-- Create a value of 'StageSummary' 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:
--
-- 'description', 'stageSummary_description' - The description of the stage.
--
-- 'gameKey', 'stageSummary_gameKey' - The game key associated with the stage.
--
-- The game key is a unique identifier that the game client uses to connect
-- to the GameSparks backend.
--
-- 'name', 'stageSummary_name' - The name of the stage.
--
-- 'state', 'stageSummary_state' - The state of the stage.
--
-- 'tags', 'stageSummary_tags' - The tags associated with the stage.
newStageSummary ::
  StageSummary
newStageSummary :: StageSummary
newStageSummary =
  StageSummary'
    { $sel:description:StageSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:gameKey:StageSummary' :: Maybe Text
gameKey = forall a. Maybe a
Prelude.Nothing,
      $sel:name:StageSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:StageSummary' :: Maybe StageState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:StageSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the stage.
stageSummary_description :: Lens.Lens' StageSummary (Prelude.Maybe Prelude.Text)
stageSummary_description :: Lens' StageSummary (Maybe Text)
stageSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageSummary' {Maybe Text
description :: Maybe Text
$sel:description:StageSummary' :: StageSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: StageSummary
s@StageSummary' {} Maybe Text
a -> StageSummary
s {$sel:description:StageSummary' :: Maybe Text
description = Maybe Text
a} :: StageSummary)

-- | The game key associated with the stage.
--
-- The game key is a unique identifier that the game client uses to connect
-- to the GameSparks backend.
stageSummary_gameKey :: Lens.Lens' StageSummary (Prelude.Maybe Prelude.Text)
stageSummary_gameKey :: Lens' StageSummary (Maybe Text)
stageSummary_gameKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageSummary' {Maybe Text
gameKey :: Maybe Text
$sel:gameKey:StageSummary' :: StageSummary -> Maybe Text
gameKey} -> Maybe Text
gameKey) (\s :: StageSummary
s@StageSummary' {} Maybe Text
a -> StageSummary
s {$sel:gameKey:StageSummary' :: Maybe Text
gameKey = Maybe Text
a} :: StageSummary)

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

-- | The state of the stage.
stageSummary_state :: Lens.Lens' StageSummary (Prelude.Maybe StageState)
stageSummary_state :: Lens' StageSummary (Maybe StageState)
stageSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageSummary' {Maybe StageState
state :: Maybe StageState
$sel:state:StageSummary' :: StageSummary -> Maybe StageState
state} -> Maybe StageState
state) (\s :: StageSummary
s@StageSummary' {} Maybe StageState
a -> StageSummary
s {$sel:state:StageSummary' :: Maybe StageState
state = Maybe StageState
a} :: StageSummary)

-- | The tags associated with the stage.
stageSummary_tags :: Lens.Lens' StageSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
stageSummary_tags :: Lens' StageSummary (Maybe (HashMap Text Text))
stageSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StageSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:StageSummary' :: StageSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: StageSummary
s@StageSummary' {} Maybe (HashMap Text Text)
a -> StageSummary
s {$sel:tags:StageSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: StageSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON StageSummary where
  parseJSON :: Value -> Parser StageSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StageSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe StageState
-> Maybe (HashMap Text Text)
-> StageSummary
StageSummary'
            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
"Description")
            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
"GameKey")
            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
"Name")
            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
"State")
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable StageSummary where
  hashWithSalt :: Int -> StageSummary -> Int
hashWithSalt Int
_salt StageSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe StageState
tags :: Maybe (HashMap Text Text)
state :: Maybe StageState
name :: Maybe Text
gameKey :: Maybe Text
description :: Maybe Text
$sel:tags:StageSummary' :: StageSummary -> Maybe (HashMap Text Text)
$sel:state:StageSummary' :: StageSummary -> Maybe StageState
$sel:name:StageSummary' :: StageSummary -> Maybe Text
$sel:gameKey:StageSummary' :: StageSummary -> Maybe Text
$sel:description:StageSummary' :: StageSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StageState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData StageSummary where
  rnf :: StageSummary -> ()
rnf StageSummary' {Maybe Text
Maybe (HashMap Text Text)
Maybe StageState
tags :: Maybe (HashMap Text Text)
state :: Maybe StageState
name :: Maybe Text
gameKey :: Maybe Text
description :: Maybe Text
$sel:tags:StageSummary' :: StageSummary -> Maybe (HashMap Text Text)
$sel:state:StageSummary' :: StageSummary -> Maybe StageState
$sel:name:StageSummary' :: StageSummary -> Maybe Text
$sel:gameKey:StageSummary' :: StageSummary -> Maybe Text
$sel:description:StageSummary' :: StageSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StageState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags