{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

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

-- |
-- Module      : Amazonka.CloudFormation.Waiters
-- 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.CloudFormation.Waiters where

import Amazonka.CloudFormation.DescribeChangeSet
import Amazonka.CloudFormation.DescribeStacks
import Amazonka.CloudFormation.DescribeTypeRegistration
import Amazonka.CloudFormation.Lens
import Amazonka.CloudFormation.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Polls 'Amazonka.CloudFormation.DescribeStacks' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newStackImportComplete :: Core.Wait DescribeStacks
newStackImportComplete :: Wait DescribeStacks
newStackImportComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StackImportComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStacks]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"IMPORT_COMPLETE"
            Accept
Core.AcceptSuccess
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"ROLLBACK_COMPLETE"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"IMPORT_ROLLBACK_IN_PROGRESS"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"IMPORT_ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"IMPORT_ROLLBACK_COMPLETE"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeStacks
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationError"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeStacks' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newStackCreateComplete :: Core.Wait DescribeStacks
newStackCreateComplete :: Wait DescribeStacks
newStackCreateComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StackCreateComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStacks]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATE_COMPLETE"
            Accept
Core.AcceptSuccess
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"CREATE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"DELETE_COMPLETE"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"DELETE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"ROLLBACK_COMPLETE"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeStacks
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationError"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeStacks' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newStackRollbackComplete :: Core.Wait DescribeStacks
newStackRollbackComplete :: Wait DescribeStacks
newStackRollbackComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StackRollbackComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStacks]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"UPDATE_ROLLBACK_COMPLETE"
            Accept
Core.AcceptSuccess
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"DELETE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeStacks
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationError"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeTypeRegistration' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newTypeRegistrationComplete :: Core.Wait DescribeTypeRegistration
newTypeRegistrationComplete :: Wait DescribeTypeRegistration
newTypeRegistrationComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"TypeRegistrationComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeTypeRegistration]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeTypeRegistration) (CI Text)
-> Acceptor DescribeTypeRegistration
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"COMPLETE"
            Accept
Core.AcceptSuccess
            ( (Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> DescribeTypeRegistrationResponse
-> f DescribeTypeRegistrationResponse
Lens' DescribeTypeRegistrationResponse (Maybe RegistrationStatus)
describeTypeRegistrationResponse_progressStatus
                ((Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
 -> DescribeTypeRegistrationResponse
 -> f DescribeTypeRegistrationResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> (CI Text -> f (CI Text))
-> DescribeTypeRegistrationResponse
-> f DescribeTypeRegistrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (RegistrationStatus -> f RegistrationStatus)
-> Maybe RegistrationStatus -> f (Maybe RegistrationStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((RegistrationStatus -> f RegistrationStatus)
 -> Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> ((CI Text -> f (CI Text))
    -> RegistrationStatus -> f RegistrationStatus)
-> (CI Text -> f (CI Text))
-> Maybe RegistrationStatus
-> f (Maybe RegistrationStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (RegistrationStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> RegistrationStatus
-> f RegistrationStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to RegistrationStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeTypeRegistration) (CI Text)
-> Acceptor DescribeTypeRegistration
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> DescribeTypeRegistrationResponse
-> f DescribeTypeRegistrationResponse
Lens' DescribeTypeRegistrationResponse (Maybe RegistrationStatus)
describeTypeRegistrationResponse_progressStatus
                ((Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
 -> DescribeTypeRegistrationResponse
 -> f DescribeTypeRegistrationResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> (CI Text -> f (CI Text))
-> DescribeTypeRegistrationResponse
-> f DescribeTypeRegistrationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (RegistrationStatus -> f RegistrationStatus)
-> Maybe RegistrationStatus -> f (Maybe RegistrationStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((RegistrationStatus -> f RegistrationStatus)
 -> Maybe RegistrationStatus -> f (Maybe RegistrationStatus))
-> ((CI Text -> f (CI Text))
    -> RegistrationStatus -> f RegistrationStatus)
-> (CI Text -> f (CI Text))
-> Maybe RegistrationStatus
-> f (Maybe RegistrationStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (RegistrationStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> RegistrationStatus
-> f RegistrationStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to RegistrationStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeStacks' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newStackUpdateComplete :: Core.Wait DescribeStacks
newStackUpdateComplete :: Wait DescribeStacks
newStackUpdateComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StackUpdateComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStacks]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"UPDATE_COMPLETE"
            Accept
Core.AcceptSuccess
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_ROLLBACK_COMPLETE"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeStacks
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationError"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeStacks' every 5 seconds until a successful state is reached. An error is returned after 20 failed checks.
newStackExists :: Core.Wait DescribeStacks
newStackExists :: Wait DescribeStacks
newStackExists =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StackExists",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
20,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
5,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStacks]
Core._waitAcceptors =
        [ Int -> Accept -> Acceptor DescribeStacks
forall a. Int -> Accept -> Acceptor a
Core.matchStatus Int
200 Accept
Core.AcceptSuccess,
          ErrorCode -> Accept -> Acceptor DescribeStacks
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError ErrorCode
"ValidationError" Accept
Core.AcceptRetry
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeStacks' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newStackDeleteComplete :: Core.Wait DescribeStacks
newStackDeleteComplete :: Wait DescribeStacks
newStackDeleteComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StackDeleteComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStacks]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"DELETE_COMPLETE"
            Accept
Core.AcceptSuccess
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeStacks
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError ErrorCode
"ValidationError" Accept
Core.AcceptSuccess,
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"DELETE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"CREATE_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_ROLLBACK_IN_PROGRESS"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_ROLLBACK_FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStacks) (CI Text)
-> Acceptor DescribeStacks
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"UPDATE_ROLLBACK_COMPLETE"
            Accept
Core.AcceptFailure
            ( (DescribeStacksResponse -> [Stack])
-> Fold DescribeStacksResponse Stack
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Stack] DescribeStacksResponse [Stack]
-> DescribeStacksResponse -> [Stack]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse
Lens' DescribeStacksResponse (Maybe [Stack])
describeStacksResponse_stacks ((Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
 -> DescribeStacksResponse -> Const [Stack] DescribeStacksResponse)
-> (([Stack] -> Const [Stack] [Stack])
    -> Maybe [Stack] -> Const [Stack] (Maybe [Stack]))
-> Getting [Stack] DescribeStacksResponse [Stack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Stack] -> Const [Stack] [Stack])
-> Maybe [Stack] -> Const [Stack] (Maybe [Stack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just)
                )
                ((Stack -> f Stack)
 -> DescribeStacksResponse -> f DescribeStacksResponse)
-> ((CI Text -> f (CI Text)) -> Stack -> f Stack)
-> (CI Text -> f (CI Text))
-> DescribeStacksResponse
-> f DescribeStacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> f StackStatus) -> Stack -> f Stack
Lens' Stack StackStatus
stack_stackStatus
                ((StackStatus -> f StackStatus) -> Stack -> f Stack)
-> ((CI Text -> f (CI Text)) -> StackStatus -> f StackStatus)
-> (CI Text -> f (CI Text))
-> Stack
-> f Stack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StackStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> StackStatus -> f StackStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StackStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.CloudFormation.DescribeChangeSet' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newChangeSetCreateComplete :: Core.Wait DescribeChangeSet
newChangeSetCreateComplete :: Wait DescribeChangeSet
newChangeSetCreateComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"ChangeSetCreateComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeChangeSet]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeChangeSet) (CI Text)
-> Acceptor DescribeChangeSet
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATE_COMPLETE"
            Accept
Core.AcceptSuccess
            ( (ChangeSetStatus -> f ChangeSetStatus)
-> DescribeChangeSetResponse -> f DescribeChangeSetResponse
Lens' DescribeChangeSetResponse ChangeSetStatus
describeChangeSetResponse_status
                ((ChangeSetStatus -> f ChangeSetStatus)
 -> DescribeChangeSetResponse -> f DescribeChangeSetResponse)
-> ((CI Text -> f (CI Text))
    -> ChangeSetStatus -> f ChangeSetStatus)
-> (CI Text -> f (CI Text))
-> DescribeChangeSetResponse
-> f DescribeChangeSetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ChangeSetStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ChangeSetStatus -> f ChangeSetStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ChangeSetStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeChangeSet) (CI Text)
-> Acceptor DescribeChangeSet
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (ChangeSetStatus -> f ChangeSetStatus)
-> DescribeChangeSetResponse -> f DescribeChangeSetResponse
Lens' DescribeChangeSetResponse ChangeSetStatus
describeChangeSetResponse_status
                ((ChangeSetStatus -> f ChangeSetStatus)
 -> DescribeChangeSetResponse -> f DescribeChangeSetResponse)
-> ((CI Text -> f (CI Text))
    -> ChangeSetStatus -> f ChangeSetStatus)
-> (CI Text -> f (CI Text))
-> DescribeChangeSetResponse
-> f DescribeChangeSetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ChangeSetStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ChangeSetStatus -> f ChangeSetStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ChangeSetStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeChangeSet
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationError"
            Accept
Core.AcceptFailure
        ]
    }