{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Support.Types.TrustedAdvisorCheckRefreshStatus
-- 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.Support.Types.TrustedAdvisorCheckRefreshStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The refresh status of a Trusted Advisor check.
--
-- /See:/ 'newTrustedAdvisorCheckRefreshStatus' smart constructor.
data TrustedAdvisorCheckRefreshStatus = TrustedAdvisorCheckRefreshStatus'
  { -- | The unique identifier for the Trusted Advisor check.
    TrustedAdvisorCheckRefreshStatus -> Text
checkId :: Prelude.Text,
    -- | The status of the Trusted Advisor check for which a refresh has been
    -- requested:
    --
    -- -   @none@ - The check is not refreshed or the non-success status
    --     exceeds the timeout
    --
    -- -   @enqueued@ - The check refresh requests has entered the refresh
    --     queue
    --
    -- -   @processing@ - The check refresh request is picked up by the rule
    --     processing engine
    --
    -- -   @success@ - The check is successfully refreshed
    --
    -- -   @abandoned@ - The check refresh has failed
    TrustedAdvisorCheckRefreshStatus -> Text
status :: Prelude.Text,
    -- | The amount of time, in milliseconds, until the Trusted Advisor check is
    -- eligible for refresh.
    TrustedAdvisorCheckRefreshStatus -> Integer
millisUntilNextRefreshable :: Prelude.Integer
  }
  deriving (TrustedAdvisorCheckRefreshStatus
-> TrustedAdvisorCheckRefreshStatus -> Bool
(TrustedAdvisorCheckRefreshStatus
 -> TrustedAdvisorCheckRefreshStatus -> Bool)
-> (TrustedAdvisorCheckRefreshStatus
    -> TrustedAdvisorCheckRefreshStatus -> Bool)
-> Eq TrustedAdvisorCheckRefreshStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrustedAdvisorCheckRefreshStatus
-> TrustedAdvisorCheckRefreshStatus -> Bool
$c/= :: TrustedAdvisorCheckRefreshStatus
-> TrustedAdvisorCheckRefreshStatus -> Bool
== :: TrustedAdvisorCheckRefreshStatus
-> TrustedAdvisorCheckRefreshStatus -> Bool
$c== :: TrustedAdvisorCheckRefreshStatus
-> TrustedAdvisorCheckRefreshStatus -> Bool
Prelude.Eq, ReadPrec [TrustedAdvisorCheckRefreshStatus]
ReadPrec TrustedAdvisorCheckRefreshStatus
Int -> ReadS TrustedAdvisorCheckRefreshStatus
ReadS [TrustedAdvisorCheckRefreshStatus]
(Int -> ReadS TrustedAdvisorCheckRefreshStatus)
-> ReadS [TrustedAdvisorCheckRefreshStatus]
-> ReadPrec TrustedAdvisorCheckRefreshStatus
-> ReadPrec [TrustedAdvisorCheckRefreshStatus]
-> Read TrustedAdvisorCheckRefreshStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrustedAdvisorCheckRefreshStatus]
$creadListPrec :: ReadPrec [TrustedAdvisorCheckRefreshStatus]
readPrec :: ReadPrec TrustedAdvisorCheckRefreshStatus
$creadPrec :: ReadPrec TrustedAdvisorCheckRefreshStatus
readList :: ReadS [TrustedAdvisorCheckRefreshStatus]
$creadList :: ReadS [TrustedAdvisorCheckRefreshStatus]
readsPrec :: Int -> ReadS TrustedAdvisorCheckRefreshStatus
$creadsPrec :: Int -> ReadS TrustedAdvisorCheckRefreshStatus
Prelude.Read, Int -> TrustedAdvisorCheckRefreshStatus -> ShowS
[TrustedAdvisorCheckRefreshStatus] -> ShowS
TrustedAdvisorCheckRefreshStatus -> String
(Int -> TrustedAdvisorCheckRefreshStatus -> ShowS)
-> (TrustedAdvisorCheckRefreshStatus -> String)
-> ([TrustedAdvisorCheckRefreshStatus] -> ShowS)
-> Show TrustedAdvisorCheckRefreshStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrustedAdvisorCheckRefreshStatus] -> ShowS
$cshowList :: [TrustedAdvisorCheckRefreshStatus] -> ShowS
show :: TrustedAdvisorCheckRefreshStatus -> String
$cshow :: TrustedAdvisorCheckRefreshStatus -> String
showsPrec :: Int -> TrustedAdvisorCheckRefreshStatus -> ShowS
$cshowsPrec :: Int -> TrustedAdvisorCheckRefreshStatus -> ShowS
Prelude.Show, (forall x.
 TrustedAdvisorCheckRefreshStatus
 -> Rep TrustedAdvisorCheckRefreshStatus x)
