{-# 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.ElasticSearch.Types.DryRunResults
-- 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.ElasticSearch.Types.DryRunResults 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

-- | /See:/ 'newDryRunResults' smart constructor.
data DryRunResults = DryRunResults'
  { -- | Specifies the deployment mechanism through which the update shall be
    -- applied on the domain. Possible responses are @Blue\/Green@ (The update
    -- will require a blue\/green deployment.) @DynamicUpdate@ (The update can
    -- be applied in-place without a Blue\/Green deployment required.)
    -- @Undetermined@ (The domain is undergoing an update which needs to
    -- complete before the deployment type can be predicted.) @None@ (The
    -- configuration change matches the current configuration and will not
    -- result in any update.)
    DryRunResults -> Maybe Text
deploymentType :: Prelude.Maybe Prelude.Text,
    -- | Contains an optional message associated with the DryRunResults.
    DryRunResults -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (DryRunResults -> DryRunResults -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DryRunResults -> DryRunResults -> Bool
$c/= :: DryRunResults -> DryRunResults -> Bool
== :: DryRunResults -> DryRunResults -> Bool
$c== :: DryRunResults -> DryRunResults -> Bool
Prelude.Eq, ReadPrec [DryRunResults]
ReadPrec DryRunResults
Int -> ReadS DryRunResults
ReadS [DryRunResults]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DryRunResults]
$creadListPrec :: ReadPrec [DryRunResults]
readPrec :: ReadPrec DryRunResults
$creadPrec :: ReadPrec DryRunResults
readList :: ReadS [DryRunResults]
$creadList :: ReadS [DryRunResults]
readsPrec :: Int -> ReadS DryRunResults
$creadsPrec :: Int -> ReadS DryRunResults
Prelude.Read, Int -> DryRunResults -> ShowS
[DryRunResults] -> ShowS
DryRunResults -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DryRunResults] -> ShowS
$cshowList :: [DryRunResults] -> ShowS
show :: DryRunResults -> String
$cshow :: DryRunResults -> String
showsPrec :: Int -> DryRunResults -> ShowS
$cshowsPrec :: Int -> DryRunResults -> ShowS
Prelude.Show, forall x. Rep DryRunResults x -> DryRunResults
forall x. DryRunResults -> Rep DryRunResults x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DryRunResults x -> DryRunResults
$cfrom :: forall x. DryRunResults -> Rep DryRunResults x
Prelude.Generic)

-- |
-- Create a value of 'DryRunResults' 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:
--
-- 'deploymentType', 'dryRunResults_deploymentType' - Specifies the deployment mechanism through which the update shall be
-- applied on the domain. Possible responses are @Blue\/Green@ (The update
-- will require a blue\/green deployment.) @DynamicUpdate@ (The update can
-- be applied in-place without a Blue\/Green deployment required.)
-- @Undetermined@ (The domain is undergoing an update which needs to
-- complete before the deployment type can be predicted.) @None@ (The
-- configuration change matches the current configuration and will not
-- result in any update.)
--
-- 'message', 'dryRunResults_message' - Contains an optional message associated with the DryRunResults.
newDryRunResults ::
  DryRunResults
newDryRunResults :: DryRunResults
newDryRunResults =
  DryRunResults'
    { $sel:deploymentType:DryRunResults' :: Maybe Text
deploymentType = forall a. Maybe a
Prelude.Nothing,
      $sel:message:DryRunResults' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the deployment mechanism through which the update shall be
-- applied on the domain. Possible responses are @Blue\/Green@ (The update
-- will require a blue\/green deployment.) @DynamicUpdate@ (The update can
-- be applied in-place without a Blue\/Green deployment required.)
-- @Undetermined@ (The domain is undergoing an update which needs to
-- complete before the deployment type can be predicted.) @None@ (The
-- configuration change matches the current configuration and will not
-- result in any update.)
dryRunResults_deploymentType :: Lens.Lens' DryRunResults (Prelude.Maybe Prelude.Text)
dryRunResults_deploymentType :: Lens' DryRunResults (Maybe Text)
dryRunResults_deploymentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DryRunResults' {Maybe Text
deploymentType :: Maybe Text
$sel:deploymentType:DryRunResults' :: DryRunResults -> Maybe Text
deploymentType} -> Maybe Text
deploymentType) (\s :: DryRunResults
s@DryRunResults' {} Maybe Text
a -> DryRunResults
s {$sel:deploymentType:DryRunResults' :: Maybe Text
deploymentType = Maybe Text
a} :: DryRunResults)

-- | Contains an optional message associated with the DryRunResults.
dryRunResults_message :: Lens.Lens' DryRunResults (Prelude.Maybe Prelude.Text)
dryRunResults_message :: Lens' DryRunResults (Maybe Text)
dryRunResults_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DryRunResults' {Maybe Text
message :: Maybe Text
$sel:message:DryRunResults' :: DryRunResults -> Maybe Text
message} -> Maybe Text
message) (\s :: DryRunResults
s@DryRunResults' {} Maybe Text
a -> DryRunResults
s {$sel:message:DryRunResults' :: Maybe Text
message = Maybe Text
a} :: DryRunResults)

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

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

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