{-# 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.AssociatePhoneNumbersWithVoiceConnector
-- 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)
--
-- Associates phone numbers with the specified Amazon Chime Voice
-- Connector.
module Amazonka.Chime.AssociatePhoneNumbersWithVoiceConnector
  ( -- * Creating a Request
    AssociatePhoneNumbersWithVoiceConnector (..),
    newAssociatePhoneNumbersWithVoiceConnector,

    -- * Request Lenses
    associatePhoneNumbersWithVoiceConnector_forceAssociate,
    associatePhoneNumbersWithVoiceConnector_voiceConnectorId,
    associatePhoneNumbersWithVoiceConnector_e164PhoneNumbers,

    -- * Destructuring the Response
    AssociatePhoneNumbersWithVoiceConnectorResponse (..),
    newAssociatePhoneNumbersWithVoiceConnectorResponse,

    -- * Response Lenses
    associatePhoneNumbersWithVoiceConnectorResponse_phoneNumberErrors,
    associatePhoneNumbersWithVoiceConnectorResponse_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:/ 'newAssociatePhoneNumbersWithVoiceConnector' smart constructor.
data AssociatePhoneNumbersWithVoiceConnector = AssociatePhoneNumbersWithVoiceConnector'
  { -- | If true, associates the provided phone numbers with the provided Amazon
    -- Chime Voice Connector and removes any previously existing associations.
    -- If false, does not associate any phone numbers that have previously
    -- existing associations.
    AssociatePhoneNumbersWithVoiceConnector -> Maybe Bool
forceAssociate :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Chime Voice Connector ID.
    AssociatePhoneNumbersWithVoiceConnector -> Text
voiceConnectorId :: Prelude.Text,
    -- | List of phone numbers, in E.164 format.
    AssociatePhoneNumbersWithVoiceConnector -> [Sensitive Text]
e164PhoneNumbers :: [Core.Sensitive Prelude.Text]
  }
  deriving (AssociatePhoneNumbersWithVoiceConnector
-> AssociatePhoneNumbersWithVoiceConnector -> Bool
(AssociatePhoneNumbersWithVoiceConnector
 -> AssociatePhoneNumbersWithVoiceConnector -> Bool)
-> (AssociatePhoneNumbersWithVoiceConnector
    -> AssociatePhoneNumbersWithVoiceConnector -> Bool)
-> Eq AssociatePhoneNumbersWithVoiceConnector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatePhoneNumbersWithVoiceConnector
-> AssociatePhoneNumbersWithVoiceConnector -> Bool
$c/= :: AssociatePhoneNumbersWithVoiceConnector
-> AssociatePhoneNumbersWithVoiceConnector -> Bool
== :: AssociatePhoneNumbersWithVoiceConnector
-> AssociatePhoneNumbersWithVoiceConnector -> Bool
$c== :: AssociatePhoneNumbersWithVoiceConnector
-> AssociatePhoneNumbersWithVoiceConnector -> Bool
Prelude.Eq, Int -> AssociatePhoneNumbersWithVoiceConnector -> ShowS
[AssociatePhoneNumbersWithVoiceConnector] -> ShowS
AssociatePhoneNumbersWithVoiceConnector -> String
(Int -> AssociatePhoneNumbersWithVoiceConnector -> ShowS)
-> (AssociatePhoneNumbersWithVoiceConnector -> String)
-> ([AssociatePhoneNumbersWithVoiceConnector] -> ShowS)
-> Show AssociatePhoneNumbersWithVoiceConnector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatePhoneNumbersWithVoiceConnector] -> ShowS
$cshowList :: [AssociatePhoneNumbersWithVoiceConnector] -> ShowS
show :: AssociatePhoneNumbersWithVoiceConnector -> String
$cshow :: AssociatePhoneNumbersWithVoiceConnector -> String
showsPrec :: Int -> AssociatePhoneNumbersWithVoiceConnector -> ShowS
$cshowsPrec :: Int -> AssociatePhoneNumbersWithVoiceConnector -> ShowS
Prelude.Show, (forall x.
 AssociatePhoneNumbersWithVoiceConnector
 -> Rep AssociatePhoneNumbersWithVoiceConnector x)
-> (forall x.
    Rep AssociatePhoneNumbersWithVoiceConnector x
    -> AssociatePhoneNumbersWithVoiceConnector)
-> Generic AssociatePhoneNumbersWithVoiceConnector
forall x.
Rep AssociatePhoneNumbersWithVoiceConnector x
-> AssociatePhoneNumbersWithVoiceConnector
forall x.
AssociatePhoneNumbersWithVoiceConnector
-> Rep AssociatePhoneNumbersWithVoiceConnector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociatePhoneNumbersWithVoiceConnector x
-> AssociatePhoneNumbersWithVoiceConnector
$cfrom :: forall x.
AssociatePhoneNumbersWithVoiceConnector
-> Rep AssociatePhoneNumbersWithVoiceConnector x
Prelude.Generic)

