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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(FailedScheduledUpdateGroupActionRequest
 -> FailedScheduledUpdateGroupActionRequest -> Bool)
-> (FailedScheduledUpdateGroupActionRequest
    -> FailedScheduledUpdateGroupActionRequest -> Bool)
-> Eq FailedScheduledUpdateGroupActionRequest
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]
(Int -> ReadS FailedScheduledUpdateGroupActionRequest)
-> ReadS [FailedScheduledUpdateGroupActionRequest]
-> ReadPrec FailedScheduledUpdateGroupActionRequest
-> ReadPrec [FailedScheduledUpdateGroupActionRequest]
-> Read 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
(Int -> FailedScheduledUpdateGroupActionRequest -> ShowS)
-> (FailedScheduledUpdateGroupActionRequest -> String)
-> ([FailedScheduledUpdateGroupActionRequest] -> ShowS)
-> Show FailedScheduledUpdateGroupActionRequest
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.
 FailedScheduledUpdateGroupActionRequest
 -> Rep FailedScheduledUpdateGroupActionRequest x)
-> (forall x.
    Rep FailedScheduledUpdateGroupActionRequest x
    -> FailedScheduledUpdateGroupActionRequest)
-> Generic FailedScheduledUpdateGroupActionRequest
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' :: Maybe Text
-> Maybe Text -> Text -> FailedScheduledUpdateGroupActionRequest
FailedScheduledUpdateGroupActionRequest'
      { $sel:errorCode:FailedScheduledUpdateGroupActionRequest' :: Maybe Text
errorCode =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:errorMessage:FailedScheduledUpdateGroupActionRequest' :: Maybe Text
errorMessage = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> FailedScheduledUpdateGroupActionRequest
-> f FailedScheduledUpdateGroupActionRequest
failedScheduledUpdateGroupActionRequest_errorCode = (FailedScheduledUpdateGroupActionRequest -> Maybe Text)
-> (FailedScheduledUpdateGroupActionRequest
    -> Maybe Text -> FailedScheduledUpdateGroupActionRequest)
-> Lens
     FailedScheduledUpdateGroupActionRequest
     FailedScheduledUpdateGroupActionRequest
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> FailedScheduledUpdateGroupActionRequest
-> f FailedScheduledUpdateGroupActionRequest
failedScheduledUpdateGroupActionRequest_errorMessage = (FailedScheduledUpdateGroupActionRequest -> Maybe Text)
-> (FailedScheduledUpdateGroupActionRequest
    -> Maybe Text -> FailedScheduledUpdateGroupActionRequest)
-> Lens
     FailedScheduledUpdateGroupActionRequest
     FailedScheduledUpdateGroupActionRequest
     (Maybe Text)
     (Maybe Text)
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 :: (Text -> f Text)
-> FailedScheduledUpdateGroupActionRequest
-> f FailedScheduledUpdateGroupActionRequest
failedScheduledUpdateGroupActionRequest_scheduledActionName = (FailedScheduledUpdateGroupActionRequest -> Text)
-> (FailedScheduledUpdateGroupActionRequest
    -> Text -> FailedScheduledUpdateGroupActionRequest)
-> Lens
     FailedScheduledUpdateGroupActionRequest
     FailedScheduledUpdateGroupActionRequest
     Text
     Text
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
  Core.FromXML
    FailedScheduledUpdateGroupActionRequest
  where
  parseXML :: [Node] -> Either String FailedScheduledUpdateGroupActionRequest
parseXML [Node]
x =
    Maybe Text
-> Maybe Text -> Text -> FailedScheduledUpdateGroupActionRequest
FailedScheduledUpdateGroupActionRequest'
      (Maybe Text
 -> Maybe Text -> Text -> FailedScheduledUpdateGroupActionRequest)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Text -> FailedScheduledUpdateGroupActionRequest)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ErrorCode")
        Either
  String
  (Maybe Text -> Text -> FailedScheduledUpdateGroupActionRequest)
-> Either String (Maybe Text)
-> Either String (Text -> FailedScheduledUpdateGroupActionRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ErrorMessage")
        Either String (Text -> FailedScheduledUpdateGroupActionRequest)
-> Either String Text
-> Either String FailedScheduledUpdateGroupActionRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"ScheduledActionName")

instance
  Prelude.Hashable
    FailedScheduledUpdateGroupActionRequest

instance
  Prelude.NFData
    FailedScheduledUpdateGroupActionRequest