{-# 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.SESV2.Types.ReviewDetails
-- 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.SESV2.Types.ReviewDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SESV2.Types.ReviewStatus

-- | An object that contains information about your account details review.
--
-- /See:/ 'newReviewDetails' smart constructor.
data ReviewDetails = ReviewDetails'
  { -- | The status of the latest review of your account. The status can be one
    -- of the following:
    --
    -- -   @PENDING@ – We have received your appeal and are in the process of
    --     reviewing it.
    --
    -- -   @GRANTED@ – Your appeal has been reviewed and your production access
    --     has been granted.
    --
    -- -   @DENIED@ – Your appeal has been reviewed and your production access
    --     has been denied.
    --
    -- -   @FAILED@ – An internal error occurred and we didn\'t receive your
    --     appeal. You can submit your appeal again.
    ReviewDetails -> Maybe ReviewStatus
status :: Prelude.Maybe ReviewStatus,
    -- | The associated support center case ID (if any).
    ReviewDetails -> Maybe Text
caseId :: Prelude.Maybe Prelude.Text
  }
  deriving (ReviewDetails -> ReviewDetails -> Bool
(ReviewDetails -> ReviewDetails -> Bool)
-> (ReviewDetails -> ReviewDetails -> Bool) -> Eq ReviewDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReviewDetails -> ReviewDetails -> Bool
$c/= :: ReviewDetails -> ReviewDetails -> Bool
== :: ReviewDetails -> ReviewDetails -> Bool
$c== :: ReviewDetails -> ReviewDetails -> Bool
Prelude.Eq, ReadPrec [ReviewDetails]
ReadPrec ReviewDetails
Int -> ReadS ReviewDetails
ReadS [ReviewDetails]
(Int -> ReadS ReviewDetails)
-> ReadS [ReviewDetails]
-> ReadPrec ReviewDetails
-> ReadPrec [ReviewDetails]
-> Read ReviewDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReviewDetails]
$creadListPrec :: ReadPrec [ReviewDetails]
readPrec :: ReadPrec ReviewDetails
$creadPrec :: ReadPrec ReviewDetails
readList :: ReadS [ReviewDetails]
$creadList :: ReadS [ReviewDetails]
readsPrec :: Int -> ReadS ReviewDetails
$creadsPrec :: Int -> ReadS ReviewDetails
Prelude.Read, Int -> ReviewDetails -> ShowS
[ReviewDetails] -> ShowS
ReviewDetails -> String
(Int -> ReviewDetails -> ShowS)
-> (ReviewDetails -> String)
-> ([ReviewDetails] -> ShowS)
-> Show ReviewDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReviewDetails] -> ShowS
$cshowList :: [ReviewDetails] -> ShowS
show :: ReviewDetails -> String
$cshow :: ReviewDetails -> String
showsPrec :: Int -> ReviewDetails -> ShowS
$cshowsPrec :: Int -> ReviewDetails -> ShowS
Prelude.Show, (forall x. ReviewDetails -> Rep ReviewDetails x)
-> (forall x. Rep ReviewDetails x -> ReviewDetails)
-> Generic ReviewDetails
forall x. Rep ReviewDetails x -> ReviewDetails
forall x. ReviewDetails -> Rep ReviewDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReviewDetails x -> ReviewDetails
$cfrom :: forall x. ReviewDetails -> Rep ReviewDetails x
Prelude.Generic)

-- |
-- Create a value of 'ReviewDetails' 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:
--
-- 'status', 'reviewDetails_status' - The status of the latest review of your account. The status can be one
-- of the following:
--
-- -   @PENDING@ – We have received your appeal and are in the process of
--     reviewing it.
--
-- -   @GRANTED@ – Your appeal has been reviewed and your production access
--     has been granted.
--
-- -   @DENIED@ – Your appeal has been reviewed and your production access
--     has been denied.
--
-- -   @FAILED@ – An internal error occurred and we didn\'t receive your
--     appeal. You can submit your appeal again.
--
-- 'caseId', 'reviewDetails_caseId' - The associated support center case ID (if any).
newReviewDetails ::
  ReviewDetails
newReviewDetails :: ReviewDetails
newReviewDetails =
  ReviewDetails' :: Maybe ReviewStatus -> Maybe Text -> ReviewDetails
ReviewDetails'
    { $sel:status:ReviewDetails' :: Maybe ReviewStatus
status = Maybe ReviewStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:caseId:ReviewDetails' :: Maybe Text
caseId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the latest review of your account. The status can be one
-- of the following:
--
-- -   @PENDING@ – We have received your appeal and are in the process of
--     reviewing it.
--
-- -   @GRANTED@ – Your appeal has been reviewed and your production access
--     has been granted.
--
-- -   @DENIED@ – Your appeal has been reviewed and your production access
--     has been denied.
--
-- -   @FAILED@ – An internal error occurred and we didn\'t receive your
--     appeal. You can submit your appeal again.
reviewDetails_status :: Lens.Lens' ReviewDetails (Prelude.Maybe ReviewStatus)
reviewDetails_status :: (Maybe ReviewStatus -> f (Maybe ReviewStatus))
-> ReviewDetails -> f ReviewDetails
reviewDetails_status = (ReviewDetails -> Maybe ReviewStatus)
-> (ReviewDetails -> Maybe ReviewStatus -> ReviewDetails)
-> Lens
     ReviewDetails
     ReviewDetails
     (Maybe ReviewStatus)
     (Maybe ReviewStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReviewDetails' {Maybe ReviewStatus
status :: Maybe ReviewStatus
$sel:status:ReviewDetails' :: ReviewDetails -> Maybe ReviewStatus
status} -> Maybe ReviewStatus
status) (\s :: ReviewDetails
s@ReviewDetails' {} Maybe ReviewStatus
a -> ReviewDetails
s {$sel:status:ReviewDetails' :: Maybe ReviewStatus
status = Maybe ReviewStatus
a} :: ReviewDetails)

-- | The associated support center case ID (if any).
reviewDetails_caseId :: Lens.Lens' ReviewDetails (Prelude.Maybe Prelude.Text)
reviewDetails_caseId :: (Maybe Text -> f (Maybe Text)) -> ReviewDetails -> f ReviewDetails
reviewDetails_caseId = (ReviewDetails -> Maybe Text)
-> (ReviewDetails -> Maybe Text -> ReviewDetails)
-> Lens ReviewDetails ReviewDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReviewDetails' {Maybe Text
caseId :: Maybe Text
$sel:caseId:ReviewDetails' :: ReviewDetails -> Maybe Text
caseId} -> Maybe Text
caseId) (\s :: ReviewDetails
s@ReviewDetails' {} Maybe Text
a -> ReviewDetails
s {$sel:caseId:ReviewDetails' :: Maybe Text
caseId = Maybe Text
a} :: ReviewDetails)

instance Core.FromJSON ReviewDetails where
  parseJSON :: Value -> Parser ReviewDetails
parseJSON =
    String
-> (Object -> Parser ReviewDetails)
-> Value
-> Parser ReviewDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReviewDetails"
      ( \Object
x ->
          Maybe ReviewStatus -> Maybe Text -> ReviewDetails
ReviewDetails'
            (Maybe ReviewStatus -> Maybe Text -> ReviewDetails)
-> Parser (Maybe ReviewStatus)
-> Parser (Maybe Text -> ReviewDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ReviewStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe Text -> ReviewDetails)
-> Parser (Maybe Text) -> Parser ReviewDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CaseId")
      )

instance Prelude.Hashable ReviewDetails

instance Prelude.NFData ReviewDetails