{-# 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.CloudFormation.ContinueUpdateRollback
-- 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)
--
-- For a specified stack that is in the @UPDATE_ROLLBACK_FAILED@ state,
-- continues rolling it back to the @UPDATE_ROLLBACK_COMPLETE@ state.
-- Depending on the cause of the failure, you can manually
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed fix the error>
-- and continue the rollback. By continuing the rollback, you can return
-- your stack to a working state (the @UPDATE_ROLLBACK_COMPLETE@ state),
-- and then try to update the stack again.
--
-- A stack goes into the @UPDATE_ROLLBACK_FAILED@ state when CloudFormation
-- cannot roll back all changes after a failed stack update. For example,
-- you might have a stack that is rolling back to an old database instance
-- that was deleted outside of CloudFormation. Because CloudFormation
-- doesn\'t know the database was deleted, it assumes that the database
-- instance still exists and attempts to roll back to it, causing the
-- update rollback to fail.
module Amazonka.CloudFormation.ContinueUpdateRollback
  ( -- * Creating a Request
    ContinueUpdateRollback (..),
    newContinueUpdateRollback,

    -- * Request Lenses
    continueUpdateRollback_resourcesToSkip,
    continueUpdateRollback_clientRequestToken,
    continueUpdateRollback_roleARN,
    continueUpdateRollback_stackName,

    -- * Destructuring the Response
    ContinueUpdateRollbackResponse (..),
    newContinueUpdateRollbackResponse,

    -- * Response Lenses
    continueUpdateRollbackResponse_httpStatus,
  )
where

import Amazonka.CloudFormation.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

-- | The input for the ContinueUpdateRollback action.
--
-- /See:/ 'newContinueUpdateRollback' smart constructor.
data ContinueUpdateRollback = ContinueUpdateRollback'
  { -- | A list of the logical IDs of the resources that CloudFormation skips
    -- during the continue update rollback operation. You can specify only
    -- resources that are in the @UPDATE_FAILED@ state because a rollback
    -- failed. You can\'t specify resources that are in the @UPDATE_FAILED@
    -- state for other reasons, for example, because an update was cancelled.
    -- To check why a resource update failed, use the DescribeStackResources
    -- action, and view the resource status reason.
    --
    -- Specify this property to skip rolling back resources that CloudFormation
    -- can\'t successfully roll back. We recommend that you
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed troubleshoot>
    -- resources before skipping them. CloudFormation sets the status of the
    -- specified resources to @UPDATE_COMPLETE@ and continues to roll back the
    -- stack. After the rollback is complete, the state of the skipped
    -- resources will be inconsistent with the state of the resources in the
    -- stack template. Before performing another stack update, you must update
    -- the stack or resources to be consistent with each other. If you don\'t,
    -- subsequent stack updates might fail, and the stack will become
    -- unrecoverable.
    --
    -- Specify the minimum number of resources required to successfully roll
    -- back your stack. For example, a failed resource update might cause
    -- dependent resources to fail. In this case, it might not be necessary to
    -- skip the dependent resources.
    --
    -- To skip resources that are part of nested stacks, use the following
    -- format: @NestedStackName.ResourceLogicalID@. If you want to specify the
    -- logical ID of a stack resource (@Type: AWS::CloudFormation::Stack@) in
    -- the @ResourcesToSkip@ list, then its corresponding embedded stack must
    -- be in one of the following states: @DELETE_IN_PROGRESS@,
    -- @DELETE_COMPLETE@, or @DELETE_FAILED@.
    --
    -- Don\'t confuse a child stack\'s name with its corresponding logical ID
    -- defined in the parent stack. For an example of a continue update
    -- rollback operation with nested stacks, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html#nested-stacks Using ResourcesToSkip to recover a nested stacks hierarchy>.
    ContinueUpdateRollback -> Maybe [Text]
resourcesToSkip :: Prelude.Maybe [Prelude.Text],
    -- | A unique identifier for this @ContinueUpdateRollback@ request. Specify
    -- this token if you plan to retry requests so that CloudFormationknows
    -- that you\'re not attempting to continue the rollback to a stack with the
    -- same name. You might retry @ContinueUpdateRollback@ requests to ensure
    -- that CloudFormation successfully received them.
    ContinueUpdateRollback -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an Identity and Access Management
    -- (IAM) role that CloudFormation assumes to roll back the stack.
    -- CloudFormation uses the role\'s credentials to make calls on your
    -- behalf. CloudFormation always uses this role for all future operations
    -- on the stack. As long as users have permission to operate on the stack,
    -- CloudFormation uses this role even if the users don\'t have permission
    -- to pass it. Ensure that the role grants least privilege.
    --
    -- If you don\'t specify a value, CloudFormation uses the role that was
    -- previously associated with the stack. If no role is available,
    -- CloudFormation uses a temporary session that is generated from your user
    -- credentials.
    ContinueUpdateRollback -> Maybe Text
roleARN :: Prelude.Maybe Prelude.Text,
    -- | The name or the unique ID of the stack that you want to continue rolling
    -- back.
    --
    -- Don\'t specify the name of a nested stack (a stack that was created by
    -- using the @AWS::CloudFormation::Stack@ resource). Instead, use this
    -- operation on the parent stack (the stack that contains the
    -- @AWS::CloudFormation::Stack@ resource).
    ContinueUpdateRollback -> Text
stackName :: Prelude.Text
  }
  deriving (ContinueUpdateRollback -> ContinueUpdateRollback -> Bool
(ContinueUpdateRollback -> ContinueUpdateRollback -> Bool)
-> (ContinueUpdateRollback -> ContinueUpdateRollback -> Bool)
-> Eq ContinueUpdateRollback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContinueUpdateRollback -> ContinueUpdateRollback -> Bool
$c/= :: ContinueUpdateRollback -> ContinueUpdateRollback -> Bool
== :: ContinueUpdateRollback -> ContinueUpdateRollback -> Bool
$c== :: ContinueUpdateRollback -> ContinueUpdateRollback -> Bool
Prelude.Eq, ReadPrec [ContinueUpdateRollback]
ReadPrec ContinueUpdateRollback
Int -> ReadS ContinueUpdateRollback
ReadS [ContinueUpdateRollback]
(Int -> ReadS ContinueUpdateRollback)
-> ReadS [ContinueUpdateRollback]
-> ReadPrec ContinueUpdateRollback
-> ReadPrec [ContinueUpdateRollback]
-> Read ContinueUpdateRollback
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContinueUpdateRollback]
$creadListPrec :: ReadPrec [ContinueUpdateRollback]
readPrec :: ReadPrec ContinueUpdateRollback
$creadPrec :: ReadPrec ContinueUpdateRollback
readList :: ReadS [ContinueUpdateRollback]
$creadList :: ReadS [ContinueUpdateRollback]
readsPrec :: Int -> ReadS ContinueUpdateRollback
$creadsPrec :: Int -> ReadS ContinueUpdateRollback
Prelude.Read, Int -> ContinueUpdateRollback -> ShowS
[ContinueUpdateRollback] -> ShowS
ContinueUpdateRollback -> String
(Int -> ContinueUpdateRollback -> ShowS)
-> (ContinueUpdateRollback -> String)
-> ([ContinueUpdateRollback] -> ShowS)
-> Show ContinueUpdateRollback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContinueUpdateRollback] -> ShowS
$cshowList :: [ContinueUpdateRollback] -> ShowS
show :: ContinueUpdateRollback -> String
$cshow :: ContinueUpdateRollback -> String
showsPrec :: Int -> ContinueUpdateRollback -> ShowS
$cshowsPrec :: Int -> ContinueUpdateRollback -> ShowS
Prelude.Show, (forall x. ContinueUpdateRollback -> Rep ContinueUpdateRollback x)
-> (forall x.
    Rep ContinueUpdateRollback x -> ContinueUpdateRollback)
-> Generic ContinueUpdateRollback
forall x. Rep ContinueUpdateRollback x -> ContinueUpdateRollback
forall x. ContinueUpdateRollback -> Rep ContinueUpdateRollback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContinueUpdateRollback x -> ContinueUpdateRollback
$cfrom :: forall x. ContinueUpdateRollback -> Rep ContinueUpdateRollback x
Prelude.Generic)

