{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PutVoiceConnectorProxy
-- 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)
--
-- Puts the specified proxy configuration to the specified Amazon Chime
-- Voice Connector.
module Amazonka.Chime.PutVoiceConnectorProxy
  ( -- * Creating a Request
    PutVoiceConnectorProxy (..),
    newPutVoiceConnectorProxy,

    -- * Request Lenses
    putVoiceConnectorProxy_disabled,
    putVoiceConnectorProxy_fallBackPhoneNumber,
    putVoiceConnectorProxy_defaultSessionExpiryMinutes,
    putVoiceConnectorProxy_phoneNumberPoolCountries,
    putVoiceConnectorProxy_voiceConnectorId,

    -- * Destructuring the Response
    PutVoiceConnectorProxyResponse (..),
    newPutVoiceConnectorProxyResponse,

    -- * Response Lenses
    putVoiceConnectorProxyResponse_proxy,
    putVoiceConnectorProxyResponse_httpStatus,
  )
where

import Amazonka.Chime.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutVoiceConnectorProxy' smart constructor.
data PutVoiceConnectorProxy = PutVoiceConnectorProxy'
  { -- | When true, stops proxy sessions from being created on the specified
    -- Amazon Chime Voice Connector.
    PutVoiceConnectorProxy -> Maybe Bool
disabled :: Prelude.Maybe Prelude.Bool,
    -- | The phone number to route calls to after a proxy session expires.
    PutVoiceConnectorProxy -> Maybe (Sensitive Text)
fallBackPhoneNumber :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The default number of minutes allowed for proxy sessions.
    PutVoiceConnectorProxy -> Int
defaultSessionExpiryMinutes :: Prelude.Int,
    -- | The countries for proxy phone numbers to be selected from.
    PutVoiceConnectorProxy -> NonEmpty Text
phoneNumberPoolCountries :: Prelude.NonEmpty Prelude.Text,
    -- | The Amazon Chime voice connector ID.
    PutVoiceConnectorProxy -> Text
voiceConnectorId :: Prelude.Text
  }
  deriving (PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool
(PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool)
-> (PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool)
-> Eq PutVoiceConnectorProxy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool
$c/= :: PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool
== :: PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool
$c== :: PutVoiceConnectorProxy -> PutVoiceConnectorProxy -> Bool
Prelude.Eq, Int -> PutVoiceConnectorProxy -> ShowS
[PutVoiceConnectorProxy] -> ShowS
PutVoiceConnectorProxy -> String
(Int -> PutVoiceConnectorProxy -> ShowS)
-> (PutVoiceConnectorProxy -> String)
-> ([PutVoiceConnectorProxy] -> ShowS)
-> Show PutVoiceConnectorProxy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutVoiceConnectorProxy] -> ShowS
$cshowList :: [PutVoiceConnectorProxy] -> ShowS
show :: PutVoiceConnectorProxy -> String
$cshow :: PutVoiceConnectorProxy -> String
showsPrec :: Int -> PutVoiceConnectorProxy -> ShowS
$cshowsPrec :: Int -> PutVoiceConnectorProxy -> ShowS
Prelude.Show, (forall x. PutVoiceConnectorProxy -> Rep PutVoiceConnectorProxy x)
-> (forall x.
    Rep PutVoiceConnectorProxy x -> PutVoiceConnectorProxy)
-> Generic PutVoiceConnectorProxy
forall x. Rep PutVoiceConnectorProxy x -> PutVoiceConnectorProxy
forall x. PutVoiceConnectorProxy -> Rep PutVoiceConnectorProxy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutVoiceConnectorProxy x -> PutVoiceConnectorProxy
$cfrom :: forall x. PutVoiceConnectorProxy -> Rep PutVoiceConnectorProxy x
Prelude.Generic)

-- |
-- Create a value of 'PutVoiceConnectorProxy' 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:
--
-- 'disabled', 'putVoiceConnectorProxy_disabled' - When true, stops proxy sessions from being created on the specified
-- Amazon Chime Voice Connector.
--
-- 'fallBackPhoneNumber', 'putVoiceConnectorProxy_fallBackPhoneNumber' - The phone number to route calls to after a proxy session expires.
--
-- 'defaultSessionExpiryMinutes', 'putVoiceConnectorProxy_defaultSessionExpiryMinutes' - The default number of minutes allowed for proxy sessions.
--
-- 'phoneNumberPoolCountries', 'putVoiceConnectorProxy_phoneNumberPoolCountries' - The countries for proxy phone numbers to be selected from.
--
-- 'voiceConnectorId', 'putVoiceConnectorProxy_voiceConnectorId' - The Amazon Chime voice connector ID.
newPutVoiceConnectorProxy ::
  -- | 'defaultSessionExpiryMinutes'
  Prelude.Int ->
  -- | 'phoneNumberPoolCountries'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'voiceConnectorId'
  Prelude.Text ->
  PutVoiceConnectorProxy
newPutVoiceConnectorProxy :: Int -> NonEmpty Text -> Text -> PutVoiceConnectorProxy
newPutVoiceConnectorProxy
  Int
pDefaultSessionExpiryMinutes_
  NonEmpty Text
pPhoneNumberPoolCountries_
  Text
pVoiceConnectorId_ =
    PutVoiceConnectorProxy' :: Maybe Bool
-> Maybe (Sensitive Text)
-> Int
-> NonEmpty Text
-> Text
-> PutVoiceConnectorProxy
PutVoiceConnectorProxy'
      { $sel:disabled:PutVoiceConnectorProxy' :: Maybe Bool
disabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:fallBackPhoneNumber:PutVoiceConnectorProxy' :: Maybe (Sensitive Text)
fallBackPhoneNumber = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:defaultSessionExpiryMinutes:PutVoiceConnectorProxy' :: Int
defaultSessionExpiryMinutes =
          Int
pDefaultSessionExpiryMinutes_,
        $sel:phoneNumberPoolCountries:PutVoiceConnectorProxy' :: NonEmpty Text
phoneNumberPoolCountries =
          Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pPhoneNumberPoolCountries_,
        $sel:voiceConnectorId:PutVoiceConnectorProxy' :: Text
voiceConnectorId = Text
pVoiceConnectorId_
      }

-- | When true, stops proxy sessions from being created on the specified
-- Amazon Chime Voice Connector.
putVoiceConnectorProxy_disabled :: Lens.Lens' PutVoiceConnectorProxy (Prelude.Maybe Prelude.Bool)
putVoiceConnectorProxy_disabled :: (Maybe Bool -> f (Maybe Bool))
-> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy
putVoiceConnectorProxy_disabled = (PutVoiceConnectorProxy -> Maybe Bool)
-> (PutVoiceConnectorProxy -> Maybe Bool -> PutVoiceConnectorProxy)
-> Lens
     PutVoiceConnectorProxy
     PutVoiceConnectorProxy
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxy' {Maybe Bool
disabled :: Maybe Bool
$sel:disabled:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Maybe Bool
disabled} -> Maybe Bool
disabled) (\s :: PutVoiceConnectorProxy
s@PutVoiceConnectorProxy' {} Maybe Bool
a -> PutVoiceConnectorProxy
s {$sel:disabled:PutVoiceConnectorProxy' :: Maybe Bool
disabled = Maybe Bool
a} :: PutVoiceConnectorProxy)

-- | The phone number to route calls to after a proxy session expires.
putVoiceConnectorProxy_fallBackPhoneNumber :: Lens.Lens' PutVoiceConnectorProxy (Prelude.Maybe Prelude.Text)
putVoiceConnectorProxy_fallBackPhoneNumber :: (Maybe Text -> f (Maybe Text))
-> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy
putVoiceConnectorProxy_fallBackPhoneNumber = (PutVoiceConnectorProxy -> Maybe (Sensitive Text))
-> (PutVoiceConnectorProxy
    -> Maybe (Sensitive Text) -> PutVoiceConnectorProxy)
-> Lens
     PutVoiceConnectorProxy
     PutVoiceConnectorProxy
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxy' {Maybe (Sensitive Text)
fallBackPhoneNumber :: Maybe (Sensitive Text)
$sel:fallBackPhoneNumber:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Maybe (Sensitive Text)
fallBackPhoneNumber} -> Maybe (Sensitive Text)
fallBackPhoneNumber) (\s :: PutVoiceConnectorProxy
s@PutVoiceConnectorProxy' {} Maybe (Sensitive Text)
a -> PutVoiceConnectorProxy
s {$sel:fallBackPhoneNumber:PutVoiceConnectorProxy' :: Maybe (Sensitive Text)
fallBackPhoneNumber = Maybe (Sensitive Text)
a} :: PutVoiceConnectorProxy) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PutVoiceConnectorProxy
-> f PutVoiceConnectorProxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The default number of minutes allowed for proxy sessions.
putVoiceConnectorProxy_defaultSessionExpiryMinutes :: Lens.Lens' PutVoiceConnectorProxy Prelude.Int
putVoiceConnectorProxy_defaultSessionExpiryMinutes :: (Int -> f Int)
-> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy
putVoiceConnectorProxy_defaultSessionExpiryMinutes = (PutVoiceConnectorProxy -> Int)
-> (PutVoiceConnectorProxy -> Int -> PutVoiceConnectorProxy)
-> Lens PutVoiceConnectorProxy PutVoiceConnectorProxy Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxy' {Int
defaultSessionExpiryMinutes :: Int
$sel:defaultSessionExpiryMinutes:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Int
defaultSessionExpiryMinutes} -> Int
defaultSessionExpiryMinutes) (\s :: PutVoiceConnectorProxy
s@PutVoiceConnectorProxy' {} Int
a -> PutVoiceConnectorProxy
s {$sel:defaultSessionExpiryMinutes:PutVoiceConnectorProxy' :: Int
defaultSessionExpiryMinutes = Int
a} :: PutVoiceConnectorProxy)

-- | The countries for proxy phone numbers to be selected from.
putVoiceConnectorProxy_phoneNumberPoolCountries :: Lens.Lens' PutVoiceConnectorProxy (Prelude.NonEmpty Prelude.Text)
putVoiceConnectorProxy_phoneNumberPoolCountries :: (NonEmpty Text -> f (NonEmpty Text))
-> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy
putVoiceConnectorProxy_phoneNumberPoolCountries = (PutVoiceConnectorProxy -> NonEmpty Text)
-> (PutVoiceConnectorProxy
    -> NonEmpty Text -> PutVoiceConnectorProxy)
-> Lens
     PutVoiceConnectorProxy
     PutVoiceConnectorProxy
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxy' {NonEmpty Text
phoneNumberPoolCountries :: NonEmpty Text
$sel:phoneNumberPoolCountries:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> NonEmpty Text
phoneNumberPoolCountries} -> NonEmpty Text
phoneNumberPoolCountries) (\s :: PutVoiceConnectorProxy
s@PutVoiceConnectorProxy' {} NonEmpty Text
a -> PutVoiceConnectorProxy
s {$sel:phoneNumberPoolCountries:PutVoiceConnectorProxy' :: NonEmpty Text
phoneNumberPoolCountries = NonEmpty Text
a} :: PutVoiceConnectorProxy) ((NonEmpty Text -> f (NonEmpty Text))
 -> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> PutVoiceConnectorProxy
-> f PutVoiceConnectorProxy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Chime voice connector ID.
putVoiceConnectorProxy_voiceConnectorId :: Lens.Lens' PutVoiceConnectorProxy Prelude.Text
putVoiceConnectorProxy_voiceConnectorId :: (Text -> f Text)
-> PutVoiceConnectorProxy -> f PutVoiceConnectorProxy
putVoiceConnectorProxy_voiceConnectorId = (PutVoiceConnectorProxy -> Text)
-> (PutVoiceConnectorProxy -> Text -> PutVoiceConnectorProxy)
-> Lens PutVoiceConnectorProxy PutVoiceConnectorProxy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxy' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: PutVoiceConnectorProxy
s@PutVoiceConnectorProxy' {} Text
a -> PutVoiceConnectorProxy
s {$sel:voiceConnectorId:PutVoiceConnectorProxy' :: Text
voiceConnectorId = Text
a} :: PutVoiceConnectorProxy)

instance Core.AWSRequest PutVoiceConnectorProxy where
  type
    AWSResponse PutVoiceConnectorProxy =
      PutVoiceConnectorProxyResponse
  request :: PutVoiceConnectorProxy -> Request PutVoiceConnectorProxy
request = Service -> PutVoiceConnectorProxy -> Request PutVoiceConnectorProxy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutVoiceConnectorProxy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutVoiceConnectorProxy)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutVoiceConnectorProxy))
-> Logger
-> Service
-> Proxy PutVoiceConnectorProxy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutVoiceConnectorProxy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Proxy -> Int -> PutVoiceConnectorProxyResponse
PutVoiceConnectorProxyResponse'
            (Maybe Proxy -> Int -> PutVoiceConnectorProxyResponse)
-> Either String (Maybe Proxy)
-> Either String (Int -> PutVoiceConnectorProxyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Proxy)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Proxy")
            Either String (Int -> PutVoiceConnectorProxyResponse)
