{-# 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.ElastiCache.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.ElastiCache.Waiters where

import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.DescribeCacheClusters
import Amazonka.ElastiCache.DescribeReplicationGroups
import Amazonka.ElastiCache.Lens
import Amazonka.ElastiCache.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Polls 'Amazonka.ElastiCache.DescribeCacheClusters' every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
newCacheClusterAvailable :: Core.Wait DescribeCacheClusters
newCacheClusterAvailable :: Wait DescribeCacheClusters
newCacheClusterAvailable =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"CacheClusterAvailable",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
40,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
15,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeCacheClusters]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"available"
            Accept
Core.AcceptSuccess
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"deleted"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"deleting"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"incompatible-network"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"restore-failed"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.ElastiCache.DescribeCacheClusters' every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
newCacheClusterDeleted :: Core.Wait DescribeCacheClusters
newCacheClusterDeleted :: Wait DescribeCacheClusters
newCacheClusterDeleted =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"CacheClusterDeleted",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
40,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
15,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeCacheClusters]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"deleted"
            Accept
Core.AcceptSuccess
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeCacheClusters
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"CacheClusterNotFound"
            Accept
Core.AcceptSuccess,
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"available"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"creating"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"incompatible-network"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"modifying"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"restore-failed"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCacheClusters) (CI Text)
-> Acceptor DescribeCacheClusters
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"snapshotting"
            Accept
Core.AcceptFailure
            ( (DescribeCacheClustersResponse -> [CacheCluster])
-> Fold DescribeCacheClustersResponse CacheCluster
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
-> DescribeCacheClustersResponse -> [CacheCluster]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [CacheCluster]
 -> Const [CacheCluster] (Maybe [CacheCluster]))
-> DescribeCacheClustersResponse
-> Const [CacheCluster] DescribeCacheClustersResponse
Lens' DescribeCacheClustersResponse (Maybe [CacheCluster])
describeCacheClustersResponse_cacheClusters
                        ((Maybe [CacheCluster]
  -> Const [CacheCluster] (Maybe [CacheCluster]))
 -> DescribeCacheClustersResponse
 -> Const [CacheCluster] DescribeCacheClustersResponse)
-> (([CacheCluster] -> Const [CacheCluster] [CacheCluster])
    -> Maybe [CacheCluster]
    -> Const [CacheCluster] (Maybe [CacheCluster]))
-> Getting
     [CacheCluster] DescribeCacheClustersResponse [CacheCluster]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CacheCluster] -> Const [CacheCluster] [CacheCluster])
-> Maybe [CacheCluster]
-> Const [CacheCluster] (Maybe [CacheCluster])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((CacheCluster -> f CacheCluster)
 -> DescribeCacheClustersResponse
 -> f DescribeCacheClustersResponse)
-> ((CI Text -> f (CI Text)) -> CacheCluster -> f CacheCluster)
-> (CI Text -> f (CI Text))
-> DescribeCacheClustersResponse
-> f DescribeCacheClustersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster
Lens' CacheCluster (Maybe Text)
cacheCluster_cacheClusterStatus
                ((Maybe Text -> f (Maybe Text)) -> CacheCluster -> f CacheCluster)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> CacheCluster
-> f CacheCluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.ElastiCache.DescribeReplicationGroups' every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
newReplicationGroupDeleted :: Core.Wait DescribeReplicationGroups
newReplicationGroupDeleted :: Wait DescribeReplicationGroups
newReplicationGroupDeleted =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"ReplicationGroupDeleted",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
40,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
15,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeReplicationGroups]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeReplicationGroups) (CI Text)
-> Acceptor DescribeReplicationGroups
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"deleted"
            Accept
Core.AcceptSuccess
            ( (DescribeReplicationGroupsResponse -> [ReplicationGroup])
-> Fold DescribeReplicationGroupsResponse ReplicationGroup
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting
  [ReplicationGroup]
  DescribeReplicationGroupsResponse
  [ReplicationGroup]
-> DescribeReplicationGroupsResponse -> [ReplicationGroup]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [ReplicationGroup]
 -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> DescribeReplicationGroupsResponse
-> Const [ReplicationGroup] DescribeReplicationGroupsResponse
Lens' DescribeReplicationGroupsResponse (Maybe [ReplicationGroup])
describeReplicationGroupsResponse_replicationGroups
                        ((Maybe [ReplicationGroup]
  -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
 -> DescribeReplicationGroupsResponse
 -> Const [ReplicationGroup] DescribeReplicationGroupsResponse)
-> (([ReplicationGroup]
     -> Const [ReplicationGroup] [ReplicationGroup])
    -> Maybe [ReplicationGroup]
    -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> Getting
     [ReplicationGroup]
     DescribeReplicationGroupsResponse
     [ReplicationGroup]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReplicationGroup] -> Const [ReplicationGroup] [ReplicationGroup])
-> Maybe [ReplicationGroup]
-> Const [ReplicationGroup] (Maybe [ReplicationGroup])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((ReplicationGroup -> f ReplicationGroup)
 -> DescribeReplicationGroupsResponse
 -> f DescribeReplicationGroupsResponse)
-> ((CI Text -> f (CI Text))
    -> ReplicationGroup -> f ReplicationGroup)
-> (CI Text -> f (CI Text))
-> DescribeReplicationGroupsResponse
-> f DescribeReplicationGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text))
-> ReplicationGroup -> f ReplicationGroup
Lens' ReplicationGroup (Maybe Text)
replicationGroup_status
                ((Maybe Text -> f (Maybe Text))
 -> ReplicationGroup -> f ReplicationGroup)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> ReplicationGroup
-> f ReplicationGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeReplicationGroups) (CI Text)
-> Acceptor DescribeReplicationGroups
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"available"
            Accept
Core.AcceptFailure
            ( (DescribeReplicationGroupsResponse -> [ReplicationGroup])
-> Fold DescribeReplicationGroupsResponse ReplicationGroup
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting
  [ReplicationGroup]
  DescribeReplicationGroupsResponse
  [ReplicationGroup]
-> DescribeReplicationGroupsResponse -> [ReplicationGroup]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [ReplicationGroup]
 -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> DescribeReplicationGroupsResponse
-> Const [ReplicationGroup] DescribeReplicationGroupsResponse
Lens' DescribeReplicationGroupsResponse (Maybe [ReplicationGroup])
describeReplicationGroupsResponse_replicationGroups
                        ((Maybe [ReplicationGroup]
  -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
 -> DescribeReplicationGroupsResponse
 -> Const [ReplicationGroup] DescribeReplicationGroupsResponse)
-> (([ReplicationGroup]
     -> Const [ReplicationGroup] [ReplicationGroup])
    -> Maybe [ReplicationGroup]
    -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> Getting
     [ReplicationGroup]
     DescribeReplicationGroupsResponse
     [ReplicationGroup]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReplicationGroup] -> Const [ReplicationGroup] [ReplicationGroup])
-> Maybe [ReplicationGroup]
-> Const [ReplicationGroup] (Maybe [ReplicationGroup])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((ReplicationGroup -> f ReplicationGroup)
 -> DescribeReplicationGroupsResponse
 -> f DescribeReplicationGroupsResponse)
-> ((CI Text -> f (CI Text))
    -> ReplicationGroup -> f ReplicationGroup)
-> (CI Text -> f (CI Text))
-> DescribeReplicationGroupsResponse
-> f DescribeReplicationGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text))
-> ReplicationGroup -> f ReplicationGroup
Lens' ReplicationGroup (Maybe Text)
replicationGroup_status
                ((Maybe Text -> f (Maybe Text))
 -> ReplicationGroup -> f ReplicationGroup)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> ReplicationGroup
-> f ReplicationGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeReplicationGroups
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ReplicationGroupNotFoundFault"
            Accept
Core.AcceptSuccess
        ]
    }

-- | Polls 'Amazonka.ElastiCache.DescribeReplicationGroups' every 15 seconds until a successful state is reached. An error is returned after 40 failed checks.
newReplicationGroupAvailable :: Core.Wait DescribeReplicationGroups
newReplicationGroupAvailable :: Wait DescribeReplicationGroups
newReplicationGroupAvailable =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"ReplicationGroupAvailable",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
40,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
15,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeReplicationGroups]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeReplicationGroups) (CI Text)
-> Acceptor DescribeReplicationGroups
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"available"
            Accept