-- |
-- Create a value of 'ContinueUpdateRollback' 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:
--
-- 'resourcesToSkip', 'continueUpdateRollback_resourcesToSkip' - A list of the logical IDs of the resources that CloudFormation skips
-- during the continue update rollback operation. You can specify only
-- resources that are in the @UPDATE_FAILED@ state because a rollback
-- failed. You can\'t specify resources that are in the @UPDATE_FAILED@
-- state for other reasons, for example, because an update was cancelled.
-- To check why a resource update failed, use the DescribeStackResources
-- action, and view the resource status reason.
--
-- Specify this property to skip rolling back resources that CloudFormation
-- can\'t successfully roll back. We recommend that you
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed troubleshoot>
-- resources before skipping them. CloudFormation sets the status of the
-- specified resources to @UPDATE_COMPLETE@ and continues to roll back the
-- stack. After the rollback is complete, the state of the skipped
-- resources will be inconsistent with the state of the resources in the
-- stack template. Before performing another stack update, you must update
-- the stack or resources to be consistent with each other. If you don\'t,
-- subsequent stack updates might fail, and the stack will become
-- unrecoverable.
--
-- Specify the minimum number of resources required to successfully roll
-- back your stack. For example, a failed resource update might cause
-- dependent resources to fail. In this case, it might not be necessary to
-- skip the dependent resources.
--
-- To skip resources that are part of nested stacks, use the following
-- format: @NestedStackName.ResourceLogicalID@. If you want to specify the
-- logical ID of a stack resource (@Type: AWS::CloudFormation::Stack@) in
-- the @ResourcesToSkip@ list, then its corresponding embedded stack must
-- be in one of the following states: @DELETE_IN_PROGRESS@,
-- @DELETE_COMPLETE@, or @DELETE_FAILED@.
--
-- Don\'t confuse a child stack\'s name with its corresponding logical ID
-- defined in the parent stack. For an example of a continue update
-- rollback operation with nested stacks, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html#nested-stacks Using ResourcesToSkip to recover a nested stacks hierarchy>.
--
-- 'clientRequestToken', 'continueUpdateRollback_clientRequestToken' - A unique identifier for this @ContinueUpdateRollback@ request. Specify
-- this token if you plan to retry requests so that CloudFormationknows
-- that you\'re not attempting to continue the rollback to a stack with the
-- same name. You might retry @ContinueUpdateRollback@ requests to ensure
-- that CloudFormation successfully received them.
--
-- 'roleARN', 'continueUpdateRollback_roleARN' - The Amazon Resource Name (ARN) of an Identity and Access Management
-- (IAM) role that CloudFormation assumes to roll back the stack.
-- CloudFormation uses the role\'s credentials to make calls on your
-- behalf. CloudFormation always uses this role for all future operations
-- on the stack. As long as users have permission to operate on the stack,
-- CloudFormation uses this role even if the users don\'t have permission
-- to pass it. Ensure that the role grants least privilege.
--
-- If you don\'t specify a value, CloudFormation uses the role that was
-- previously associated with the stack. If no role is available,
-- CloudFormation uses a temporary session that is generated from your user
-- credentials.
--
-- 'stackName', 'continueUpdateRollback_stackName' - The name or the unique ID of the stack that you want to continue rolling
-- back.
--
-- Don\'t specify the name of a nested stack (a stack that was created by
-- using the @AWS::CloudFormation::Stack@ resource). Instead, use this
-- operation on the parent stack (the stack that contains the
-- @AWS::CloudFormation::Stack@ resource).
newContinueUpdateRollback ::
  -- | 'stackName'
  Prelude.Text ->
  ContinueUpdateRollback
newContinueUpdateRollback :: Text -> ContinueUpdateRollback
newContinueUpdateRollback Text
pStackName_ =
  ContinueUpdateRollback' :: Maybe [Text]
-> Maybe Text -> Maybe Text -> Text -> ContinueUpdateRollback
ContinueUpdateRollback'
    { $sel:resourcesToSkip:ContinueUpdateRollback' :: Maybe [Text]
resourcesToSkip =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:ContinueUpdateRollback' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleARN:ContinueUpdateRollback' :: Maybe Text
roleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:ContinueUpdateRollback' :: Text
stackName = Text
pStackName_
    }

-- | A list of the logical IDs of the resources that CloudFormation skips
-- during the continue update rollback operation. You can specify only
-- resources that are in the @UPDATE_FAILED@ state because a rollback
-- failed. You can\'t specify resources that are in the @UPDATE_FAILED@
-- state for other reasons, for example, because an update was cancelled.
-- To check why a resource update failed, use the DescribeStackResources
-- action, and view the resource status reason.
--
-- Specify this property to skip rolling back resources that CloudFormation
-- can\'t successfully roll back. We recommend that you
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed troubleshoot>
-- resources before skipping them. CloudFormation sets the status of the
-- specified resources to @UPDATE_COMPLETE@ and continues to roll back the
-- stack. After the rollback is complete, the state of the skipped
-- resources will be inconsistent with the state of the resources in the
-- stack template. Before performing another stack update, you must update
-- the stack or resources to be consistent with each other. If you don\'t,
-- subsequent stack updates might fail, and the stack will become
-- unrecoverable.
--
-- Specify the minimum number of resources required to successfully roll
-- back your stack. For example, a failed resource update might cause
-- dependent resources to fail. In this case, it might not be necessary to
-- skip the dependent resources.
--
-- To skip resources that are part of nested stacks, use the following
-- format: @NestedStackName.ResourceLogicalID@. If you want to specify the
-- logical ID of a stack resource (@Type: AWS::CloudFormation::Stack@) in
-- the @ResourcesToSkip@ list, then its corresponding embedded stack must
-- be in one of the following states: @DELETE_IN_PROGRESS@,
-- @DELETE_COMPLETE@, or @DELETE_FAILED@.
--
-- Don\'t confuse a child stack\'s name with its corresponding logical ID
-- defined in the parent stack. For an example of a continue update
-- rollback operation with nested stacks, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-continueupdaterollback.html#nested-stacks Using ResourcesToSkip to recover a nested stacks hierarchy>.
continueUpdateRollback_resourcesToSkip :: Lens.Lens' ContinueUpdateRollback (Prelude.Maybe [Prelude.Text])
continueUpdateRollback_resourcesToSkip :: (Maybe [Text] -> f (Maybe [Text]))
-> ContinueUpdateRollback -> f ContinueUpdateRollback
continueUpdateRollback_resourcesToSkip = (ContinueUpdateRollback -> Maybe [Text])
-> (ContinueUpdateRollback
    -> Maybe [Text] -> ContinueUpdateRollback)
-> Lens
     ContinueUpdateRollback
     ContinueUpdateRollback
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueUpdateRollback' {Maybe [Text]
resourcesToSkip :: Maybe [Text]
$sel:resourcesToSkip:ContinueUpdateRollback' :: ContinueUpdateRollback -> Maybe [Text]
resourcesToSkip} -> Maybe [Text]
resourcesToSkip) (\s :: ContinueUpdateRollback
s@ContinueUpdateRollback' {} Maybe [Text]
a -> ContinueUpdateRollback
s {$sel:resourcesToSkip:ContinueUpdateRollback' :: Maybe [Text]
resourcesToSkip = Maybe [Text]
a} :: ContinueUpdateRollback) ((Maybe [Text] -> f (Maybe [Text]))
 -> ContinueUpdateRollback -> f ContinueUpdateRollback)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ContinueUpdateRollback
-> f ContinueUpdateRollback
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for this @ContinueUpdateRollback@ request. Specify
-- this token if you plan to retry requests so that CloudFormationknows
-- that you\'re not attempting to continue the rollback to a stack with the
-- same name. You might retry @ContinueUpdateRollback@ requests to ensure
-- that CloudFormation successfully received them.
continueUpdateRollback_clientRequestToken :: Lens.Lens' ContinueUpdateRollback (Prelude.Maybe Prelude.Text)
continueUpdateRollback_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> ContinueUpdateRollback -> f ContinueUpdateRollback
continueUpdateRollback_clientRequestToken = (ContinueUpdateRollback -> Maybe Text)
-> (ContinueUpdateRollback -> Maybe Text -> ContinueUpdateRollback)
-> Lens
     ContinueUpdateRollback
     ContinueUpdateRollback
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueUpdateRollback' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:ContinueUpdateRollback' :: ContinueUpdateRollback -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: ContinueUpdateRollback
s@ContinueUpdateRollback' {} Maybe Text
a -> ContinueUpdateRollback
s {$sel:clientRequestToken:ContinueUpdateRollback' :: Maybe Text
clientRequestToken = Maybe Text
a} :: ContinueUpdateRollback)

-- | The Amazon Resource Name (ARN) of an Identity and Access Management
-- (IAM) role that CloudFormation assumes to roll back the stack.
-- CloudFormation uses the role\'s credentials to make calls on your
-- behalf. CloudFormation always uses this role for all future operations
-- on the stack. As long as users have permission to operate on the stack,
-- CloudFormation uses this role even if the users don\'t have permission
-- to pass it. Ensure that the role grants least privilege.
--
-- If you don\'t specify a value, CloudFormation uses the role that was
-- previously associated with the stack. If no role is available,
-- CloudFormation uses a temporary session that is generated from your user
-- credentials.
continueUpdateRollback_roleARN :: Lens.Lens' ContinueUpdateRollback (Prelude.Maybe Prelude.Text)
continueUpdateRollback_roleARN :: (Maybe Text -> f (Maybe Text))
-> ContinueUpdateRollback -> f ContinueUpdateRollback
continueUpdateRollback_roleARN = (ContinueUpdateRollback -> Maybe Text)
-> (ContinueUpdateRollback -> Maybe Text -> ContinueUpdateRollback)
-> Lens
     ContinueUpdateRollback
     ContinueUpdateRollback
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueUpdateRollback' {Maybe Text
roleARN :: Maybe Text
$sel:roleARN:ContinueUpdateRollback' :: ContinueUpdateRollback -> Maybe Text
roleARN} -> Maybe Text
roleARN) (\s :: ContinueUpdateRollback
s@ContinueUpdateRollback' {} Maybe Text
a -> ContinueUpdateRollback
s {$sel:roleARN:ContinueUpdateRollback' :: Maybe Text
roleARN = Maybe Text
a} :: ContinueUpdateRollback)

-- | The name or the unique ID of the stack that you want to continue rolling
-- back.
--
-- Don\'t specify the name of a nested stack (a stack that was created by
-- using the @AWS::CloudFormation::Stack@ resource). Instead, use this
-- operation on the parent stack (the stack that contains the
-- @AWS::CloudFormation::Stack@ resource).
continueUpdateRollback_stackName :: Lens.Lens' ContinueUpdateRollback Prelude.Text
continueUpdateRollback_stackName :: (Text -> f Text)
-> ContinueUpdateRollback -> f ContinueUpdateRollback
continueUpdateRollback_stackName = (ContinueUpdateRollback -> Text)
-> (ContinueUpdateRollback -> Text -> ContinueUpdateRollback)
-> Lens ContinueUpdateRollback ContinueUpdateRollback Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContinueUpdateRollback' {Text
stackName :: Text
$sel:stackName:ContinueUpdateRollback' :: ContinueUpdateRollback -> Text
stackName} -> Text
stackName) (\s :: ContinueUpdateRollback
s@ContinueUpdateRollback' {} Text
a -> ContinueUpdateRollback
s {$sel:stackName:ContinueUpdateRollback' :: Text
stackName = Text
a} :: ContinueUpdateRollback)

instance Core.AWSRequest ContinueUpdateRollback where
  type
    AWSResponse ContinueUpdateRollback =
      ContinueUpdateRollbackResponse
  request :: ContinueUpdateRollback -> Request ContinueUpdateRollback
request = Service -> ContinueUpdateRollback -> Request ContinueUpdateRollback
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ContinueUpdateRollback
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ContinueUpdateRollback)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ContinueUpdateRollback))
-> Logger
-> Service
-> Proxy ContinueUpdateRollback
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ContinueUpdateRollback)))
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
"ContinueUpdateRollbackResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> ContinueUpdateRollbackResponse
ContinueUpdateRollbackResponse'
            (Int -> ContinueUpdateRollbackResponse)
-> Either String Int
-> Either String ContinueUpdateRollbackResponse
forall (f :: * -> *) a b. Functor 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 ContinueUpdateRollback

instance Prelude.NFData ContinueUpdateRollback

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

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

instance Core.ToQuery ContinueUpdateRollback where
  toQuery :: ContinueUpdateRollback -> QueryString
toQuery ContinueUpdateRollback' {Maybe [Text]
Maybe Text
Text
stackName :: Text
roleARN :: Maybe Text
clientRequestToken :: Maybe Text
resourcesToSkip :: Maybe [Text]
$sel:stackName:ContinueUpdateRollback' :: ContinueUpdateRollback -> Text
$sel:roleARN:ContinueUpdateRollback' :: ContinueUpdateRollback -> Maybe Text
$sel:clientRequestToken:ContinueUpdateRollback' :: ContinueUpdateRollback -> Maybe Text
$sel:resourcesToSkip:ContinueUpdateRollback' :: ContinueUpdateRollback -> 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
"ContinueUpdateRollback" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"ResourcesToSkip"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resourcesToSkip
            ),
        ByteString
"ClientRequestToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientRequestToken,
        ByteString
"RoleARN" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
roleARN,
        ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
      ]