-> (forall x.
    Rep TrustedAdvisorCheckRefreshStatus x
    -> TrustedAdvisorCheckRefreshStatus)
-> Generic TrustedAdvisorCheckRefreshStatus
forall x.
Rep TrustedAdvisorCheckRefreshStatus x
-> TrustedAdvisorCheckRefreshStatus
forall x.
TrustedAdvisorCheckRefreshStatus
-> Rep TrustedAdvisorCheckRefreshStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TrustedAdvisorCheckRefreshStatus x
-> TrustedAdvisorCheckRefreshStatus
$cfrom :: forall x.
TrustedAdvisorCheckRefreshStatus
-> Rep TrustedAdvisorCheckRefreshStatus x
Prelude.Generic)

-- |
-- Create a value of 'TrustedAdvisorCheckRefreshStatus' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'checkId', 'trustedAdvisorCheckRefreshStatus_checkId' - The unique identifier for the Trusted Advisor check.
--
-- 'status', 'trustedAdvisorCheckRefreshStatus_status' - The status of the Trusted Advisor check for which a refresh has been
-- requested:
--
-- -   @none@ - The check is not refreshed or the non-success status
--     exceeds the timeout
--
-- -   @enqueued@ - The check refresh requests has entered the refresh
--     queue
--
-- -   @processing@ - The check refresh request is picked up by the rule
--     processing engine
--
-- -   @success@ - The check is successfully refreshed
--
-- -   @abandoned@ - The check refresh has failed
--
-- 'millisUntilNextRefreshable', 'trustedAdvisorCheckRefreshStatus_millisUntilNextRefreshable' - The amount of time, in milliseconds, until the Trusted Advisor check is
-- eligible for refresh.
newTrustedAdvisorCheckRefreshStatus ::
  -- | 'checkId'
  Prelude.Text ->
  -- | 'status'
  Prelude.Text ->
  -- | 'millisUntilNextRefreshable'
  Prelude.Integer ->
  TrustedAdvisorCheckRefreshStatus
newTrustedAdvisorCheckRefreshStatus :: Text -> Text -> Integer -> TrustedAdvisorCheckRefreshStatus
newTrustedAdvisorCheckRefreshStatus
  Text
pCheckId_
  Text
pStatus_
  Integer
pMillisUntilNextRefreshable_ =
    TrustedAdvisorCheckRefreshStatus' :: Text -> Text -> Integer -> TrustedAdvisorCheckRefreshStatus
TrustedAdvisorCheckRefreshStatus'
      { $sel:checkId:TrustedAdvisorCheckRefreshStatus' :: Text
checkId =
          Text
pCheckId_,
        $sel:status:TrustedAdvisorCheckRefreshStatus' :: Text
status = Text
pStatus_,
        $sel:millisUntilNextRefreshable:TrustedAdvisorCheckRefreshStatus' :: Integer
millisUntilNextRefreshable =
          Integer
pMillisUntilNextRefreshable_
      }

-- | The unique identifier for the Trusted Advisor check.
trustedAdvisorCheckRefreshStatus_checkId :: Lens.Lens' TrustedAdvisorCheckRefreshStatus Prelude.Text
trustedAdvisorCheckRefreshStatus_checkId :: (Text -> f Text)
-> TrustedAdvisorCheckRefreshStatus
-> f TrustedAdvisorCheckRefreshStatus
trustedAdvisorCheckRefreshStatus_checkId = (TrustedAdvisorCheckRefreshStatus -> Text)
-> (TrustedAdvisorCheckRefreshStatus
    -> Text -> TrustedAdvisorCheckRefreshStatus)
-> Lens
     TrustedAdvisorCheckRefreshStatus
     TrustedAdvisorCheckRefreshStatus
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckRefreshStatus' {Text
checkId :: Text
$sel:checkId:TrustedAdvisorCheckRefreshStatus' :: TrustedAdvisorCheckRefreshStatus -> Text
checkId} -> Text
checkId) (\s :: TrustedAdvisorCheckRefreshStatus
s@TrustedAdvisorCheckRefreshStatus' {} Text
a -> TrustedAdvisorCheckRefreshStatus
s {$sel:checkId:TrustedAdvisorCheckRefreshStatus' :: Text
checkId = Text
a} :: TrustedAdvisorCheckRefreshStatus)