-- |
-- Create a value of 'AssociatePhoneNumbersWithVoiceConnector' 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:
--
-- 'forceAssociate', 'associatePhoneNumbersWithVoiceConnector_forceAssociate' - If true, associates the provided phone numbers with the provided Amazon
-- Chime Voice Connector and removes any previously existing associations.
-- If false, does not associate any phone numbers that have previously
-- existing associations.
--
-- 'voiceConnectorId', 'associatePhoneNumbersWithVoiceConnector_voiceConnectorId' - The Amazon Chime Voice Connector ID.
--
-- 'e164PhoneNumbers', 'associatePhoneNumbersWithVoiceConnector_e164PhoneNumbers' - List of phone numbers, in E.164 format.
newAssociatePhoneNumbersWithVoiceConnector ::
  -- | 'voiceConnectorId'
  Prelude.Text ->
  AssociatePhoneNumbersWithVoiceConnector
newAssociatePhoneNumbersWithVoiceConnector :: Text -> AssociatePhoneNumbersWithVoiceConnector
newAssociatePhoneNumbersWithVoiceConnector
  Text
pVoiceConnectorId_ =
    AssociatePhoneNumbersWithVoiceConnector' :: Maybe Bool
-> Text
-> [Sensitive Text]
-> AssociatePhoneNumbersWithVoiceConnector
AssociatePhoneNumbersWithVoiceConnector'
      { $sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnector' :: Maybe Bool
forceAssociate =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:voiceConnectorId:AssociatePhoneNumbersWithVoiceConnector' :: Text
voiceConnectorId =
          Text
pVoiceConnectorId_,
        $sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnector' :: [Sensitive Text]
e164PhoneNumbers = [Sensitive Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | If true, associates the provided phone numbers with the provided Amazon
-- Chime Voice Connector and removes any previously existing associations.
-- If false, does not associate any phone numbers that have previously
-- existing associations.
associatePhoneNumbersWithVoiceConnector_forceAssociate :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnector (Prelude.Maybe Prelude.Bool)
associatePhoneNumbersWithVoiceConnector_forceAssociate :: (Maybe Bool -> f (Maybe Bool))
-> AssociatePhoneNumbersWithVoiceConnector
-> f AssociatePhoneNumbersWithVoiceConnector
associatePhoneNumbersWithVoiceConnector_forceAssociate = (AssociatePhoneNumbersWithVoiceConnector -> Maybe Bool)
-> (AssociatePhoneNumbersWithVoiceConnector
    -> Maybe Bool -> AssociatePhoneNumbersWithVoiceConnector)
-> Lens
     AssociatePhoneNumbersWithVoiceConnector
     AssociatePhoneNumbersWithVoiceConnector
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnector' {Maybe Bool
forceAssociate :: Maybe Bool
$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> Maybe Bool
forceAssociate} -> Maybe Bool
forceAssociate) (\s :: AssociatePhoneNumbersWithVoiceConnector
s@AssociatePhoneNumbersWithVoiceConnector' {} Maybe Bool
a -> AssociatePhoneNumbersWithVoiceConnector
s {$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnector' :: Maybe Bool
forceAssociate = Maybe Bool
a} :: AssociatePhoneNumbersWithVoiceConnector)

-- | The Amazon Chime Voice Connector ID.
associatePhoneNumbersWithVoiceConnector_voiceConnectorId :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnector Prelude.Text
associatePhoneNumbersWithVoiceConnector_voiceConnectorId :: (Text -> f Text)
-> AssociatePhoneNumbersWithVoiceConnector
-> f AssociatePhoneNumbersWithVoiceConnector
associatePhoneNumbersWithVoiceConnector_voiceConnectorId = (AssociatePhoneNumbersWithVoiceConnector -> Text)
-> (AssociatePhoneNumbersWithVoiceConnector
    -> Text -> AssociatePhoneNumbersWithVoiceConnector)
-> Lens
     AssociatePhoneNumbersWithVoiceConnector
     AssociatePhoneNumbersWithVoiceConnector
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnector' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: AssociatePhoneNumbersWithVoiceConnector
s@AssociatePhoneNumbersWithVoiceConnector' {} Text
a -> AssociatePhoneNumbersWithVoiceConnector
s {$sel:voiceConnectorId:AssociatePhoneNumbersWithVoiceConnector' :: Text
voiceConnectorId = Text
a} :: AssociatePhoneNumbersWithVoiceConnector)

-- | List of phone numbers, in E.164 format.
associatePhoneNumbersWithVoiceConnector_e164PhoneNumbers :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnector [Prelude.Text]
associatePhoneNumbersWithVoiceConnector_e164PhoneNumbers :: ([Text] -> f [Text])
-> AssociatePhoneNumbersWithVoiceConnector
-> f AssociatePhoneNumbersWithVoiceConnector
associatePhoneNumbersWithVoiceConnector_e164PhoneNumbers = (AssociatePhoneNumbersWithVoiceConnector -> [Sensitive Text])
-> (AssociatePhoneNumbersWithVoiceConnector
    -> [Sensitive Text] -> AssociatePhoneNumbersWithVoiceConnector)
-> Lens
     AssociatePhoneNumbersWithVoiceConnector
     AssociatePhoneNumbersWithVoiceConnector
     [Sensitive Text]
     [Sensitive Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnector' {[Sensitive Text]
e164PhoneNumbers :: [Sensitive Text]
$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> [Sensitive Text]
e164PhoneNumbers} -> [Sensitive Text]
e164PhoneNumbers) (\s :: AssociatePhoneNumbersWithVoiceConnector
s@AssociatePhoneNumbersWithVoiceConnector' {} [Sensitive Text]
a -> AssociatePhoneNumbersWithVoiceConnector
s {$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnector' :: [Sensitive Text]
e164PhoneNumbers = [Sensitive Text]
a} :: AssociatePhoneNumbersWithVoiceConnector) (([Sensitive Text] -> f [Sensitive Text])
 -> AssociatePhoneNumbersWithVoiceConnector
 -> f AssociatePhoneNumbersWithVoiceConnector)
-> (([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text])
-> ([Text] -> f [Text])
-> AssociatePhoneNumbersWithVoiceConnector
-> f AssociatePhoneNumbersWithVoiceConnector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    AssociatePhoneNumbersWithVoiceConnector
  where
  type
    AWSResponse
      AssociatePhoneNumbersWithVoiceConnector =
      AssociatePhoneNumbersWithVoiceConnectorResponse
  request :: AssociatePhoneNumbersWithVoiceConnector
-> Request AssociatePhoneNumbersWithVoiceConnector
request = Service
-> AssociatePhoneNumbersWithVoiceConnector
-> Request AssociatePhoneNumbersWithVoiceConnector
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociatePhoneNumbersWithVoiceConnector
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse AssociatePhoneNumbersWithVoiceConnector)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse AssociatePhoneNumbersWithVoiceConnector))
-> Logger
-> Service
-> Proxy AssociatePhoneNumbersWithVoiceConnector
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse AssociatePhoneNumbersWithVoiceConnector)))
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 [PhoneNumberError]
-> Int -> AssociatePhoneNumbersWithVoiceConnectorResponse
AssociatePhoneNumbersWithVoiceConnectorResponse'
            (Maybe [PhoneNumberError]
 -> Int -> AssociatePhoneNumbersWithVoiceConnectorResponse)
-> Either String (Maybe [PhoneNumberError])
-> Either
     String (Int -> AssociatePhoneNumbersWithVoiceConnectorResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [PhoneNumberError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PhoneNumberErrors"
                            Either String (Maybe (Maybe [PhoneNumberError]))
-> Maybe [PhoneNumberError]
-> Either String (Maybe [PhoneNumberError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PhoneNumberError]
forall a. Monoid a => a
Prelude.mempty
                        )
              Either
  String (Int -> AssociatePhoneNumbersWithVoiceConnectorResponse)
-> Either String Int
-> Either String AssociatePhoneNumbersWithVoiceConnectorResponse
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
    AssociatePhoneNumbersWithVoiceConnector

instance
  Prelude.NFData
    AssociatePhoneNumbersWithVoiceConnector

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

instance
  Core.ToJSON
    AssociatePhoneNumbersWithVoiceConnector
  where
  toJSON :: AssociatePhoneNumbersWithVoiceConnector -> Value
toJSON AssociatePhoneNumbersWithVoiceConnector' {[Sensitive Text]
Maybe Bool
Text
e164PhoneNumbers :: [Sensitive Text]
voiceConnectorId :: Text
forceAssociate :: Maybe Bool
$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> [Sensitive Text]
$sel:voiceConnectorId:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> Text
$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ForceAssociate" 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
forceAssociate,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"E164PhoneNumbers" Text -> [Sensitive Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Sensitive Text]
e164PhoneNumbers)
          ]
      )

instance
  Core.ToPath
    AssociatePhoneNumbersWithVoiceConnector
  where
  toPath :: AssociatePhoneNumbersWithVoiceConnector -> ByteString
toPath AssociatePhoneNumbersWithVoiceConnector' {[Sensitive Text]
Maybe Bool
Text
e164PhoneNumbers :: [Sensitive Text]
voiceConnectorId :: Text
forceAssociate :: Maybe Bool
$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> [Sensitive Text]
$sel:voiceConnectorId:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> Text
$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnector' :: AssociatePhoneNumbersWithVoiceConnector -> 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]

instance
  Core.ToQuery
    AssociatePhoneNumbersWithVoiceConnector
  where
  toQuery :: AssociatePhoneNumbersWithVoiceConnector -> QueryString
toQuery =
    QueryString
-> AssociatePhoneNumbersWithVoiceConnector -> QueryString
forall a b. a -> b -> a
Prelude.const
      ( [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [QueryString
"operation=associate-phone-numbers"]
      )

-- | /See:/ 'newAssociatePhoneNumbersWithVoiceConnectorResponse' smart constructor.
data AssociatePhoneNumbersWithVoiceConnectorResponse = AssociatePhoneNumbersWithVoiceConnectorResponse'
  { -- | If the action fails for one or more of the phone numbers in the request,
    -- a list of the phone numbers is returned, along with error codes and
    -- error messages.
    AssociatePhoneNumbersWithVoiceConnectorResponse
-> Maybe [PhoneNumberError]
phoneNumberErrors :: Prelude.Maybe [PhoneNumberError],
    -- | The response's http status code.
    AssociatePhoneNumbersWithVoiceConnectorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociatePhoneNumbersWithVoiceConnectorResponse
-> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool
(AssociatePhoneNumbersWithVoiceConnectorResponse
 -> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool)
-> (AssociatePhoneNumbersWithVoiceConnectorResponse
    -> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool)
-> Eq AssociatePhoneNumbersWithVoiceConnectorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatePhoneNumbersWithVoiceConnectorResponse
-> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool
$c/= :: AssociatePhoneNumbersWithVoiceConnectorResponse
-> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool
== :: AssociatePhoneNumbersWithVoiceConnectorResponse
-> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool
$c== :: AssociatePhoneNumbersWithVoiceConnectorResponse
-> AssociatePhoneNumbersWithVoiceConnectorResponse -> Bool
Prelude.Eq, ReadPrec [AssociatePhoneNumbersWithVoiceConnectorResponse]
ReadPrec AssociatePhoneNumbersWithVoiceConnectorResponse
Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorResponse
ReadS [AssociatePhoneNumbersWithVoiceConnectorResponse]
(Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorResponse)
-> ReadS [AssociatePhoneNumbersWithVoiceConnectorResponse]
-> ReadPrec AssociatePhoneNumbersWithVoiceConnectorResponse
-> ReadPrec [AssociatePhoneNumbersWithVoiceConnectorResponse]
-> Read AssociatePhoneNumbersWithVoiceConnectorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatePhoneNumbersWithVoiceConnectorResponse]
$creadListPrec :: ReadPrec [AssociatePhoneNumbersWithVoiceConnectorResponse]
readPrec :: ReadPrec AssociatePhoneNumbersWithVoiceConnectorResponse
$creadPrec :: ReadPrec AssociatePhoneNumbersWithVoiceConnectorResponse
readList :: ReadS [AssociatePhoneNumbersWithVoiceConnectorResponse]
$creadList :: ReadS [AssociatePhoneNumbersWithVoiceConnectorResponse]
readsPrec :: Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorResponse
$creadsPrec :: Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorResponse
Prelude.Read, Int -> AssociatePhoneNumbersWithVoiceConnectorResponse -> ShowS
[AssociatePhoneNumbersWithVoiceConnectorResponse] -> ShowS
AssociatePhoneNumbersWithVoiceConnectorResponse -> String
(Int -> AssociatePhoneNumbersWithVoiceConnectorResponse -> ShowS)
-> (AssociatePhoneNumbersWithVoiceConnectorResponse -> String)
-> ([AssociatePhoneNumbersWithVoiceConnectorResponse] -> ShowS)
-> Show AssociatePhoneNumbersWithVoiceConnectorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatePhoneNumbersWithVoiceConnectorResponse] -> ShowS
$cshowList :: [AssociatePhoneNumbersWithVoiceConnectorResponse] -> ShowS
show :: AssociatePhoneNumbersWithVoiceConnectorResponse -> String
$cshow :: AssociatePhoneNumbersWithVoiceConnectorResponse -> String
showsPrec :: Int -> AssociatePhoneNumbersWithVoiceConnectorResponse -> ShowS
$cshowsPrec :: Int -> AssociatePhoneNumbersWithVoiceConnectorResponse -> ShowS
Prelude.Show, (forall x.
 AssociatePhoneNumbersWithVoiceConnectorResponse
 -> Rep AssociatePhoneNumbersWithVoiceConnectorResponse x)
-> (forall x.
    Rep AssociatePhoneNumbersWithVoiceConnectorResponse x
    -> AssociatePhoneNumbersWithVoiceConnectorResponse)
-> Generic AssociatePhoneNumbersWithVoiceConnectorResponse
forall x.
Rep AssociatePhoneNumbersWithVoiceConnectorResponse x
-> AssociatePhoneNumbersWithVoiceConnectorResponse
forall x.
AssociatePhoneNumbersWithVoiceConnectorResponse
-> Rep AssociatePhoneNumbersWithVoiceConnectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociatePhoneNumbersWithVoiceConnectorResponse x
-> AssociatePhoneNumbersWithVoiceConnectorResponse
$cfrom :: forall x.
AssociatePhoneNumbersWithVoiceConnectorResponse
-> Rep AssociatePhoneNumbersWithVoiceConnectorResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociatePhoneNumbersWithVoiceConnectorResponse' 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:
--
-- 'phoneNumberErrors', 'associatePhoneNumbersWithVoiceConnectorResponse_phoneNumberErrors' - If the action fails for one or more of the phone numbers in the request,
-- a list of the phone numbers is returned, along with error codes and
-- error messages.
--
-- 'httpStatus', 'associatePhoneNumbersWithVoiceConnectorResponse_httpStatus' - The response's http status code.
newAssociatePhoneNumbersWithVoiceConnectorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociatePhoneNumbersWithVoiceConnectorResponse
newAssociatePhoneNumbersWithVoiceConnectorResponse :: Int -> AssociatePhoneNumbersWithVoiceConnectorResponse
newAssociatePhoneNumbersWithVoiceConnectorResponse
  Int
pHttpStatus_ =
    AssociatePhoneNumbersWithVoiceConnectorResponse' :: Maybe [PhoneNumberError]
-> Int -> AssociatePhoneNumbersWithVoiceConnectorResponse
AssociatePhoneNumbersWithVoiceConnectorResponse'
      { $sel:phoneNumberErrors:AssociatePhoneNumbersWithVoiceConnectorResponse' :: Maybe [PhoneNumberError]
phoneNumberErrors =
          Maybe [PhoneNumberError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AssociatePhoneNumbersWithVoiceConnectorResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | If the action fails for one or more of the phone numbers in the request,
-- a list of the phone numbers is returned, along with error codes and
-- error messages.
associatePhoneNumbersWithVoiceConnectorResponse_phoneNumberErrors :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnectorResponse (Prelude.Maybe [PhoneNumberError])
associatePhoneNumbersWithVoiceConnectorResponse_phoneNumberErrors :: (Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
-> AssociatePhoneNumbersWithVoiceConnectorResponse
-> f AssociatePhoneNumbersWithVoiceConnectorResponse
associatePhoneNumbersWithVoiceConnectorResponse_phoneNumberErrors = (AssociatePhoneNumbersWithVoiceConnectorResponse
 -> Maybe [PhoneNumberError])
-> (AssociatePhoneNumbersWithVoiceConnectorResponse
    -> Maybe [PhoneNumberError]
    -> AssociatePhoneNumbersWithVoiceConnectorResponse)
-> Lens
     AssociatePhoneNumbersWithVoiceConnectorResponse
     AssociatePhoneNumbersWithVoiceConnectorResponse
     (Maybe [PhoneNumberError])
     (Maybe [PhoneNumberError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnectorResponse' {Maybe [PhoneNumberError]
phoneNumberErrors :: Maybe [PhoneNumberError]
$sel:phoneNumberErrors:AssociatePhoneNumbersWithVoiceConnectorResponse' :: AssociatePhoneNumbersWithVoiceConnectorResponse
-> Maybe [PhoneNumberError]
phoneNumberErrors} -> Maybe [PhoneNumberError]
phoneNumberErrors) (\s :: AssociatePhoneNumbersWithVoiceConnectorResponse
s@AssociatePhoneNumbersWithVoiceConnectorResponse' {} Maybe [PhoneNumberError]
a -> AssociatePhoneNumbersWithVoiceConnectorResponse
s {$sel:phoneNumberErrors:AssociatePhoneNumbersWithVoiceConnectorResponse' :: Maybe [PhoneNumberError]
phoneNumberErrors = Maybe [PhoneNumberError]
a} :: AssociatePhoneNumbersWithVoiceConnectorResponse) ((Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
 -> AssociatePhoneNumbersWithVoiceConnectorResponse
 -> f AssociatePhoneNumbersWithVoiceConnectorResponse)
-> ((Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
    -> Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
-> (Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
-> AssociatePhoneNumbersWithVoiceConnectorResponse
-> f AssociatePhoneNumbersWithVoiceConnectorResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PhoneNumberError]
  [PhoneNumberError]
  [PhoneNumberError]
  [PhoneNumberError]
-> Iso
     (Maybe [PhoneNumberError])
     (Maybe [PhoneNumberError])
     (Maybe [PhoneNumberError])
     (Maybe [PhoneNumberError])
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
  [PhoneNumberError]
  [PhoneNumberError]
  [PhoneNumberError]
  [PhoneNumberError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    AssociatePhoneNumbersWithVoiceConnectorResponse