{-# 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.EC2.Types.DisableFastSnapshotRestoreStateError
-- 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.EC2.Types.DisableFastSnapshotRestoreStateError where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes an error that occurred when disabling fast snapshot restores.
--
-- /See:/ 'newDisableFastSnapshotRestoreStateError' smart constructor.
data DisableFastSnapshotRestoreStateError = DisableFastSnapshotRestoreStateError'
  { -- | The error code.
    DisableFastSnapshotRestoreStateError -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
    -- | The error message.
    DisableFastSnapshotRestoreStateError -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (DisableFastSnapshotRestoreStateError
-> DisableFastSnapshotRestoreStateError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableFastSnapshotRestoreStateError
-> DisableFastSnapshotRestoreStateError -> Bool
$c/= :: DisableFastSnapshotRestoreStateError
-> DisableFastSnapshotRestoreStateError -> Bool
== :: DisableFastSnapshotRestoreStateError
-> DisableFastSnapshotRestoreStateError -> Bool
$c== :: DisableFastSnapshotRestoreStateError
-> DisableFastSnapshotRestoreStateError -> Bool
Prelude.Eq, ReadPrec [DisableFastSnapshotRestoreStateError]
ReadPrec DisableFastSnapshotRestoreStateError
Int -> ReadS DisableFastSnapshotRestoreStateError
ReadS [DisableFastSnapshotRestoreStateError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableFastSnapshotRestoreStateError]
$creadListPrec :: ReadPrec [DisableFastSnapshotRestoreStateError]
readPrec :: ReadPrec DisableFastSnapshotRestoreStateError
$creadPrec :: ReadPrec DisableFastSnapshotRestoreStateError
readList :: ReadS [DisableFastSnapshotRestoreStateError]
$creadList :: ReadS [DisableFastSnapshotRestoreStateError]
readsPrec :: Int -> ReadS DisableFastSnapshotRestoreStateError
$creadsPrec :: Int -> ReadS DisableFastSnapshotRestoreStateError
Prelude.Read, Int -> DisableFastSnapshotRestoreStateError -> ShowS
[DisableFastSnapshotRestoreStateError] -> ShowS
DisableFastSnapshotRestoreStateError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableFastSnapshotRestoreStateError] -> ShowS
$cshowList :: [DisableFastSnapshotRestoreStateError] -> ShowS
show :: DisableFastSnapshotRestoreStateError -> String
$cshow :: DisableFastSnapshotRestoreStateError -> String
showsPrec :: Int -> DisableFastSnapshotRestoreStateError -> ShowS
$cshowsPrec :: Int -> DisableFastSnapshotRestoreStateError -> ShowS
Prelude.Show, forall x.
Rep DisableFastSnapshotRestoreStateError x
-> DisableFastSnapshotRestoreStateError
forall x.
DisableFastSnapshotRestoreStateError
-> Rep DisableFastSnapshotRestoreStateError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisableFastSnapshotRestoreStateError x
-> DisableFastSnapshotRestoreStateError
$cfrom :: forall x.
DisableFastSnapshotRestoreStateError
-> Rep DisableFastSnapshotRestoreStateError x
Prelude.Generic)

-- |
-- Create a value of 'DisableFastSnapshotRestoreStateError' 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:
--
-- 'code', 'disableFastSnapshotRestoreStateError_code' - The error code.
--
-- 'message', 'disableFastSnapshotRestoreStateError_message' - The error message.
newDisableFastSnapshotRestoreStateError ::
  DisableFastSnapshotRestoreStateError
newDisableFastSnapshotRestoreStateError :: DisableFastSnapshotRestoreStateError
newDisableFastSnapshotRestoreStateError =
  DisableFastSnapshotRestoreStateError'
    { $sel:code:DisableFastSnapshotRestoreStateError' :: Maybe Text
code =
        forall a. Maybe a
Prelude.Nothing,
      $sel:message:DisableFastSnapshotRestoreStateError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

-- | The error code.
disableFastSnapshotRestoreStateError_code :: Lens.Lens' DisableFastSnapshotRestoreStateError (Prelude.Maybe Prelude.Text)
disableFastSnapshotRestoreStateError_code :: Lens' DisableFastSnapshotRestoreStateError (Maybe Text)
disableFastSnapshotRestoreStateError_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableFastSnapshotRestoreStateError' {Maybe Text
code :: Maybe Text
$sel:code:DisableFastSnapshotRestoreStateError' :: DisableFastSnapshotRestoreStateError -> Maybe Text
code} -> Maybe Text
code) (\s :: DisableFastSnapshotRestoreStateError
s@DisableFastSnapshotRestoreStateError' {} Maybe Text
a -> DisableFastSnapshotRestoreStateError
s {$sel:code:DisableFastSnapshotRestoreStateError' :: Maybe Text
code = Maybe Text
a} :: DisableFastSnapshotRestoreStateError)

-- | The error message.
disableFastSnapshotRestoreStateError_message :: Lens.Lens' DisableFastSnapshotRestoreStateError (Prelude.Maybe Prelude.Text)
disableFastSnapshotRestoreStateError_message :: Lens' DisableFastSnapshotRestoreStateError (Maybe Text)
disableFastSnapshotRestoreStateError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableFastSnapshotRestoreStateError' {Maybe Text
message :: Maybe Text
$sel:message:DisableFastSnapshotRestoreStateError' :: DisableFastSnapshotRestoreStateError -> Maybe Text
message} -> Maybe Text
message) (\s :: DisableFastSnapshotRestoreStateError
s@DisableFastSnapshotRestoreStateError' {} Maybe Text
a -> DisableFastSnapshotRestoreStateError
s {$sel:message:DisableFastSnapshotRestoreStateError' :: Maybe Text
message = Maybe Text
a} :: DisableFastSnapshotRestoreStateError)

instance
  Data.FromXML
    DisableFastSnapshotRestoreStateError
  where
  parseXML :: [Node] -> Either String DisableFastSnapshotRestoreStateError
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> DisableFastSnapshotRestoreStateError
DisableFastSnapshotRestoreStateError'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"code")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"message")

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

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