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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MachineLearning.DescribeBatchPredictions
import Amazonka.MachineLearning.DescribeDataSources
import Amazonka.MachineLearning.DescribeEvaluations
import Amazonka.MachineLearning.DescribeMLModels
import Amazonka.MachineLearning.Lens
import Amazonka.MachineLearning.Types
import qualified Amazonka.Prelude as Prelude

-- | Polls 'Amazonka.MachineLearning.DescribeMLModels' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newMLModelAvailable :: Core.Wait DescribeMLModels
newMLModelAvailable :: Wait DescribeMLModels
newMLModelAvailable =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"MLModelAvailable",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeMLModels]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeMLModels) (CI Text)
-> Acceptor DescribeMLModels
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"COMPLETED"
            Accept
Core.AcceptSuccess
            ( (DescribeMLModelsResponse -> [MLModel])
-> Fold DescribeMLModelsResponse MLModel
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [MLModel] DescribeMLModelsResponse [MLModel]
-> DescribeMLModelsResponse -> [MLModel]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel]))
-> DescribeMLModelsResponse
-> Const [MLModel] DescribeMLModelsResponse
Lens' DescribeMLModelsResponse (Maybe [MLModel])
describeMLModelsResponse_results
                        ((Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel]))
 -> DescribeMLModelsResponse
 -> Const [MLModel] DescribeMLModelsResponse)
-> (([MLModel] -> Const [MLModel] [MLModel])
    -> Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel]))
-> Getting [MLModel] DescribeMLModelsResponse [MLModel]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MLModel] -> Const [MLModel] [MLModel])
-> Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((MLModel -> f MLModel)
 -> DescribeMLModelsResponse -> f DescribeMLModelsResponse)
-> ((CI Text -> f (CI Text)) -> MLModel -> f MLModel)
-> (CI Text -> f (CI Text))
-> DescribeMLModelsResponse
-> f DescribeMLModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> MLModel -> f MLModel
Lens' MLModel (Maybe EntityStatus)
mLModel_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> MLModel -> f MLModel)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> MLModel
-> f MLModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeMLModels) (CI Text)
-> Acceptor DescribeMLModels
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeMLModelsResponse -> [MLModel])
-> Fold DescribeMLModelsResponse MLModel
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [MLModel] DescribeMLModelsResponse [MLModel]
-> DescribeMLModelsResponse -> [MLModel]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel]))
-> DescribeMLModelsResponse
-> Const [MLModel] DescribeMLModelsResponse
Lens' DescribeMLModelsResponse (Maybe [MLModel])
describeMLModelsResponse_results
                        ((Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel]))
 -> DescribeMLModelsResponse
 -> Const [MLModel] DescribeMLModelsResponse)
-> (([MLModel] -> Const [MLModel] [MLModel])
    -> Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel]))
-> Getting [MLModel] DescribeMLModelsResponse [MLModel]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MLModel] -> Const [MLModel] [MLModel])
-> Maybe [MLModel] -> Const [MLModel] (Maybe [MLModel])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((MLModel -> f MLModel)
 -> DescribeMLModelsResponse -> f DescribeMLModelsResponse)
-> ((CI Text -> f (CI Text)) -> MLModel -> f MLModel)
-> (CI Text -> f (CI Text))
-> DescribeMLModelsResponse
-> f DescribeMLModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> MLModel -> f MLModel
Lens' MLModel (Maybe EntityStatus)
mLModel_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> MLModel -> f MLModel)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> MLModel
-> f MLModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.MachineLearning.DescribeBatchPredictions' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newBatchPredictionAvailable :: Core.Wait DescribeBatchPredictions
newBatchPredictionAvailable :: Wait DescribeBatchPredictions
newBatchPredictionAvailable =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"BatchPredictionAvailable",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeBatchPredictions]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeBatchPredictions) (CI Text)
-> Acceptor DescribeBatchPredictions
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"COMPLETED"
            Accept
Core.AcceptSuccess
            ( (DescribeBatchPredictionsResponse -> [BatchPrediction])
-> Fold DescribeBatchPredictionsResponse BatchPrediction
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting
  [BatchPrediction]
  DescribeBatchPredictionsResponse
  [BatchPrediction]
-> DescribeBatchPredictionsResponse -> [BatchPrediction]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [BatchPrediction]
 -> Const [BatchPrediction] (Maybe [BatchPrediction]))
-> DescribeBatchPredictionsResponse
-> Const [BatchPrediction] DescribeBatchPredictionsResponse
Lens' DescribeBatchPredictionsResponse (Maybe [BatchPrediction])
describeBatchPredictionsResponse_results
                        ((Maybe [BatchPrediction]
  -> Const [BatchPrediction] (Maybe [BatchPrediction]))
 -> DescribeBatchPredictionsResponse
 -> Const [BatchPrediction] DescribeBatchPredictionsResponse)
-> (([BatchPrediction]
     -> Const [BatchPrediction] [BatchPrediction])
    -> Maybe [BatchPrediction]
    -> Const [BatchPrediction] (Maybe [BatchPrediction]))
-> Getting
     [BatchPrediction]
     DescribeBatchPredictionsResponse
     [BatchPrediction]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchPrediction] -> Const [BatchPrediction] [BatchPrediction])
-> Maybe [BatchPrediction]
-> Const [BatchPrediction] (Maybe [BatchPrediction])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((BatchPrediction -> f BatchPrediction)
 -> DescribeBatchPredictionsResponse
 -> f DescribeBatchPredictionsResponse)
-> ((CI Text -> f (CI Text))
    -> BatchPrediction -> f BatchPrediction)
-> (CI Text -> f (CI Text))
-> DescribeBatchPredictionsResponse
-> f DescribeBatchPredictionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> BatchPrediction -> f BatchPrediction
Lens' BatchPrediction (Maybe EntityStatus)
batchPrediction_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> BatchPrediction -> f BatchPrediction)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> BatchPrediction
-> f BatchPrediction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeBatchPredictions) (CI Text)
-> Acceptor DescribeBatchPredictions
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeBatchPredictionsResponse -> [BatchPrediction])
-> Fold DescribeBatchPredictionsResponse BatchPrediction
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting
  [BatchPrediction]
  DescribeBatchPredictionsResponse
  [BatchPrediction]
-> DescribeBatchPredictionsResponse -> [BatchPrediction]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [BatchPrediction]
 -> Const [BatchPrediction] (Maybe [BatchPrediction]))
-> DescribeBatchPredictionsResponse
-> Const [BatchPrediction] DescribeBatchPredictionsResponse
Lens' DescribeBatchPredictionsResponse (Maybe [BatchPrediction])
describeBatchPredictionsResponse_results
                        ((Maybe [BatchPrediction]
  -> Const [BatchPrediction] (Maybe [BatchPrediction]))
 -> DescribeBatchPredictionsResponse
 -> Const [BatchPrediction] DescribeBatchPredictionsResponse)
-> (([BatchPrediction]
     -> Const [BatchPrediction] [BatchPrediction])
    -> Maybe [BatchPrediction]
    -> Const [BatchPrediction] (Maybe [BatchPrediction]))
-> Getting
     [BatchPrediction]
     DescribeBatchPredictionsResponse
     [BatchPrediction]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchPrediction] -> Const [BatchPrediction] [BatchPrediction])
-> Maybe [BatchPrediction]
-> Const [BatchPrediction] (Maybe [BatchPrediction])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((BatchPrediction -> f BatchPrediction)
 -> DescribeBatchPredictionsResponse
 -> f DescribeBatchPredictionsResponse)
-> ((CI Text -> f (CI Text))
    -> BatchPrediction -> f BatchPrediction)
-> (CI Text -> f (CI Text))
-> DescribeBatchPredictionsResponse
-> f DescribeBatchPredictionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> BatchPrediction -> f BatchPrediction
Lens' BatchPrediction (Maybe EntityStatus)
batchPrediction_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> BatchPrediction -> f BatchPrediction)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> BatchPrediction
-> f BatchPrediction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.MachineLearning.DescribeDataSources' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newDataSourceAvailable :: Core.Wait DescribeDataSources
newDataSourceAvailable :: Wait DescribeDataSources
newDataSourceAvailable =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"DataSourceAvailable",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeDataSources]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeDataSources) (CI Text)
-> Acceptor DescribeDataSources
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"COMPLETED"
            Accept
Core.AcceptSuccess
            ( (DescribeDataSourcesResponse -> [DataSource])
-> Fold DescribeDataSourcesResponse DataSource
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [DataSource] DescribeDataSourcesResponse [DataSource]
-> DescribeDataSourcesResponse -> [DataSource]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource]))
-> DescribeDataSourcesResponse
-> Const [DataSource] DescribeDataSourcesResponse
Lens' DescribeDataSourcesResponse (Maybe [DataSource])
describeDataSourcesResponse_results
                        ((Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource]))
 -> DescribeDataSourcesResponse
 -> Const [DataSource] DescribeDataSourcesResponse)
-> (([DataSource] -> Const [DataSource] [DataSource])
    -> Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource]))
-> Getting [DataSource] DescribeDataSourcesResponse [DataSource]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DataSource] -> Const [DataSource] [DataSource])
-> Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((DataSource -> f DataSource)
 -> DescribeDataSourcesResponse -> f DescribeDataSourcesResponse)
-> ((CI Text -> f (CI Text)) -> DataSource -> f DataSource)
-> (CI Text -> f (CI Text))
-> DescribeDataSourcesResponse
-> f DescribeDataSourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> DataSource -> f DataSource
Lens' DataSource (Maybe EntityStatus)
dataSource_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> DataSource -> f DataSource)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> DataSource
-> f DataSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeDataSources) (CI Text)
-> Acceptor DescribeDataSources
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeDataSourcesResponse -> [DataSource])
-> Fold DescribeDataSourcesResponse DataSource
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [DataSource] DescribeDataSourcesResponse [DataSource]
-> DescribeDataSourcesResponse -> [DataSource]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource]))
-> DescribeDataSourcesResponse
-> Const [DataSource] DescribeDataSourcesResponse
Lens' DescribeDataSourcesResponse (Maybe [DataSource])
describeDataSourcesResponse_results
                        ((Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource]))
 -> DescribeDataSourcesResponse
 -> Const [DataSource] DescribeDataSourcesResponse)
-> (([DataSource] -> Const [DataSource] [DataSource])
    -> Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource]))
-> Getting [DataSource] DescribeDataSourcesResponse [DataSource]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DataSource] -> Const [DataSource] [DataSource])
-> Maybe [DataSource] -> Const [DataSource] (Maybe [DataSource])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((DataSource -> f DataSource)
 -> DescribeDataSourcesResponse -> f DescribeDataSourcesResponse)
-> ((CI Text -> f (CI Text)) -> DataSource -> f DataSource)
-> (CI Text -> f (CI Text))
-> DescribeDataSourcesResponse
-> f DescribeDataSourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> DataSource -> f DataSource
Lens' DataSource (Maybe EntityStatus)
dataSource_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> DataSource -> f DataSource)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> DataSource
-> f DataSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.MachineLearning.DescribeEvaluations' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newEvaluationAvailable :: Core.Wait DescribeEvaluations
newEvaluationAvailable :: Wait DescribeEvaluations
newEvaluationAvailable =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"EvaluationAvailable",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeEvaluations]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeEvaluations) (CI Text)
-> Acceptor DescribeEvaluations
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"COMPLETED"
            Accept
Core.AcceptSuccess
            ( (DescribeEvaluationsResponse -> [Evaluation])
-> Fold DescribeEvaluationsResponse Evaluation
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Evaluation] DescribeEvaluationsResponse [Evaluation]
-> DescribeEvaluationsResponse -> [Evaluation]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation]))
-> DescribeEvaluationsResponse
-> Const [Evaluation] DescribeEvaluationsResponse
Lens' DescribeEvaluationsResponse (Maybe [Evaluation])
describeEvaluationsResponse_results
                        ((Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation]))
 -> DescribeEvaluationsResponse
 -> Const [Evaluation] DescribeEvaluationsResponse)
-> (([Evaluation] -> Const [Evaluation] [Evaluation])
    -> Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation]))
-> Getting [Evaluation] DescribeEvaluationsResponse [Evaluation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Evaluation] -> Const [Evaluation] [Evaluation])
-> Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((Evaluation -> f Evaluation)
 -> DescribeEvaluationsResponse -> f DescribeEvaluationsResponse)
-> ((CI Text -> f (CI Text)) -> Evaluation -> f Evaluation)
-> (CI Text -> f (CI Text))
-> DescribeEvaluationsResponse
-> f DescribeEvaluationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> Evaluation -> f Evaluation
Lens' Evaluation (Maybe EntityStatus)
evaluation_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> Evaluation -> f Evaluation)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> Evaluation
-> f Evaluation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeEvaluations) (CI Text)
-> Acceptor DescribeEvaluations
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAny
            CI Text
"FAILED"
            Accept
Core.AcceptFailure
            ( (DescribeEvaluationsResponse -> [Evaluation])
-> Fold DescribeEvaluationsResponse Evaluation
forall (f :: * -> *) s a. Foldable f => (s -> f a) -> Fold s a
Lens.folding
                ( Getting [Evaluation] DescribeEvaluationsResponse [Evaluation]
-> DescribeEvaluationsResponse -> [Evaluation]
forall r s. Getting [r] s [r] -> s -> [r]
Lens.concatOf
                    ( (Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation]))
-> DescribeEvaluationsResponse
-> Const [Evaluation] DescribeEvaluationsResponse
Lens' DescribeEvaluationsResponse (Maybe [Evaluation])
describeEvaluationsResponse_results
                        ((Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation]))
 -> DescribeEvaluationsResponse
 -> Const [Evaluation] DescribeEvaluationsResponse)
-> (([Evaluation] -> Const [Evaluation] [Evaluation])
    -> Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation]))
-> Getting [Evaluation] DescribeEvaluationsResponse [Evaluation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Evaluation] -> Const [Evaluation] [Evaluation])
-> Maybe [Evaluation] -> Const [Evaluation] (Maybe [Evaluation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                    )
                )
                ((Evaluation -> f Evaluation)
 -> DescribeEvaluationsResponse -> f DescribeEvaluationsResponse)
-> ((CI Text -> f (CI Text)) -> Evaluation -> f Evaluation)
-> (CI Text -> f (CI Text))
-> DescribeEvaluationsResponse
-> f DescribeEvaluationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Maybe EntityStatus -> f (Maybe EntityStatus))
-> Evaluation -> f Evaluation
Lens' Evaluation (Maybe EntityStatus)
evaluation_status
                ((Maybe EntityStatus -> f (Maybe EntityStatus))
 -> Evaluation -> f Evaluation)
-> ((CI Text -> f (CI Text))
    -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> (CI Text -> f (CI Text))
-> Evaluation
-> f Evaluation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> f EntityStatus)
-> Maybe EntityStatus -> f (Maybe EntityStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((EntityStatus -> f EntityStatus)
 -> Maybe EntityStatus -> f (Maybe EntityStatus))
-> ((CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus)
-> (CI Text -> f (CI Text))
-> Maybe EntityStatus
-> f (Maybe EntityStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EntityStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EntityStatus -> f EntityStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EntityStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }