{-# 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.AssociatePhoneNumbersWithVoiceConnectorGroup
-- 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
-- group.
module Amazonka.Chime.AssociatePhoneNumbersWithVoiceConnectorGroup
  ( -- * Creating a Request
    AssociatePhoneNumbersWithVoiceConnectorGroup (..),
    newAssociatePhoneNumbersWithVoiceConnectorGroup,

    -- * Request Lenses
    associatePhoneNumbersWithVoiceConnectorGroup_forceAssociate,
    associatePhoneNumbersWithVoiceConnectorGroup_voiceConnectorGroupId,
    associatePhoneNumbersWithVoiceConnectorGroup_e164PhoneNumbers,

    -- * Destructuring the Response
    AssociatePhoneNumbersWithVoiceConnectorGroupResponse (..),
    newAssociatePhoneNumbersWithVoiceConnectorGroupResponse,

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

-- |
-- Create a value of 'AssociatePhoneNumbersWithVoiceConnectorGroup' 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', 'associatePhoneNumbersWithVoiceConnectorGroup_forceAssociate' - If true, associates the provided phone numbers with the provided Amazon
-- Chime Voice Connector Group and removes any previously existing
-- associations. If false, does not associate any phone numbers that have
-- previously existing associations.
--
-- 'voiceConnectorGroupId', 'associatePhoneNumbersWithVoiceConnectorGroup_voiceConnectorGroupId' - The Amazon Chime Voice Connector group ID.
--
-- 'e164PhoneNumbers', 'associatePhoneNumbersWithVoiceConnectorGroup_e164PhoneNumbers' - List of phone numbers, in E.164 format.
newAssociatePhoneNumbersWithVoiceConnectorGroup ::
  -- | 'voiceConnectorGroupId'
  Prelude.Text ->
  AssociatePhoneNumbersWithVoiceConnectorGroup
newAssociatePhoneNumbersWithVoiceConnectorGroup :: Text -> AssociatePhoneNumbersWithVoiceConnectorGroup
newAssociatePhoneNumbersWithVoiceConnectorGroup
  Text
pVoiceConnectorGroupId_ =
    AssociatePhoneNumbersWithVoiceConnectorGroup' :: Maybe Bool
-> Text
-> [Sensitive Text]
-> AssociatePhoneNumbersWithVoiceConnectorGroup
AssociatePhoneNumbersWithVoiceConnectorGroup'
      { $sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnectorGroup' :: Maybe Bool
forceAssociate =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:voiceConnectorGroupId:AssociatePhoneNumbersWithVoiceConnectorGroup' :: Text
voiceConnectorGroupId =
          Text
pVoiceConnectorGroupId_,
        $sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnectorGroup' :: [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 Group and removes any previously existing
-- associations. If false, does not associate any phone numbers that have
-- previously existing associations.
associatePhoneNumbersWithVoiceConnectorGroup_forceAssociate :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnectorGroup (Prelude.Maybe Prelude.Bool)
associatePhoneNumbersWithVoiceConnectorGroup_forceAssociate :: (Maybe Bool -> f (Maybe Bool))
-> AssociatePhoneNumbersWithVoiceConnectorGroup
-> f AssociatePhoneNumbersWithVoiceConnectorGroup
associatePhoneNumbersWithVoiceConnectorGroup_forceAssociate = (AssociatePhoneNumbersWithVoiceConnectorGroup -> Maybe Bool)
-> (AssociatePhoneNumbersWithVoiceConnectorGroup
    -> Maybe Bool -> AssociatePhoneNumbersWithVoiceConnectorGroup)
-> Lens
     AssociatePhoneNumbersWithVoiceConnectorGroup
     AssociatePhoneNumbersWithVoiceConnectorGroup
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnectorGroup' {Maybe Bool
forceAssociate :: Maybe Bool
$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> Maybe Bool
forceAssociate} -> Maybe Bool
forceAssociate) (\s :: AssociatePhoneNumbersWithVoiceConnectorGroup
s@AssociatePhoneNumbersWithVoiceConnectorGroup' {} Maybe Bool
a -> AssociatePhoneNumbersWithVoiceConnectorGroup
s {$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnectorGroup' :: Maybe Bool
forceAssociate = Maybe Bool
a} :: AssociatePhoneNumbersWithVoiceConnectorGroup)

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

-- | List of phone numbers, in E.164 format.
associatePhoneNumbersWithVoiceConnectorGroup_e164PhoneNumbers :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnectorGroup [Prelude.Text]
associatePhoneNumbersWithVoiceConnectorGroup_e164PhoneNumbers :: ([Text] -> f [Text])
-> AssociatePhoneNumbersWithVoiceConnectorGroup
-> f AssociatePhoneNumbersWithVoiceConnectorGroup
associatePhoneNumbersWithVoiceConnectorGroup_e164PhoneNumbers = (AssociatePhoneNumbersWithVoiceConnectorGroup -> [Sensitive Text])
-> (AssociatePhoneNumbersWithVoiceConnectorGroup
    -> [Sensitive Text]
    -> AssociatePhoneNumbersWithVoiceConnectorGroup)
-> Lens
     AssociatePhoneNumbersWithVoiceConnectorGroup
     AssociatePhoneNumbersWithVoiceConnectorGroup
     [Sensitive Text]
     [Sensitive Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnectorGroup' {[Sensitive Text]
e164PhoneNumbers :: [Sensitive Text]
$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> [Sensitive Text]
e164PhoneNumbers} -> [Sensitive Text]
e164PhoneNumbers) (\s :: AssociatePhoneNumbersWithVoiceConnectorGroup
s@AssociatePhoneNumbersWithVoiceConnectorGroup' {} [Sensitive Text]
a -> AssociatePhoneNumbersWithVoiceConnectorGroup
s {$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnectorGroup' :: [Sensitive Text]
e164PhoneNumbers = [Sensitive Text]
a} :: AssociatePhoneNumbersWithVoiceConnectorGroup) (([Sensitive Text] -> f [Sensitive Text])
 -> AssociatePhoneNumbersWithVoiceConnectorGroup
 -> f AssociatePhoneNumbersWithVoiceConnectorGroup)
-> (([Text] -> f [Text]) -> [Sensitive Text] -> f [Sensitive Text])
-> ([Text] -> f [Text])
-> AssociatePhoneNumbersWithVoiceConnectorGroup
-> f AssociatePhoneNumbersWithVoiceConnectorGroup
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
    AssociatePhoneNumbersWithVoiceConnectorGroup
  where
  type
    AWSResponse
      AssociatePhoneNumbersWithVoiceConnectorGroup =
      AssociatePhoneNumbersWithVoiceConnectorGroupResponse
  request :: AssociatePhoneNumbersWithVoiceConnectorGroup
-> Request AssociatePhoneNumbersWithVoiceConnectorGroup
request = Service
-> AssociatePhoneNumbersWithVoiceConnectorGroup
-> Request AssociatePhoneNumbersWithVoiceConnectorGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociatePhoneNumbersWithVoiceConnectorGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse AssociatePhoneNumbersWithVoiceConnectorGroup)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse AssociatePhoneNumbersWithVoiceConnectorGroup))
-> Logger
-> Service
-> Proxy AssociatePhoneNumbersWithVoiceConnectorGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse AssociatePhoneNumbersWithVoiceConnectorGroup)))
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 -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
AssociatePhoneNumbersWithVoiceConnectorGroupResponse'
            (Maybe [PhoneNumberError]
 -> Int -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> Either String (Maybe [PhoneNumberError])
-> Either
     String
     (Int -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
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 -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> Either String Int
-> Either
     String AssociatePhoneNumbersWithVoiceConnectorGroupResponse
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
    AssociatePhoneNumbersWithVoiceConnectorGroup

instance
  Prelude.NFData
    AssociatePhoneNumbersWithVoiceConnectorGroup

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

instance
  Core.ToJSON
    AssociatePhoneNumbersWithVoiceConnectorGroup
  where
  toJSON :: AssociatePhoneNumbersWithVoiceConnectorGroup -> Value
toJSON
    AssociatePhoneNumbersWithVoiceConnectorGroup' {[Sensitive Text]
Maybe Bool
Text
e164PhoneNumbers :: [Sensitive Text]
voiceConnectorGroupId :: Text
forceAssociate :: Maybe Bool
$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> [Sensitive Text]
$sel:voiceConnectorGroupId:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> Text
$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> 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
    AssociatePhoneNumbersWithVoiceConnectorGroup
  where
  toPath :: AssociatePhoneNumbersWithVoiceConnectorGroup -> ByteString
toPath
    AssociatePhoneNumbersWithVoiceConnectorGroup' {[Sensitive Text]
Maybe Bool
Text
e164PhoneNumbers :: [Sensitive Text]
voiceConnectorGroupId :: Text
forceAssociate :: Maybe Bool
$sel:e164PhoneNumbers:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> [Sensitive Text]
$sel:voiceConnectorGroupId:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> Text
$sel:forceAssociate:AssociatePhoneNumbersWithVoiceConnectorGroup' :: AssociatePhoneNumbersWithVoiceConnectorGroup -> Maybe Bool
..} =
      [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"/voice-connector-groups/",
          Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
voiceConnectorGroupId
        ]

instance
  Core.ToQuery
    AssociatePhoneNumbersWithVoiceConnectorGroup
  where
  toQuery :: AssociatePhoneNumbersWithVoiceConnectorGroup -> QueryString
toQuery =
    QueryString
-> AssociatePhoneNumbersWithVoiceConnectorGroup -> 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:/ 'newAssociatePhoneNumbersWithVoiceConnectorGroupResponse' smart constructor.
data AssociatePhoneNumbersWithVoiceConnectorGroupResponse = AssociatePhoneNumbersWithVoiceConnectorGroupResponse'
  { -- | 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.
    AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> Maybe [PhoneNumberError]
phoneNumberErrors :: Prelude.Maybe [PhoneNumberError],
    -- | The response's http status code.
    AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool
(AssociatePhoneNumbersWithVoiceConnectorGroupResponse
 -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool)
-> (AssociatePhoneNumbersWithVoiceConnectorGroupResponse
    -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool)
-> Eq AssociatePhoneNumbersWithVoiceConnectorGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool
$c/= :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool
== :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool
$c== :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Bool
Prelude.Eq, ReadPrec [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
ReadPrec AssociatePhoneNumbersWithVoiceConnectorGroupResponse
Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorGroupResponse
ReadS [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
(Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> ReadS [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
-> ReadPrec AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> ReadPrec [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
-> Read AssociatePhoneNumbersWithVoiceConnectorGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
$creadListPrec :: ReadPrec [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
readPrec :: ReadPrec AssociatePhoneNumbersWithVoiceConnectorGroupResponse
$creadPrec :: ReadPrec AssociatePhoneNumbersWithVoiceConnectorGroupResponse
readList :: ReadS [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
$creadList :: ReadS [AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
readsPrec :: Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorGroupResponse
$creadsPrec :: Int -> ReadS AssociatePhoneNumbersWithVoiceConnectorGroupResponse
Prelude.Read, Int
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> ShowS
[AssociatePhoneNumbersWithVoiceConnectorGroupResponse] -> ShowS
AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> String
(Int
 -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> ShowS)
-> (AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> String)
-> ([AssociatePhoneNumbersWithVoiceConnectorGroupResponse]
    -> ShowS)
-> Show AssociatePhoneNumbersWithVoiceConnectorGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatePhoneNumbersWithVoiceConnectorGroupResponse] -> ShowS
$cshowList :: [AssociatePhoneNumbersWithVoiceConnectorGroupResponse] -> ShowS
show :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> String
$cshow :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> String
showsPrec :: Int
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> ShowS
$cshowsPrec :: Int
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> ShowS
Prelude.Show, (forall x.
 AssociatePhoneNumbersWithVoiceConnectorGroupResponse
 -> Rep AssociatePhoneNumbersWithVoiceConnectorGroupResponse x)
-> (forall x.
    Rep AssociatePhoneNumbersWithVoiceConnectorGroupResponse x
    -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> Generic AssociatePhoneNumbersWithVoiceConnectorGroupResponse
forall x.
Rep AssociatePhoneNumbersWithVoiceConnectorGroupResponse x
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
forall x.
AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> Rep AssociatePhoneNumbersWithVoiceConnectorGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociatePhoneNumbersWithVoiceConnectorGroupResponse x
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
$cfrom :: forall x.
AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> Rep AssociatePhoneNumbersWithVoiceConnectorGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociatePhoneNumbersWithVoiceConnectorGroupResponse' 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', 'associatePhoneNumbersWithVoiceConnectorGroupResponse_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', 'associatePhoneNumbersWithVoiceConnectorGroupResponse_httpStatus' - The response's http status code.
newAssociatePhoneNumbersWithVoiceConnectorGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociatePhoneNumbersWithVoiceConnectorGroupResponse
newAssociatePhoneNumbersWithVoiceConnectorGroupResponse :: Int -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
newAssociatePhoneNumbersWithVoiceConnectorGroupResponse
  Int
pHttpStatus_ =
    AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: Maybe [PhoneNumberError]
-> Int -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
AssociatePhoneNumbersWithVoiceConnectorGroupResponse'
      { $sel:phoneNumberErrors:AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: Maybe [PhoneNumberError]
phoneNumberErrors =
          Maybe [PhoneNumberError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: 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.
associatePhoneNumbersWithVoiceConnectorGroupResponse_phoneNumberErrors :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnectorGroupResponse (Prelude.Maybe [PhoneNumberError])
associatePhoneNumbersWithVoiceConnectorGroupResponse_phoneNumberErrors :: (Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> f AssociatePhoneNumbersWithVoiceConnectorGroupResponse
associatePhoneNumbersWithVoiceConnectorGroupResponse_phoneNumberErrors = (AssociatePhoneNumbersWithVoiceConnectorGroupResponse
 -> Maybe [PhoneNumberError])
-> (AssociatePhoneNumbersWithVoiceConnectorGroupResponse
    -> Maybe [PhoneNumberError]
    -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> Lens
     AssociatePhoneNumbersWithVoiceConnectorGroupResponse
     AssociatePhoneNumbersWithVoiceConnectorGroupResponse
     (Maybe [PhoneNumberError])
     (Maybe [PhoneNumberError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnectorGroupResponse' {Maybe [PhoneNumberError]
phoneNumberErrors :: Maybe [PhoneNumberError]
$sel:phoneNumberErrors:AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> Maybe [PhoneNumberError]
phoneNumberErrors} -> Maybe [PhoneNumberError]
phoneNumberErrors) (\s :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
s@AssociatePhoneNumbersWithVoiceConnectorGroupResponse' {} Maybe [PhoneNumberError]
a -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
s {$sel:phoneNumberErrors:AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: Maybe [PhoneNumberError]
phoneNumberErrors = Maybe [PhoneNumberError]
a} :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse) ((Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
 -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
 -> f AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> ((Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
    -> Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
-> (Maybe [PhoneNumberError] -> f (Maybe [PhoneNumberError]))
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> f AssociatePhoneNumbersWithVoiceConnectorGroupResponse
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.
associatePhoneNumbersWithVoiceConnectorGroupResponse_httpStatus :: Lens.Lens' AssociatePhoneNumbersWithVoiceConnectorGroupResponse Prelude.Int
associatePhoneNumbersWithVoiceConnectorGroupResponse_httpStatus :: (Int -> f Int)
-> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
-> f AssociatePhoneNumbersWithVoiceConnectorGroupResponse
associatePhoneNumbersWithVoiceConnectorGroupResponse_httpStatus = (AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Int)
-> (AssociatePhoneNumbersWithVoiceConnectorGroupResponse
    -> Int -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse)
-> Lens
     AssociatePhoneNumbersWithVoiceConnectorGroupResponse
     AssociatePhoneNumbersWithVoiceConnectorGroupResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumbersWithVoiceConnectorGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse
s@AssociatePhoneNumbersWithVoiceConnectorGroupResponse' {} Int
a -> AssociatePhoneNumbersWithVoiceConnectorGroupResponse
s {$sel:httpStatus:AssociatePhoneNumbersWithVoiceConnectorGroupResponse' :: Int
httpStatus = Int
a} :: AssociatePhoneNumbersWithVoiceConnectorGroupResponse)

instance
  Prelude.NFData
    AssociatePhoneNumbersWithVoiceConnectorGroupResponse