-> Either String Int
-> Either String PutVoiceConnectorProxyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutVoiceConnectorProxy

instance Prelude.NFData PutVoiceConnectorProxy

instance Core.ToHeaders PutVoiceConnectorProxy where
  toHeaders :: PutVoiceConnectorProxy -> ResponseHeaders
toHeaders = ResponseHeaders -> PutVoiceConnectorProxy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON PutVoiceConnectorProxy where
  toJSON :: PutVoiceConnectorProxy -> Value
toJSON PutVoiceConnectorProxy' {Int
Maybe Bool
Maybe (Sensitive Text)
NonEmpty Text
Text
voiceConnectorId :: Text
phoneNumberPoolCountries :: NonEmpty Text
defaultSessionExpiryMinutes :: Int
fallBackPhoneNumber :: Maybe (Sensitive Text)
disabled :: Maybe Bool
$sel:voiceConnectorId:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Text
$sel:phoneNumberPoolCountries:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> NonEmpty Text
$sel:defaultSessionExpiryMinutes:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Int
$sel:fallBackPhoneNumber:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Maybe (Sensitive Text)
$sel:disabled:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Disabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disabled,
            (Text
"FallBackPhoneNumber" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
fallBackPhoneNumber,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"DefaultSessionExpiryMinutes"
                  Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
defaultSessionExpiryMinutes
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"PhoneNumberPoolCountries"
                  Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
phoneNumberPoolCountries
              )
          ]
      )

instance Core.ToPath PutVoiceConnectorProxy where
  toPath :: PutVoiceConnectorProxy -> ByteString
toPath PutVoiceConnectorProxy' {Int
Maybe Bool
Maybe (Sensitive Text)
NonEmpty Text
Text
voiceConnectorId :: Text
phoneNumberPoolCountries :: NonEmpty Text
defaultSessionExpiryMinutes :: Int
fallBackPhoneNumber :: Maybe (Sensitive Text)
disabled :: Maybe Bool
$sel:voiceConnectorId:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Text
$sel:phoneNumberPoolCountries:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> NonEmpty Text
$sel:defaultSessionExpiryMinutes:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Int
$sel:fallBackPhoneNumber:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Maybe (Sensitive Text)
$sel:disabled:PutVoiceConnectorProxy' :: PutVoiceConnectorProxy -> Maybe Bool
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/voice-connectors/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
voiceConnectorId,
        ByteString
"/programmable-numbers/proxy"
      ]

instance Core.ToQuery PutVoiceConnectorProxy where
  toQuery :: PutVoiceConnectorProxy -> QueryString
toQuery = QueryString -> PutVoiceConnectorProxy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutVoiceConnectorProxyResponse' smart constructor.
data PutVoiceConnectorProxyResponse = PutVoiceConnectorProxyResponse'
  { -- | The proxy configuration details.
    PutVoiceConnectorProxyResponse -> Maybe Proxy
proxy :: Prelude.Maybe Proxy,
    -- | The response's http status code.
    PutVoiceConnectorProxyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutVoiceConnectorProxyResponse
-> PutVoiceConnectorProxyResponse -> Bool
(PutVoiceConnectorProxyResponse
 -> PutVoiceConnectorProxyResponse -> Bool)
-> (PutVoiceConnectorProxyResponse
    -> PutVoiceConnectorProxyResponse -> Bool)
-> Eq PutVoiceConnectorProxyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutVoiceConnectorProxyResponse
-> PutVoiceConnectorProxyResponse -> Bool
$c/= :: PutVoiceConnectorProxyResponse
-> PutVoiceConnectorProxyResponse -> Bool
== :: PutVoiceConnectorProxyResponse
-> PutVoiceConnectorProxyResponse -> Bool
$c== :: PutVoiceConnectorProxyResponse
-> PutVoiceConnectorProxyResponse -> Bool
Prelude.Eq, Int -> PutVoiceConnectorProxyResponse -> ShowS
[PutVoiceConnectorProxyResponse] -> ShowS
PutVoiceConnectorProxyResponse -> String
(Int -> PutVoiceConnectorProxyResponse -> ShowS)
-> (PutVoiceConnectorProxyResponse -> String)
-> ([PutVoiceConnectorProxyResponse] -> ShowS)
-> Show PutVoiceConnectorProxyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutVoiceConnectorProxyResponse] -> ShowS
$cshowList :: [PutVoiceConnectorProxyResponse] -> ShowS
show :: PutVoiceConnectorProxyResponse -> String
$cshow :: PutVoiceConnectorProxyResponse -> String
showsPrec :: Int -> PutVoiceConnectorProxyResponse -> ShowS
$cshowsPrec :: Int -> PutVoiceConnectorProxyResponse -> ShowS
Prelude.Show, (forall x.
 PutVoiceConnectorProxyResponse
 -> Rep PutVoiceConnectorProxyResponse x)
-> (forall x.
    Rep PutVoiceConnectorProxyResponse x
    -> PutVoiceConnectorProxyResponse)
-> Generic PutVoiceConnectorProxyResponse
forall x.
Rep PutVoiceConnectorProxyResponse x
-> PutVoiceConnectorProxyResponse
forall x.
PutVoiceConnectorProxyResponse
-> Rep PutVoiceConnectorProxyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutVoiceConnectorProxyResponse x
-> PutVoiceConnectorProxyResponse
$cfrom :: forall x.
PutVoiceConnectorProxyResponse
-> Rep PutVoiceConnectorProxyResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutVoiceConnectorProxyResponse' 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:
--
-- 'proxy', 'putVoiceConnectorProxyResponse_proxy' - The proxy configuration details.
--
-- 'httpStatus', 'putVoiceConnectorProxyResponse_httpStatus' - The response's http status code.
newPutVoiceConnectorProxyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutVoiceConnectorProxyResponse
newPutVoiceConnectorProxyResponse :: Int -> PutVoiceConnectorProxyResponse
newPutVoiceConnectorProxyResponse Int
pHttpStatus_ =
  PutVoiceConnectorProxyResponse' :: Maybe Proxy -> Int -> PutVoiceConnectorProxyResponse
PutVoiceConnectorProxyResponse'
    { $sel:proxy:PutVoiceConnectorProxyResponse' :: Maybe Proxy
proxy =
        Maybe Proxy
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutVoiceConnectorProxyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The proxy configuration details.
putVoiceConnectorProxyResponse_proxy :: Lens.Lens' PutVoiceConnectorProxyResponse (Prelude.Maybe Proxy)
putVoiceConnectorProxyResponse_proxy :: (Maybe Proxy -> f (Maybe Proxy))
-> PutVoiceConnectorProxyResponse
-> f PutVoiceConnectorProxyResponse
putVoiceConnectorProxyResponse_proxy = (PutVoiceConnectorProxyResponse -> Maybe Proxy)
-> (PutVoiceConnectorProxyResponse
    -> Maybe Proxy -> PutVoiceConnectorProxyResponse)
-> Lens
     PutVoiceConnectorProxyResponse
     PutVoiceConnectorProxyResponse
     (Maybe Proxy)
     (Maybe Proxy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxyResponse' {Maybe Proxy
proxy :: Maybe Proxy
$sel:proxy:PutVoiceConnectorProxyResponse' :: PutVoiceConnectorProxyResponse -> Maybe Proxy
proxy} -> Maybe Proxy
proxy) (\s :: PutVoiceConnectorProxyResponse
s@PutVoiceConnectorProxyResponse' {} Maybe Proxy
a -> PutVoiceConnectorProxyResponse
s {$sel:proxy:PutVoiceConnectorProxyResponse' :: Maybe Proxy
proxy = Maybe Proxy
a} :: PutVoiceConnectorProxyResponse)

-- | The response's http status code.
putVoiceConnectorProxyResponse_httpStatus :: Lens.Lens' PutVoiceConnectorProxyResponse Prelude.Int
putVoiceConnectorProxyResponse_httpStatus :: (Int -> f Int)
-> PutVoiceConnectorProxyResponse
-> f PutVoiceConnectorProxyResponse
putVoiceConnectorProxyResponse_httpStatus = (PutVoiceConnectorProxyResponse -> Int)
-> (PutVoiceConnectorProxyResponse
    -> Int -> PutVoiceConnectorProxyResponse)
-> Lens
     PutVoiceConnectorProxyResponse
     PutVoiceConnectorProxyResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutVoiceConnectorProxyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutVoiceConnectorProxyResponse' :: PutVoiceConnectorProxyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutVoiceConnectorProxyResponse
s@PutVoiceConnectorProxyResponse' {} Int
a -> PutVoiceConnectorProxyResponse
s {$sel:httpStatus:PutVoiceConnectorProxyResponse' :: Int
httpStatus = Int
a} :: PutVoiceConnectorProxyResponse)

instance
  Prelude.NFData
    PutVoiceConnectorProxyResponse