{-# 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.SES.Types.IdentityVerificationAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SES.Types.IdentityVerificationAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.VerificationStatus

-- | Represents the verification attributes of a single identity.
--
-- /See:/ 'newIdentityVerificationAttributes' smart constructor.
data IdentityVerificationAttributes = IdentityVerificationAttributes'
  { -- | The verification token for a domain identity. Null for email address
    -- identities.
    IdentityVerificationAttributes -> Maybe Text
verificationToken :: Prelude.Maybe Prelude.Text,
    -- | The verification status of the identity: \"Pending\", \"Success\",
    -- \"Failed\", or \"TemporaryFailure\".
    IdentityVerificationAttributes -> VerificationStatus
verificationStatus :: VerificationStatus
  }
  deriving (IdentityVerificationAttributes
-> IdentityVerificationAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityVerificationAttributes
-> IdentityVerificationAttributes -> Bool
$c/= :: IdentityVerificationAttributes
-> IdentityVerificationAttributes -> Bool
== :: IdentityVerificationAttributes
-> IdentityVerificationAttributes -> Bool
$c== :: IdentityVerificationAttributes
-> IdentityVerificationAttributes -> Bool
Prelude.Eq, ReadPrec [IdentityVerificationAttributes]
ReadPrec IdentityVerificationAttributes
Int -> ReadS IdentityVerificationAttributes
ReadS [IdentityVerificationAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityVerificationAttributes]
$creadListPrec :: ReadPrec [IdentityVerificationAttributes]
readPrec :: ReadPrec IdentityVerificationAttributes
$creadPrec :: ReadPrec IdentityVerificationAttributes
readList :: ReadS [IdentityVerificationAttributes]
$creadList :: ReadS [IdentityVerificationAttributes]
readsPrec :: Int -> ReadS IdentityVerificationAttributes
$creadsPrec :: Int -> ReadS IdentityVerificationAttributes
Prelude.Read, Int -> IdentityVerificationAttributes -> ShowS
[IdentityVerificationAttributes] -> ShowS
IdentityVerificationAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityVerificationAttributes] -> ShowS
$cshowList :: [IdentityVerificationAttributes] -> ShowS
show :: IdentityVerificationAttributes -> String
$cshow :: IdentityVerificationAttributes -> String
showsPrec :: Int -> IdentityVerificationAttributes -> ShowS
$cshowsPrec :: Int -> IdentityVerificationAttributes -> ShowS
Prelude.Show, forall x.
Rep IdentityVerificationAttributes x
-> IdentityVerificationAttributes
forall x.
IdentityVerificationAttributes
-> Rep IdentityVerificationAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IdentityVerificationAttributes x
-> IdentityVerificationAttributes
$cfrom :: forall x.
IdentityVerificationAttributes
-> Rep IdentityVerificationAttributes x
Prelude.Generic)

-- |
-- Create a value of 'IdentityVerificationAttributes' 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:
--
-- 'verificationToken', 'identityVerificationAttributes_verificationToken' - The verification token for a domain identity. Null for email address
-- identities.
--
-- 'verificationStatus', 'identityVerificationAttributes_verificationStatus' - The verification status of the identity: \"Pending\", \"Success\",
-- \"Failed\", or \"TemporaryFailure\".
newIdentityVerificationAttributes ::
  -- | 'verificationStatus'
  VerificationStatus ->
  IdentityVerificationAttributes
newIdentityVerificationAttributes :: VerificationStatus -> IdentityVerificationAttributes
newIdentityVerificationAttributes
  VerificationStatus
pVerificationStatus_ =
    IdentityVerificationAttributes'
      { $sel:verificationToken:IdentityVerificationAttributes' :: Maybe Text
verificationToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:verificationStatus:IdentityVerificationAttributes' :: VerificationStatus
verificationStatus = VerificationStatus
pVerificationStatus_
      }

-- | The verification token for a domain identity. Null for email address
-- identities.
identityVerificationAttributes_verificationToken :: Lens.Lens' IdentityVerificationAttributes (Prelude.Maybe Prelude.Text)
identityVerificationAttributes_verificationToken :: Lens' IdentityVerificationAttributes (Maybe Text)
identityVerificationAttributes_verificationToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityVerificationAttributes' {Maybe Text
verificationToken :: Maybe Text
$sel:verificationToken:IdentityVerificationAttributes' :: IdentityVerificationAttributes -> Maybe Text
verificationToken} -> Maybe Text
verificationToken) (\s :: IdentityVerificationAttributes
s@IdentityVerificationAttributes' {} Maybe Text
a -> IdentityVerificationAttributes
s {$sel:verificationToken:IdentityVerificationAttributes' :: Maybe Text
verificationToken = Maybe Text
a} :: IdentityVerificationAttributes)

-- | The verification status of the identity: \"Pending\", \"Success\",
-- \"Failed\", or \"TemporaryFailure\".
identityVerificationAttributes_verificationStatus :: Lens.Lens' IdentityVerificationAttributes VerificationStatus
identityVerificationAttributes_verificationStatus :: Lens' IdentityVerificationAttributes VerificationStatus
identityVerificationAttributes_verificationStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityVerificationAttributes' {VerificationStatus
verificationStatus :: VerificationStatus
$sel:verificationStatus:IdentityVerificationAttributes' :: IdentityVerificationAttributes -> VerificationStatus
verificationStatus} -> VerificationStatus
verificationStatus) (\s :: IdentityVerificationAttributes
s@IdentityVerificationAttributes' {} VerificationStatus
a -> IdentityVerificationAttributes
s {$sel:verificationStatus:IdentityVerificationAttributes' :: VerificationStatus
verificationStatus = VerificationStatus
a} :: IdentityVerificationAttributes)

instance Data.FromXML IdentityVerificationAttributes where
  parseXML :: [Node] -> Either String IdentityVerificationAttributes
parseXML [Node]
x =
    Maybe Text -> VerificationStatus -> IdentityVerificationAttributes
IdentityVerificationAttributes'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"VerificationToken")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"VerificationStatus")

instance
  Prelude.Hashable
    IdentityVerificationAttributes
  where
  hashWithSalt :: Int -> IdentityVerificationAttributes -> Int
hashWithSalt
    Int
_salt
    IdentityVerificationAttributes' {Maybe Text
VerificationStatus
verificationStatus :: VerificationStatus
verificationToken :: Maybe Text
$sel:verificationStatus:IdentityVerificationAttributes' :: IdentityVerificationAttributes -> VerificationStatus
$sel:verificationToken:IdentityVerificationAttributes' :: IdentityVerificationAttributes -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
verificationToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VerificationStatus
verificationStatus

instance
  Prelude.NFData
    IdentityVerificationAttributes
  where
  rnf :: IdentityVerificationAttributes -> ()
rnf IdentityVerificationAttributes' {Maybe Text
VerificationStatus
verificationStatus :: VerificationStatus
verificationToken :: Maybe Text
$sel:verificationStatus:IdentityVerificationAttributes' :: IdentityVerificationAttributes -> VerificationStatus
$sel:verificationToken:IdentityVerificationAttributes' :: IdentityVerificationAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
verificationToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VerificationStatus
verificationStatus