{-# 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.ChangeProgressDetails
-- 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.ChangeProgressDetails 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

-- | Specifies change details of the domain configuration change.
--
-- /See:/ 'newChangeProgressDetails' smart constructor.
data ChangeProgressDetails = ChangeProgressDetails'
  { -- | The unique change identifier associated with a specific domain
    -- configuration change.
    ChangeProgressDetails -> Maybe Text
changeId :: Prelude.Maybe Prelude.Text,
    -- | Contains an optional message associated with the domain configuration
    -- change.
    ChangeProgressDetails -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (ChangeProgressDetails -> ChangeProgressDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeProgressDetails -> ChangeProgressDetails -> Bool
$c/= :: ChangeProgressDetails -> ChangeProgressDetails -> Bool
== :: ChangeProgressDetails -> ChangeProgressDetails -> Bool
$c== :: ChangeProgressDetails -> ChangeProgressDetails -> Bool
Prelude.Eq, ReadPrec [ChangeProgressDetails]
ReadPrec ChangeProgressDetails
Int -> ReadS ChangeProgressDetails
ReadS [ChangeProgressDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeProgressDetails]
$creadListPrec :: ReadPrec [ChangeProgressDetails]
readPrec :: ReadPrec ChangeProgressDetails
$creadPrec :: ReadPrec ChangeProgressDetails
readList :: ReadS [ChangeProgressDetails]
$creadList :: ReadS [ChangeProgressDetails]
readsPrec :: Int -> ReadS ChangeProgressDetails
$creadsPrec :: Int -> ReadS ChangeProgressDetails
Prelude.Read, Int -> ChangeProgressDetails -> ShowS
[ChangeProgressDetails] -> ShowS
ChangeProgressDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeProgressDetails] -> ShowS
$cshowList :: [ChangeProgressDetails] -> ShowS
show :: ChangeProgressDetails -> String
$cshow :: ChangeProgressDetails -> String
showsPrec :: Int -> ChangeProgressDetails -> ShowS
$cshowsPrec :: Int -> ChangeProgressDetails -> ShowS
Prelude.Show, forall x. Rep ChangeProgressDetails x -> ChangeProgressDetails
forall x. ChangeProgressDetails -> Rep ChangeProgressDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChangeProgressDetails x -> ChangeProgressDetails
$cfrom :: forall x. ChangeProgressDetails -> Rep ChangeProgressDetails x
Prelude.Generic)

-- |
-- Create a value of 'ChangeProgressDetails' 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:
--
-- 'changeId', 'changeProgressDetails_changeId' - The unique change identifier associated with a specific domain
-- configuration change.
--
-- 'message', 'changeProgressDetails_message' - Contains an optional message associated with the domain configuration
-- change.
newChangeProgressDetails ::
  ChangeProgressDetails
newChangeProgressDetails :: ChangeProgressDetails
newChangeProgressDetails =
  ChangeProgressDetails'
    { $sel:changeId:ChangeProgressDetails' :: Maybe Text
changeId = forall a. Maybe a
Prelude.Nothing,
      $sel:message:ChangeProgressDetails' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique change identifier associated with a specific domain
-- configuration change.
changeProgressDetails_changeId :: Lens.Lens' ChangeProgressDetails (Prelude.Maybe Prelude.Text)
changeProgressDetails_changeId :: Lens' ChangeProgressDetails (Maybe Text)
changeProgressDetails_changeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeProgressDetails' {Maybe Text
changeId :: Maybe Text
$sel:changeId:ChangeProgressDetails' :: ChangeProgressDetails -> Maybe Text
changeId} -> Maybe Text
changeId) (\s :: ChangeProgressDetails
s@ChangeProgressDetails' {} Maybe Text
a -> ChangeProgressDetails
s {$sel:changeId:ChangeProgressDetails' :: Maybe Text
changeId = Maybe Text
a} :: ChangeProgressDetails)

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

instance Data.FromJSON ChangeProgressDetails where
  parseJSON :: Value -> Parser ChangeProgressDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ChangeProgressDetails"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ChangeProgressDetails
ChangeProgressDetails'
            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
"ChangeId")
            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 ChangeProgressDetails where
  hashWithSalt :: Int -> ChangeProgressDetails -> Int
hashWithSalt Int
_salt ChangeProgressDetails' {Maybe Text
message :: Maybe Text
changeId :: Maybe Text
$sel:message:ChangeProgressDetails' :: ChangeProgressDetails -> Maybe Text
$sel:changeId:ChangeProgressDetails' :: ChangeProgressDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
changeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message

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