{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AutoScaling.DeleteScheduledAction
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the specified scheduled action.
module Amazonka.AutoScaling.DeleteScheduledAction
  ( -- * Creating a Request
    DeleteScheduledAction (..),
    newDeleteScheduledAction,

    -- * Request Lenses
    deleteScheduledAction_autoScalingGroupName,
    deleteScheduledAction_scheduledActionName,

    -- * Destructuring the Response
    DeleteScheduledActionResponse (..),
    newDeleteScheduledActionResponse,
  )
where

import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteScheduledAction' smart constructor.
data DeleteScheduledAction = DeleteScheduledAction'
  { -- | The name of the Auto Scaling group.
    DeleteScheduledAction -> Text
autoScalingGroupName :: Prelude.Text,
    -- | The name of the action to delete.
    DeleteScheduledAction -> Text
scheduledActionName :: Prelude.Text
  }
  deriving (DeleteScheduledAction -> DeleteScheduledAction -> Bool
(DeleteScheduledAction -> DeleteScheduledAction -> Bool)
-> (DeleteScheduledAction -> DeleteScheduledAction -> Bool)
-> Eq DeleteScheduledAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScheduledAction -> DeleteScheduledAction -> Bool
$c/= :: DeleteScheduledAction -> DeleteScheduledAction -> Bool
== :: DeleteScheduledAction -> DeleteScheduledAction -> Bool
$c== :: DeleteScheduledAction -> DeleteScheduledAction -> Bool
Prelude.Eq, ReadPrec [DeleteScheduledAction]
ReadPrec DeleteScheduledAction
Int -> ReadS DeleteScheduledAction
ReadS [DeleteScheduledAction]
(Int -> ReadS DeleteScheduledAction)
-> ReadS [DeleteScheduledAction]
-> ReadPrec DeleteScheduledAction
-> ReadPrec [DeleteScheduledAction]
-> Read DeleteScheduledAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScheduledAction]
$creadListPrec :: ReadPrec [DeleteScheduledAction]
readPrec :: ReadPrec DeleteScheduledAction
$creadPrec :: ReadPrec DeleteScheduledAction
readList :: ReadS [DeleteScheduledAction]
$creadList :: ReadS [DeleteScheduledAction]
readsPrec :: Int -> ReadS DeleteScheduledAction
$creadsPrec :: Int -> ReadS DeleteScheduledAction
Prelude.Read, Int -> DeleteScheduledAction -> ShowS
[DeleteScheduledAction] -> ShowS
DeleteScheduledAction -> String
(Int -> DeleteScheduledAction -> ShowS)
-> (DeleteScheduledAction -> String)
-> ([DeleteScheduledAction] -> ShowS)
-> Show DeleteScheduledAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScheduledAction] -> ShowS
$cshowList :: [DeleteScheduledAction] -> ShowS
show :: DeleteScheduledAction -> String
$cshow :: DeleteScheduledAction -> String
showsPrec :: Int -> DeleteScheduledAction -> ShowS
$cshowsPrec :: Int -> DeleteScheduledAction -> ShowS
Prelude.Show, (forall x. DeleteScheduledAction -> Rep DeleteScheduledAction x)
-> (forall x. Rep DeleteScheduledAction x -> DeleteScheduledAction)
-> Generic DeleteScheduledAction
forall x. Rep DeleteScheduledAction x -> DeleteScheduledAction
forall x. DeleteScheduledAction -> Rep DeleteScheduledAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteScheduledAction x -> DeleteScheduledAction
$cfrom :: forall x. DeleteScheduledAction -> Rep DeleteScheduledAction x
Prelude.Generic)

-- |
-- Create a value of 'DeleteScheduledAction' 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:
--
-- 'autoScalingGroupName', 'deleteScheduledAction_autoScalingGroupName' - The name of the Auto Scaling group.
--
-- 'scheduledActionName', 'deleteScheduledAction_scheduledActionName' - The name of the action to delete.
newDeleteScheduledAction ::
  -- | 'autoScalingGroupName'
  Prelude.Text ->
  -- | 'scheduledActionName'
  Prelude.Text ->
  DeleteScheduledAction
newDeleteScheduledAction :: Text -> Text -> DeleteScheduledAction
newDeleteScheduledAction
  Text
pAutoScalingGroupName_
  Text
pScheduledActionName_ =
    DeleteScheduledAction' :: Text -> Text -> DeleteScheduledAction
DeleteScheduledAction'
      { $sel:autoScalingGroupName:DeleteScheduledAction' :: Text
autoScalingGroupName =
          Text
pAutoScalingGroupName_,
        $sel:scheduledActionName:DeleteScheduledAction' :: Text
scheduledActionName = Text
pScheduledActionName_
      }

-- | The name of the Auto Scaling group.
deleteScheduledAction_autoScalingGroupName :: Lens.Lens' DeleteScheduledAction Prelude.Text
deleteScheduledAction_autoScalingGroupName :: (Text -> f Text)
-> DeleteScheduledAction -> f DeleteScheduledAction
deleteScheduledAction_autoScalingGroupName = (DeleteScheduledAction -> Text)
-> (DeleteScheduledAction -> Text -> DeleteScheduledAction)
-> Lens DeleteScheduledAction DeleteScheduledAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteScheduledAction' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DeleteScheduledAction' :: DeleteScheduledAction -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DeleteScheduledAction
s@DeleteScheduledAction' {} Text
a -> DeleteScheduledAction
s {$sel:autoScalingGroupName:DeleteScheduledAction' :: Text
autoScalingGroupName = Text
a} :: DeleteScheduledAction)

-- | The name of the action to delete.
deleteScheduledAction_scheduledActionName :: Lens.Lens' DeleteScheduledAction Prelude.Text
deleteScheduledAction_scheduledActionName :: (Text -> f Text)
-> DeleteScheduledAction -> f DeleteScheduledAction
deleteScheduledAction_scheduledActionName = (DeleteScheduledAction -> Text)
-> (DeleteScheduledAction -> Text -> DeleteScheduledAction)
-> Lens DeleteScheduledAction DeleteScheduledAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteScheduledAction' {Text
scheduledActionName :: Text
$sel:scheduledActionName:DeleteScheduledAction' :: DeleteScheduledAction -> Text
scheduledActionName} -> Text
scheduledActionName) (\s :: DeleteScheduledAction
s@DeleteScheduledAction' {} Text
a -> DeleteScheduledAction
s {$sel:scheduledActionName:DeleteScheduledAction' :: Text
scheduledActionName = Text
a} :: DeleteScheduledAction)

instance Core.AWSRequest DeleteScheduledAction where
  type
    AWSResponse DeleteScheduledAction =
      DeleteScheduledActionResponse
  request :: DeleteScheduledAction -> Request DeleteScheduledAction
request = Service -> DeleteScheduledAction -> Request DeleteScheduledAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteScheduledAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteScheduledAction)))
response =
    AWSResponse DeleteScheduledAction
-> Logger
-> Service
-> Proxy DeleteScheduledAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteScheduledAction)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteScheduledAction
DeleteScheduledActionResponse
DeleteScheduledActionResponse'

instance Prelude.Hashable DeleteScheduledAction

instance Prelude.NFData DeleteScheduledAction

instance Core.ToHeaders DeleteScheduledAction where
  toHeaders :: DeleteScheduledAction -> [Header]
toHeaders = [Header] -> DeleteScheduledAction -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DeleteScheduledAction where
  toPath :: DeleteScheduledAction -> ByteString
toPath = ByteString -> DeleteScheduledAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DeleteScheduledAction where
  toQuery :: DeleteScheduledAction -> QueryString
toQuery DeleteScheduledAction' {Text
scheduledActionName :: Text
autoScalingGroupName :: Text
$sel:scheduledActionName:DeleteScheduledAction' :: DeleteScheduledAction -> Text
$sel:autoScalingGroupName:DeleteScheduledAction' :: DeleteScheduledAction -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DeleteScheduledAction" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
        ByteString
"ScheduledActionName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
scheduledActionName
      ]

-- | /See:/ 'newDeleteScheduledActionResponse' smart constructor.
data DeleteScheduledActionResponse = DeleteScheduledActionResponse'
  {
  }
  deriving (DeleteScheduledActionResponse
-> DeleteScheduledActionResponse -> Bool
(DeleteScheduledActionResponse
 -> DeleteScheduledActionResponse -> Bool)
-> (DeleteScheduledActionResponse
    -> DeleteScheduledActionResponse -> Bool)
-> Eq DeleteScheduledActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScheduledActionResponse
-> DeleteScheduledActionResponse -> Bool
$c/= :: DeleteScheduledActionResponse
-> DeleteScheduledActionResponse -> Bool
== :: DeleteScheduledActionResponse
-> DeleteScheduledActionResponse -> Bool
$c== :: DeleteScheduledActionResponse
-> DeleteScheduledActionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteScheduledActionResponse]
ReadPrec DeleteScheduledActionResponse
Int -> ReadS DeleteScheduledActionResponse
ReadS [DeleteScheduledActionResponse]
(Int -> ReadS DeleteScheduledActionResponse)
-> ReadS [DeleteScheduledActionResponse]
-> ReadPrec DeleteScheduledActionResponse
-> ReadPrec [DeleteScheduledActionResponse]
-> Read DeleteScheduledActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScheduledActionResponse]
$creadListPrec :: ReadPrec [DeleteScheduledActionResponse]
readPrec :: ReadPrec DeleteScheduledActionResponse
$creadPrec :: ReadPrec DeleteScheduledActionResponse
readList :: ReadS [DeleteScheduledActionResponse]
$creadList :: ReadS [DeleteScheduledActionResponse]
readsPrec :: Int -> ReadS DeleteScheduledActionResponse
$creadsPrec :: Int -> ReadS DeleteScheduledActionResponse
Prelude.Read, Int -> DeleteScheduledActionResponse -> ShowS
[DeleteScheduledActionResponse] -> ShowS
DeleteScheduledActionResponse -> String
(Int -> DeleteScheduledActionResponse -> ShowS)
-> (DeleteScheduledActionResponse -> String)
-> ([DeleteScheduledActionResponse] -> ShowS)
-> Show DeleteScheduledActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScheduledActionResponse] -> ShowS
$cshowList :: [DeleteScheduledActionResponse] -> ShowS
show :: DeleteScheduledActionResponse -> String
$cshow :: DeleteScheduledActionResponse -> String
showsPrec :: Int -> DeleteScheduledActionResponse -> ShowS
$cshowsPrec :: Int -> DeleteScheduledActionResponse -> ShowS
Prelude.Show, (forall x.
 DeleteScheduledActionResponse
 -> Rep DeleteScheduledActionResponse x)
-> (forall x.
    Rep DeleteScheduledActionResponse x
    -> DeleteScheduledActionResponse)
-> Generic DeleteScheduledActionResponse
forall x.
Rep DeleteScheduledActionResponse x
-> DeleteScheduledActionResponse
forall x.
DeleteScheduledActionResponse
-> Rep DeleteScheduledActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteScheduledActionResponse x
-> DeleteScheduledActionResponse
$cfrom :: forall x.
DeleteScheduledActionResponse
-> Rep DeleteScheduledActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteScheduledActionResponse' 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.
newDeleteScheduledActionResponse ::
  DeleteScheduledActionResponse
newDeleteScheduledActionResponse :: DeleteScheduledActionResponse
newDeleteScheduledActionResponse =
  DeleteScheduledActionResponse
DeleteScheduledActionResponse'

instance Prelude.NFData DeleteScheduledActionResponse