-- | The status of the Trusted Advisor check for which a refresh has been
-- requested:
--
-- -   @none@ - The check is not refreshed or the non-success status
--     exceeds the timeout
--
-- -   @enqueued@ - The check refresh requests has entered the refresh
--     queue
--
-- -   @processing@ - The check refresh request is picked up by the rule
--     processing engine
--
-- -   @success@ - The check is successfully refreshed
--
-- -   @abandoned@ - The check refresh has failed
trustedAdvisorCheckRefreshStatus_status :: Lens.Lens' TrustedAdvisorCheckRefreshStatus Prelude.Text
trustedAdvisorCheckRefreshStatus_status :: (Text -> f Text)
-> TrustedAdvisorCheckRefreshStatus
-> f TrustedAdvisorCheckRefreshStatus
trustedAdvisorCheckRefreshStatus_status = (TrustedAdvisorCheckRefreshStatus -> Text)
-> (TrustedAdvisorCheckRefreshStatus
    -> Text -> TrustedAdvisorCheckRefreshStatus)
-> Lens
     TrustedAdvisorCheckRefreshStatus
     TrustedAdvisorCheckRefreshStatus
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckRefreshStatus' {Text
status :: Text
$sel:status:TrustedAdvisorCheckRefreshStatus' :: TrustedAdvisorCheckRefreshStatus -> Text
status} -> Text
status) (\s :: TrustedAdvisorCheckRefreshStatus
s@TrustedAdvisorCheckRefreshStatus' {} Text
a -> TrustedAdvisorCheckRefreshStatus
s {$sel:status:TrustedAdvisorCheckRefreshStatus' :: Text
status = Text
a} :: TrustedAdvisorCheckRefreshStatus)

-- | The amount of time, in milliseconds, until the Trusted Advisor check is
-- eligible for refresh.
trustedAdvisorCheckRefreshStatus_millisUntilNextRefreshable :: Lens.Lens' TrustedAdvisorCheckRefreshStatus Prelude.Integer
trustedAdvisorCheckRefreshStatus_millisUntilNextRefreshable :: (Integer -> f Integer)
-> TrustedAdvisorCheckRefreshStatus
-> f TrustedAdvisorCheckRefreshStatus
trustedAdvisorCheckRefreshStatus_millisUntilNextRefreshable = (TrustedAdvisorCheckRefreshStatus -> Integer)
-> (TrustedAdvisorCheckRefreshStatus
    -> Integer -> TrustedAdvisorCheckRefreshStatus)
-> Lens
     TrustedAdvisorCheckRefreshStatus
     TrustedAdvisorCheckRefreshStatus
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrustedAdvisorCheckRefreshStatus' {Integer
millisUntilNextRefreshable :: Integer
$sel:millisUntilNextRefreshable:TrustedAdvisorCheckRefreshStatus' :: TrustedAdvisorCheckRefreshStatus -> Integer
millisUntilNextRefreshable} -> Integer
millisUntilNextRefreshable) (\s :: TrustedAdvisorCheckRefreshStatus
s@TrustedAdvisorCheckRefreshStatus' {} Integer
a -> TrustedAdvisorCheckRefreshStatus
s {$sel:millisUntilNextRefreshable:TrustedAdvisorCheckRefreshStatus' :: Integer
millisUntilNextRefreshable = Integer
a} :: TrustedAdvisorCheckRefreshStatus)

instance
  Core.FromJSON
    TrustedAdvisorCheckRefreshStatus
  where
  parseJSON :: Value -> Parser TrustedAdvisorCheckRefreshStatus
parseJSON =
    String
-> (Object -> Parser TrustedAdvisorCheckRefreshStatus)
-> Value
-> Parser TrustedAdvisorCheckRefreshStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TrustedAdvisorCheckRefreshStatus"
      ( \Object
x ->
          Text -> Text -> Integer -> TrustedAdvisorCheckRefreshStatus
TrustedAdvisorCheckRefreshStatus'
            (Text -> Text -> Integer -> TrustedAdvisorCheckRefreshStatus)
-> Parser Text
-> Parser (Text -> Integer -> TrustedAdvisorCheckRefreshStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"checkId")
            Parser (Text -> Integer -> TrustedAdvisorCheckRefreshStatus)
-> Parser Text
-> Parser (Integer -> TrustedAdvisorCheckRefreshStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser (Integer -> TrustedAdvisorCheckRefreshStatus)
-> Parser Integer -> Parser TrustedAdvisorCheckRefreshStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"millisUntilNextRefreshable")
      )

instance
  Prelude.Hashable
    TrustedAdvisorCheckRefreshStatus

instance
  Prelude.NFData
    TrustedAdvisorCheckRefreshStatus