Core.AcceptSuccess
            ( (DescribeReplicationGroupsResponse -> [ReplicationGroup])
-> Fold DescribeReplicationGroupsResponse ReplicationGroup
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting
  [ReplicationGroup]
  DescribeReplicationGroupsResponse
  [ReplicationGroup]
-> DescribeReplicationGroupsResponse -> [ReplicationGroup]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [ReplicationGroup]
 -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> DescribeReplicationGroupsResponse
-> Const [ReplicationGroup] DescribeReplicationGroupsResponse
Lens' DescribeReplicationGroupsResponse (Maybe [ReplicationGroup])
describeReplicationGroupsResponse_replicationGroups
                        ((Maybe [ReplicationGroup]
  -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
 -> DescribeReplicationGroupsResponse
 -> Const [ReplicationGroup] DescribeReplicationGroupsResponse)
-> (([ReplicationGroup]
     -> Const [ReplicationGroup] [ReplicationGroup])
    -> Maybe [ReplicationGroup]
    -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> Getting
     [ReplicationGroup]
     DescribeReplicationGroupsResponse
     [ReplicationGroup]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReplicationGroup] -> Const [ReplicationGroup] [ReplicationGroup])
-> Maybe [ReplicationGroup]
-> Const [ReplicationGroup] (Maybe [ReplicationGroup])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((ReplicationGroup -> f ReplicationGroup)
 -> DescribeReplicationGroupsResponse
 -> f DescribeReplicationGroupsResponse)
-> ((CI Text -> f (CI Text))
    -> ReplicationGroup -> f ReplicationGroup)
-> (CI Text -> f (CI Text))
-> DescribeReplicationGroupsResponse
-> f DescribeReplicationGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text))
-> ReplicationGroup -> f ReplicationGroup
Lens' ReplicationGroup (Maybe Text)
replicationGroup_status
                ((Maybe Text -> f (Maybe Text))
 -> ReplicationGroup -> f ReplicationGroup)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> ReplicationGroup
-> f ReplicationGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeReplicationGroups) (CI Text)
-> Acceptor DescribeReplicationGroups
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"deleted"
            Accept
Core.AcceptFailure
            ( (DescribeReplicationGroupsResponse -> [ReplicationGroup])
-> Fold DescribeReplicationGroupsResponse ReplicationGroup
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting
  [ReplicationGroup]
  DescribeReplicationGroupsResponse
  [ReplicationGroup]
-> DescribeReplicationGroupsResponse -> [ReplicationGroup]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [ReplicationGroup]
 -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> DescribeReplicationGroupsResponse
-> Const [ReplicationGroup] DescribeReplicationGroupsResponse
Lens' DescribeReplicationGroupsResponse (Maybe [ReplicationGroup])
describeReplicationGroupsResponse_replicationGroups
                        ((Maybe [ReplicationGroup]
  -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
 -> DescribeReplicationGroupsResponse
 -> Const [ReplicationGroup] DescribeReplicationGroupsResponse)
-> (([ReplicationGroup]
     -> Const [ReplicationGroup] [ReplicationGroup])
    -> Maybe [ReplicationGroup]
    -> Const [ReplicationGroup] (Maybe [ReplicationGroup]))
-> Getting
     [ReplicationGroup]
     DescribeReplicationGroupsResponse
     [ReplicationGroup]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReplicationGroup] -> Const [ReplicationGroup] [ReplicationGroup])
-> Maybe [ReplicationGroup]
-> Const [ReplicationGroup] (Maybe [ReplicationGroup])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((ReplicationGroup -> f ReplicationGroup)
 -> DescribeReplicationGroupsResponse
 -> f DescribeReplicationGroupsResponse)
-> ((CI Text -> f (CI Text))
    -> ReplicationGroup -> f ReplicationGroup)
-> (CI Text -> f (CI Text))
-> DescribeReplicationGroupsResponse
-> f DescribeReplicationGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe Text -> f (Maybe Text))
-> ReplicationGroup -> f ReplicationGroup
Lens' ReplicationGroup (Maybe Text)
replicationGroup_status
                ((Maybe Text -> f (Maybe Text))
 -> ReplicationGroup -> f ReplicationGroup)
-> ((CI Text -> f (CI Text)) -> Maybe Text -> f (Maybe Text))
-> (CI Text -> f (CI Text))
-> ReplicationGroup
-> f ReplicationGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Maybe Text -> f (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Text -> f Text) -> Maybe Text -> f (Maybe Text))
-> ((CI Text -> f (CI Text)) -> Text -> f Text)
-> (CI Text -> f (CI Text))
-> Maybe Text
-> f (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> CI Text) -> (CI Text -> f (CI Text)) -> Text -> f Text
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to Text -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }