{-# 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.Chime.Types.PhoneNumberCapabilities
-- 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.Chime.Types.PhoneNumberCapabilities 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

-- | The phone number capabilities for Amazon Chime Business Calling phone
-- numbers, such as enabled inbound and outbound calling and text
-- messaging.
--
-- /See:/ 'newPhoneNumberCapabilities' smart constructor.
data PhoneNumberCapabilities = PhoneNumberCapabilities'
  { -- | Allows or denies inbound calling for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
inboundCall :: Prelude.Maybe Prelude.Bool,
    -- | Allows or denies inbound MMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
inboundMMS :: Prelude.Maybe Prelude.Bool,
    -- | Allows or denies inbound SMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
inboundSMS :: Prelude.Maybe Prelude.Bool,
    -- | Allows or denies outbound calling for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
outboundCall :: Prelude.Maybe Prelude.Bool,
    -- | Allows or denies outbound MMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
outboundMMS :: Prelude.Maybe Prelude.Bool,
    -- | Allows or denies outbound SMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
outboundSMS :: Prelude.Maybe Prelude.Bool
  }
  deriving (PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool
$c/= :: PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool
== :: PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool
$c== :: PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool
Prelude.Eq, ReadPrec [PhoneNumberCapabilities]
ReadPrec PhoneNumberCapabilities
Int -> ReadS PhoneNumberCapabilities
ReadS [PhoneNumberCapabilities]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhoneNumberCapabilities]
$creadListPrec :: ReadPrec [PhoneNumberCapabilities]
readPrec :: ReadPrec PhoneNumberCapabilities
$creadPrec :: ReadPrec PhoneNumberCapabilities
readList :: ReadS [PhoneNumberCapabilities]
$creadList :: ReadS [PhoneNumberCapabilities]
readsPrec :: Int -> ReadS PhoneNumberCapabilities
$creadsPrec :: Int -> ReadS PhoneNumberCapabilities
Prelude.Read, Int -> PhoneNumberCapabilities -> ShowS
[PhoneNumberCapabilities] -> ShowS
PhoneNumberCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhoneNumberCapabilities] -> ShowS
$cshowList :: [PhoneNumberCapabilities] -> ShowS
show :: PhoneNumberCapabilities -> String
$cshow :: PhoneNumberCapabilities -> String
showsPrec :: Int -> PhoneNumberCapabilities -> ShowS
$cshowsPrec :: Int -> PhoneNumberCapabilities -> ShowS
Prelude.Show, forall x. Rep PhoneNumberCapabilities x -> PhoneNumberCapabilities
forall x. PhoneNumberCapabilities -> Rep PhoneNumberCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhoneNumberCapabilities x -> PhoneNumberCapabilities
$cfrom :: forall x. PhoneNumberCapabilities -> Rep PhoneNumberCapabilities x
Prelude.Generic)

-- |
-- Create a value of 'PhoneNumberCapabilities' 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:
--
-- 'inboundCall', 'phoneNumberCapabilities_inboundCall' - Allows or denies inbound calling for the specified phone number.
--
-- 'inboundMMS', 'phoneNumberCapabilities_inboundMMS' - Allows or denies inbound MMS messaging for the specified phone number.
--
-- 'inboundSMS', 'phoneNumberCapabilities_inboundSMS' - Allows or denies inbound SMS messaging for the specified phone number.
--
-- 'outboundCall', 'phoneNumberCapabilities_outboundCall' - Allows or denies outbound calling for the specified phone number.
--
-- 'outboundMMS', 'phoneNumberCapabilities_outboundMMS' - Allows or denies outbound MMS messaging for the specified phone number.
--
-- 'outboundSMS', 'phoneNumberCapabilities_outboundSMS' - Allows or denies outbound SMS messaging for the specified phone number.
newPhoneNumberCapabilities ::
  PhoneNumberCapabilities
newPhoneNumberCapabilities :: PhoneNumberCapabilities
newPhoneNumberCapabilities =
  PhoneNumberCapabilities'
    { $sel:inboundCall:PhoneNumberCapabilities' :: Maybe Bool
inboundCall =
        forall a. Maybe a
Prelude.Nothing,
      $sel:inboundMMS:PhoneNumberCapabilities' :: Maybe Bool
inboundMMS = forall a. Maybe a
Prelude.Nothing,
      $sel:inboundSMS:PhoneNumberCapabilities' :: Maybe Bool
inboundSMS = forall a. Maybe a
Prelude.Nothing,
      $sel:outboundCall:PhoneNumberCapabilities' :: Maybe Bool
outboundCall = forall a. Maybe a
Prelude.Nothing,
      $sel:outboundMMS:PhoneNumberCapabilities' :: Maybe Bool
outboundMMS = forall a. Maybe a
Prelude.Nothing,
      $sel:outboundSMS:PhoneNumberCapabilities' :: Maybe Bool
outboundSMS = forall a. Maybe a
Prelude.Nothing
    }

-- | Allows or denies inbound calling for the specified phone number.
phoneNumberCapabilities_inboundCall :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_inboundCall :: Lens' PhoneNumberCapabilities (Maybe Bool)
phoneNumberCapabilities_inboundCall = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberCapabilities' {Maybe Bool
inboundCall :: Maybe Bool
$sel:inboundCall:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
inboundCall} -> Maybe Bool
inboundCall) (\s :: PhoneNumberCapabilities
s@PhoneNumberCapabilities' {} Maybe Bool
a -> PhoneNumberCapabilities
s {$sel:inboundCall:PhoneNumberCapabilities' :: Maybe Bool
inboundCall = Maybe Bool
a} :: PhoneNumberCapabilities)

-- | Allows or denies inbound MMS messaging for the specified phone number.
phoneNumberCapabilities_inboundMMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_inboundMMS :: Lens' PhoneNumberCapabilities (Maybe Bool)
phoneNumberCapabilities_inboundMMS = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberCapabilities' {Maybe Bool
inboundMMS :: Maybe Bool
$sel:inboundMMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
inboundMMS} -> Maybe Bool
inboundMMS) (\s :: PhoneNumberCapabilities
s@PhoneNumberCapabilities' {} Maybe Bool
a -> PhoneNumberCapabilities
s {$sel:inboundMMS:PhoneNumberCapabilities' :: Maybe Bool
inboundMMS = Maybe Bool
a} :: PhoneNumberCapabilities)

-- | Allows or denies inbound SMS messaging for the specified phone number.
phoneNumberCapabilities_inboundSMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_inboundSMS :: Lens' PhoneNumberCapabilities (Maybe Bool)
phoneNumberCapabilities_inboundSMS = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberCapabilities' {Maybe Bool
inboundSMS :: Maybe Bool
$sel:inboundSMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
inboundSMS} -> Maybe Bool
inboundSMS) (\s :: PhoneNumberCapabilities
s@PhoneNumberCapabilities' {} Maybe Bool
a -> PhoneNumberCapabilities
s {$sel:inboundSMS:PhoneNumberCapabilities' :: Maybe Bool
inboundSMS = Maybe Bool
a} :: PhoneNumberCapabilities)

-- | Allows or denies outbound calling for the specified phone number.
phoneNumberCapabilities_outboundCall :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_outboundCall :: Lens' PhoneNumberCapabilities (Maybe Bool)
phoneNumberCapabilities_outboundCall = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberCapabilities' {Maybe Bool
outboundCall :: Maybe Bool
$sel:outboundCall:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
outboundCall} -> Maybe Bool
outboundCall) (\s :: PhoneNumberCapabilities
s@PhoneNumberCapabilities' {} Maybe Bool
a -> PhoneNumberCapabilities
s {$sel:outboundCall:PhoneNumberCapabilities' :: Maybe Bool
outboundCall = Maybe Bool
a} :: PhoneNumberCapabilities)

-- | Allows or denies outbound MMS messaging for the specified phone number.
phoneNumberCapabilities_outboundMMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_outboundMMS :: Lens' PhoneNumberCapabilities (Maybe Bool)
phoneNumberCapabilities_outboundMMS = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberCapabilities' {Maybe Bool
outboundMMS :: Maybe Bool
$sel:outboundMMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
outboundMMS} -> Maybe Bool
outboundMMS) (\s :: PhoneNumberCapabilities
s@PhoneNumberCapabilities' {} Maybe Bool
a -> PhoneNumberCapabilities
s {$sel:outboundMMS:PhoneNumberCapabilities' :: Maybe Bool
outboundMMS = Maybe Bool
a} :: PhoneNumberCapabilities)

-- | Allows or denies outbound SMS messaging for the specified phone number.
phoneNumberCapabilities_outboundSMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_outboundSMS :: Lens' PhoneNumberCapabilities (Maybe Bool)
phoneNumberCapabilities_outboundSMS = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhoneNumberCapabilities' {Maybe Bool
outboundSMS :: Maybe Bool
$sel:outboundSMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
outboundSMS} -> Maybe Bool
outboundSMS) (\s :: PhoneNumberCapabilities
s@PhoneNumberCapabilities' {} Maybe Bool
a -> PhoneNumberCapabilities
s {$sel:outboundSMS:PhoneNumberCapabilities' :: Maybe Bool
outboundSMS = Maybe Bool
a} :: PhoneNumberCapabilities)

instance Data.FromJSON PhoneNumberCapabilities where
  parseJSON :: Value -> Parser PhoneNumberCapabilities
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PhoneNumberCapabilities"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PhoneNumberCapabilities
PhoneNumberCapabilities'
            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
"InboundCall")
            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
"InboundMMS")
            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
"InboundSMS")
            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
"OutboundCall")
            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
"OutboundMMS")
            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
"OutboundSMS")
      )

instance Prelude.Hashable PhoneNumberCapabilities where
  hashWithSalt :: Int -> PhoneNumberCapabilities -> Int
hashWithSalt Int
_salt PhoneNumberCapabilities' {Maybe Bool
outboundSMS :: Maybe Bool
outboundMMS :: Maybe Bool
outboundCall :: Maybe Bool
inboundSMS :: Maybe Bool
inboundMMS :: Maybe Bool
inboundCall :: Maybe Bool
$sel:outboundSMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:outboundMMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:outboundCall:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:inboundSMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:inboundMMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:inboundCall:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
inboundCall
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
inboundMMS
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
inboundSMS
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
outboundCall
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
outboundMMS
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
outboundSMS

instance Prelude.NFData PhoneNumberCapabilities where
  rnf :: PhoneNumberCapabilities -> ()
rnf PhoneNumberCapabilities' {Maybe Bool
outboundSMS :: Maybe Bool
outboundMMS :: Maybe Bool
outboundCall :: Maybe Bool
inboundSMS :: Maybe Bool
inboundMMS :: Maybe Bool
inboundCall :: Maybe Bool
$sel:outboundSMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:outboundMMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:outboundCall:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:inboundSMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:inboundMMS:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
$sel:inboundCall:PhoneNumberCapabilities' :: PhoneNumberCapabilities -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
inboundCall
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
inboundMMS
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
inboundSMS
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
outboundCall
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
outboundMMS
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
outboundSMS