-- | The output for a ContinueUpdateRollback action.
--
-- /See:/ 'newContinueUpdateRollbackResponse' smart constructor.
data ContinueUpdateRollbackResponse = ContinueUpdateRollbackResponse'
  { -- | The response's http status code.
    ContinueUpdateRollbackResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ContinueUpdateRollbackResponse
-> ContinueUpdateRollbackResponse -> Bool
(ContinueUpdateRollbackResponse
 -> ContinueUpdateRollbackResponse -> Bool)
-> (ContinueUpdateRollbackResponse
    -> ContinueUpdateRollbackResponse -> Bool)
-> Eq ContinueUpdateRollbackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContinueUpdateRollbackResponse
-> ContinueUpdateRollbackResponse -> Bool
$c/= :: ContinueUpdateRollbackResponse
-> ContinueUpdateRollbackResponse -> Bool
== :: ContinueUpdateRollbackResponse
-> ContinueUpdateRollbackResponse -> Bool
$c== :: ContinueUpdateRollbackResponse
-> ContinueUpdateRollbackResponse -> Bool
Prelude.Eq, ReadPrec [ContinueUpdateRollbackResponse]
ReadPrec ContinueUpdateRollbackResponse
Int -> ReadS ContinueUpdateRollbackResponse
ReadS [ContinueUpdateRollbackResponse]
(Int -> ReadS ContinueUpdateRollbackResponse)
-> ReadS [ContinueUpdateRollbackResponse]
-> ReadPrec ContinueUpdateRollbackResponse
-> ReadPrec [ContinueUpdateRollbackResponse]
-> Read ContinueUpdateRollbackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContinueUpdateRollbackResponse]
$creadListPrec :: ReadPrec [ContinueUpdateRollbackResponse]
readPrec :: ReadPrec ContinueUpdateRollbackResponse
$creadPrec :: ReadPrec ContinueUpdateRollbackResponse
readList :: ReadS [ContinueUpdateRollbackResponse]
$creadList :: ReadS [ContinueUpdateRollbackResponse]
readsPrec :: Int -> ReadS ContinueUpdateRollbackResponse
$creadsPrec :: Int -> ReadS ContinueUpdateRollbackResponse
Prelude.Read, Int -> ContinueUpdateRollbackResponse -> ShowS
[ContinueUpdateRollbackResponse] -> ShowS
ContinueUpdateRollbackResponse -> String
(Int -> ContinueUpdateRollbackResponse -> ShowS)
-> (ContinueUpdateRollbackResponse -> String)
-> ([ContinueUpdateRollbackResponse] -> ShowS)
-> Show ContinueUpdateRollbackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContinueUpdateRollbackResponse] -> ShowS
$cshowList :: [ContinueUpdateRollbackResponse] -> ShowS
show :: ContinueUpdateRollbackResponse -> String
$cshow :: ContinueUpdateRollbackResponse -> String
showsPrec :: Int -> ContinueUpdateRollbackResponse -> ShowS
$cshowsPrec :: Int -> ContinueUpdateRollbackResponse -> ShowS
Prelude.Show, (forall x.
 ContinueUpdateRollbackResponse
 -> Rep ContinueUpdateRollbackResponse x)
-> (forall x.
    Rep ContinueUpdateRollbackResponse x
    -> ContinueUpdateRollbackResponse)
-> Generic ContinueUpdateRollbackResponse
forall x.
Rep ContinueUpdateRollbackResponse x
-> ContinueUpdateRollbackResponse
forall x.
ContinueUpdateRollbackResponse
-> Rep ContinueUpdateRollbackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContinueUpdateRollbackResponse x
-> ContinueUpdateRollbackResponse
$cfrom :: forall x.
ContinueUpdateRollbackResponse
-> Rep ContinueUpdateRollbackResponse x
Prelude.Generic)

-- |
-- Create a value of 'ContinueUpdateRollbackResponse' 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:
--
-- 'httpStatus', 'continueUpdateRollbackResponse_httpStatus' - The response's http status code.
newContinueUpdateRollbackResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ContinueUpdateRollbackResponse
newContinueUpdateRollbackResponse :: Int -> ContinueUpdateRollbackResponse
newContinueUpdateRollbackResponse Int
pHttpStatus_ =
  ContinueUpdateRollbackResponse' :: Int -> ContinueUpdateRollbackResponse
ContinueUpdateRollbackResponse'
    { $sel:httpStatus:ContinueUpdateRollbackResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    ContinueUpdateRollbackResponse