{-# 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.Proxy
-- 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.Proxy 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:/ 'newProxy' smart constructor.
data Proxy = Proxy'
  { Proxy -> Maybe Int
defaultSessionExpiryMinutes :: Prelude.Maybe Prelude.Int,
    Proxy -> Maybe Bool
disabled :: Prelude.Maybe Prelude.Bool,
    Proxy -> Maybe (Sensitive Text)
fallBackPhoneNumber :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    Proxy -> Maybe [Text]
phoneNumberCountries :: Prelude.Maybe [Prelude.Text]
  }
  deriving (Proxy -> Proxy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Proxy -> Proxy -> Bool
$c/= :: Proxy -> Proxy -> Bool
== :: Proxy -> Proxy -> Bool
$c== :: Proxy -> Proxy -> Bool
Prelude.Eq, Int -> Proxy -> ShowS
[Proxy] -> ShowS
Proxy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Proxy] -> ShowS
$cshowList :: [Proxy] -> ShowS
show :: Proxy -> String
$cshow :: Proxy -> String
showsPrec :: Int -> Proxy -> ShowS
$cshowsPrec :: Int -> Proxy -> ShowS
Prelude.Show, forall x. Rep Proxy x -> Proxy
forall x. Proxy -> Rep Proxy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Proxy x -> Proxy
$cfrom :: forall x. Proxy -> Rep Proxy x
Prelude.Generic)

-- |
-- Create a value of 'Proxy' 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:
--
-- 'defaultSessionExpiryMinutes', 'proxy_defaultSessionExpiryMinutes' - Undocumented member.
--
-- 'disabled', 'proxy_disabled' - Undocumented member.
--
-- 'fallBackPhoneNumber', 'proxy_fallBackPhoneNumber' - Undocumented member.
--
-- 'phoneNumberCountries', 'proxy_phoneNumberCountries' - Undocumented member.
newProxy ::
  Proxy
newProxy :: Proxy
newProxy =
  Proxy'
    { $sel:defaultSessionExpiryMinutes:Proxy' :: Maybe Int
defaultSessionExpiryMinutes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:disabled:Proxy' :: Maybe Bool
disabled = forall a. Maybe a
Prelude.Nothing,
      $sel:fallBackPhoneNumber:Proxy' :: Maybe (Sensitive Text)
fallBackPhoneNumber = forall a. Maybe a
Prelude.Nothing,
      $sel:phoneNumberCountries:Proxy' :: Maybe [Text]
phoneNumberCountries = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
proxy_defaultSessionExpiryMinutes :: Lens.Lens' Proxy (Prelude.Maybe Prelude.Int)
proxy_defaultSessionExpiryMinutes :: Lens' Proxy (Maybe Int)
proxy_defaultSessionExpiryMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proxy' {Maybe Int
defaultSessionExpiryMinutes :: Maybe Int
$sel:defaultSessionExpiryMinutes:Proxy' :: Proxy -> Maybe Int
defaultSessionExpiryMinutes} -> Maybe Int
defaultSessionExpiryMinutes) (\s :: Proxy
s@Proxy' {} Maybe Int
a -> Proxy
s {$sel:defaultSessionExpiryMinutes:Proxy' :: Maybe Int
defaultSessionExpiryMinutes = Maybe Int
a} :: Proxy)

-- | Undocumented member.
proxy_disabled :: Lens.Lens' Proxy (Prelude.Maybe Prelude.Bool)
proxy_disabled :: Lens' Proxy (Maybe Bool)
proxy_disabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proxy' {Maybe Bool
disabled :: Maybe Bool
$sel:disabled:Proxy' :: Proxy -> Maybe Bool
disabled} -> Maybe Bool
disabled) (\s :: Proxy
s@Proxy' {} Maybe Bool
a -> Proxy
s {$sel:disabled:Proxy' :: Maybe Bool
disabled = Maybe Bool
a} :: Proxy)

-- | Undocumented member.
proxy_fallBackPhoneNumber :: Lens.Lens' Proxy (Prelude.Maybe Prelude.Text)
proxy_fallBackPhoneNumber :: Lens' Proxy (Maybe Text)
proxy_fallBackPhoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proxy' {Maybe (Sensitive Text)
fallBackPhoneNumber :: Maybe (Sensitive Text)
$sel:fallBackPhoneNumber:Proxy' :: Proxy -> Maybe (Sensitive Text)
fallBackPhoneNumber} -> Maybe (Sensitive Text)
fallBackPhoneNumber) (\s :: Proxy
s@Proxy' {} Maybe (Sensitive Text)
a -> Proxy
s {$sel:fallBackPhoneNumber:Proxy' :: Maybe (Sensitive Text)
fallBackPhoneNumber = Maybe (Sensitive Text)
a} :: Proxy) 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.
proxy_phoneNumberCountries :: Lens.Lens' Proxy (Prelude.Maybe [Prelude.Text])
proxy_phoneNumberCountries :: Lens' Proxy (Maybe [Text])
proxy_phoneNumberCountries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proxy' {Maybe [Text]
phoneNumberCountries :: Maybe [Text]
$sel:phoneNumberCountries:Proxy' :: Proxy -> Maybe [Text]
phoneNumberCountries} -> Maybe [Text]
phoneNumberCountries) (\s :: Proxy
s@Proxy' {} Maybe [Text]
a -> Proxy
s {$sel:phoneNumberCountries:Proxy' :: Maybe [Text]
phoneNumberCountries = Maybe [Text]
a} :: Proxy) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON Proxy where
  parseJSON :: Value -> Parser Proxy
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Proxy"
      ( \Object
x ->
          Maybe Int
-> Maybe Bool -> Maybe (Sensitive Text) -> Maybe [Text] -> Proxy
Proxy'
            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
"DefaultSessionExpiryMinutes")
            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
"Disabled")
            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
"FallBackPhoneNumber")
            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
"PhoneNumberCountries"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable Proxy where
  hashWithSalt :: Int -> Proxy -> Int
hashWithSalt Int
_salt Proxy' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe (Sensitive Text)
phoneNumberCountries :: Maybe [Text]
fallBackPhoneNumber :: Maybe (Sensitive Text)
disabled :: Maybe Bool
defaultSessionExpiryMinutes :: Maybe Int
$sel:phoneNumberCountries:Proxy' :: Proxy -> Maybe [Text]
$sel:fallBackPhoneNumber:Proxy' :: Proxy -> Maybe (Sensitive Text)
$sel:disabled:Proxy' :: Proxy -> Maybe Bool
$sel:defaultSessionExpiryMinutes:Proxy' :: Proxy -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
defaultSessionExpiryMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
fallBackPhoneNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
phoneNumberCountries

instance Prelude.NFData Proxy where
  rnf :: Proxy -> ()
rnf Proxy' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe (Sensitive Text)
phoneNumberCountries :: Maybe [Text]
fallBackPhoneNumber :: Maybe (Sensitive Text)
disabled :: Maybe Bool
defaultSessionExpiryMinutes :: Maybe Int
$sel:phoneNumberCountries:Proxy' :: Proxy -> Maybe [Text]
$sel:fallBackPhoneNumber:Proxy' :: Proxy -> Maybe (Sensitive Text)
$sel:disabled:Proxy' :: Proxy -> Maybe Bool
$sel:defaultSessionExpiryMinutes:Proxy' :: Proxy -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
defaultSessionExpiryMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
fallBackPhoneNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
phoneNumberCountries