{-# 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.PinpointSmsVoiceV2.Types.PhoneNumberInformation
-- 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.PinpointSmsVoiceV2.Types.PhoneNumberInformation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointSmsVoiceV2.Types.MessageType
import Amazonka.PinpointSmsVoiceV2.Types.NumberCapability
import Amazonka.PinpointSmsVoiceV2.Types.NumberStatus
import Amazonka.PinpointSmsVoiceV2.Types.NumberType
import qualified Amazonka.Prelude as Prelude

-- | The information for a phone number in an Amazon Web Services account.
--
-- /See:/ 'newPhoneNumberInformation' smart constructor.
data PhoneNumberInformation = PhoneNumberInformation'
  { -- | The unique identifier for the phone number.
    PhoneNumberInformation -> Maybe Text
phoneNumberId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the pool associated with the phone number.
    PhoneNumberInformation -> Maybe Text
poolId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the two way channel.
    PhoneNumberInformation -> Maybe Text
twoWayChannelArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) associated with the phone number.
    PhoneNumberInformation -> Text
phoneNumberArn :: Prelude.Text,
    -- | The phone number in E.164 format.
    PhoneNumberInformation -> Text
phoneNumber :: Prelude.Text,
    -- | The current status of the phone number.
    PhoneNumberInformation -> NumberStatus
status :: NumberStatus,
    -- | The two-character code, in ISO 3166-1 alpha-2 format, for the country or
    -- region.
    PhoneNumberInformation -> Text
isoCountryCode :: Prelude.Text,
    -- | The type of message. Valid values are TRANSACTIONAL for messages that
    -- are critical or time-sensitive and PROMOTIONAL for messages that aren\'t
    -- critical or time-sensitive.
    PhoneNumberInformation -> MessageType
messageType :: MessageType,
    -- | Describes if the origination identity can be used for text messages,
    -- voice calls or both.
    PhoneNumberInformation -> NonEmpty NumberCapability
numberCapabilities :: Prelude.NonEmpty NumberCapability,
    -- | The type of phone number.
    PhoneNumberInformation -> NumberType
numberType :: NumberType,
    -- | The price, in US dollars, to lease the phone number.
    PhoneNumberInformation -> Text
monthlyLeasingPrice :: Prelude.Text,
    -- | By default this is set to false. When set to true you can receive
    -- incoming text messages from your end recipients using the
    -- TwoWayChannelArn.
    PhoneNumberInformation -> Bool
twoWayEnabled :: Prelude.Bool,
    -- | When set to false an end recipient sends a message that begins with HELP
    -- or STOP to one of your dedicated numbers, Amazon Pinpoint automatically
    -- replies with a customizable message and adds the end recipient to the
    -- OptOutList. When set to true you\'re responsible for responding to HELP
    -- and STOP requests. You\'re also responsible for tracking and honoring
    -- opt-out request. For more information see
    -- <https://docs.aws.amazon.com/pinpoint/latest/userguide/settings-sms-managing.html#settings-account-sms-self-managed-opt-out Self-managed opt-outs>
    PhoneNumberInformation -> Bool
selfManagedOptOutsEnabled :: Prelude.Bool,
    -- | The name of the OptOutList associated with the phone number.
    PhoneNumberInformation -> Text
optOutListName :: Prelude.Text,
    -- | When set to true the phone number can\'t be deleted.
    PhoneNumberInformation -> Bool
deletionProtectionEnabled :: Prelude.Bool,
    -- | The time when the phone number was created, in
    -- <https://www.epochconverter.com/ UNIX epoch time> format.
    PhoneNumberInformation -> POSIX
createdTimestamp :: Data.POSIX
  }
  deriving (PhoneNumberInformation -> PhoneNumberInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhoneNumberInformation -> PhoneNumberInformation -> Bool
$c/= :: PhoneNumberInformation -> PhoneNumberInformation -> Bool
== :: PhoneNumberInformation -> PhoneNumberInformation -> Bool
$c== :: PhoneNumberInformation -> PhoneNumberInformation -> Bool
Prelude.Eq, ReadPrec [PhoneNumberInformation]
ReadPrec PhoneNumberInformation
Int -> ReadS PhoneNumberInformation
ReadS [PhoneNumberInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhoneNumberInformation]
$creadListPrec :: ReadPrec [PhoneNumberInformation]
readPrec :: ReadPrec PhoneNumberInformation
$creadPrec :: ReadPrec PhoneNumberInformation
readList :: ReadS [PhoneNumberInformation]
$creadList :: ReadS [PhoneNumberInformation]
readsPrec :: Int -> ReadS PhoneNumberInformation
$creadsPrec :: Int -> ReadS PhoneNumberInformation
Prelude.Read, Int -> PhoneNumberInformation -> ShowS
[PhoneNumberInformation] -> ShowS
PhoneNumberInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhoneNumberInformation] -> ShowS
$cshowList :: [PhoneNumberInformation] -> ShowS
show :: PhoneNumberInformation -> String
$cshow :: PhoneNumberInformation -> String
showsPrec :: Int -> PhoneNumberInformation -> ShowS
$cshowsPrec :: Int -> PhoneNumberInformation -> ShowS
Prelude.Show, forall x. Rep PhoneNumberInformation x -> PhoneNumberInformation
forall x. PhoneNumberInformation -> Rep PhoneNumberInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhoneNumberInformation x -> PhoneNumberInformation
$cfrom :: forall x. PhoneNumberInformation -> Rep PhoneNumberInformation x
Prelude.Generic)

-- |
-- Create a value of 'PhoneNumberInformation' 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:
--
-- 'phoneNumberId', 'phoneNumberInformation_phoneNumberId' - The unique identifier for the phone number.
--
-- 'poolId', 'phoneNumberInformation_poolId' - The unique identifier of the pool associated with the phone number.
--
-- 'twoWayChannelArn', 'phoneNumberInformation_twoWayChannelArn' - The Amazon Resource Name (ARN) of the two way channel.
--
-- 'phoneNumberArn', 'phoneNumberInformation_phoneNumberArn' - The Amazon Resource Name (ARN) associated with the phone number.
--
-- 'phoneNumber', 'phoneNumberInformation_phoneNumber' - The phone number in E.164 format.
--
-- 'status', 'phoneNumberInformation_status' - The current status of the phone number.
--
-- 'isoCountryCode', 'phoneNumberInformation_isoCountryCode' - The two-character code, in ISO 3166-1 alpha-2 format, for the country or
-- region.
--
-- 'messageType', 'phoneNumberInformation_messageType' - The type of message. Valid values are TRANSACTIONAL for messages that
-- are critical or time-sensitive and PROMOTIONAL for messages that aren\'t
-- critical or time-sensitive.
--
-- 'numberCapabilities', 'phoneNumberInformation_numberCapabilities' - Describes if the origination identity can be used for text messages,
-- voice calls or both.
--
-- 'numberType', 'phoneNumberInformation_numberType' - The type of phone number.
--
-- 'monthlyLeasingPrice', 'phoneNumberInformation_monthlyLeasingPrice' - The price, in US dollars, to lease the phone number.
--
-- 'twoWayEnabled', 'phoneNumberInformation_twoWayEnabled' - By default this is set to false. When set to true you can receive
-- incoming text messages from your end recipients using the
-- TwoWayChannelArn.
--
-- 'selfManagedOptOutsEnabled', 'phoneNumberInformation_selfManagedOptOutsEnabled' - When set to false an end recipient sends a message that begins with HELP
-- or STOP to one of your dedicated numbers, Amazon Pinpoint automatically
-- replies with a customizable message and adds the end recipient to the
-- OptOutList. When set to true you\'re responsible for responding to HELP
-- and STOP requests. You\'re also responsible for tracking and honoring
-- opt-out request. For more information see
-- <https://docs.aws.amazon.com/pinpoint/latest/userguide/settings-sms-managing.html#settings-account-sms-self-managed-opt-out Self-managed opt-outs>
--
-- 'optOutListName', 'phoneNumberInformation_optOutListName' - The name of the OptOutList associated with the phone number.
--
-- 'deletionProtectionEnabled', 'phoneNumberInformation_deletionProtectionEnabled' - When set to true the phone number can\'t be deleted.
--
-- 'createdTimestamp', 'phoneNumberInformation_createdTimestamp' - The time when the phone number was created, in
-- <https://www.epochconverter.com/ UNIX epoch time> format.
newPhoneNumberInformation ::
  -- | 'phoneNumberArn'
  Prelude.Text ->
  -- | 'phoneNumber'
  Prelude.Text ->
  -- | 'status'
  NumberStatus ->
  -- | 'isoCountryCode'
  Prelude.Text ->
  -- | 'messageType'
  MessageType ->
  -- | 'numberCapabilities'
  Prelude.NonEmpty NumberCapability ->
  -- | 'numberType'
  NumberType ->
  -- | 'monthlyLeasingPrice'
  Prelude.Text ->
  -- | 'twoWayEnabled'
  Prelude.Bool ->
  -- | 'selfManagedOptOutsEnabled'
  Prelude.Bool ->
  -- | 'optOutListName'
  Prelude.Text ->
  -- | 'deletionProtectionEnabled'
  Prelude.Bool ->
  -- | 'createdTimestamp'
  Prelude.UTCTime ->
  PhoneNumberInformation
newPhoneNumberInformation :: Text
-> Text
-> NumberStatus
-> Text
-> MessageType
-> NonEmpty NumberCapability
-> NumberType
-> Text
-> Bool
-> Bool
-> Text
-> Bool
-> UTCTime
-> PhoneNumberInformation
newPhoneNumberInformation
  Text
pPhoneNumberArn_
  Text
pPhoneNumber_
  NumberStatus
pStatus_
  Text
pIsoCountryCode_
  MessageType
pMessageType_
  NonEmpty NumberCapability
pNumberCapabilities_
  NumberType
pNumberType_
  Text
pMonthlyLeasingPrice_
  Bool
pTwoWayEnabled_
  Bool
pSelfManagedOptOutsEnabled_
  Text
pOptOutListName_
  Bool
pDeletionProtectionEnabled_
  UTCTime
pCreatedTimestamp_ =
    PhoneNumberInformation'
      { $sel:phoneNumberId:PhoneNumberInformation' :: Maybe Text
phoneNumberId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:poolId:PhoneNumberInformation' :: Maybe Text
poolId = forall a. Maybe a
Prelude.Nothing,
        $sel:twoWayChannelArn:PhoneNumberInformation' :: Maybe Text
twoWayChannelArn = forall a. Maybe a
Prelude.Nothing,
        $sel:phoneNumberArn:PhoneNumberInformation' :: Text
phoneNumberArn = Text
pPhoneNumberArn_,
        $sel:phoneNumber:PhoneNumberInformation' :: Text
phoneNumber = Text
pPhoneNumber_,
        $sel:status:PhoneNumberInformation' :: NumberStatus
status = NumberStatus
pStatus_,
        $sel:isoCountryCode:PhoneNumberInformation' :: Text
isoCountryCode = Text
pIsoCountryCode_,
        $sel:messageType:PhoneNumberInformation' :: MessageType
messageType = MessageType
pMessageType_,
        $sel:numberCapabilities:PhoneNumberInformation' :: NonEmpty NumberCapability
numberCapabilities =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty NumberCapability
pNumberCapabilities_,
        $sel:numberType:PhoneNumberInformation' :: NumberType
numberType = NumberType
pNumberType_,
        $sel:monthlyLeasingPrice:PhoneNumberInformation' :: Text
monthlyLeasingPrice = Text
pMonthlyLeasingPrice_,
        $sel:twoWayEnabled:PhoneNumberInformation' :: Bool
twoWayEnabled = Bool
pTwoWayEnabled_,
        $sel:selfManagedOptOutsEnabled:PhoneNumberInformation' :: Bool
selfManagedOptOutsEnabled =
          Bool
pSelfManagedOptOutsEnabled_,
        $sel:optOutListName:PhoneNumberInformation' :: Text
optOutListName = Text
pOptOutListName_,
        $sel:deletionProtectionEnabled:PhoneNumberInformation' :: Bool
deletionProtectionEnabled =
          Bool
pDeletionProtectionEnabled_,
        $sel:createdTimestamp:PhoneNumberInformation' :: POSIX
createdTimestamp =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedTimestamp_
      }

-- | The unique identifier for the phone number.
phoneNumberInformation_phoneNumberId :: Lens.Lens' PhoneNumberInformation (Prelude.Maybe Prelude.Text)
phoneNumberInformation_phoneNumberId :: Lens' PhoneNumberInformation (Maybe Text)
phoneNumberInformation_phoneNumberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Maybe Text
phoneNumberId :: Maybe Text
$sel:phoneNumberId:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
phoneNumberId} -> Maybe Text
phoneNumberId) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Maybe Text
a -> PhoneNumberInformation
s {$sel:phoneNumberId:PhoneNumberInformation' :: Maybe Text
phoneNumberId = Maybe Text
a} :: PhoneNumberInformation)

-- | The unique identifier of the pool associated with the phone number.
phoneNumberInformation_poolId :: Lens.Lens' PhoneNumberInformation (Prelude.Maybe Prelude.Text)
phoneNumberInformation_poolId :: Lens' PhoneNumberInformation (Maybe Text)
phoneNumberInformation_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Maybe Text
poolId :: Maybe Text
$sel:poolId:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
poolId} -> Maybe Text
poolId) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Maybe Text
a -> PhoneNumberInformation
s {$sel:poolId:PhoneNumberInformation' :: Maybe Text
poolId = Maybe Text
a} :: PhoneNumberInformation)

-- | The Amazon Resource Name (ARN) of the two way channel.
phoneNumberInformation_twoWayChannelArn :: Lens.Lens' PhoneNumberInformation (Prelude.Maybe Prelude.Text)
phoneNumberInformation_twoWayChannelArn :: Lens' PhoneNumberInformation (Maybe Text)
phoneNumberInformation_twoWayChannelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Maybe Text
twoWayChannelArn :: Maybe Text
$sel:twoWayChannelArn:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
twoWayChannelArn} -> Maybe Text
twoWayChannelArn) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Maybe Text
a -> PhoneNumberInformation
s {$sel:twoWayChannelArn:PhoneNumberInformation' :: Maybe Text
twoWayChannelArn = Maybe Text
a} :: PhoneNumberInformation)

-- | The Amazon Resource Name (ARN) associated with the phone number.
phoneNumberInformation_phoneNumberArn :: Lens.Lens' PhoneNumberInformation Prelude.Text
phoneNumberInformation_phoneNumberArn :: Lens' PhoneNumberInformation Text
phoneNumberInformation_phoneNumberArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Text
phoneNumberArn :: Text
$sel:phoneNumberArn:PhoneNumberInformation' :: PhoneNumberInformation -> Text
phoneNumberArn} -> Text
phoneNumberArn) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Text
a -> PhoneNumberInformation
s {$sel:phoneNumberArn:PhoneNumberInformation' :: Text
phoneNumberArn = Text
a} :: PhoneNumberInformation)

-- | The phone number in E.164 format.
phoneNumberInformation_phoneNumber :: Lens.Lens' PhoneNumberInformation Prelude.Text
phoneNumberInformation_phoneNumber :: Lens' PhoneNumberInformation Text
phoneNumberInformation_phoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Text
phoneNumber :: Text
$sel:phoneNumber:PhoneNumberInformation' :: PhoneNumberInformation -> Text
phoneNumber} -> Text
phoneNumber) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Text
a -> PhoneNumberInformation
s {$sel:phoneNumber:PhoneNumberInformation' :: Text
phoneNumber = Text
a} :: PhoneNumberInformation)

-- | The current status of the phone number.
phoneNumberInformation_status :: Lens.Lens' PhoneNumberInformation NumberStatus
phoneNumberInformation_status :: Lens' PhoneNumberInformation NumberStatus
phoneNumberInformation_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {NumberStatus
status :: NumberStatus
$sel:status:PhoneNumberInformation' :: PhoneNumberInformation -> NumberStatus
status} -> NumberStatus
status) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} NumberStatus
a -> PhoneNumberInformation
s {$sel:status:PhoneNumberInformation' :: NumberStatus
status = NumberStatus
a} :: PhoneNumberInformation)

-- | The two-character code, in ISO 3166-1 alpha-2 format, for the country or
-- region.
phoneNumberInformation_isoCountryCode :: Lens.Lens' PhoneNumberInformation Prelude.Text
phoneNumberInformation_isoCountryCode :: Lens' PhoneNumberInformation Text
phoneNumberInformation_isoCountryCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Text
isoCountryCode :: Text
$sel:isoCountryCode:PhoneNumberInformation' :: PhoneNumberInformation -> Text
isoCountryCode} -> Text
isoCountryCode) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Text
a -> PhoneNumberInformation
s {$sel:isoCountryCode:PhoneNumberInformation' :: Text
isoCountryCode = Text
a} :: PhoneNumberInformation)

-- | The type of message. Valid values are TRANSACTIONAL for messages that
-- are critical or time-sensitive and PROMOTIONAL for messages that aren\'t
-- critical or time-sensitive.
phoneNumberInformation_messageType :: Lens.Lens' PhoneNumberInformation MessageType
phoneNumberInformation_messageType :: Lens' PhoneNumberInformation MessageType
phoneNumberInformation_messageType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {MessageType
messageType :: MessageType
$sel:messageType:PhoneNumberInformation' :: PhoneNumberInformation -> MessageType
messageType} -> MessageType
messageType) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} MessageType
a -> PhoneNumberInformation
s {$sel:messageType:PhoneNumberInformation' :: MessageType
messageType = MessageType
a} :: PhoneNumberInformation)

-- | Describes if the origination identity can be used for text messages,
-- voice calls or both.
phoneNumberInformation_numberCapabilities :: Lens.Lens' PhoneNumberInformation (Prelude.NonEmpty NumberCapability)
phoneNumberInformation_numberCapabilities :: Lens' PhoneNumberInformation (NonEmpty NumberCapability)
phoneNumberInformation_numberCapabilities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {NonEmpty NumberCapability
numberCapabilities :: NonEmpty NumberCapability
$sel:numberCapabilities:PhoneNumberInformation' :: PhoneNumberInformation -> NonEmpty NumberCapability
numberCapabilities} -> NonEmpty NumberCapability
numberCapabilities) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} NonEmpty NumberCapability
a -> PhoneNumberInformation
s {$sel:numberCapabilities:PhoneNumberInformation' :: NonEmpty NumberCapability
numberCapabilities = NonEmpty NumberCapability
a} :: PhoneNumberInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of phone number.
phoneNumberInformation_numberType :: Lens.Lens' PhoneNumberInformation NumberType
phoneNumberInformation_numberType :: Lens' PhoneNumberInformation NumberType
phoneNumberInformation_numberType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {NumberType
numberType :: NumberType
$sel:numberType:PhoneNumberInformation' :: PhoneNumberInformation -> NumberType
numberType} -> NumberType
numberType) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} NumberType
a -> PhoneNumberInformation
s {$sel:numberType:PhoneNumberInformation' :: NumberType
numberType = NumberType
a} :: PhoneNumberInformation)

-- | The price, in US dollars, to lease the phone number.
phoneNumberInformation_monthlyLeasingPrice :: Lens.Lens' PhoneNumberInformation Prelude.Text
phoneNumberInformation_monthlyLeasingPrice :: Lens' PhoneNumberInformation Text
phoneNumberInformation_monthlyLeasingPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Text
monthlyLeasingPrice :: Text
$sel:monthlyLeasingPrice:PhoneNumberInformation' :: PhoneNumberInformation -> Text
monthlyLeasingPrice} -> Text
monthlyLeasingPrice) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Text
a -> PhoneNumberInformation
s {$sel:monthlyLeasingPrice:PhoneNumberInformation' :: Text
monthlyLeasingPrice = Text
a} :: PhoneNumberInformation)

-- | By default this is set to false. When set to true you can receive
-- incoming text messages from your end recipients using the
-- TwoWayChannelArn.
phoneNumberInformation_twoWayEnabled :: Lens.Lens' PhoneNumberInformation Prelude.Bool
phoneNumberInformation_twoWayEnabled :: Lens' PhoneNumberInformation Bool
phoneNumberInformation_twoWayEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Bool
twoWayEnabled :: Bool
$sel:twoWayEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
twoWayEnabled} -> Bool
twoWayEnabled) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Bool
a -> PhoneNumberInformation
s {$sel:twoWayEnabled:PhoneNumberInformation' :: Bool
twoWayEnabled = Bool
a} :: PhoneNumberInformation)

-- | When set to false an end recipient sends a message that begins with HELP
-- or STOP to one of your dedicated numbers, Amazon Pinpoint automatically
-- replies with a customizable message and adds the end recipient to the
-- OptOutList. When set to true you\'re responsible for responding to HELP
-- and STOP requests. You\'re also responsible for tracking and honoring
-- opt-out request. For more information see
-- <https://docs.aws.amazon.com/pinpoint/latest/userguide/settings-sms-managing.html#settings-account-sms-self-managed-opt-out Self-managed opt-outs>
phoneNumberInformation_selfManagedOptOutsEnabled :: Lens.Lens' PhoneNumberInformation Prelude.Bool
phoneNumberInformation_selfManagedOptOutsEnabled :: Lens' PhoneNumberInformation Bool
phoneNumberInformation_selfManagedOptOutsEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Bool
selfManagedOptOutsEnabled :: Bool
$sel:selfManagedOptOutsEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
selfManagedOptOutsEnabled} -> Bool
selfManagedOptOutsEnabled) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Bool
a -> PhoneNumberInformation
s {$sel:selfManagedOptOutsEnabled:PhoneNumberInformation' :: Bool
selfManagedOptOutsEnabled = Bool
a} :: PhoneNumberInformation)

-- | The name of the OptOutList associated with the phone number.
phoneNumberInformation_optOutListName :: Lens.Lens' PhoneNumberInformation Prelude.Text
phoneNumberInformation_optOutListName :: Lens' PhoneNumberInformation Text
phoneNumberInformation_optOutListName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Text
optOutListName :: Text
$sel:optOutListName:PhoneNumberInformation' :: PhoneNumberInformation -> Text
optOutListName} -> Text
optOutListName) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Text
a -> PhoneNumberInformation
s {$sel:optOutListName:PhoneNumberInformation' :: Text
optOutListName = Text
a} :: PhoneNumberInformation)

-- | When set to true the phone number can\'t be deleted.
phoneNumberInformation_deletionProtectionEnabled :: Lens.Lens' PhoneNumberInformation Prelude.Bool
phoneNumberInformation_deletionProtectionEnabled :: Lens' PhoneNumberInformation Bool
phoneNumberInformation_deletionProtectionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {Bool
deletionProtectionEnabled :: Bool
$sel:deletionProtectionEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
deletionProtectionEnabled} -> Bool
deletionProtectionEnabled) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} Bool
a -> PhoneNumberInformation
s {$sel:deletionProtectionEnabled:PhoneNumberInformation' :: Bool
deletionProtectionEnabled = Bool
a} :: PhoneNumberInformation)

-- | The time when the phone number was created, in
-- <https://www.epochconverter.com/ UNIX epoch time> format.
phoneNumberInformation_createdTimestamp :: Lens.Lens' PhoneNumberInformation Prelude.UTCTime
phoneNumberInformation_createdTimestamp :: Lens' PhoneNumberInformation UTCTime
phoneNumberInformation_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberInformation' {POSIX
createdTimestamp :: POSIX
$sel:createdTimestamp:PhoneNumberInformation' :: PhoneNumberInformation -> POSIX
createdTimestamp} -> POSIX
createdTimestamp) (\s :: PhoneNumberInformation
s@PhoneNumberInformation' {} POSIX
a -> PhoneNumberInformation
s {$sel:createdTimestamp:PhoneNumberInformation' :: POSIX
createdTimestamp = POSIX
a} :: PhoneNumberInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON PhoneNumberInformation where
  parseJSON :: Value -> Parser PhoneNumberInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PhoneNumberInformation"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> NumberStatus
-> Text
-> MessageType
-> NonEmpty NumberCapability
-> NumberType
-> Text
-> Bool
-> Bool
-> Text
-> Bool
-> POSIX
-> PhoneNumberInformation
PhoneNumberInformation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PhoneNumberId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PoolId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TwoWayChannelArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PhoneNumberArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PhoneNumber")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"IsoCountryCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MessageType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"NumberCapabilities")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"NumberType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MonthlyLeasingPrice")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TwoWayEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SelfManagedOptOutsEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OptOutListName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DeletionProtectionEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreatedTimestamp")
      )

instance Prelude.Hashable PhoneNumberInformation where
  hashWithSalt :: Int -> PhoneNumberInformation -> Int
hashWithSalt Int
_salt PhoneNumberInformation' {Bool
Maybe Text
NonEmpty NumberCapability
Text
POSIX
MessageType
NumberStatus
NumberType
createdTimestamp :: POSIX
deletionProtectionEnabled :: Bool
optOutListName :: Text
selfManagedOptOutsEnabled :: Bool
twoWayEnabled :: Bool
monthlyLeasingPrice :: Text
numberType :: NumberType
numberCapabilities :: NonEmpty NumberCapability
messageType :: MessageType
isoCountryCode :: Text
status :: NumberStatus
phoneNumber :: Text
phoneNumberArn :: Text
twoWayChannelArn :: Maybe Text
poolId :: Maybe Text
phoneNumberId :: Maybe Text
$sel:createdTimestamp:PhoneNumberInformation' :: PhoneNumberInformation -> POSIX
$sel:deletionProtectionEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
$sel:optOutListName:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:selfManagedOptOutsEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
$sel:twoWayEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
$sel:monthlyLeasingPrice:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:numberType:PhoneNumberInformation' :: PhoneNumberInformation -> NumberType
$sel:numberCapabilities:PhoneNumberInformation' :: PhoneNumberInformation -> NonEmpty NumberCapability
$sel:messageType:PhoneNumberInformation' :: PhoneNumberInformation -> MessageType
$sel:isoCountryCode:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:status:PhoneNumberInformation' :: PhoneNumberInformation -> NumberStatus
$sel:phoneNumber:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:phoneNumberArn:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:twoWayChannelArn:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
$sel:poolId:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
$sel:phoneNumberId:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
phoneNumberId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
poolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
twoWayChannelArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
phoneNumberArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
phoneNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NumberStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
isoCountryCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MessageType
messageType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty NumberCapability
numberCapabilities
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NumberType
numberType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
monthlyLeasingPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
twoWayEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
selfManagedOptOutsEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
optOutListName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
deletionProtectionEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdTimestamp

instance Prelude.NFData PhoneNumberInformation where
  rnf :: PhoneNumberInformation -> ()
rnf PhoneNumberInformation' {Bool
Maybe Text
NonEmpty NumberCapability
Text
POSIX
MessageType
NumberStatus
NumberType
createdTimestamp :: POSIX
deletionProtectionEnabled :: Bool
optOutListName :: Text
selfManagedOptOutsEnabled :: Bool
twoWayEnabled :: Bool
monthlyLeasingPrice :: Text
numberType :: NumberType
numberCapabilities :: NonEmpty NumberCapability
messageType :: MessageType
isoCountryCode :: Text
status :: NumberStatus
phoneNumber :: Text
phoneNumberArn :: Text
twoWayChannelArn :: Maybe Text
poolId :: Maybe Text
phoneNumberId :: Maybe Text
$sel:createdTimestamp:PhoneNumberInformation' :: PhoneNumberInformation -> POSIX
$sel:deletionProtectionEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
$sel:optOutListName:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:selfManagedOptOutsEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
$sel:twoWayEnabled:PhoneNumberInformation' :: PhoneNumberInformation -> Bool
$sel:monthlyLeasingPrice:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:numberType:PhoneNumberInformation' :: PhoneNumberInformation -> NumberType
$sel:numberCapabilities:PhoneNumberInformation' :: PhoneNumberInformation -> NonEmpty NumberCapability
$sel:messageType:PhoneNumberInformation' :: PhoneNumberInformation -> MessageType
$sel:isoCountryCode:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:status:PhoneNumberInformation' :: PhoneNumberInformation -> NumberStatus
$sel:phoneNumber:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:phoneNumberArn:PhoneNumberInformation' :: PhoneNumberInformation -> Text
$sel:twoWayChannelArn:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
$sel:poolId:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
$sel:phoneNumberId:PhoneNumberInformation' :: PhoneNumberInformation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
phoneNumberId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
twoWayChannelArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
phoneNumberArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
phoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NumberStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
isoCountryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MessageType
messageType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty NumberCapability
numberCapabilities
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NumberType
numberType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
monthlyLeasingPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
twoWayEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
selfManagedOptOutsEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
optOutListName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
deletionProtectionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdTimestamp