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

import qualified Amazonka.Core as Core
import Amazonka.Glacier.DescribeVault
import Amazonka.Glacier.Lens
import Amazonka.Glacier.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Polls 'Amazonka.Glacier.DescribeVault' every 3 seconds until a successful state is reached. An error is returned after 15 failed checks.
newVaultNotExists :: Core.Wait DescribeVault
newVaultNotExists :: Wait DescribeVault
newVaultNotExists =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"VaultNotExists",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
15,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
3,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeVault]
Core._waitAcceptors =
        [ Int -> Accept -> Acceptor DescribeVault
forall a. Int -> Accept -> Acceptor a
Core.matchStatus Int
200 Accept
Core.AcceptRetry,
          ErrorCode -> Accept -> Acceptor DescribeVault
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ResourceNotFoundException"
            Accept
Core.AcceptSuccess
        ]
    }

-- | Polls 'Amazonka.Glacier.DescribeVault' every 3 seconds until a successful state is reached. An error is returned after 15 failed checks.
newVaultExists :: Core.Wait DescribeVault
newVaultExists :: Wait DescribeVault
newVaultExists =
  Wait :: forall a. ByteString -> Int -> Seconds -> [Acceptor a] -> Wait a
Core.Wait
    { $sel:_waitName:Wait :: ByteString
Core._waitName = ByteString
"VaultExists",
      $sel:_waitAttempts:Wait :: Int
Core._waitAttempts = Int
15,
      $sel:_waitDelay:Wait :: Seconds
Core._waitDelay = Seconds
3,
      $sel:_waitAcceptors:Wait :: [Acceptor DescribeVault]
Core._waitAcceptors =
        [ Int -> Accept -> Acceptor DescribeVault
forall a. Int -> Accept -> Acceptor a
Core.matchStatus Int
200 Accept
Core.AcceptSuccess,
          ErrorCode -> Accept -> Acceptor DescribeVault
forall a. ErrorCode -> Accept -> Acceptor a
Core.matchError
            ErrorCode
"ResourceNotFoundException"
            Accept
Core.AcceptRetry
        ]
    }