{-# 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.SuccessfulQueuedPurchaseDeletion
-- 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.SuccessfulQueuedPurchaseDeletion 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 a Reserved Instance whose queued purchase was successfully
-- deleted.
--
-- /See:/ 'newSuccessfulQueuedPurchaseDeletion' smart constructor.
data SuccessfulQueuedPurchaseDeletion = SuccessfulQueuedPurchaseDeletion'
  { -- | The ID of the Reserved Instance.
    SuccessfulQueuedPurchaseDeletion -> Maybe Text
reservedInstancesId :: Prelude.Maybe Prelude.Text
  }
  deriving (SuccessfulQueuedPurchaseDeletion
-> SuccessfulQueuedPurchaseDeletion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuccessfulQueuedPurchaseDeletion
-> SuccessfulQueuedPurchaseDeletion -> Bool
$c/= :: SuccessfulQueuedPurchaseDeletion
-> SuccessfulQueuedPurchaseDeletion -> Bool
== :: SuccessfulQueuedPurchaseDeletion
-> SuccessfulQueuedPurchaseDeletion -> Bool
$c== :: SuccessfulQueuedPurchaseDeletion
-> SuccessfulQueuedPurchaseDeletion -> Bool
Prelude.Eq, ReadPrec [SuccessfulQueuedPurchaseDeletion]
ReadPrec SuccessfulQueuedPurchaseDeletion
Int -> ReadS SuccessfulQueuedPurchaseDeletion
ReadS [SuccessfulQueuedPurchaseDeletion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuccessfulQueuedPurchaseDeletion]
$creadListPrec :: ReadPrec [SuccessfulQueuedPurchaseDeletion]
readPrec :: ReadPrec SuccessfulQueuedPurchaseDeletion
$creadPrec :: ReadPrec SuccessfulQueuedPurchaseDeletion
readList :: ReadS [SuccessfulQueuedPurchaseDeletion]
$creadList :: ReadS [SuccessfulQueuedPurchaseDeletion]
readsPrec :: Int -> ReadS SuccessfulQueuedPurchaseDeletion
$creadsPrec :: Int -> ReadS SuccessfulQueuedPurchaseDeletion
Prelude.Read, Int -> SuccessfulQueuedPurchaseDeletion -> ShowS
[SuccessfulQueuedPurchaseDeletion] -> ShowS
SuccessfulQueuedPurchaseDeletion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuccessfulQueuedPurchaseDeletion] -> ShowS
$cshowList :: [SuccessfulQueuedPurchaseDeletion] -> ShowS
show :: SuccessfulQueuedPurchaseDeletion -> String
$cshow :: SuccessfulQueuedPurchaseDeletion -> String
showsPrec :: Int -> SuccessfulQueuedPurchaseDeletion -> ShowS
$cshowsPrec :: Int -> SuccessfulQueuedPurchaseDeletion -> ShowS
Prelude.Show, forall x.
Rep SuccessfulQueuedPurchaseDeletion x
-> SuccessfulQueuedPurchaseDeletion
forall x.
SuccessfulQueuedPurchaseDeletion
-> Rep SuccessfulQueuedPurchaseDeletion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SuccessfulQueuedPurchaseDeletion x
-> SuccessfulQueuedPurchaseDeletion
$cfrom :: forall x.
SuccessfulQueuedPurchaseDeletion
-> Rep SuccessfulQueuedPurchaseDeletion x
Prelude.Generic)

-- |
-- Create a value of 'SuccessfulQueuedPurchaseDeletion' 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:
--
-- 'reservedInstancesId', 'successfulQueuedPurchaseDeletion_reservedInstancesId' - The ID of the Reserved Instance.
newSuccessfulQueuedPurchaseDeletion ::
  SuccessfulQueuedPurchaseDeletion
newSuccessfulQueuedPurchaseDeletion :: SuccessfulQueuedPurchaseDeletion
newSuccessfulQueuedPurchaseDeletion =
  SuccessfulQueuedPurchaseDeletion'
    { $sel:reservedInstancesId:SuccessfulQueuedPurchaseDeletion' :: Maybe Text
reservedInstancesId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Reserved Instance.
successfulQueuedPurchaseDeletion_reservedInstancesId :: Lens.Lens' SuccessfulQueuedPurchaseDeletion (Prelude.Maybe Prelude.Text)
successfulQueuedPurchaseDeletion_reservedInstancesId :: Lens' SuccessfulQueuedPurchaseDeletion (Maybe Text)
successfulQueuedPurchaseDeletion_reservedInstancesId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuccessfulQueuedPurchaseDeletion' {Maybe Text
reservedInstancesId :: Maybe Text
$sel:reservedInstancesId:SuccessfulQueuedPurchaseDeletion' :: SuccessfulQueuedPurchaseDeletion -> Maybe Text
reservedInstancesId} -> Maybe Text
reservedInstancesId) (\s :: SuccessfulQueuedPurchaseDeletion
s@SuccessfulQueuedPurchaseDeletion' {} Maybe Text
a -> SuccessfulQueuedPurchaseDeletion
s {$sel:reservedInstancesId:SuccessfulQueuedPurchaseDeletion' :: Maybe Text
reservedInstancesId = Maybe Text
a} :: SuccessfulQueuedPurchaseDeletion)

instance
  Data.FromXML
    SuccessfulQueuedPurchaseDeletion
  where
  parseXML :: [Node] -> Either String SuccessfulQueuedPurchaseDeletion
parseXML [Node]
x =
    Maybe Text -> SuccessfulQueuedPurchaseDeletion
SuccessfulQueuedPurchaseDeletion'
      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
"reservedInstancesId")

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

instance
  Prelude.NFData
    SuccessfulQueuedPurchaseDeletion
  where
  rnf :: SuccessfulQueuedPurchaseDeletion -> ()
rnf SuccessfulQueuedPurchaseDeletion' {Maybe Text
reservedInstancesId :: Maybe Text
$sel:reservedInstancesId:SuccessfulQueuedPurchaseDeletion' :: SuccessfulQueuedPurchaseDeletion -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reservedInstancesId