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

-- | Indicates whether your instance is configured for hibernation. This
-- parameter is valid only if the instance meets the
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites hibernation prerequisites>.
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html Hibernate your instance>
-- in the /Amazon EC2 User Guide/.
--
-- /See:/ 'newHibernationOptionsRequest' smart constructor.
data HibernationOptionsRequest = HibernationOptionsRequest'
  { -- | If you set this parameter to @true@, your instance is enabled for
    -- hibernation.
    --
    -- Default: @false@
    HibernationOptionsRequest -> Maybe Bool
configured :: Prelude.Maybe Prelude.Bool
  }
  deriving (HibernationOptionsRequest -> HibernationOptionsRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HibernationOptionsRequest -> HibernationOptionsRequest -> Bool
$c/= :: HibernationOptionsRequest -> HibernationOptionsRequest -> Bool
== :: HibernationOptionsRequest -> HibernationOptionsRequest -> Bool
$c== :: HibernationOptionsRequest -> HibernationOptionsRequest -> Bool
Prelude.Eq, ReadPrec [HibernationOptionsRequest]
ReadPrec HibernationOptionsRequest
Int -> ReadS HibernationOptionsRequest
ReadS [HibernationOptionsRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HibernationOptionsRequest]
$creadListPrec :: ReadPrec [HibernationOptionsRequest]
readPrec :: ReadPrec HibernationOptionsRequest
$creadPrec :: ReadPrec HibernationOptionsRequest
readList :: ReadS [HibernationOptionsRequest]
$creadList :: ReadS [HibernationOptionsRequest]
readsPrec :: Int -> ReadS HibernationOptionsRequest
$creadsPrec :: Int -> ReadS HibernationOptionsRequest
Prelude.Read, Int -> HibernationOptionsRequest -> ShowS
[HibernationOptionsRequest] -> ShowS
HibernationOptionsRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HibernationOptionsRequest] -> ShowS
$cshowList :: [HibernationOptionsRequest] -> ShowS
show :: HibernationOptionsRequest -> String
$cshow :: HibernationOptionsRequest -> String
showsPrec :: Int -> HibernationOptionsRequest -> ShowS
$cshowsPrec :: Int -> HibernationOptionsRequest -> ShowS
Prelude.Show, forall x.
Rep HibernationOptionsRequest x -> HibernationOptionsRequest
forall x.
HibernationOptionsRequest -> Rep HibernationOptionsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HibernationOptionsRequest x -> HibernationOptionsRequest
$cfrom :: forall x.
HibernationOptionsRequest -> Rep HibernationOptionsRequest x
Prelude.Generic)

-- |
-- Create a value of 'HibernationOptionsRequest' 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:
--
-- 'configured', 'hibernationOptionsRequest_configured' - If you set this parameter to @true@, your instance is enabled for
-- hibernation.
--
-- Default: @false@
newHibernationOptionsRequest ::
  HibernationOptionsRequest
newHibernationOptionsRequest :: HibernationOptionsRequest
newHibernationOptionsRequest =
  HibernationOptionsRequest'
    { $sel:configured:HibernationOptionsRequest' :: Maybe Bool
configured =
        forall a. Maybe a
Prelude.Nothing
    }

-- | If you set this parameter to @true@, your instance is enabled for
-- hibernation.
--
-- Default: @false@
hibernationOptionsRequest_configured :: Lens.Lens' HibernationOptionsRequest (Prelude.Maybe Prelude.Bool)
hibernationOptionsRequest_configured :: Lens' HibernationOptionsRequest (Maybe Bool)
hibernationOptionsRequest_configured = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HibernationOptionsRequest' {Maybe Bool
configured :: Maybe Bool
$sel:configured:HibernationOptionsRequest' :: HibernationOptionsRequest -> Maybe Bool
configured} -> Maybe Bool
configured) (\s :: HibernationOptionsRequest
s@HibernationOptionsRequest' {} Maybe Bool
a -> HibernationOptionsRequest
s {$sel:configured:HibernationOptionsRequest' :: Maybe Bool
configured = Maybe Bool
a} :: HibernationOptionsRequest)

instance Prelude.Hashable HibernationOptionsRequest where
  hashWithSalt :: Int -> HibernationOptionsRequest -> Int
hashWithSalt Int
_salt HibernationOptionsRequest' {Maybe Bool
configured :: Maybe Bool
$sel:configured:HibernationOptionsRequest' :: HibernationOptionsRequest -> Maybe Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
configured

instance Prelude.NFData HibernationOptionsRequest where
  rnf :: HibernationOptionsRequest -> ()
rnf HibernationOptionsRequest' {Maybe Bool
configured :: Maybe Bool
$sel:configured:HibernationOptionsRequest' :: HibernationOptionsRequest -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
configured

instance Data.ToQuery HibernationOptionsRequest where
  toQuery :: HibernationOptionsRequest -> QueryString
toQuery HibernationOptionsRequest' {Maybe Bool
configured :: Maybe Bool
$sel:configured:HibernationOptionsRequest' :: HibernationOptionsRequest -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Configured" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
configured]