{-# 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.DeploymentResult
-- 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.DeploymentResult 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.ResultCode
import qualified Amazonka.Prelude as Prelude

-- | The result of the deployment.
--
-- /See:/ 'newDeploymentResult' smart constructor.
data DeploymentResult = DeploymentResult'
  { -- | Details about the deployment result.
    DeploymentResult -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The type of deployment result.
    DeploymentResult -> Maybe ResultCode
resultCode :: Prelude.Maybe ResultCode
  }
  deriving (DeploymentResult -> DeploymentResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentResult -> DeploymentResult -> Bool
$c/= :: DeploymentResult -> DeploymentResult -> Bool
== :: DeploymentResult -> DeploymentResult -> Bool
$c== :: DeploymentResult -> DeploymentResult -> Bool
Prelude.Eq, ReadPrec [DeploymentResult]
ReadPrec DeploymentResult
Int -> ReadS DeploymentResult
ReadS [DeploymentResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentResult]
$creadListPrec :: ReadPrec [DeploymentResult]
readPrec :: ReadPrec DeploymentResult
$creadPrec :: ReadPrec DeploymentResult
readList :: ReadS [DeploymentResult]
$creadList :: ReadS [DeploymentResult]
readsPrec :: Int -> ReadS DeploymentResult
$creadsPrec :: Int -> ReadS DeploymentResult
Prelude.Read, Int -> DeploymentResult -> ShowS
[DeploymentResult] -> ShowS
DeploymentResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentResult] -> ShowS
$cshowList :: [DeploymentResult] -> ShowS
show :: DeploymentResult -> String
$cshow :: DeploymentResult -> String
showsPrec :: Int -> DeploymentResult -> ShowS
$cshowsPrec :: Int -> DeploymentResult -> ShowS
Prelude.Show, forall x. Rep DeploymentResult x -> DeploymentResult
forall x. DeploymentResult -> Rep DeploymentResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentResult x -> DeploymentResult
$cfrom :: forall x. DeploymentResult -> Rep DeploymentResult x
Prelude.Generic)

-- |
-- Create a value of 'DeploymentResult' 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:
--
-- 'message', 'deploymentResult_message' - Details about the deployment result.
--
-- 'resultCode', 'deploymentResult_resultCode' - The type of deployment result.
newDeploymentResult ::
  DeploymentResult
newDeploymentResult :: DeploymentResult
newDeploymentResult =
  DeploymentResult'
    { $sel:message:DeploymentResult' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:resultCode:DeploymentResult' :: Maybe ResultCode
resultCode = forall a. Maybe a
Prelude.Nothing
    }

-- | Details about the deployment result.
deploymentResult_message :: Lens.Lens' DeploymentResult (Prelude.Maybe Prelude.Text)
deploymentResult_message :: Lens' DeploymentResult (Maybe Text)
deploymentResult_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentResult' {Maybe Text
message :: Maybe Text
$sel:message:DeploymentResult' :: DeploymentResult -> Maybe Text
message} -> Maybe Text
message) (\s :: DeploymentResult
s@DeploymentResult' {} Maybe Text
a -> DeploymentResult
s {$sel:message:DeploymentResult' :: Maybe Text
message = Maybe Text
a} :: DeploymentResult)

-- | The type of deployment result.
deploymentResult_resultCode :: Lens.Lens' DeploymentResult (Prelude.Maybe ResultCode)
deploymentResult_resultCode :: Lens' DeploymentResult (Maybe ResultCode)
deploymentResult_resultCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentResult' {Maybe ResultCode
resultCode :: Maybe ResultCode
$sel:resultCode:DeploymentResult' :: DeploymentResult -> Maybe ResultCode
resultCode} -> Maybe ResultCode
resultCode) (\s :: DeploymentResult
s@DeploymentResult' {} Maybe ResultCode
a -> DeploymentResult
s {$sel:resultCode:DeploymentResult' :: Maybe ResultCode
resultCode = Maybe ResultCode
a} :: DeploymentResult)

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

instance Prelude.Hashable DeploymentResult where
  hashWithSalt :: Int -> DeploymentResult -> Int
hashWithSalt Int
_salt DeploymentResult' {Maybe Text
Maybe ResultCode
resultCode :: Maybe ResultCode
message :: Maybe Text
$sel:resultCode:DeploymentResult' :: DeploymentResult -> Maybe ResultCode
$sel:message:DeploymentResult' :: DeploymentResult -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResultCode
resultCode

instance Prelude.NFData DeploymentResult where
  rnf :: DeploymentResult -> ()
rnf DeploymentResult' {Maybe Text
Maybe ResultCode
resultCode :: Maybe ResultCode
message :: Maybe Text
$sel:resultCode:DeploymentResult' :: DeploymentResult -> Maybe ResultCode
$sel:message:DeploymentResult' :: DeploymentResult -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResultCode
resultCode