{-# 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.ElasticBeanstalk.ApplyEnvironmentManagedAction
-- 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)
--
-- Applies a scheduled managed action immediately. A managed action can be
-- applied only if its status is @Scheduled@. Get the status and action ID
-- of a managed action with DescribeEnvironmentManagedActions.
module Amazonka.ElasticBeanstalk.ApplyEnvironmentManagedAction
  ( -- * Creating a Request
    ApplyEnvironmentManagedAction (..),
    newApplyEnvironmentManagedAction,

    -- * Request Lenses
    applyEnvironmentManagedAction_environmentName,
    applyEnvironmentManagedAction_environmentId,
    applyEnvironmentManagedAction_actionId,

    -- * Destructuring the Response
    ApplyEnvironmentManagedActionResponse (..),
    newApplyEnvironmentManagedActionResponse,

    -- * Response Lenses
    applyEnvironmentManagedActionResponse_status,
    applyEnvironmentManagedActionResponse_actionId,
    applyEnvironmentManagedActionResponse_actionDescription,
    applyEnvironmentManagedActionResponse_actionType,
    applyEnvironmentManagedActionResponse_httpStatus,
  )
where

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

-- | Request to execute a scheduled managed action immediately.
--
-- /See:/ 'newApplyEnvironmentManagedAction' smart constructor.
data ApplyEnvironmentManagedAction = ApplyEnvironmentManagedAction'
  { -- | The name of the target environment.
    ApplyEnvironmentManagedAction -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text,
    -- | The environment ID of the target environment.
    ApplyEnvironmentManagedAction -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text,
    -- | The action ID of the scheduled managed action to execute.
    ApplyEnvironmentManagedAction -> Text
actionId :: Prelude.Text
  }
  deriving (ApplyEnvironmentManagedAction
-> ApplyEnvironmentManagedAction -> Bool
(ApplyEnvironmentManagedAction
 -> ApplyEnvironmentManagedAction -> Bool)
-> (ApplyEnvironmentManagedAction
    -> ApplyEnvironmentManagedAction -> Bool)
-> Eq ApplyEnvironmentManagedAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplyEnvironmentManagedAction
-> ApplyEnvironmentManagedAction -> Bool
$c/= :: ApplyEnvironmentManagedAction
-> ApplyEnvironmentManagedAction -> Bool
== :: ApplyEnvironmentManagedAction
-> ApplyEnvironmentManagedAction -> Bool
$c== :: ApplyEnvironmentManagedAction
-> ApplyEnvironmentManagedAction -> Bool
Prelude.Eq, ReadPrec [ApplyEnvironmentManagedAction]
ReadPrec ApplyEnvironmentManagedAction
Int -> ReadS ApplyEnvironmentManagedAction
ReadS [ApplyEnvironmentManagedAction]
(Int -> ReadS ApplyEnvironmentManagedAction)
-> ReadS [ApplyEnvironmentManagedAction]
-> ReadPrec ApplyEnvironmentManagedAction
-> ReadPrec [ApplyEnvironmentManagedAction]
-> Read ApplyEnvironmentManagedAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplyEnvironmentManagedAction]
$creadListPrec :: ReadPrec [ApplyEnvironmentManagedAction]
readPrec :: ReadPrec ApplyEnvironmentManagedAction
$creadPrec :: ReadPrec ApplyEnvironmentManagedAction
readList :: ReadS [ApplyEnvironmentManagedAction]
$creadList :: ReadS [ApplyEnvironmentManagedAction]
readsPrec :: Int -> ReadS ApplyEnvironmentManagedAction
$creadsPrec :: Int -> ReadS ApplyEnvironmentManagedAction
Prelude.Read, Int -> ApplyEnvironmentManagedAction -> ShowS
[ApplyEnvironmentManagedAction] -> ShowS
ApplyEnvironmentManagedAction -> String
(Int -> ApplyEnvironmentManagedAction -> ShowS)
-> (ApplyEnvironmentManagedAction -> String)
-> ([ApplyEnvironmentManagedAction] -> ShowS)
-> Show ApplyEnvironmentManagedAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplyEnvironmentManagedAction] -> ShowS
$cshowList :: [ApplyEnvironmentManagedAction] -> ShowS
show :: ApplyEnvironmentManagedAction -> String
$cshow :: ApplyEnvironmentManagedAction -> String
showsPrec :: Int -> ApplyEnvironmentManagedAction -> ShowS
$cshowsPrec :: Int -> ApplyEnvironmentManagedAction -> ShowS
Prelude.Show, (forall x.
 ApplyEnvironmentManagedAction
 -> Rep ApplyEnvironmentManagedAction x)
