{-# 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.ChimeSdkVoice.Types.DNISEmergencyCallingConfiguration
-- 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.ChimeSdkVoice.Types.DNISEmergencyCallingConfiguration 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

-- | /See:/ 'newDNISEmergencyCallingConfiguration' smart constructor.
data DNISEmergencyCallingConfiguration = DNISEmergencyCallingConfiguration'
  { DNISEmergencyCallingConfiguration -> Maybe (Sensitive Text)
testPhoneNumber :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    DNISEmergencyCallingConfiguration -> Sensitive Text
emergencyPhoneNumber :: Data.Sensitive Prelude.Text,
    DNISEmergencyCallingConfiguration -> Text
callingCountry :: Prelude.Text
  }
  deriving (DNISEmergencyCallingConfiguration
-> DNISEmergencyCallingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DNISEmergencyCallingConfiguration
-> DNISEmergencyCallingConfiguration -> Bool
$c/= :: DNISEmergencyCallingConfiguration
-> DNISEmergencyCallingConfiguration -> Bool
== :: DNISEmergencyCallingConfiguration
-> DNISEmergencyCallingConfiguration -> Bool
$c== :: DNISEmergencyCallingConfiguration
-> DNISEmergencyCallingConfiguration -> Bool
Prelude.Eq, Int -> DNISEmergencyCallingConfiguration -> ShowS
[DNISEmergencyCallingConfiguration] -> ShowS
DNISEmergencyCallingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DNISEmergencyCallingConfiguration] -> ShowS
$cshowList :: [DNISEmergencyCallingConfiguration] -> ShowS
show :: DNISEmergencyCallingConfiguration -> String
$cshow :: DNISEmergencyCallingConfiguration -> String
showsPrec :: Int -> DNISEmergencyCallingConfiguration -> ShowS
$cshowsPrec :: Int -> DNISEmergencyCallingConfiguration -> ShowS
Prelude.Show, forall x.
Rep DNISEmergencyCallingConfiguration x
-> DNISEmergencyCallingConfiguration
forall x.
DNISEmergencyCallingConfiguration
-> Rep DNISEmergencyCallingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DNISEmergencyCallingConfiguration x
-> DNISEmergencyCallingConfiguration
$cfrom :: forall x.
DNISEmergencyCallingConfiguration
-> Rep DNISEmergencyCallingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DNISEmergencyCallingConfiguration' 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:
--
-- 'testPhoneNumber', 'dNISEmergencyCallingConfiguration_testPhoneNumber' - Undocumented member.
--
-- 'emergencyPhoneNumber', 'dNISEmergencyCallingConfiguration_emergencyPhoneNumber' - Undocumented member.
--
-- 'callingCountry', 'dNISEmergencyCallingConfiguration_callingCountry' - Undocumented member.
newDNISEmergencyCallingConfiguration ::
  -- | 'emergencyPhoneNumber'
  Prelude.Text ->
  -- | 'callingCountry'
  Prelude.Text ->
  DNISEmergencyCallingConfiguration
newDNISEmergencyCallingConfiguration :: Text -> Text -> DNISEmergencyCallingConfiguration
newDNISEmergencyCallingConfiguration
  Text
pEmergencyPhoneNumber_
  Text
pCallingCountry_ =
    DNISEmergencyCallingConfiguration'
      { $sel:testPhoneNumber:DNISEmergencyCallingConfiguration' :: Maybe (Sensitive Text)
testPhoneNumber =
          forall a. Maybe a
Prelude.Nothing,
        $sel:emergencyPhoneNumber:DNISEmergencyCallingConfiguration' :: Sensitive Text
emergencyPhoneNumber =
          forall a. Iso' (Sensitive a) a
Data._Sensitive
            forall t b. AReview t b -> b -> t
Lens.# Text
pEmergencyPhoneNumber_,
        $sel:callingCountry:DNISEmergencyCallingConfiguration' :: Text
callingCountry = Text
pCallingCountry_
      }

-- | Undocumented member.
dNISEmergencyCallingConfiguration_testPhoneNumber :: Lens.Lens' DNISEmergencyCallingConfiguration (Prelude.Maybe Prelude.Text)
dNISEmergencyCallingConfiguration_testPhoneNumber :: Lens' DNISEmergencyCallingConfiguration (Maybe Text)
dNISEmergencyCallingConfiguration_testPhoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DNISEmergencyCallingConfiguration' {Maybe (Sensitive Text)
testPhoneNumber :: Maybe (Sensitive Text)
$sel:testPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Maybe (Sensitive Text)
testPhoneNumber} -> Maybe (Sensitive Text)
testPhoneNumber) (\s :: DNISEmergencyCallingConfiguration
s@DNISEmergencyCallingConfiguration' {} Maybe (Sensitive Text)
a -> DNISEmergencyCallingConfiguration
s {$sel:testPhoneNumber:DNISEmergencyCallingConfiguration' :: Maybe (Sensitive Text)
testPhoneNumber = Maybe (Sensitive Text)
a} :: DNISEmergencyCallingConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | Undocumented member.
dNISEmergencyCallingConfiguration_emergencyPhoneNumber :: Lens.Lens' DNISEmergencyCallingConfiguration Prelude.Text
dNISEmergencyCallingConfiguration_emergencyPhoneNumber :: Lens' DNISEmergencyCallingConfiguration Text
dNISEmergencyCallingConfiguration_emergencyPhoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DNISEmergencyCallingConfiguration' {Sensitive Text
emergencyPhoneNumber :: Sensitive Text
$sel:emergencyPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Sensitive Text
emergencyPhoneNumber} -> Sensitive Text
emergencyPhoneNumber) (\s :: DNISEmergencyCallingConfiguration
s@DNISEmergencyCallingConfiguration' {} Sensitive Text
a -> DNISEmergencyCallingConfiguration
s {$sel:emergencyPhoneNumber:DNISEmergencyCallingConfiguration' :: Sensitive Text
emergencyPhoneNumber = Sensitive Text
a} :: DNISEmergencyCallingConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | Undocumented member.
dNISEmergencyCallingConfiguration_callingCountry :: Lens.Lens' DNISEmergencyCallingConfiguration Prelude.Text
dNISEmergencyCallingConfiguration_callingCountry :: Lens' DNISEmergencyCallingConfiguration Text
dNISEmergencyCallingConfiguration_callingCountry = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DNISEmergencyCallingConfiguration' {Text
callingCountry :: Text
$sel:callingCountry:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Text
callingCountry} -> Text
callingCountry) (\s :: DNISEmergencyCallingConfiguration
s@DNISEmergencyCallingConfiguration' {} Text
a -> DNISEmergencyCallingConfiguration
s {$sel:callingCountry:DNISEmergencyCallingConfiguration' :: Text
callingCountry = Text
a} :: DNISEmergencyCallingConfiguration)

