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

import qualified Amazonka.Core as Core
import Amazonka.EMR.DescribeCluster
import Amazonka.EMR.DescribeStep
import Amazonka.EMR.Lens
import Amazonka.EMR.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Polls 'Amazonka.EMR.DescribeStep' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newStepComplete :: Core.Wait DescribeStep
newStepComplete :: Wait DescribeStep
newStepComplete =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"StepComplete",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeStep]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeStep) (CI Text)
-> Acceptor DescribeStep
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"COMPLETED"
            Accept
Core.AcceptSuccess
            ( (Maybe Step -> f (Maybe Step))
-> DescribeStepResponse -> f DescribeStepResponse
Lens' DescribeStepResponse (Maybe Step)
describeStepResponse_step ((Maybe Step -> f (Maybe Step))
 -> DescribeStepResponse -> f DescribeStepResponse)
-> ((CI Text -> f (CI Text)) -> Maybe Step -> f (Maybe Step))
-> (CI Text -> f (CI Text))
-> DescribeStepResponse
-> f DescribeStepResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Step -> f Step) -> Maybe Step -> f (Maybe Step)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Step -> f Step) -> Maybe Step -> f (Maybe Step))
-> ((CI Text -> f (CI Text)) -> Step -> f Step)
-> (CI Text -> f (CI Text))
-> Maybe Step
-> f (Maybe Step)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step
Lens' Step (Maybe StepStatus)
step_status
                ((Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step)
-> ((CI Text -> f (CI Text))
    -> Maybe StepStatus -> f (Maybe StepStatus))
-> (CI Text -> f (CI Text))
-> Step
-> f Step
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepStatus -> f StepStatus)
-> Maybe StepStatus -> f (Maybe StepStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((StepStatus -> f StepStatus)
 -> Maybe StepStatus -> f (Maybe StepStatus))
-> ((CI Text -> f (CI Text)) -> StepStatus -> f StepStatus)
-> (CI Text -> f (CI Text))
-> Maybe StepStatus
-> f (Maybe StepStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe StepState -> f (Maybe StepState))
-> StepStatus -> f StepStatus
Lens' StepStatus (Maybe StepState)
stepStatus_state
                ((Maybe StepState -> f (Maybe StepState))
 -> StepStatus -> f StepStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe StepState -> f (Maybe StepState))
-> (CI Text -> f (CI Text))
-> StepStatus
-> f StepStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepState -> f StepState)
-> Maybe StepState -> f (Maybe StepState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((StepState -> f StepState)
 -> Maybe StepState -> f (Maybe StepState))
-> ((CI Text -> f (CI Text)) -> StepState -> f StepState)
-> (CI Text -> f (CI Text))
-> Maybe StepState
-> f (Maybe StepState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepState -> CI Text)
-> (CI Text -> f (CI Text)) -> StepState -> f StepState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StepState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStep) (CI Text)
-> Acceptor DescribeStep
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe Step -> f (Maybe Step))
-> DescribeStepResponse -> f DescribeStepResponse
Lens' DescribeStepResponse (Maybe Step)
describeStepResponse_step ((Maybe Step -> f (Maybe Step))
 -> DescribeStepResponse -> f DescribeStepResponse)
-> ((CI Text -> f (CI Text)) -> Maybe Step -> f (Maybe Step))
-> (CI Text -> f (CI Text))
-> DescribeStepResponse
-> f DescribeStepResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Step -> f Step) -> Maybe Step -> f (Maybe Step)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Step -> f Step) -> Maybe Step -> f (Maybe Step))
-> ((CI Text -> f (CI Text)) -> Step -> f Step)
-> (CI Text -> f (CI Text))
-> Maybe Step
-> f (Maybe Step)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step
Lens' Step (Maybe StepStatus)
step_status
                ((Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step)
-> ((CI Text -> f (CI Text))
    -> Maybe StepStatus -> f (Maybe StepStatus))
-> (CI Text -> f (CI Text))
-> Step
-> f Step
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepStatus -> f StepStatus)
-> Maybe StepStatus -> f (Maybe StepStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((StepStatus -> f StepStatus)
 -> Maybe StepStatus -> f (Maybe StepStatus))
-> ((CI Text -> f (CI Text)) -> StepStatus -> f StepStatus)
-> (CI Text -> f (CI Text))
-> Maybe StepStatus
-> f (Maybe StepStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe StepState -> f (Maybe StepState))
-> StepStatus -> f StepStatus
Lens' StepStatus (Maybe StepState)
stepStatus_state
                ((Maybe StepState -> f (Maybe StepState))
 -> StepStatus -> f StepStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe StepState -> f (Maybe StepState))
-> (CI Text -> f (CI Text))
-> StepStatus
-> f StepStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepState -> f StepState)
-> Maybe StepState -> f (Maybe StepState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((StepState -> f StepState)
 -> Maybe StepState -> f (Maybe StepState))
-> ((CI Text -> f (CI Text)) -> StepState -> f StepState)
-> (CI Text -> f (CI Text))
-> Maybe StepState
-> f (Maybe StepState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepState -> CI Text)
-> (CI Text -> f (CI Text)) -> StepState -> f StepState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StepState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeStep) (CI Text)
-> Acceptor DescribeStep
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CANCELLED"
            Accept
Core.AcceptFailure
            ( (Maybe Step -> f (Maybe Step))
-> DescribeStepResponse -> f DescribeStepResponse
Lens' DescribeStepResponse (Maybe Step)
describeStepResponse_step ((Maybe Step -> f (Maybe Step))
 -> DescribeStepResponse -> f DescribeStepResponse)
-> ((CI Text -> f (CI Text)) -> Maybe Step -> f (Maybe Step))
-> (CI Text -> f (CI Text))
-> DescribeStepResponse
-> f DescribeStepResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Step -> f Step) -> Maybe Step -> f (Maybe Step)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((Step -> f Step) -> Maybe Step -> f (Maybe Step))
-> ((CI Text -> f (CI Text)) -> Step -> f Step)
-> (CI Text -> f (CI Text))
-> Maybe Step
-> f (Maybe Step)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step
Lens' Step (Maybe StepStatus)
step_status
                ((Maybe StepStatus -> f (Maybe StepStatus)) -> Step -> f Step)
-> ((CI Text -> f (CI Text))
    -> Maybe StepStatus -> f (Maybe StepStatus))
-> (CI Text -> f (CI Text))
-> Step
-> f Step
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepStatus -> f StepStatus)
-> Maybe StepStatus -> f (Maybe StepStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((StepStatus -> f StepStatus)
 -> Maybe StepStatus -> f (Maybe StepStatus))
-> ((CI Text -> f (CI Text)) -> StepStatus -> f StepStatus)
-> (CI Text -> f (CI Text))
-> Maybe StepStatus
-> f (Maybe StepStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe StepState -> f (Maybe StepState))
-> StepStatus -> f StepStatus
Lens' StepStatus (Maybe StepState)
stepStatus_state
                ((Maybe StepState -> f (Maybe StepState))
 -> StepStatus -> f StepStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe StepState -> f (Maybe StepState))
-> (CI Text -> f (CI Text))
-> StepStatus
-> f StepStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepState -> f StepState)
-> Maybe StepState -> f (Maybe StepState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((StepState -> f StepState)
 -> Maybe StepState -> f (Maybe StepState))
-> ((CI Text -> f (CI Text)) -> StepState -> f StepState)
-> (CI Text -> f (CI Text))
-> Maybe StepState
-> f (Maybe StepState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (StepState -> CI Text)
-> (CI Text -> f (CI Text)) -> StepState -> f StepState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to StepState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.EMR.DescribeCluster' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newClusterTerminated :: Core.Wait DescribeCluster
newClusterTerminated :: Wait DescribeCluster
newClusterTerminated =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ClusterTerminated",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeCluster]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"TERMINATED"
            Accept
Core.AcceptSuccess
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"TERMINATED_WITH_ERRORS"
            Accept
Core.AcceptFailure
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.EMR.DescribeCluster' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newClusterRunning :: Core.Wait DescribeCluster
newClusterRunning :: Wait DescribeCluster
newClusterRunning =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ClusterRunning",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeCluster]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"RUNNING"
            Accept
Core.AcceptSuccess
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"WAITING"
            Accept
Core.AcceptSuccess
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"TERMINATING"
            Accept
Core.AcceptFailure
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"TERMINATED"
            Accept
Core.AcceptFailure
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeCluster) (CI Text)
-> Acceptor DescribeCluster
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"TERMINATED_WITH_ERRORS"
            Accept
Core.AcceptFailure
            ( (Cluster -> f Cluster)
-> DescribeClusterResponse -> f DescribeClusterResponse
Lens' DescribeClusterResponse Cluster
describeClusterResponse_cluster
                ((Cluster -> f Cluster)
 -> DescribeClusterResponse -> f DescribeClusterResponse)
-> ((CI Text -> f (CI Text)) -> Cluster -> f Cluster)
-> (CI Text -> f (CI Text))
-> DescribeClusterResponse
-> f DescribeClusterResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster
Lens' Cluster ClusterStatus
cluster_status
                ((ClusterStatus -> f ClusterStatus) -> Cluster -> f Cluster)
-> ((CI Text -> f (CI Text)) -> ClusterStatus -> f ClusterStatus)
-> (CI Text -> f (CI Text))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe ClusterState -> f (Maybe ClusterState))
-> ClusterStatus -> f ClusterStatus
Lens' ClusterStatus (Maybe ClusterState)
clusterStatus_state
                ((Maybe ClusterState -> f (Maybe ClusterState))
 -> ClusterStatus -> f ClusterStatus)
-> ((CI Text -> f (CI Text))
    -> Maybe ClusterState -> f (Maybe ClusterState))
-> (CI Text -> f (CI Text))
-> ClusterStatus
-> f ClusterStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> f ClusterState)
-> Maybe ClusterState -> f (Maybe ClusterState)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ClusterState -> f ClusterState)
 -> Maybe ClusterState -> f (Maybe ClusterState))
-> ((CI Text -> f (CI Text)) -> ClusterState -> f ClusterState)
-> (CI Text -> f (CI Text))
-> Maybe ClusterState
-> f (Maybe ClusterState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ClusterState -> CI Text)
-> (CI Text -> f (CI Text)) -> ClusterState -> f ClusterState
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ClusterState -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }