{-# 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.AutoScaling.Types.FailedScheduledUpdateGroupActionRequest
-- 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.AutoScaling.Types.FailedScheduledUpdateGroupActionRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Describes a scheduled action that could not be created, updated, or
-- deleted.
--
-- /See:/ 'newFailedScheduledUpdateGroupActionRequest' smart constructor.
data FailedScheduledUpdateGroupActionRequest = FailedScheduledUpdateGroupActionRequest'
  { -- | The error code.
    FailedScheduledUpdateGroupActionRequest -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The error message accompanying the error code.
    FailedScheduledUpdateGroupActionRequest -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The name of the scheduled action.
    FailedScheduledUpdateGroupActionRequest -> Text
scheduledActionName :: Prelude.Text
  }
  deriving (FailedScheduledUpdateGroupActionRequest
-> FailedScheduledUpdateGroupActionRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedScheduledUpdateGroupActionRequest
-> FailedScheduledUpdateGroupActionRequest -> Bool
$c/= :: FailedScheduledUpdateGroupActionRequest
-> FailedScheduledUpdateGroupActionRequest -> Bool
== :: FailedScheduledUpdateGroupActionRequest
-> FailedScheduledUpdateGroupActionRequest -> Bool
$c== :: FailedScheduledUpdateGroupActionRequest
-> FailedScheduledUpdateGroupActionRequest -> Bool
Prelude.Eq, ReadPrec [FailedScheduledUpdateGroupActionRequest]
ReadPrec FailedScheduledUpdateGroupActionRequest
Int -> ReadS FailedScheduledUpdateGroupActionRequest
ReadS [FailedScheduledUpdateGroupActionRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedScheduledUpdateGroupActionRequest]
$creadListPrec :: ReadPrec [FailedScheduledUpdateGroupActionRequest]
readPrec :: ReadPrec FailedScheduledUpdateGroupActionRequest
$creadPrec :: ReadPrec FailedScheduledUpdateGroupActionRequest
readList :: ReadS [FailedScheduledUpdateGroupActionRequest]
$creadList :: ReadS [FailedScheduledUpdateGroupActionRequest]
readsPrec :: Int -> ReadS FailedScheduledUpdateGroupActionRequest
$creadsPrec :: Int -> ReadS FailedScheduledUpdateGroupActionRequest
Prelude.Read, Int -> FailedScheduledUpdateGroupActionRequest -> ShowS
[FailedScheduledUpdateGroupActionRequest] -> ShowS
FailedScheduledUpdateGroupActionRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedScheduledUpdateGroupActionRequest] -> ShowS
$cshowList :: [FailedScheduledUpdateGroupActionRequest] -> ShowS
show :: FailedScheduledUpdateGroupActionRequest -> String
$cshow :: FailedScheduledUpdateGroupActionRequest -> String
showsPrec :: Int -> FailedScheduledUpdateGroupActionRequest -> ShowS
$cshowsPrec :: Int -> FailedScheduledUpdateGroupActionRequest -> ShowS
Prelude.Show, forall x.
Rep FailedScheduledUpdateGroupActionRequest x
-> FailedScheduledUpdateGroupActionRequest
forall x.
FailedScheduledUpdateGroupActionRequest
-> Rep FailedScheduledUpdateGroupActionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FailedScheduledUpdateGroupActionRequest x
-> FailedScheduledUpdateGroupActionRequest
$cfrom :: forall x.
FailedScheduledUpdateGroupActionRequest
-> Rep FailedScheduledUpdateGroupActionRequest x
Prelude.Generic)

-- |
-- Create a value of 'FailedScheduledUpdateGroupActionRequest' 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:
--
-- 'errorCode', 'failedScheduledUpdateGroupActionRequest_errorCode' - The error code.
--
-- 'errorMessage', 'failedScheduledUpdateGroupActionRequest_errorMessage' - The error message accompanying the error code.
--
-- 'scheduledActionName', 'failedScheduledUpdateGroupActionRequest_scheduledActionName' - The name of the scheduled action.
newFailedScheduledUpdateGroupActionRequest ::
  -- | 'scheduledActionName'
  Prelude.Text ->
  FailedScheduledUpdateGroupActionRequest
newFailedScheduledUpdateGroupActionRequest :: Text -> FailedScheduledUpdateGroupActionRequest
newFailedScheduledUpdateGroupActionRequest
  Text
pScheduledActionName_ =
    FailedScheduledUpdateGroupActionRequest'
      { $sel:errorCode:FailedScheduledUpdateGroupActionRequest' :: Maybe Text
errorCode =
          forall a. Maybe a
Prelude.Nothing,
        $sel:errorMessage:FailedScheduledUpdateGroupActionRequest' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
        $sel:scheduledActionName:FailedScheduledUpdateGroupActionRequest' :: Text
scheduledActionName =
          Text
pScheduledActionName_
      }

-- | The error code.
failedScheduledUpdateGroupActionRequest_errorCode :: Lens.Lens' FailedScheduledUpdateGroupActionRequest (Prelude.Maybe Prelude.Text)
failedScheduledUpdateGroupActionRequest_errorCode :: Lens' FailedScheduledUpdateGroupActionRequest (Maybe Text)
failedScheduledUpdateGroupActionRequest_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedScheduledUpdateGroupActionRequest' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: FailedScheduledUpdateGroupActionRequest
s@FailedScheduledUpdateGroupActionRequest' {} Maybe Text
a -> FailedScheduledUpdateGroupActionRequest
s {$sel:errorCode:FailedScheduledUpdateGroupActionRequest' :: Maybe Text
errorCode = Maybe Text
a} :: FailedScheduledUpdateGroupActionRequest)

-- | The error message accompanying the error code.
failedScheduledUpdateGroupActionRequest_errorMessage :: Lens.Lens' FailedScheduledUpdateGroupActionRequest (Prelude.Maybe Prelude.Text)
failedScheduledUpdateGroupActionRequest_errorMessage :: Lens' FailedScheduledUpdateGroupActionRequest (Maybe Text)
failedScheduledUpdateGroupActionRequest_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedScheduledUpdateGroupActionRequest' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: FailedScheduledUpdateGroupActionRequest
s@FailedScheduledUpdateGroupActionRequest' {} Maybe Text
a -> FailedScheduledUpdateGroupActionRequest
s {$sel:errorMessage:FailedScheduledUpdateGroupActionRequest' :: Maybe Text
errorMessage = Maybe Text
a} :: FailedScheduledUpdateGroupActionRequest)

-- | The name of the scheduled action.
failedScheduledUpdateGroupActionRequest_scheduledActionName :: Lens.Lens' FailedScheduledUpdateGroupActionRequest Prelude.Text
failedScheduledUpdateGroupActionRequest_scheduledActionName :: Lens' FailedScheduledUpdateGroupActionRequest Text
failedScheduledUpdateGroupActionRequest_scheduledActionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedScheduledUpdateGroupActionRequest' {Text
scheduledActionName :: Text
$sel:scheduledActionName:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Text
scheduledActionName} -> Text
scheduledActionName) (\s :: FailedScheduledUpdateGroupActionRequest
s@FailedScheduledUpdateGroupActionRequest' {} Text
a -> FailedScheduledUpdateGroupActionRequest
s {$sel:scheduledActionName:FailedScheduledUpdateGroupActionRequest' :: Text
scheduledActionName = Text
a} :: FailedScheduledUpdateGroupActionRequest)

instance
  Data.FromXML
    FailedScheduledUpdateGroupActionRequest
  where
  parseXML :: [Node] -> Either String FailedScheduledUpdateGroupActionRequest
parseXML [Node]
x =
    Maybe Text
-> Maybe Text -> Text -> FailedScheduledUpdateGroupActionRequest
FailedScheduledUpdateGroupActionRequest'
      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
"ErrorCode")
      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
"ErrorMessage")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ScheduledActionName")

instance
  Prelude.Hashable
    FailedScheduledUpdateGroupActionRequest
  where
  hashWithSalt :: Int -> FailedScheduledUpdateGroupActionRequest -> Int
hashWithSalt
    Int
_salt
    FailedScheduledUpdateGroupActionRequest' {Maybe Text
Text
scheduledActionName :: Text
errorMessage :: Maybe Text
errorCode :: Maybe Text
$sel:scheduledActionName:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Text
$sel:errorMessage:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Maybe Text
$sel:errorCode:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorCode
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
scheduledActionName

instance
  Prelude.NFData
    FailedScheduledUpdateGroupActionRequest
  where
  rnf :: FailedScheduledUpdateGroupActionRequest -> ()
rnf FailedScheduledUpdateGroupActionRequest' {Maybe Text
Text
scheduledActionName :: Text
errorMessage :: Maybe Text
errorCode :: Maybe Text
$sel:scheduledActionName:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Text
$sel:errorMessage:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Maybe Text
$sel:errorCode:FailedScheduledUpdateGroupActionRequest' :: FailedScheduledUpdateGroupActionRequest -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
scheduledActionName