instance
  Data.FromJSON
    DNISEmergencyCallingConfiguration
  where
  parseJSON :: Value -> Parser DNISEmergencyCallingConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DNISEmergencyCallingConfiguration"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Sensitive Text -> Text -> DNISEmergencyCallingConfiguration
DNISEmergencyCallingConfiguration'
            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
"TestPhoneNumber")
            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
"EmergencyPhoneNumber")
            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
"CallingCountry")
      )

instance
  Prelude.Hashable
    DNISEmergencyCallingConfiguration
  where
  hashWithSalt :: Int -> DNISEmergencyCallingConfiguration -> Int
hashWithSalt
    Int
_salt
    DNISEmergencyCallingConfiguration' {Maybe (Sensitive Text)
Text
Sensitive Text
callingCountry :: Text
emergencyPhoneNumber :: Sensitive Text
testPhoneNumber :: Maybe (Sensitive Text)
$sel:callingCountry:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Text
$sel:emergencyPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Sensitive Text
$sel:testPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Maybe (Sensitive Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
testPhoneNumber
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
emergencyPhoneNumber
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
callingCountry

instance
  Prelude.NFData
    DNISEmergencyCallingConfiguration
  where
  rnf :: DNISEmergencyCallingConfiguration -> ()
rnf DNISEmergencyCallingConfiguration' {Maybe (Sensitive Text)
Text
Sensitive Text
callingCountry :: Text
emergencyPhoneNumber :: Sensitive Text
testPhoneNumber :: Maybe (Sensitive Text)
$sel:callingCountry:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Text
$sel:emergencyPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Sensitive Text
$sel:testPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
testPhoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
emergencyPhoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
callingCountry

instance
  Data.ToJSON
    DNISEmergencyCallingConfiguration
  where
  toJSON :: DNISEmergencyCallingConfiguration -> Value
toJSON DNISEmergencyCallingConfiguration' {Maybe (Sensitive Text)
Text
Sensitive Text
callingCountry :: Text
emergencyPhoneNumber :: Sensitive Text
testPhoneNumber :: Maybe (Sensitive Text)
$sel:callingCountry:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Text
$sel:emergencyPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Sensitive Text
$sel:testPhoneNumber:DNISEmergencyCallingConfiguration' :: DNISEmergencyCallingConfiguration -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"TestPhoneNumber" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
testPhoneNumber,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"EmergencyPhoneNumber"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
emergencyPhoneNumber
              ),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"CallingCountry" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
callingCountry)
          ]
      )