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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.DescribeEndpoint
import Amazonka.SageMaker.DescribeImage
import Amazonka.SageMaker.DescribeImageVersion
import Amazonka.SageMaker.DescribeNotebookInstance
import Amazonka.SageMaker.DescribeProcessingJob
import Amazonka.SageMaker.DescribeTrainingJob
import Amazonka.SageMaker.DescribeTransformJob
import Amazonka.SageMaker.Lens
import Amazonka.SageMaker.Types

-- | Polls 'Amazonka.SageMaker.DescribeImage' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newImageUpdated :: Core.Wait DescribeImage
newImageUpdated :: Wait DescribeImage
newImageUpdated =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ImageUpdated",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeImage]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeImage) (CI Text)
-> Acceptor DescribeImage
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATED"
            Accept
Core.AcceptSuccess
            ( (Maybe ImageStatus -> f (Maybe ImageStatus))
-> DescribeImageResponse -> f DescribeImageResponse
Lens' DescribeImageResponse (Maybe ImageStatus)
describeImageResponse_imageStatus
                ((Maybe ImageStatus -> f (Maybe ImageStatus))
 -> DescribeImageResponse -> f DescribeImageResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageResponse
-> f DescribeImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> f ImageStatus)
-> Maybe ImageStatus -> f (Maybe ImageStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageStatus -> f ImageStatus)
 -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> ((CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageStatus
-> f (Maybe ImageStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeImage) (CI Text)
-> Acceptor DescribeImage
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"UPDATE_FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe ImageStatus -> f (Maybe ImageStatus))
-> DescribeImageResponse -> f DescribeImageResponse
Lens' DescribeImageResponse (Maybe ImageStatus)
describeImageResponse_imageStatus
                ((Maybe ImageStatus -> f (Maybe ImageStatus))
 -> DescribeImageResponse -> f DescribeImageResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageResponse
-> f DescribeImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> f ImageStatus)
-> Maybe ImageStatus -> f (Maybe ImageStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageStatus -> f ImageStatus)
 -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> ((CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageStatus
-> f (Maybe ImageStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeImage
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeImage' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newImageDeleted :: Core.Wait DescribeImage
newImageDeleted :: Wait DescribeImage
newImageDeleted =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ImageDeleted",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeImage]
Core._waitAcceptors =
        [ ErrorCode -> Accept -> Acceptor DescribeImage
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ResourceNotFoundException"
            Accept
Core.AcceptSuccess,
          CI Text
-> Accept
-> Fold (AWSResponse DescribeImage) (CI Text)
-> Acceptor DescribeImage
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"DELETE_FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe ImageStatus -> f (Maybe ImageStatus))
-> DescribeImageResponse -> f DescribeImageResponse
Lens' DescribeImageResponse (Maybe ImageStatus)
describeImageResponse_imageStatus
                ((Maybe ImageStatus -> f (Maybe ImageStatus))
 -> DescribeImageResponse -> f DescribeImageResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageResponse
-> f DescribeImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> f ImageStatus)
-> Maybe ImageStatus -> f (Maybe ImageStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageStatus -> f ImageStatus)
 -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> ((CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageStatus
-> f (Maybe ImageStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeImage
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeNotebookInstance' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newNotebookInstanceDeleted :: Core.Wait DescribeNotebookInstance
newNotebookInstanceDeleted :: Wait DescribeNotebookInstance
newNotebookInstanceDeleted =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"NotebookInstanceDeleted",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeNotebookInstance]
Core._waitAcceptors =
        [ ErrorCode -> Accept -> Acceptor DescribeNotebookInstance
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptSuccess,
          CI Text
-> Accept
-> Fold (AWSResponse DescribeNotebookInstance) (CI Text)
-> Acceptor DescribeNotebookInstance
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
Lens'
  DescribeNotebookInstanceResponse (Maybe NotebookInstanceStatus)
describeNotebookInstanceResponse_notebookInstanceStatus
                ((Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
 -> DescribeNotebookInstanceResponse
 -> f DescribeNotebookInstanceResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe NotebookInstanceStatus
    -> f (Maybe NotebookInstanceStatus))
-> (CI Text -> f (CI Text))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> f NotebookInstanceStatus)
-> Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((NotebookInstanceStatus -> f NotebookInstanceStatus)
 -> Maybe NotebookInstanceStatus
 -> f (Maybe NotebookInstanceStatus))
-> ((CI Text -> f (CI Text))
    -> NotebookInstanceStatus -> f NotebookInstanceStatus)
-> (CI Text -> f (CI Text))
-> Maybe NotebookInstanceStatus
-> f (Maybe NotebookInstanceStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> NotebookInstanceStatus
-> f NotebookInstanceStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NotebookInstanceStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeImageVersion' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newImageVersionDeleted :: Core.Wait DescribeImageVersion
newImageVersionDeleted :: Wait DescribeImageVersion
newImageVersionDeleted =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ImageVersionDeleted",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeImageVersion]
Core._waitAcceptors =
        [ ErrorCode -> Accept -> Acceptor DescribeImageVersion
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ResourceNotFoundException"
            Accept
Core.AcceptSuccess,
          CI Text
-> Accept
-> Fold (AWSResponse DescribeImageVersion) (CI Text)
-> Acceptor DescribeImageVersion
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"DELETE_FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> DescribeImageVersionResponse -> f DescribeImageVersionResponse
Lens' DescribeImageVersionResponse (Maybe ImageVersionStatus)
describeImageVersionResponse_imageVersionStatus
                ((Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
 -> DescribeImageVersionResponse -> f DescribeImageVersionResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageVersionResponse
-> f DescribeImageVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageVersionStatus -> f ImageVersionStatus)
-> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageVersionStatus -> f ImageVersionStatus)
 -> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> ((CI Text -> f (CI Text))
    -> ImageVersionStatus -> f ImageVersionStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageVersionStatus
-> f (Maybe ImageVersionStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageVersionStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> ImageVersionStatus
-> f ImageVersionStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageVersionStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeImageVersion
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeEndpoint' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newEndpointDeleted :: Core.Wait DescribeEndpoint
newEndpointDeleted :: Wait DescribeEndpoint
newEndpointDeleted =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"EndpointDeleted",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeEndpoint]
Core._waitAcceptors =
        [ ErrorCode -> Accept -> Acceptor DescribeEndpoint
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptSuccess,
          CI Text
-> Accept
-> Fold (AWSResponse DescribeEndpoint) (CI Text)
-> Acceptor DescribeEndpoint
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (EndpointStatus -> f EndpointStatus)
-> DescribeEndpointResponse -> f DescribeEndpointResponse
Lens' DescribeEndpointResponse EndpointStatus
describeEndpointResponse_endpointStatus
                ((EndpointStatus -> f EndpointStatus)
 -> DescribeEndpointResponse -> f DescribeEndpointResponse)
-> ((CI Text -> f (CI Text)) -> EndpointStatus -> f EndpointStatus)
-> (CI Text -> f (CI Text))
-> DescribeEndpointResponse
-> f DescribeEndpointResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EndpointStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EndpointStatus -> f EndpointStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EndpointStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeEndpoint' every 30 seconds until a successful state is reached. An error is returned after 120 failed checks.
newEndpointInService :: Core.Wait DescribeEndpoint
newEndpointInService :: Wait DescribeEndpoint
newEndpointInService =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"EndpointInService",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
120,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeEndpoint]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeEndpoint) (CI Text)
-> Acceptor DescribeEndpoint
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"InService"
            Accept
Core.AcceptSuccess
            ( (EndpointStatus -> f EndpointStatus)
-> DescribeEndpointResponse -> f DescribeEndpointResponse
Lens' DescribeEndpointResponse EndpointStatus
describeEndpointResponse_endpointStatus
                ((EndpointStatus -> f EndpointStatus)
 -> DescribeEndpointResponse -> f DescribeEndpointResponse)
-> ((CI Text -> f (CI Text)) -> EndpointStatus -> f EndpointStatus)
-> (CI Text -> f (CI Text))
-> DescribeEndpointResponse
-> f DescribeEndpointResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EndpointStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EndpointStatus -> f EndpointStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EndpointStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeEndpoint) (CI Text)
-> Acceptor DescribeEndpoint
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (EndpointStatus -> f EndpointStatus)
-> DescribeEndpointResponse -> f DescribeEndpointResponse
Lens' DescribeEndpointResponse EndpointStatus
describeEndpointResponse_endpointStatus
                ((EndpointStatus -> f EndpointStatus)
 -> DescribeEndpointResponse -> f DescribeEndpointResponse)
-> ((CI Text -> f (CI Text)) -> EndpointStatus -> f EndpointStatus)
-> (CI Text -> f (CI Text))
-> DescribeEndpointResponse
-> f DescribeEndpointResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (EndpointStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> EndpointStatus -> f EndpointStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to EndpointStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeEndpoint
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeImage' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newImageCreated :: Core.Wait DescribeImage
newImageCreated :: Wait DescribeImage
newImageCreated =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ImageCreated",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeImage]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeImage) (CI Text)
-> Acceptor DescribeImage
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATED"
            Accept
Core.AcceptSuccess
            ( (Maybe ImageStatus -> f (Maybe ImageStatus))
-> DescribeImageResponse -> f DescribeImageResponse
Lens' DescribeImageResponse (Maybe ImageStatus)
describeImageResponse_imageStatus
                ((Maybe ImageStatus -> f (Maybe ImageStatus))
 -> DescribeImageResponse -> f DescribeImageResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageResponse
-> f DescribeImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> f ImageStatus)
-> Maybe ImageStatus -> f (Maybe ImageStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageStatus -> f ImageStatus)
 -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> ((CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageStatus
-> f (Maybe ImageStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeImage) (CI Text)
-> Acceptor DescribeImage
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATE_FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe ImageStatus -> f (Maybe ImageStatus))
-> DescribeImageResponse -> f DescribeImageResponse
Lens' DescribeImageResponse (Maybe ImageStatus)
describeImageResponse_imageStatus
                ((Maybe ImageStatus -> f (Maybe ImageStatus))
 -> DescribeImageResponse -> f DescribeImageResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageResponse
-> f DescribeImageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> f ImageStatus)
-> Maybe ImageStatus -> f (Maybe ImageStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageStatus -> f ImageStatus)
 -> Maybe ImageStatus -> f (Maybe ImageStatus))
-> ((CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageStatus
-> f (Maybe ImageStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageStatus -> CI Text)
-> (CI Text -> f (CI Text)) -> ImageStatus -> f ImageStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeImage
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeTransformJob' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newTransformJobCompletedOrStopped :: Core.Wait DescribeTransformJob
newTransformJobCompletedOrStopped :: Wait DescribeTransformJob
newTransformJobCompletedOrStopped =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"TransformJobCompletedOrStopped",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeTransformJob]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeTransformJob) (CI Text)
-> Acceptor DescribeTransformJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Completed"
            Accept
Core.AcceptSuccess
            ( (TransformJobStatus -> f TransformJobStatus)
-> DescribeTransformJobResponse -> f DescribeTransformJobResponse
Lens' DescribeTransformJobResponse TransformJobStatus
describeTransformJobResponse_transformJobStatus
                ((TransformJobStatus -> f TransformJobStatus)
 -> DescribeTransformJobResponse -> f DescribeTransformJobResponse)
-> ((CI Text -> f (CI Text))
    -> TransformJobStatus -> f TransformJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeTransformJobResponse
-> f DescribeTransformJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (TransformJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> TransformJobStatus
-> f TransformJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to TransformJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeTransformJob) (CI Text)
-> Acceptor DescribeTransformJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Stopped"
            Accept
Core.AcceptSuccess
            ( (TransformJobStatus -> f TransformJobStatus)
-> DescribeTransformJobResponse -> f DescribeTransformJobResponse
Lens' DescribeTransformJobResponse TransformJobStatus
describeTransformJobResponse_transformJobStatus
                ((TransformJobStatus -> f TransformJobStatus)
 -> DescribeTransformJobResponse -> f DescribeTransformJobResponse)
-> ((CI Text -> f (CI Text))
    -> TransformJobStatus -> f TransformJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeTransformJobResponse
-> f DescribeTransformJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (TransformJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> TransformJobStatus
-> f TransformJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to TransformJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeTransformJob) (CI Text)
-> Acceptor DescribeTransformJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (TransformJobStatus -> f TransformJobStatus)
-> DescribeTransformJobResponse -> f DescribeTransformJobResponse
Lens' DescribeTransformJobResponse TransformJobStatus
describeTransformJobResponse_transformJobStatus
                ((TransformJobStatus -> f TransformJobStatus)
 -> DescribeTransformJobResponse -> f DescribeTransformJobResponse)
-> ((CI Text -> f (CI Text))
    -> TransformJobStatus -> f TransformJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeTransformJobResponse
-> f DescribeTransformJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (TransformJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> TransformJobStatus
-> f TransformJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to TransformJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeTransformJob
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeNotebookInstance' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newNotebookInstanceInService :: Core.Wait DescribeNotebookInstance
newNotebookInstanceInService :: Wait DescribeNotebookInstance
newNotebookInstanceInService =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"NotebookInstanceInService",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeNotebookInstance]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeNotebookInstance) (CI Text)
-> Acceptor DescribeNotebookInstance
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"InService"
            Accept
Core.AcceptSuccess
            ( (Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
Lens'
  DescribeNotebookInstanceResponse (Maybe NotebookInstanceStatus)
describeNotebookInstanceResponse_notebookInstanceStatus
                ((Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
 -> DescribeNotebookInstanceResponse
 -> f DescribeNotebookInstanceResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe NotebookInstanceStatus
    -> f (Maybe NotebookInstanceStatus))
-> (CI Text -> f (CI Text))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> f NotebookInstanceStatus)
-> Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((NotebookInstanceStatus -> f NotebookInstanceStatus)
 -> Maybe NotebookInstanceStatus
 -> f (Maybe NotebookInstanceStatus))
-> ((CI Text -> f (CI Text))
    -> NotebookInstanceStatus -> f NotebookInstanceStatus)
-> (CI Text -> f (CI Text))
-> Maybe NotebookInstanceStatus
-> f (Maybe NotebookInstanceStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> NotebookInstanceStatus
-> f NotebookInstanceStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NotebookInstanceStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeNotebookInstance) (CI Text)
-> Acceptor DescribeNotebookInstance
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
Lens'
  DescribeNotebookInstanceResponse (Maybe NotebookInstanceStatus)
describeNotebookInstanceResponse_notebookInstanceStatus
                ((Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
 -> DescribeNotebookInstanceResponse
 -> f DescribeNotebookInstanceResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe NotebookInstanceStatus
    -> f (Maybe NotebookInstanceStatus))
-> (CI Text -> f (CI Text))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> f NotebookInstanceStatus)
-> Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((NotebookInstanceStatus -> f NotebookInstanceStatus)
 -> Maybe NotebookInstanceStatus
 -> f (Maybe NotebookInstanceStatus))
-> ((CI Text -> f (CI Text))
    -> NotebookInstanceStatus -> f NotebookInstanceStatus)
-> (CI Text -> f (CI Text))
-> Maybe NotebookInstanceStatus
-> f (Maybe NotebookInstanceStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> NotebookInstanceStatus
-> f NotebookInstanceStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NotebookInstanceStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeProcessingJob' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newProcessingJobCompletedOrStopped :: Core.Wait DescribeProcessingJob
newProcessingJobCompletedOrStopped :: Wait DescribeProcessingJob
newProcessingJobCompletedOrStopped =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"ProcessingJobCompletedOrStopped",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeProcessingJob]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeProcessingJob) (CI Text)
-> Acceptor DescribeProcessingJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Completed"
            Accept
Core.AcceptSuccess
            ( (ProcessingJobStatus -> f ProcessingJobStatus)
-> DescribeProcessingJobResponse -> f DescribeProcessingJobResponse
Lens' DescribeProcessingJobResponse ProcessingJobStatus
describeProcessingJobResponse_processingJobStatus
                ((ProcessingJobStatus -> f ProcessingJobStatus)
 -> DescribeProcessingJobResponse
 -> f DescribeProcessingJobResponse)
-> ((CI Text -> f (CI Text))
    -> ProcessingJobStatus -> f ProcessingJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeProcessingJobResponse
-> f DescribeProcessingJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ProcessingJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> ProcessingJobStatus
-> f ProcessingJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ProcessingJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeProcessingJob) (CI Text)
-> Acceptor DescribeProcessingJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Stopped"
            Accept
Core.AcceptSuccess
            ( (ProcessingJobStatus -> f ProcessingJobStatus)
-> DescribeProcessingJobResponse -> f DescribeProcessingJobResponse
Lens' DescribeProcessingJobResponse ProcessingJobStatus
describeProcessingJobResponse_processingJobStatus
                ((ProcessingJobStatus -> f ProcessingJobStatus)
 -> DescribeProcessingJobResponse
 -> f DescribeProcessingJobResponse)
-> ((CI Text -> f (CI Text))
    -> ProcessingJobStatus -> f ProcessingJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeProcessingJobResponse
-> f DescribeProcessingJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ProcessingJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> ProcessingJobStatus
-> f ProcessingJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ProcessingJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeProcessingJob) (CI Text)
-> Acceptor DescribeProcessingJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (ProcessingJobStatus -> f ProcessingJobStatus)
-> DescribeProcessingJobResponse -> f DescribeProcessingJobResponse
Lens' DescribeProcessingJobResponse ProcessingJobStatus
describeProcessingJobResponse_processingJobStatus
                ((ProcessingJobStatus -> f ProcessingJobStatus)
 -> DescribeProcessingJobResponse
 -> f DescribeProcessingJobResponse)
-> ((CI Text -> f (CI Text))
    -> ProcessingJobStatus -> f ProcessingJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeProcessingJobResponse
-> f DescribeProcessingJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ProcessingJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> ProcessingJobStatus
-> f ProcessingJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ProcessingJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeProcessingJob
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeImageVersion' every 60 seconds until a successful state is reached. An error is returned after 60 failed checks.
newImageVersionCreated :: Core.Wait DescribeImageVersion
newImageVersionCreated :: Wait DescribeImageVersion
newImageVersionCreated =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"ImageVersionCreated",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
60,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeImageVersion]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeImageVersion) (CI Text)
-> Acceptor DescribeImageVersion
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATED"
            Accept
Core.AcceptSuccess
            ( (Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> DescribeImageVersionResponse -> f DescribeImageVersionResponse
Lens' DescribeImageVersionResponse (Maybe ImageVersionStatus)
describeImageVersionResponse_imageVersionStatus
                ((Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
 -> DescribeImageVersionResponse -> f DescribeImageVersionResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageVersionResponse
-> f DescribeImageVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageVersionStatus -> f ImageVersionStatus)
-> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageVersionStatus -> f ImageVersionStatus)
 -> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> ((CI Text -> f (CI Text))
    -> ImageVersionStatus -> f ImageVersionStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageVersionStatus
-> f (Maybe ImageVersionStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageVersionStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> ImageVersionStatus
-> f ImageVersionStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageVersionStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeImageVersion) (CI Text)
-> Acceptor DescribeImageVersion
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"CREATE_FAILED"
            Accept
Core.AcceptFailure
            ( (Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> DescribeImageVersionResponse -> f DescribeImageVersionResponse
Lens' DescribeImageVersionResponse (Maybe ImageVersionStatus)
describeImageVersionResponse_imageVersionStatus
                ((Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
 -> DescribeImageVersionResponse -> f DescribeImageVersionResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> (CI Text -> f (CI Text))
-> DescribeImageVersionResponse
-> f DescribeImageVersionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageVersionStatus -> f ImageVersionStatus)
-> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((ImageVersionStatus -> f ImageVersionStatus)
 -> Maybe ImageVersionStatus -> f (Maybe ImageVersionStatus))
-> ((CI Text -> f (CI Text))
    -> ImageVersionStatus -> f ImageVersionStatus)
-> (CI Text -> f (CI Text))
-> Maybe ImageVersionStatus
-> f (Maybe ImageVersionStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ImageVersionStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> ImageVersionStatus
-> f ImageVersionStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to ImageVersionStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeImageVersion
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeTrainingJob' every 120 seconds until a successful state is reached. An error is returned after 180 failed checks.
newTrainingJobCompletedOrStopped :: Core.Wait DescribeTrainingJob
newTrainingJobCompletedOrStopped :: Wait DescribeTrainingJob
newTrainingJobCompletedOrStopped =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"TrainingJobCompletedOrStopped",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
180,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
120,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeTrainingJob]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeTrainingJob) (CI Text)
-> Acceptor DescribeTrainingJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Completed"
            Accept
Core.AcceptSuccess
            ( (TrainingJobStatus -> f TrainingJobStatus)
-> DescribeTrainingJobResponse -> f DescribeTrainingJobResponse
Lens' DescribeTrainingJobResponse TrainingJobStatus
describeTrainingJobResponse_trainingJobStatus
                ((TrainingJobStatus -> f TrainingJobStatus)
 -> DescribeTrainingJobResponse -> f DescribeTrainingJobResponse)
-> ((CI Text -> f (CI Text))
    -> TrainingJobStatus -> f TrainingJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeTrainingJobResponse
-> f DescribeTrainingJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (TrainingJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> TrainingJobStatus
-> f TrainingJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to TrainingJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeTrainingJob) (CI Text)
-> Acceptor DescribeTrainingJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Stopped"
            Accept
Core.AcceptSuccess
            ( (TrainingJobStatus -> f TrainingJobStatus)
-> DescribeTrainingJobResponse -> f DescribeTrainingJobResponse
Lens' DescribeTrainingJobResponse TrainingJobStatus
describeTrainingJobResponse_trainingJobStatus
                ((TrainingJobStatus -> f TrainingJobStatus)
 -> DescribeTrainingJobResponse -> f DescribeTrainingJobResponse)
-> ((CI Text -> f (CI Text))
    -> TrainingJobStatus -> f TrainingJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeTrainingJobResponse
-> f DescribeTrainingJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (TrainingJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> TrainingJobStatus
-> f TrainingJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to TrainingJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeTrainingJob) (CI Text)
-> Acceptor DescribeTrainingJob
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (TrainingJobStatus -> f TrainingJobStatus)
-> DescribeTrainingJobResponse -> f DescribeTrainingJobResponse
Lens' DescribeTrainingJobResponse TrainingJobStatus
describeTrainingJobResponse_trainingJobStatus
                ((TrainingJobStatus -> f TrainingJobStatus)
 -> DescribeTrainingJobResponse -> f DescribeTrainingJobResponse)
-> ((CI Text -> f (CI Text))
    -> TrainingJobStatus -> f TrainingJobStatus)
-> (CI Text -> f (CI Text))
-> DescribeTrainingJobResponse
-> f DescribeTrainingJobResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (TrainingJobStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> TrainingJobStatus
-> f TrainingJobStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to TrainingJobStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          ErrorCode -> Accept -> Acceptor DescribeTrainingJob
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ValidationException"
            Accept
Core.AcceptFailure
        ]
    }

-- | Polls 'Amazonka.SageMaker.DescribeNotebookInstance' every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
newNotebookInstanceStopped :: Core.Wait DescribeNotebookInstance
newNotebookInstanceStopped :: Wait DescribeNotebookInstance
newNotebookInstanceStopped =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName =
        ByteString
"NotebookInstanceStopped",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
60,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
30,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeNotebookInstance]
Core._waitAcceptors =
        [ CI Text
-> Accept
-> Fold (AWSResponse DescribeNotebookInstance) (CI Text)
-> Acceptor DescribeNotebookInstance
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Stopped"
            Accept
Core.AcceptSuccess
            ( (Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
Lens'
  DescribeNotebookInstanceResponse (Maybe NotebookInstanceStatus)
describeNotebookInstanceResponse_notebookInstanceStatus
                ((Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
 -> DescribeNotebookInstanceResponse
 -> f DescribeNotebookInstanceResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe NotebookInstanceStatus
    -> f (Maybe NotebookInstanceStatus))
-> (CI Text -> f (CI Text))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> f NotebookInstanceStatus)
-> Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((NotebookInstanceStatus -> f NotebookInstanceStatus)
 -> Maybe NotebookInstanceStatus
 -> f (Maybe NotebookInstanceStatus))
-> ((CI Text -> f (CI Text))
    -> NotebookInstanceStatus -> f NotebookInstanceStatus)
-> (CI Text -> f (CI Text))
-> Maybe NotebookInstanceStatus
-> f (Maybe NotebookInstanceStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> NotebookInstanceStatus
-> f NotebookInstanceStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NotebookInstanceStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            ),
          CI Text
-> Accept
-> Fold (AWSResponse DescribeNotebookInstance) (CI Text)
-> Acceptor DescribeNotebookInstance
forall b a.
Eq b =>
b -> Accept -> Fold (AWSResponse a) b -> Acceptor a
Core.matchAll
            CI Text
"Failed"
            Accept
Core.AcceptFailure
            ( (Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
Lens'
  DescribeNotebookInstanceResponse (Maybe NotebookInstanceStatus)
describeNotebookInstanceResponse_notebookInstanceStatus
                ((Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus))
 -> DescribeNotebookInstanceResponse
 -> f DescribeNotebookInstanceResponse)
-> ((CI Text -> f (CI Text))
    -> Maybe NotebookInstanceStatus
    -> f (Maybe NotebookInstanceStatus))
-> (CI Text -> f (CI Text))
-> DescribeNotebookInstanceResponse
-> f DescribeNotebookInstanceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> f NotebookInstanceStatus)
-> Maybe NotebookInstanceStatus -> f (Maybe NotebookInstanceStatus)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
                ((NotebookInstanceStatus -> f NotebookInstanceStatus)
 -> Maybe NotebookInstanceStatus
 -> f (Maybe NotebookInstanceStatus))
-> ((CI Text -> f (CI Text))
    -> NotebookInstanceStatus -> f NotebookInstanceStatus)
-> (CI Text -> f (CI Text))
-> Maybe NotebookInstanceStatus
-> f (Maybe NotebookInstanceStatus)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NotebookInstanceStatus -> CI Text)
-> (CI Text -> f (CI Text))
-> NotebookInstanceStatus
-> f NotebookInstanceStatus
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NotebookInstanceStatus -> CI Text
forall a. ToText a => a -> CI Text
Core.toTextCI
            )
        ]
    }