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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 outbound MMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
outboundMMS :: Prelude.Maybe Prelude.Bool,
    -- | Allows or denies inbound calling for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
inboundCall :: 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 inbound MMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
inboundMMS :: 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 SMS messaging for the specified phone number.
    PhoneNumberCapabilities -> Maybe Bool
outboundSMS :: Prelude.Maybe Prelude.Bool
  }
  deriving (PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool
(PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool)
-> (PhoneNumberCapabilities -> PhoneNumberCapabilities -> Bool)
-> Eq PhoneNumberCapabilities
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]
(Int -> ReadS PhoneNumberCapabilities)
-> ReadS [PhoneNumberCapabilities]
-> ReadPrec PhoneNumberCapabilities
-> ReadPrec [PhoneNumberCapabilities]
-> Read 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
(Int -> PhoneNumberCapabilities -> ShowS)
-> (PhoneNumberCapabilities -> String)
-> ([PhoneNumberCapabilities] -> ShowS)
-> Show PhoneNumberCapabilities
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.
 PhoneNumberCapabilities -> Rep PhoneNumberCapabilities x)
-> (forall x.
    Rep PhoneNumberCapabilities x -> PhoneNumberCapabilities)
-> Generic PhoneNumberCapabilities
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:
--
-- 'outboundMMS', 'phoneNumberCapabilities_outboundMMS' - Allows or denies outbound MMS messaging for the specified phone number.
--
-- 'inboundCall', 'phoneNumberCapabilities_inboundCall' - Allows or denies inbound calling for the specified phone number.
--
-- 'inboundSMS', 'phoneNumberCapabilities_inboundSMS' - Allows or denies inbound SMS messaging for the specified phone number.
--
-- 'inboundMMS', 'phoneNumberCapabilities_inboundMMS' - Allows or denies inbound MMS messaging for the specified phone number.
--
-- 'outboundCall', 'phoneNumberCapabilities_outboundCall' - Allows or denies outbound calling 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' :: Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PhoneNumberCapabilities
PhoneNumberCapabilities'
    { $sel:outboundMMS:PhoneNumberCapabilities' :: Maybe Bool
outboundMMS =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inboundCall:PhoneNumberCapabilities' :: Maybe Bool
inboundCall = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inboundSMS:PhoneNumberCapabilities' :: Maybe Bool
inboundSMS = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inboundMMS:PhoneNumberCapabilities' :: Maybe Bool
inboundMMS = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:outboundCall:PhoneNumberCapabilities' :: Maybe Bool
outboundCall = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:outboundSMS:PhoneNumberCapabilities' :: Maybe Bool
outboundSMS = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Allows or denies outbound MMS messaging for the specified phone number.
phoneNumberCapabilities_outboundMMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_outboundMMS :: (Maybe Bool -> f (Maybe Bool))
-> PhoneNumberCapabilities -> f PhoneNumberCapabilities
phoneNumberCapabilities_outboundMMS = (PhoneNumberCapabilities -> Maybe Bool)
-> (PhoneNumberCapabilities
    -> Maybe Bool -> PhoneNumberCapabilities)
-> Lens
     PhoneNumberCapabilities
     PhoneNumberCapabilities
     (Maybe Bool)
     (Maybe Bool)
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 inbound calling for the specified phone number.
phoneNumberCapabilities_inboundCall :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_inboundCall :: (Maybe Bool -> f (Maybe Bool))
-> PhoneNumberCapabilities -> f PhoneNumberCapabilities
phoneNumberCapabilities_inboundCall = (PhoneNumberCapabilities -> Maybe Bool)
-> (PhoneNumberCapabilities
    -> Maybe Bool -> PhoneNumberCapabilities)
-> Lens
     PhoneNumberCapabilities
     PhoneNumberCapabilities
     (Maybe Bool)
     (Maybe Bool)
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 SMS messaging for the specified phone number.
phoneNumberCapabilities_inboundSMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_inboundSMS :: (Maybe Bool -> f (Maybe Bool))
-> PhoneNumberCapabilities -> f PhoneNumberCapabilities
phoneNumberCapabilities_inboundSMS = (PhoneNumberCapabilities -> Maybe Bool)
-> (PhoneNumberCapabilities
    -> Maybe Bool -> PhoneNumberCapabilities)
-> Lens
     PhoneNumberCapabilities
     PhoneNumberCapabilities
     (Maybe Bool)
     (Maybe Bool)
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 inbound MMS messaging for the specified phone number.
phoneNumberCapabilities_inboundMMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_inboundMMS :: (Maybe Bool -> f (Maybe Bool))
-> PhoneNumberCapabilities -> f PhoneNumberCapabilities
phoneNumberCapabilities_inboundMMS = (PhoneNumberCapabilities -> Maybe Bool)
-> (PhoneNumberCapabilities
    -> Maybe Bool -> PhoneNumberCapabilities)
-> Lens
     PhoneNumberCapabilities
     PhoneNumberCapabilities
     (Maybe Bool)
     (Maybe Bool)
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 outbound calling for the specified phone number.
phoneNumberCapabilities_outboundCall :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_outboundCall :: (Maybe Bool -> f (Maybe Bool))
-> PhoneNumberCapabilities -> f PhoneNumberCapabilities
phoneNumberCapabilities_outboundCall = (PhoneNumberCapabilities -> Maybe Bool)
-> (PhoneNumberCapabilities
    -> Maybe Bool -> PhoneNumberCapabilities)
-> Lens
     PhoneNumberCapabilities
     PhoneNumberCapabilities
     (Maybe Bool)
     (Maybe Bool)
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 SMS messaging for the specified phone number.
phoneNumberCapabilities_outboundSMS :: Lens.Lens' PhoneNumberCapabilities (Prelude.Maybe Prelude.Bool)
phoneNumberCapabilities_outboundSMS :: (Maybe Bool -> f (Maybe Bool))
-> PhoneNumberCapabilities -> f PhoneNumberCapabilities
phoneNumberCapabilities_outboundSMS = (PhoneNumberCapabilities -> Maybe Bool)
-> (PhoneNumberCapabilities
    -> Maybe Bool -> PhoneNumberCapabilities)
-> Lens
     PhoneNumberCapabilities
     PhoneNumberCapabilities
     (Maybe Bool)
     (Maybe Bool)
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 Core.FromJSON PhoneNumberCapabilities where
  parseJSON :: Value -> Parser PhoneNumberCapabilities
parseJSON =
    String
-> (Object -> Parser PhoneNumberCapabilities)
-> Value
-> Parser PhoneNumberCapabilities
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PhoneNumberCapabilities"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PhoneNumberCapabilities
PhoneNumberCapabilities'
            (Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> PhoneNumberCapabilities)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PhoneNumberCapabilities)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutboundMMS")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PhoneNumberCapabilities)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> PhoneNumberCapabilities)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InboundCall")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> PhoneNumberCapabilities)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool -> Maybe Bool -> Maybe Bool -> PhoneNumberCapabilities)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InboundSMS")
            Parser
  (Maybe Bool -> Maybe Bool -> Maybe Bool -> PhoneNumberCapabilities)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> Maybe Bool -> PhoneNumberCapabilities)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InboundMMS")
            Parser (Maybe Bool -> Maybe Bool -> PhoneNumberCapabilities)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> PhoneNumberCapabilities)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutboundCall")
            Parser (Maybe Bool -> PhoneNumberCapabilities)
-> Parser (Maybe Bool) -> Parser PhoneNumberCapabilities
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutboundSMS")
      )

instance Prelude.Hashable PhoneNumberCapabilities

instance Prelude.NFData PhoneNumberCapabilities