{-# 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.LaunchTemplateInstanceMaintenanceOptionsRequest
-- 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.LaunchTemplateInstanceMaintenanceOptionsRequest 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.LaunchTemplateAutoRecoveryState
import qualified Amazonka.Prelude as Prelude

-- | The maintenance options of your instance.
--
-- /See:/ 'newLaunchTemplateInstanceMaintenanceOptionsRequest' smart constructor.
data LaunchTemplateInstanceMaintenanceOptionsRequest = LaunchTemplateInstanceMaintenanceOptionsRequest'
  { -- | Disables the automatic recovery behavior of your instance or sets it to
    -- default. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery Simplified automatic recovery>.
    LaunchTemplateInstanceMaintenanceOptionsRequest
-> Maybe LaunchTemplateAutoRecoveryState
autoRecovery :: Prelude.Maybe LaunchTemplateAutoRecoveryState
  }
  deriving (LaunchTemplateInstanceMaintenanceOptionsRequest
-> LaunchTemplateInstanceMaintenanceOptionsRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> LaunchTemplateInstanceMaintenanceOptionsRequest -> Bool
$c/= :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> LaunchTemplateInstanceMaintenanceOptionsRequest -> Bool
== :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> LaunchTemplateInstanceMaintenanceOptionsRequest -> Bool
$c== :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> LaunchTemplateInstanceMaintenanceOptionsRequest -> Bool
Prelude.Eq, ReadPrec [LaunchTemplateInstanceMaintenanceOptionsRequest]
ReadPrec LaunchTemplateInstanceMaintenanceOptionsRequest
Int -> ReadS LaunchTemplateInstanceMaintenanceOptionsRequest
ReadS [LaunchTemplateInstanceMaintenanceOptionsRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchTemplateInstanceMaintenanceOptionsRequest]
$creadListPrec :: ReadPrec [LaunchTemplateInstanceMaintenanceOptionsRequest]
readPrec :: ReadPrec LaunchTemplateInstanceMaintenanceOptionsRequest
$creadPrec :: ReadPrec LaunchTemplateInstanceMaintenanceOptionsRequest
readList :: ReadS [LaunchTemplateInstanceMaintenanceOptionsRequest]
$creadList :: ReadS [LaunchTemplateInstanceMaintenanceOptionsRequest]
readsPrec :: Int -> ReadS LaunchTemplateInstanceMaintenanceOptionsRequest
$creadsPrec :: Int -> ReadS LaunchTemplateInstanceMaintenanceOptionsRequest
Prelude.Read, Int -> LaunchTemplateInstanceMaintenanceOptionsRequest -> ShowS
[LaunchTemplateInstanceMaintenanceOptionsRequest] -> ShowS
LaunchTemplateInstanceMaintenanceOptionsRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchTemplateInstanceMaintenanceOptionsRequest] -> ShowS
$cshowList :: [LaunchTemplateInstanceMaintenanceOptionsRequest] -> ShowS
show :: LaunchTemplateInstanceMaintenanceOptionsRequest -> String
$cshow :: LaunchTemplateInstanceMaintenanceOptionsRequest -> String
showsPrec :: Int -> LaunchTemplateInstanceMaintenanceOptionsRequest -> ShowS
$cshowsPrec :: Int -> LaunchTemplateInstanceMaintenanceOptionsRequest -> ShowS
Prelude.Show, forall x.
Rep LaunchTemplateInstanceMaintenanceOptionsRequest x
-> LaunchTemplateInstanceMaintenanceOptionsRequest
forall x.
LaunchTemplateInstanceMaintenanceOptionsRequest
-> Rep LaunchTemplateInstanceMaintenanceOptionsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LaunchTemplateInstanceMaintenanceOptionsRequest x
-> LaunchTemplateInstanceMaintenanceOptionsRequest
$cfrom :: forall x.
LaunchTemplateInstanceMaintenanceOptionsRequest
-> Rep LaunchTemplateInstanceMaintenanceOptionsRequest x
Prelude.Generic)

-- |
-- Create a value of 'LaunchTemplateInstanceMaintenanceOptionsRequest' 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:
--
-- 'autoRecovery', 'launchTemplateInstanceMaintenanceOptionsRequest_autoRecovery' - Disables the automatic recovery behavior of your instance or sets it to
-- default. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery Simplified automatic recovery>.
newLaunchTemplateInstanceMaintenanceOptionsRequest ::
  LaunchTemplateInstanceMaintenanceOptionsRequest
newLaunchTemplateInstanceMaintenanceOptionsRequest :: LaunchTemplateInstanceMaintenanceOptionsRequest
newLaunchTemplateInstanceMaintenanceOptionsRequest =
  LaunchTemplateInstanceMaintenanceOptionsRequest'
    { $sel:autoRecovery:LaunchTemplateInstanceMaintenanceOptionsRequest' :: Maybe LaunchTemplateAutoRecoveryState
autoRecovery =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Disables the automatic recovery behavior of your instance or sets it to
-- default. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html#instance-configuration-recovery Simplified automatic recovery>.
launchTemplateInstanceMaintenanceOptionsRequest_autoRecovery :: Lens.Lens' LaunchTemplateInstanceMaintenanceOptionsRequest (Prelude.Maybe LaunchTemplateAutoRecoveryState)
launchTemplateInstanceMaintenanceOptionsRequest_autoRecovery :: Lens'
  LaunchTemplateInstanceMaintenanceOptionsRequest
  (Maybe LaunchTemplateAutoRecoveryState)
launchTemplateInstanceMaintenanceOptionsRequest_autoRecovery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateInstanceMaintenanceOptionsRequest' {Maybe LaunchTemplateAutoRecoveryState
autoRecovery :: Maybe LaunchTemplateAutoRecoveryState
$sel:autoRecovery:LaunchTemplateInstanceMaintenanceOptionsRequest' :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> Maybe LaunchTemplateAutoRecoveryState
autoRecovery} -> Maybe LaunchTemplateAutoRecoveryState
autoRecovery) (\s :: LaunchTemplateInstanceMaintenanceOptionsRequest
s@LaunchTemplateInstanceMaintenanceOptionsRequest' {} Maybe LaunchTemplateAutoRecoveryState
a -> LaunchTemplateInstanceMaintenanceOptionsRequest
s {$sel:autoRecovery:LaunchTemplateInstanceMaintenanceOptionsRequest' :: Maybe LaunchTemplateAutoRecoveryState
autoRecovery = Maybe LaunchTemplateAutoRecoveryState
a} :: LaunchTemplateInstanceMaintenanceOptionsRequest)

instance
  Prelude.Hashable
    LaunchTemplateInstanceMaintenanceOptionsRequest
  where
  hashWithSalt :: Int -> LaunchTemplateInstanceMaintenanceOptionsRequest -> Int
hashWithSalt
    Int
_salt
    LaunchTemplateInstanceMaintenanceOptionsRequest' {Maybe LaunchTemplateAutoRecoveryState
autoRecovery :: Maybe LaunchTemplateAutoRecoveryState
$sel:autoRecovery:LaunchTemplateInstanceMaintenanceOptionsRequest' :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> Maybe LaunchTemplateAutoRecoveryState
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LaunchTemplateAutoRecoveryState
autoRecovery

instance
  Prelude.NFData
    LaunchTemplateInstanceMaintenanceOptionsRequest
  where
  rnf :: LaunchTemplateInstanceMaintenanceOptionsRequest -> ()
rnf
    LaunchTemplateInstanceMaintenanceOptionsRequest' {Maybe LaunchTemplateAutoRecoveryState
autoRecovery :: Maybe LaunchTemplateAutoRecoveryState
$sel:autoRecovery:LaunchTemplateInstanceMaintenanceOptionsRequest' :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> Maybe LaunchTemplateAutoRecoveryState
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe LaunchTemplateAutoRecoveryState
autoRecovery

instance
  Data.ToQuery
    LaunchTemplateInstanceMaintenanceOptionsRequest
  where
  toQuery :: LaunchTemplateInstanceMaintenanceOptionsRequest -> QueryString
toQuery
    LaunchTemplateInstanceMaintenanceOptionsRequest' {Maybe LaunchTemplateAutoRecoveryState
autoRecovery :: Maybe LaunchTemplateAutoRecoveryState
$sel:autoRecovery:LaunchTemplateInstanceMaintenanceOptionsRequest' :: LaunchTemplateInstanceMaintenanceOptionsRequest
-> Maybe LaunchTemplateAutoRecoveryState
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ByteString
"AutoRecovery" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe LaunchTemplateAutoRecoveryState
autoRecovery]