{-# 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.DeleteQueuedReservedInstancesError
-- 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.DeleteQueuedReservedInstancesError 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 Amazonka.EC2.Types.DeleteQueuedReservedInstancesErrorCode
import qualified Amazonka.Prelude as Prelude

-- | Describes the error for a Reserved Instance whose queued purchase could
-- not be deleted.
--
-- /See:/ 'newDeleteQueuedReservedInstancesError' smart constructor.
data DeleteQueuedReservedInstancesError = DeleteQueuedReservedInstancesError'
  { -- | The error code.
    DeleteQueuedReservedInstancesError
-> Maybe DeleteQueuedReservedInstancesErrorCode
code :: Prelude.Maybe DeleteQueuedReservedInstancesErrorCode,
    -- | The error message.
    DeleteQueuedReservedInstancesError -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (DeleteQueuedReservedInstancesError
-> DeleteQueuedReservedInstancesError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteQueuedReservedInstancesError
-> DeleteQueuedReservedInstancesError -> Bool
$c/= :: DeleteQueuedReservedInstancesError
-> DeleteQueuedReservedInstancesError -> Bool
== :: DeleteQueuedReservedInstancesError
-> DeleteQueuedReservedInstancesError -> Bool
$c== :: DeleteQueuedReservedInstancesError
-> DeleteQueuedReservedInstancesError -> Bool
Prelude.Eq, ReadPrec [DeleteQueuedReservedInstancesError]
ReadPrec DeleteQueuedReservedInstancesError
Int -> ReadS DeleteQueuedReservedInstancesError
ReadS [DeleteQueuedReservedInstancesError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteQueuedReservedInstancesError]
$creadListPrec :: ReadPrec [DeleteQueuedReservedInstancesError]
readPrec :: ReadPrec DeleteQueuedReservedInstancesError
$creadPrec :: ReadPrec DeleteQueuedReservedInstancesError
readList :: ReadS [DeleteQueuedReservedInstancesError]
$creadList :: ReadS [DeleteQueuedReservedInstancesError]
readsPrec :: Int -> ReadS DeleteQueuedReservedInstancesError
$creadsPrec :: Int -> ReadS DeleteQueuedReservedInstancesError
Prelude.Read, Int -> DeleteQueuedReservedInstancesError -> ShowS
[DeleteQueuedReservedInstancesError] -> ShowS
DeleteQueuedReservedInstancesError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteQueuedReservedInstancesError] -> ShowS
$cshowList :: [DeleteQueuedReservedInstancesError] -> ShowS
show :: DeleteQueuedReservedInstancesError -> String
$cshow :: DeleteQueuedReservedInstancesError -> String
showsPrec :: Int -> DeleteQueuedReservedInstancesError -> ShowS
$cshowsPrec :: Int -> DeleteQueuedReservedInstancesError -> ShowS
Prelude.Show, forall x.
Rep DeleteQueuedReservedInstancesError x
-> DeleteQueuedReservedInstancesError
forall x.
DeleteQueuedReservedInstancesError
-> Rep DeleteQueuedReservedInstancesError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteQueuedReservedInstancesError x
-> DeleteQueuedReservedInstancesError
$cfrom :: forall x.
DeleteQueuedReservedInstancesError
-> Rep DeleteQueuedReservedInstancesError x
Prelude.Generic)

-- |
-- Create a value of 'DeleteQueuedReservedInstancesError' 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', 'deleteQueuedReservedInstancesError_code' - The error code.
--
-- 'message', 'deleteQueuedReservedInstancesError_message' - The error message.
newDeleteQueuedReservedInstancesError ::
  DeleteQueuedReservedInstancesError
newDeleteQueuedReservedInstancesError :: DeleteQueuedReservedInstancesError
newDeleteQueuedReservedInstancesError =
  DeleteQueuedReservedInstancesError'
    { $sel:code:DeleteQueuedReservedInstancesError' :: Maybe DeleteQueuedReservedInstancesErrorCode
code =
        forall a. Maybe a
Prelude.Nothing,
      $sel:message:DeleteQueuedReservedInstancesError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

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

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

instance
  Data.FromXML
    DeleteQueuedReservedInstancesError
  where
  parseXML :: [Node] -> Either String DeleteQueuedReservedInstancesError
parseXML [Node]
x =
    Maybe DeleteQueuedReservedInstancesErrorCode
-> Maybe Text -> DeleteQueuedReservedInstancesError
DeleteQueuedReservedInstancesError'
      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
    DeleteQueuedReservedInstancesError
  where
  hashWithSalt :: Int -> DeleteQueuedReservedInstancesError -> Int
hashWithSalt
    Int
_salt
    DeleteQueuedReservedInstancesError' {Maybe Text
Maybe DeleteQueuedReservedInstancesErrorCode
message :: Maybe Text
code :: Maybe DeleteQueuedReservedInstancesErrorCode
$sel:message:DeleteQueuedReservedInstancesError' :: DeleteQueuedReservedInstancesError -> Maybe Text
$sel:code:DeleteQueuedReservedInstancesError' :: DeleteQueuedReservedInstancesError
-> Maybe DeleteQueuedReservedInstancesErrorCode
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeleteQueuedReservedInstancesErrorCode
code
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message

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