{-# 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.SNS.Types.SMSSandboxPhoneNumber
-- 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.SNS.Types.SMSSandboxPhoneNumber where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SNS.Types.SMSSandboxPhoneNumberVerificationStatus

-- | A verified or pending destination phone number in the SMS sandbox.
--
-- When you start using Amazon SNS to send SMS messages, your account is in
-- the /SMS sandbox/. The SMS sandbox provides a safe environment for you
-- to try Amazon SNS features without risking your reputation as an SMS
-- sender. While your account is in the SMS sandbox, you can use all of the
-- features of Amazon SNS. However, you can send SMS messages only to
-- verified destination phone numbers. For more information, including how
-- to move out of the sandbox to send messages without restrictions, see
-- <https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html SMS sandbox>
-- in the /Amazon SNS Developer Guide/.
--
-- /See:/ 'newSMSSandboxPhoneNumber' smart constructor.
data SMSSandboxPhoneNumber = SMSSandboxPhoneNumber'
  { -- | The destination phone number\'s verification status.
    SMSSandboxPhoneNumber
-> Maybe SMSSandboxPhoneNumberVerificationStatus
status :: Prelude.Maybe SMSSandboxPhoneNumberVerificationStatus,
    -- | The destination phone number.
    SMSSandboxPhoneNumber -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text
  }
  deriving (SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool
(SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool)
-> (SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool)
-> Eq SMSSandboxPhoneNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool
$c/= :: SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool
== :: SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool
$c== :: SMSSandboxPhoneNumber -> SMSSandboxPhoneNumber -> Bool
Prelude.Eq, ReadPrec [SMSSandboxPhoneNumber]
ReadPrec SMSSandboxPhoneNumber
Int -> ReadS SMSSandboxPhoneNumber
ReadS [SMSSandboxPhoneNumber]
(Int -> ReadS SMSSandboxPhoneNumber)
-> ReadS [SMSSandboxPhoneNumber]
-> ReadPrec SMSSandboxPhoneNumber
-> ReadPrec [SMSSandboxPhoneNumber]
-> Read SMSSandboxPhoneNumber
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SMSSandboxPhoneNumber]
$creadListPrec :: ReadPrec [SMSSandboxPhoneNumber]
readPrec :: ReadPrec SMSSandboxPhoneNumber
$creadPrec :: ReadPrec SMSSandboxPhoneNumber
readList :: ReadS [SMSSandboxPhoneNumber]
$creadList :: ReadS [SMSSandboxPhoneNumber]
readsPrec :: Int -> ReadS SMSSandboxPhoneNumber
$creadsPrec :: Int -> ReadS SMSSandboxPhoneNumber
Prelude.Read, Int -> SMSSandboxPhoneNumber -> ShowS
[SMSSandboxPhoneNumber] -> ShowS
SMSSandboxPhoneNumber -> String
(Int -> SMSSandboxPhoneNumber -> ShowS)
-> (SMSSandboxPhoneNumber -> String)
-> ([SMSSandboxPhoneNumber] -> ShowS)
-> Show SMSSandboxPhoneNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SMSSandboxPhoneNumber] -> ShowS
$cshowList :: [SMSSandboxPhoneNumber] -> ShowS
show :: SMSSandboxPhoneNumber -> String
$cshow :: SMSSandboxPhoneNumber -> String
showsPrec :: Int -> SMSSandboxPhoneNumber -> ShowS
$cshowsPrec :: Int -> SMSSandboxPhoneNumber -> ShowS
Prelude.Show, (forall x. SMSSandboxPhoneNumber -> Rep SMSSandboxPhoneNumber x)
-> (forall x. Rep SMSSandboxPhoneNumber x -> SMSSandboxPhoneNumber)
-> Generic SMSSandboxPhoneNumber
forall x. Rep SMSSandboxPhoneNumber x -> SMSSandboxPhoneNumber
forall x. SMSSandboxPhoneNumber -> Rep SMSSandboxPhoneNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SMSSandboxPhoneNumber x -> SMSSandboxPhoneNumber
$cfrom :: forall x. SMSSandboxPhoneNumber -> Rep SMSSandboxPhoneNumber x
Prelude.Generic)

-- |
-- Create a value of 'SMSSandboxPhoneNumber' 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', 'sMSSandboxPhoneNumber_status' - The destination phone number\'s verification status.
--
-- 'phoneNumber', 'sMSSandboxPhoneNumber_phoneNumber' - The destination phone number.
newSMSSandboxPhoneNumber ::
  SMSSandboxPhoneNumber
newSMSSandboxPhoneNumber :: SMSSandboxPhoneNumber
newSMSSandboxPhoneNumber =
  SMSSandboxPhoneNumber' :: Maybe SMSSandboxPhoneNumberVerificationStatus
-> Maybe Text -> SMSSandboxPhoneNumber
SMSSandboxPhoneNumber'
    { $sel:status:SMSSandboxPhoneNumber' :: Maybe SMSSandboxPhoneNumberVerificationStatus
status = Maybe SMSSandboxPhoneNumberVerificationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:phoneNumber:SMSSandboxPhoneNumber' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The destination phone number\'s verification status.
sMSSandboxPhoneNumber_status :: Lens.Lens' SMSSandboxPhoneNumber (Prelude.Maybe SMSSandboxPhoneNumberVerificationStatus)
sMSSandboxPhoneNumber_status :: (Maybe SMSSandboxPhoneNumberVerificationStatus
 -> f (Maybe SMSSandboxPhoneNumberVerificationStatus))
-> SMSSandboxPhoneNumber -> f SMSSandboxPhoneNumber
sMSSandboxPhoneNumber_status = (SMSSandboxPhoneNumber
 -> Maybe SMSSandboxPhoneNumberVerificationStatus)
-> (SMSSandboxPhoneNumber
    -> Maybe SMSSandboxPhoneNumberVerificationStatus
    -> SMSSandboxPhoneNumber)
-> Lens
     SMSSandboxPhoneNumber
     SMSSandboxPhoneNumber
     (Maybe SMSSandboxPhoneNumberVerificationStatus)
     (Maybe SMSSandboxPhoneNumberVerificationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSSandboxPhoneNumber' {Maybe SMSSandboxPhoneNumberVerificationStatus
status :: Maybe SMSSandboxPhoneNumberVerificationStatus
$sel:status:SMSSandboxPhoneNumber' :: SMSSandboxPhoneNumber
-> Maybe SMSSandboxPhoneNumberVerificationStatus
status} -> Maybe SMSSandboxPhoneNumberVerificationStatus
status) (\s :: SMSSandboxPhoneNumber
s@SMSSandboxPhoneNumber' {} Maybe SMSSandboxPhoneNumberVerificationStatus
a -> SMSSandboxPhoneNumber
s {$sel:status:SMSSandboxPhoneNumber' :: Maybe SMSSandboxPhoneNumberVerificationStatus
status = Maybe SMSSandboxPhoneNumberVerificationStatus
a} :: SMSSandboxPhoneNumber)

-- | The destination phone number.
sMSSandboxPhoneNumber_phoneNumber :: Lens.Lens' SMSSandboxPhoneNumber (Prelude.Maybe Prelude.Text)
sMSSandboxPhoneNumber_phoneNumber :: (Maybe Text -> f (Maybe Text))
-> SMSSandboxPhoneNumber -> f SMSSandboxPhoneNumber
sMSSandboxPhoneNumber_phoneNumber = (SMSSandboxPhoneNumber -> Maybe Text)
-> (SMSSandboxPhoneNumber -> Maybe Text -> SMSSandboxPhoneNumber)
-> Lens
     SMSSandboxPhoneNumber
     SMSSandboxPhoneNumber
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSSandboxPhoneNumber' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:SMSSandboxPhoneNumber' :: SMSSandboxPhoneNumber -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: SMSSandboxPhoneNumber
s@SMSSandboxPhoneNumber' {} Maybe Text
a -> SMSSandboxPhoneNumber
s {$sel:phoneNumber:SMSSandboxPhoneNumber' :: Maybe Text
phoneNumber = Maybe Text
a} :: SMSSandboxPhoneNumber)

instance Core.FromXML SMSSandboxPhoneNumber where
  parseXML :: [Node] -> Either String SMSSandboxPhoneNumber
parseXML [Node]
x =
    Maybe SMSSandboxPhoneNumberVerificationStatus
-> Maybe Text -> SMSSandboxPhoneNumber
SMSSandboxPhoneNumber'
      (Maybe SMSSandboxPhoneNumberVerificationStatus
 -> Maybe Text -> SMSSandboxPhoneNumber)
-> Either String (Maybe SMSSandboxPhoneNumberVerificationStatus)
-> Either String (Maybe Text -> SMSSandboxPhoneNumber)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text
-> Either String (Maybe SMSSandboxPhoneNumberVerificationStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either String (Maybe Text -> SMSSandboxPhoneNumber)
-> Either String (Maybe Text)
-> Either String SMSSandboxPhoneNumber
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PhoneNumber")

instance Prelude.Hashable SMSSandboxPhoneNumber

instance Prelude.NFData SMSSandboxPhoneNumber