-> (forall x.
    Rep ApplyEnvironmentManagedAction x
    -> ApplyEnvironmentManagedAction)
-> Generic ApplyEnvironmentManagedAction
forall x.
Rep ApplyEnvironmentManagedAction x
-> ApplyEnvironmentManagedAction
forall x.
ApplyEnvironmentManagedAction
-> Rep ApplyEnvironmentManagedAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplyEnvironmentManagedAction x
-> ApplyEnvironmentManagedAction
$cfrom :: forall x.
ApplyEnvironmentManagedAction
-> Rep ApplyEnvironmentManagedAction x
Prelude.Generic)

-- |
-- Create a value of 'ApplyEnvironmentManagedAction' 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:
--
-- 'environmentName', 'applyEnvironmentManagedAction_environmentName' - The name of the target environment.
--
-- 'environmentId', 'applyEnvironmentManagedAction_environmentId' - The environment ID of the target environment.
--
-- 'actionId', 'applyEnvironmentManagedAction_actionId' - The action ID of the scheduled managed action to execute.
newApplyEnvironmentManagedAction ::
  -- | 'actionId'
  Prelude.Text ->
  ApplyEnvironmentManagedAction
newApplyEnvironmentManagedAction :: Text -> ApplyEnvironmentManagedAction
newApplyEnvironmentManagedAction Text
pActionId_ =
  ApplyEnvironmentManagedAction' :: Maybe Text -> Maybe Text -> Text -> ApplyEnvironmentManagedAction
ApplyEnvironmentManagedAction'
    { $sel:environmentName:ApplyEnvironmentManagedAction' :: Maybe Text
environmentName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentId:ApplyEnvironmentManagedAction' :: Maybe Text
environmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionId:ApplyEnvironmentManagedAction' :: Text
actionId = Text
pActionId_
    }

-- | The name of the target environment.
applyEnvironmentManagedAction_environmentName :: Lens.Lens' ApplyEnvironmentManagedAction (Prelude.Maybe Prelude.Text)
applyEnvironmentManagedAction_environmentName :: (Maybe Text -> f (Maybe Text))
-> ApplyEnvironmentManagedAction -> f ApplyEnvironmentManagedAction
applyEnvironmentManagedAction_environmentName = (ApplyEnvironmentManagedAction -> Maybe Text)
-> (ApplyEnvironmentManagedAction
    -> Maybe Text -> ApplyEnvironmentManagedAction)
-> Lens
     ApplyEnvironmentManagedAction
     ApplyEnvironmentManagedAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedAction' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:ApplyEnvironmentManagedAction' :: ApplyEnvironmentManagedAction -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: ApplyEnvironmentManagedAction
s@ApplyEnvironmentManagedAction' {} Maybe Text
a -> ApplyEnvironmentManagedAction
s {$sel:environmentName:ApplyEnvironmentManagedAction' :: Maybe Text
environmentName = Maybe Text
a} :: ApplyEnvironmentManagedAction)

-- | The environment ID of the target environment.
applyEnvironmentManagedAction_environmentId :: Lens.Lens' ApplyEnvironmentManagedAction (Prelude.Maybe Prelude.Text)
applyEnvironmentManagedAction_environmentId :: (Maybe Text -> f (Maybe Text))
-> ApplyEnvironmentManagedAction -> f ApplyEnvironmentManagedAction
applyEnvironmentManagedAction_environmentId = (ApplyEnvironmentManagedAction -> Maybe Text)
-> (ApplyEnvironmentManagedAction
    -> Maybe Text -> ApplyEnvironmentManagedAction)
-> Lens
     ApplyEnvironmentManagedAction
     ApplyEnvironmentManagedAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedAction' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:ApplyEnvironmentManagedAction' :: ApplyEnvironmentManagedAction -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: ApplyEnvironmentManagedAction
s@ApplyEnvironmentManagedAction' {} Maybe Text
a -> ApplyEnvironmentManagedAction
s {$sel:environmentId:ApplyEnvironmentManagedAction' :: Maybe Text
environmentId = Maybe Text
a} :: ApplyEnvironmentManagedAction)

-- | The action ID of the scheduled managed action to execute.
applyEnvironmentManagedAction_actionId :: Lens.Lens' ApplyEnvironmentManagedAction Prelude.Text
applyEnvironmentManagedAction_actionId :: (Text -> f Text)
-> ApplyEnvironmentManagedAction -> f ApplyEnvironmentManagedAction
applyEnvironmentManagedAction_actionId = (ApplyEnvironmentManagedAction -> Text)
-> (ApplyEnvironmentManagedAction
    -> Text -> ApplyEnvironmentManagedAction)
-> Lens
     ApplyEnvironmentManagedAction
     ApplyEnvironmentManagedAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedAction' {Text
actionId :: Text
$sel:actionId:ApplyEnvironmentManagedAction' :: ApplyEnvironmentManagedAction -> Text
actionId} -> Text
actionId) (\s :: ApplyEnvironmentManagedAction
s@ApplyEnvironmentManagedAction' {} Text
a -> ApplyEnvironmentManagedAction
s {$sel:actionId:ApplyEnvironmentManagedAction' :: Text
actionId = Text
a} :: ApplyEnvironmentManagedAction)

instance
  Core.AWSRequest
    ApplyEnvironmentManagedAction
  where
  type
    AWSResponse ApplyEnvironmentManagedAction =
      ApplyEnvironmentManagedActionResponse
  request :: ApplyEnvironmentManagedAction
-> Request ApplyEnvironmentManagedAction
request = Service
-> ApplyEnvironmentManagedAction
-> Request ApplyEnvironmentManagedAction
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ApplyEnvironmentManagedAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ApplyEnvironmentManagedAction)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ApplyEnvironmentManagedAction))
-> Logger
-> Service
-> Proxy ApplyEnvironmentManagedAction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ApplyEnvironmentManagedAction)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ApplyEnvironmentManagedActionResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ActionType
-> Int
-> ApplyEnvironmentManagedActionResponse
ApplyEnvironmentManagedActionResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ActionType
 -> Int
 -> ApplyEnvironmentManagedActionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ActionType
      -> Int
      -> ApplyEnvironmentManagedActionResponse)
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
"Status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ActionType
   -> Int
   -> ApplyEnvironmentManagedActionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ActionType
      -> Int
      -> ApplyEnvironmentManagedActionResponse)
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
"ActionId")
            Either
  String
  (Maybe Text
   -> Maybe ActionType
   -> Int
   -> ApplyEnvironmentManagedActionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ActionType -> Int -> ApplyEnvironmentManagedActionResponse)
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
"ActionDescription")
            Either
  String
  (Maybe ActionType -> Int -> ApplyEnvironmentManagedActionResponse)
-> Either String (Maybe ActionType)
-> Either String (Int -> ApplyEnvironmentManagedActionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ActionType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ActionType")
            Either String (Int -> ApplyEnvironmentManagedActionResponse)
-> Either String Int
-> Either String ApplyEnvironmentManagedActionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ApplyEnvironmentManagedAction

instance Prelude.NFData ApplyEnvironmentManagedAction

instance Core.ToHeaders ApplyEnvironmentManagedAction where
  toHeaders :: ApplyEnvironmentManagedAction -> ResponseHeaders
toHeaders = ResponseHeaders -> ApplyEnvironmentManagedAction -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ApplyEnvironmentManagedAction where
  toQuery :: ApplyEnvironmentManagedAction -> QueryString
toQuery ApplyEnvironmentManagedAction' {Maybe Text
Text
actionId :: Text
environmentId :: Maybe Text
environmentName :: Maybe Text
$sel:actionId:ApplyEnvironmentManagedAction' :: ApplyEnvironmentManagedAction -> Text
$sel:environmentId:ApplyEnvironmentManagedAction' :: ApplyEnvironmentManagedAction -> Maybe Text
$sel:environmentName:ApplyEnvironmentManagedAction' :: ApplyEnvironmentManagedAction -> Maybe 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
"ApplyEnvironmentManagedAction" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"EnvironmentName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentName,
        ByteString
"EnvironmentId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentId,
        ByteString
"ActionId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
actionId
      ]

-- | The result message containing information about the managed action.
--
-- /See:/ 'newApplyEnvironmentManagedActionResponse' smart constructor.
data ApplyEnvironmentManagedActionResponse = ApplyEnvironmentManagedActionResponse'
  { -- | The status of the managed action.
    ApplyEnvironmentManagedActionResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The action ID of the managed action.
    ApplyEnvironmentManagedActionResponse -> Maybe Text
actionId :: Prelude.Maybe Prelude.Text,
    -- | A description of the managed action.
    ApplyEnvironmentManagedActionResponse -> Maybe Text
actionDescription :: Prelude.Maybe Prelude.Text,
    -- | The type of managed action.
    ApplyEnvironmentManagedActionResponse -> Maybe ActionType
actionType :: Prelude.Maybe ActionType,
    -- | The response's http status code.
    ApplyEnvironmentManagedActionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ApplyEnvironmentManagedActionResponse
-> ApplyEnvironmentManagedActionResponse -> Bool
(ApplyEnvironmentManagedActionResponse
 -> ApplyEnvironmentManagedActionResponse -> Bool)
-> (ApplyEnvironmentManagedActionResponse
    -> ApplyEnvironmentManagedActionResponse -> Bool)
-> Eq ApplyEnvironmentManagedActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplyEnvironmentManagedActionResponse
-> ApplyEnvironmentManagedActionResponse -> Bool
$c/= :: ApplyEnvironmentManagedActionResponse
-> ApplyEnvironmentManagedActionResponse -> Bool
== :: ApplyEnvironmentManagedActionResponse
-> ApplyEnvironmentManagedActionResponse -> Bool
$c== :: ApplyEnvironmentManagedActionResponse
-> ApplyEnvironmentManagedActionResponse -> Bool
Prelude.Eq, ReadPrec [ApplyEnvironmentManagedActionResponse]
ReadPrec ApplyEnvironmentManagedActionResponse
Int -> ReadS ApplyEnvironmentManagedActionResponse
ReadS [ApplyEnvironmentManagedActionResponse]
(Int -> ReadS ApplyEnvironmentManagedActionResponse)
-> ReadS [ApplyEnvironmentManagedActionResponse]
-> ReadPrec ApplyEnvironmentManagedActionResponse
-> ReadPrec [ApplyEnvironmentManagedActionResponse]
-> Read ApplyEnvironmentManagedActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplyEnvironmentManagedActionResponse]
$creadListPrec :: ReadPrec [ApplyEnvironmentManagedActionResponse]
readPrec :: ReadPrec ApplyEnvironmentManagedActionResponse
$creadPrec :: ReadPrec ApplyEnvironmentManagedActionResponse
readList :: ReadS [ApplyEnvironmentManagedActionResponse]
$creadList :: ReadS [ApplyEnvironmentManagedActionResponse]
readsPrec :: Int -> ReadS ApplyEnvironmentManagedActionResponse
$creadsPrec :: Int -> ReadS ApplyEnvironmentManagedActionResponse
Prelude.Read, Int -> ApplyEnvironmentManagedActionResponse -> ShowS
[ApplyEnvironmentManagedActionResponse] -> ShowS
ApplyEnvironmentManagedActionResponse -> String
(Int -> ApplyEnvironmentManagedActionResponse -> ShowS)
-> (ApplyEnvironmentManagedActionResponse -> String)
-> ([ApplyEnvironmentManagedActionResponse] -> ShowS)
-> Show ApplyEnvironmentManagedActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplyEnvironmentManagedActionResponse] -> ShowS
$cshowList :: [ApplyEnvironmentManagedActionResponse] -> ShowS
show :: ApplyEnvironmentManagedActionResponse -> String
$cshow :: ApplyEnvironmentManagedActionResponse -> String
showsPrec :: Int -> ApplyEnvironmentManagedActionResponse -> ShowS
$cshowsPrec :: Int -> ApplyEnvironmentManagedActionResponse -> ShowS
Prelude.Show, (forall x.
 ApplyEnvironmentManagedActionResponse
 -> Rep ApplyEnvironmentManagedActionResponse x)
-> (forall x.
    Rep ApplyEnvironmentManagedActionResponse x
    -> ApplyEnvironmentManagedActionResponse)
-> Generic ApplyEnvironmentManagedActionResponse
forall x.
Rep ApplyEnvironmentManagedActionResponse x
-> ApplyEnvironmentManagedActionResponse
forall x.
ApplyEnvironmentManagedActionResponse
-> Rep ApplyEnvironmentManagedActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplyEnvironmentManagedActionResponse x
-> ApplyEnvironmentManagedActionResponse
$cfrom :: forall x.
ApplyEnvironmentManagedActionResponse
-> Rep ApplyEnvironmentManagedActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'ApplyEnvironmentManagedActionResponse' 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:
--
-- 'status', 'applyEnvironmentManagedActionResponse_status' - The status of the managed action.
--
-- 'actionId', 'applyEnvironmentManagedActionResponse_actionId' - The action ID of the managed action.
--
-- 'actionDescription', 'applyEnvironmentManagedActionResponse_actionDescription' - A description of the managed action.
--
-- 'actionType', 'applyEnvironmentManagedActionResponse_actionType' - The type of managed action.
--
-- 'httpStatus', 'applyEnvironmentManagedActionResponse_httpStatus' - The response's http status code.
newApplyEnvironmentManagedActionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ApplyEnvironmentManagedActionResponse
newApplyEnvironmentManagedActionResponse :: Int -> ApplyEnvironmentManagedActionResponse
newApplyEnvironmentManagedActionResponse Int
pHttpStatus_ =
  ApplyEnvironmentManagedActionResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ActionType
-> Int
-> ApplyEnvironmentManagedActionResponse
ApplyEnvironmentManagedActionResponse'
    { $sel:status:ApplyEnvironmentManagedActionResponse' :: Maybe Text
status =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionId:ApplyEnvironmentManagedActionResponse' :: Maybe Text
actionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionDescription:ApplyEnvironmentManagedActionResponse' :: Maybe Text
actionDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionType:ApplyEnvironmentManagedActionResponse' :: Maybe ActionType
actionType = Maybe ActionType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ApplyEnvironmentManagedActionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the managed action.
applyEnvironmentManagedActionResponse_status :: Lens.Lens' ApplyEnvironmentManagedActionResponse (Prelude.Maybe Prelude.Text)
applyEnvironmentManagedActionResponse_status :: (Maybe Text -> f (Maybe Text))
-> ApplyEnvironmentManagedActionResponse
-> f ApplyEnvironmentManagedActionResponse
applyEnvironmentManagedActionResponse_status = (ApplyEnvironmentManagedActionResponse -> Maybe Text)
-> (ApplyEnvironmentManagedActionResponse
    -> Maybe Text -> ApplyEnvironmentManagedActionResponse)
-> Lens
     ApplyEnvironmentManagedActionResponse
     ApplyEnvironmentManagedActionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedActionResponse' {Maybe Text
status :: Maybe Text
$sel:status:ApplyEnvironmentManagedActionResponse' :: ApplyEnvironmentManagedActionResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: ApplyEnvironmentManagedActionResponse
s@ApplyEnvironmentManagedActionResponse' {} Maybe Text
a -> ApplyEnvironmentManagedActionResponse
s {$sel:status:ApplyEnvironmentManagedActionResponse' :: Maybe Text
status = Maybe Text
a} :: ApplyEnvironmentManagedActionResponse)

-- | The action ID of the managed action.
applyEnvironmentManagedActionResponse_actionId :: Lens.Lens' ApplyEnvironmentManagedActionResponse (Prelude.Maybe Prelude.Text)
applyEnvironmentManagedActionResponse_actionId :: (Maybe Text -> f (Maybe Text))
-> ApplyEnvironmentManagedActionResponse
-> f ApplyEnvironmentManagedActionResponse
applyEnvironmentManagedActionResponse_actionId = (ApplyEnvironmentManagedActionResponse -> Maybe Text)
-> (ApplyEnvironmentManagedActionResponse
    -> Maybe Text -> ApplyEnvironmentManagedActionResponse)
-> Lens
     ApplyEnvironmentManagedActionResponse
     ApplyEnvironmentManagedActionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedActionResponse' {Maybe Text
actionId :: Maybe Text
$sel:actionId:ApplyEnvironmentManagedActionResponse' :: ApplyEnvironmentManagedActionResponse -> Maybe Text
actionId} -> Maybe Text
actionId) (\s :: ApplyEnvironmentManagedActionResponse
s@ApplyEnvironmentManagedActionResponse' {} Maybe Text
a -> ApplyEnvironmentManagedActionResponse
s {$sel:actionId:ApplyEnvironmentManagedActionResponse' :: Maybe Text
actionId = Maybe Text
a} :: ApplyEnvironmentManagedActionResponse)

-- | A description of the managed action.
applyEnvironmentManagedActionResponse_actionDescription :: Lens.Lens' ApplyEnvironmentManagedActionResponse (Prelude.Maybe Prelude.Text)
applyEnvironmentManagedActionResponse_actionDescription :: (Maybe Text -> f (Maybe Text))
-> ApplyEnvironmentManagedActionResponse
-> f ApplyEnvironmentManagedActionResponse
applyEnvironmentManagedActionResponse_actionDescription = (ApplyEnvironmentManagedActionResponse -> Maybe Text)
-> (ApplyEnvironmentManagedActionResponse
    -> Maybe Text -> ApplyEnvironmentManagedActionResponse)
-> Lens
     ApplyEnvironmentManagedActionResponse
     ApplyEnvironmentManagedActionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedActionResponse' {Maybe Text
actionDescription :: Maybe Text
$sel:actionDescription:ApplyEnvironmentManagedActionResponse' :: ApplyEnvironmentManagedActionResponse -> Maybe Text
actionDescription} -> Maybe Text
actionDescription) (\s :: ApplyEnvironmentManagedActionResponse
s@ApplyEnvironmentManagedActionResponse' {} Maybe Text
a -> ApplyEnvironmentManagedActionResponse
s {$sel:actionDescription:ApplyEnvironmentManagedActionResponse' :: Maybe Text
actionDescription = Maybe Text
a} :: ApplyEnvironmentManagedActionResponse)

-- | The type of managed action.
applyEnvironmentManagedActionResponse_actionType :: Lens.Lens' ApplyEnvironmentManagedActionResponse (Prelude.Maybe ActionType)
applyEnvironmentManagedActionResponse_actionType :: (Maybe ActionType -> f (Maybe ActionType))
-> ApplyEnvironmentManagedActionResponse
-> f ApplyEnvironmentManagedActionResponse
applyEnvironmentManagedActionResponse_actionType = (ApplyEnvironmentManagedActionResponse -> Maybe ActionType)
-> (ApplyEnvironmentManagedActionResponse
    -> Maybe ActionType -> ApplyEnvironmentManagedActionResponse)
-> Lens
     ApplyEnvironmentManagedActionResponse
     ApplyEnvironmentManagedActionResponse
     (Maybe ActionType)
     (Maybe ActionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedActionResponse' {Maybe ActionType
actionType :: Maybe ActionType
$sel:actionType:ApplyEnvironmentManagedActionResponse' :: ApplyEnvironmentManagedActionResponse -> Maybe ActionType
actionType} -> Maybe ActionType
actionType) (\s :: ApplyEnvironmentManagedActionResponse
s@ApplyEnvironmentManagedActionResponse' {} Maybe ActionType
a -> ApplyEnvironmentManagedActionResponse
s {$sel:actionType:ApplyEnvironmentManagedActionResponse' :: Maybe ActionType
actionType = Maybe ActionType
a} :: ApplyEnvironmentManagedActionResponse)

-- | The response's http status code.
applyEnvironmentManagedActionResponse_httpStatus :: Lens.Lens' ApplyEnvironmentManagedActionResponse Prelude.Int
applyEnvironmentManagedActionResponse_httpStatus :: (Int -> f Int)
-> ApplyEnvironmentManagedActionResponse
-> f ApplyEnvironmentManagedActionResponse
applyEnvironmentManagedActionResponse_httpStatus = (ApplyEnvironmentManagedActionResponse -> Int)
-> (ApplyEnvironmentManagedActionResponse
    -> Int -> ApplyEnvironmentManagedActionResponse)
-> Lens
     ApplyEnvironmentManagedActionResponse
     ApplyEnvironmentManagedActionResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplyEnvironmentManagedActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:ApplyEnvironmentManagedActionResponse' :: ApplyEnvironmentManagedActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ApplyEnvironmentManagedActionResponse
s@ApplyEnvironmentManagedActionResponse' {} Int
a -> ApplyEnvironmentManagedActionResponse
s {$sel:httpStatus:ApplyEnvironmentManagedActionResponse' :: Int
httpStatus = Int
a} :: ApplyEnvironmentManagedActionResponse)

instance
  Prelude.NFData
    ApplyEnvironmentManagedActionResponse