{-# 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.Connect.UpdateRoutingProfileConcurrency
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the channels that agents can handle in the Contact Control Panel
-- (CCP) for a routing profile.
module Amazonka.Connect.UpdateRoutingProfileConcurrency
  ( -- * Creating a Request
    UpdateRoutingProfileConcurrency (..),
    newUpdateRoutingProfileConcurrency,

    -- * Request Lenses
    updateRoutingProfileConcurrency_instanceId,
    updateRoutingProfileConcurrency_routingProfileId,
    updateRoutingProfileConcurrency_mediaConcurrencies,

    -- * Destructuring the Response
    UpdateRoutingProfileConcurrencyResponse (..),
    newUpdateRoutingProfileConcurrencyResponse,
  )
where

import Amazonka.Connect.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateRoutingProfileConcurrency' smart constructor.
data UpdateRoutingProfileConcurrency = UpdateRoutingProfileConcurrency'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    UpdateRoutingProfileConcurrency -> Text
instanceId :: Prelude.Text,
    -- | The identifier of the routing profile.
    UpdateRoutingProfileConcurrency -> Text
routingProfileId :: Prelude.Text,
    -- | The channels that agents can handle in the Contact Control Panel (CCP).
    UpdateRoutingProfileConcurrency -> [MediaConcurrency]
mediaConcurrencies :: [MediaConcurrency]
  }
  deriving (UpdateRoutingProfileConcurrency
-> UpdateRoutingProfileConcurrency -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingProfileConcurrency
-> UpdateRoutingProfileConcurrency -> Bool
$c/= :: UpdateRoutingProfileConcurrency
-> UpdateRoutingProfileConcurrency -> Bool
== :: UpdateRoutingProfileConcurrency
-> UpdateRoutingProfileConcurrency -> Bool
$c== :: UpdateRoutingProfileConcurrency
-> UpdateRoutingProfileConcurrency -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingProfileConcurrency]
ReadPrec UpdateRoutingProfileConcurrency
Int -> ReadS UpdateRoutingProfileConcurrency
ReadS [UpdateRoutingProfileConcurrency]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingProfileConcurrency]
$creadListPrec :: ReadPrec [UpdateRoutingProfileConcurrency]
readPrec :: ReadPrec UpdateRoutingProfileConcurrency
$creadPrec :: ReadPrec UpdateRoutingProfileConcurrency
readList :: ReadS [UpdateRoutingProfileConcurrency]
$creadList :: ReadS [UpdateRoutingProfileConcurrency]
readsPrec :: Int -> ReadS UpdateRoutingProfileConcurrency
$creadsPrec :: Int -> ReadS UpdateRoutingProfileConcurrency
Prelude.Read, Int -> UpdateRoutingProfileConcurrency -> ShowS
[UpdateRoutingProfileConcurrency] -> ShowS
UpdateRoutingProfileConcurrency -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingProfileConcurrency] -> ShowS
$cshowList :: [UpdateRoutingProfileConcurrency] -> ShowS
show :: UpdateRoutingProfileConcurrency -> String
$cshow :: UpdateRoutingProfileConcurrency -> String
showsPrec :: Int -> UpdateRoutingProfileConcurrency -> ShowS
$cshowsPrec :: Int -> UpdateRoutingProfileConcurrency -> ShowS
Prelude.Show, forall x.
Rep UpdateRoutingProfileConcurrency x
-> UpdateRoutingProfileConcurrency
forall x.
UpdateRoutingProfileConcurrency
-> Rep UpdateRoutingProfileConcurrency x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingProfileConcurrency x
-> UpdateRoutingProfileConcurrency
$cfrom :: forall x.
UpdateRoutingProfileConcurrency
-> Rep UpdateRoutingProfileConcurrency x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRoutingProfileConcurrency' 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:
--
-- 'instanceId', 'updateRoutingProfileConcurrency_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'routingProfileId', 'updateRoutingProfileConcurrency_routingProfileId' - The identifier of the routing profile.
--
-- 'mediaConcurrencies', 'updateRoutingProfileConcurrency_mediaConcurrencies' - The channels that agents can handle in the Contact Control Panel (CCP).
newUpdateRoutingProfileConcurrency ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'routingProfileId'
  Prelude.Text ->
  UpdateRoutingProfileConcurrency
newUpdateRoutingProfileConcurrency :: Text -> Text -> UpdateRoutingProfileConcurrency
newUpdateRoutingProfileConcurrency
  Text
pInstanceId_
  Text
pRoutingProfileId_ =
    UpdateRoutingProfileConcurrency'
      { $sel:instanceId:UpdateRoutingProfileConcurrency' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:routingProfileId:UpdateRoutingProfileConcurrency' :: Text
routingProfileId = Text
pRoutingProfileId_,
        $sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: [MediaConcurrency]
mediaConcurrencies = forall a. Monoid a => a
Prelude.mempty
      }

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
updateRoutingProfileConcurrency_instanceId :: Lens.Lens' UpdateRoutingProfileConcurrency Prelude.Text
updateRoutingProfileConcurrency_instanceId :: Lens' UpdateRoutingProfileConcurrency Text
updateRoutingProfileConcurrency_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingProfileConcurrency' {Text
instanceId :: Text
$sel:instanceId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
instanceId} -> Text
instanceId) (\s :: UpdateRoutingProfileConcurrency
s@UpdateRoutingProfileConcurrency' {} Text
a -> UpdateRoutingProfileConcurrency
s {$sel:instanceId:UpdateRoutingProfileConcurrency' :: Text
instanceId = Text
a} :: UpdateRoutingProfileConcurrency)

-- | The identifier of the routing profile.
updateRoutingProfileConcurrency_routingProfileId :: Lens.Lens' UpdateRoutingProfileConcurrency Prelude.Text
updateRoutingProfileConcurrency_routingProfileId :: Lens' UpdateRoutingProfileConcurrency Text
updateRoutingProfileConcurrency_routingProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingProfileConcurrency' {Text
routingProfileId :: Text
$sel:routingProfileId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
routingProfileId} -> Text
routingProfileId) (\s :: UpdateRoutingProfileConcurrency
s@UpdateRoutingProfileConcurrency' {} Text
a -> UpdateRoutingProfileConcurrency
s {$sel:routingProfileId:UpdateRoutingProfileConcurrency' :: Text
routingProfileId = Text
a} :: UpdateRoutingProfileConcurrency)

-- | The channels that agents can handle in the Contact Control Panel (CCP).
updateRoutingProfileConcurrency_mediaConcurrencies :: Lens.Lens' UpdateRoutingProfileConcurrency [MediaConcurrency]
updateRoutingProfileConcurrency_mediaConcurrencies :: Lens' UpdateRoutingProfileConcurrency [MediaConcurrency]
updateRoutingProfileConcurrency_mediaConcurrencies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoutingProfileConcurrency' {[MediaConcurrency]
mediaConcurrencies :: [MediaConcurrency]
$sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> [MediaConcurrency]
mediaConcurrencies} -> [MediaConcurrency]
mediaConcurrencies) (\s :: UpdateRoutingProfileConcurrency
s@UpdateRoutingProfileConcurrency' {} [MediaConcurrency]
a -> UpdateRoutingProfileConcurrency
s {$sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: [MediaConcurrency]
mediaConcurrencies = [MediaConcurrency]
a} :: UpdateRoutingProfileConcurrency) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    UpdateRoutingProfileConcurrency
  where
  type
    AWSResponse UpdateRoutingProfileConcurrency =
      UpdateRoutingProfileConcurrencyResponse
  request :: (Service -> Service)
-> UpdateRoutingProfileConcurrency
-> Request UpdateRoutingProfileConcurrency
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateRoutingProfileConcurrency
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateRoutingProfileConcurrency)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      UpdateRoutingProfileConcurrencyResponse
UpdateRoutingProfileConcurrencyResponse'

instance
  Prelude.Hashable
    UpdateRoutingProfileConcurrency
  where
  hashWithSalt :: Int -> UpdateRoutingProfileConcurrency -> Int
hashWithSalt
    Int
_salt
    UpdateRoutingProfileConcurrency' {[MediaConcurrency]
Text
mediaConcurrencies :: [MediaConcurrency]
routingProfileId :: Text
instanceId :: Text
$sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> [MediaConcurrency]
$sel:routingProfileId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
$sel:instanceId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
routingProfileId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [MediaConcurrency]
mediaConcurrencies

instance
  Prelude.NFData
    UpdateRoutingProfileConcurrency
  where
  rnf :: UpdateRoutingProfileConcurrency -> ()
rnf UpdateRoutingProfileConcurrency' {[MediaConcurrency]
Text
mediaConcurrencies :: [MediaConcurrency]
routingProfileId :: Text
instanceId :: Text
$sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> [MediaConcurrency]
$sel:routingProfileId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
$sel:instanceId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
routingProfileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [MediaConcurrency]
mediaConcurrencies

instance
  Data.ToHeaders
    UpdateRoutingProfileConcurrency
  where
  toHeaders :: UpdateRoutingProfileConcurrency -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateRoutingProfileConcurrency where
  toJSON :: UpdateRoutingProfileConcurrency -> Value
toJSON UpdateRoutingProfileConcurrency' {[MediaConcurrency]
Text
mediaConcurrencies :: [MediaConcurrency]
routingProfileId :: Text
instanceId :: Text
$sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> [MediaConcurrency]
$sel:routingProfileId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
$sel:instanceId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"MediaConcurrencies" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [MediaConcurrency]
mediaConcurrencies)
          ]
      )

instance Data.ToPath UpdateRoutingProfileConcurrency where
  toPath :: UpdateRoutingProfileConcurrency -> ByteString
toPath UpdateRoutingProfileConcurrency' {[MediaConcurrency]
Text
mediaConcurrencies :: [MediaConcurrency]
routingProfileId :: Text
instanceId :: Text
$sel:mediaConcurrencies:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> [MediaConcurrency]
$sel:routingProfileId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
$sel:instanceId:UpdateRoutingProfileConcurrency' :: UpdateRoutingProfileConcurrency -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/routing-profiles/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId,
        ByteString
"/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
routingProfileId,
        ByteString
"/concurrency"
      ]

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

-- | /See:/ 'newUpdateRoutingProfileConcurrencyResponse' smart constructor.
data UpdateRoutingProfileConcurrencyResponse = UpdateRoutingProfileConcurrencyResponse'
  {
  }
  deriving (UpdateRoutingProfileConcurrencyResponse
-> UpdateRoutingProfileConcurrencyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoutingProfileConcurrencyResponse
-> UpdateRoutingProfileConcurrencyResponse -> Bool
$c/= :: UpdateRoutingProfileConcurrencyResponse
-> UpdateRoutingProfileConcurrencyResponse -> Bool
== :: UpdateRoutingProfileConcurrencyResponse
-> UpdateRoutingProfileConcurrencyResponse -> Bool
$c== :: UpdateRoutingProfileConcurrencyResponse
-> UpdateRoutingProfileConcurrencyResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRoutingProfileConcurrencyResponse]
ReadPrec UpdateRoutingProfileConcurrencyResponse
Int -> ReadS UpdateRoutingProfileConcurrencyResponse
ReadS [UpdateRoutingProfileConcurrencyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoutingProfileConcurrencyResponse]
$creadListPrec :: ReadPrec [UpdateRoutingProfileConcurrencyResponse]
readPrec :: ReadPrec UpdateRoutingProfileConcurrencyResponse
$creadPrec :: ReadPrec UpdateRoutingProfileConcurrencyResponse
readList :: ReadS [UpdateRoutingProfileConcurrencyResponse]
$creadList :: ReadS [UpdateRoutingProfileConcurrencyResponse]
readsPrec :: Int -> ReadS UpdateRoutingProfileConcurrencyResponse
$creadsPrec :: Int -> ReadS UpdateRoutingProfileConcurrencyResponse
Prelude.Read, Int -> UpdateRoutingProfileConcurrencyResponse -> ShowS
[UpdateRoutingProfileConcurrencyResponse] -> ShowS
UpdateRoutingProfileConcurrencyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoutingProfileConcurrencyResponse] -> ShowS
$cshowList :: [UpdateRoutingProfileConcurrencyResponse] -> ShowS
show :: UpdateRoutingProfileConcurrencyResponse -> String
$cshow :: UpdateRoutingProfileConcurrencyResponse -> String
showsPrec :: Int -> UpdateRoutingProfileConcurrencyResponse -> ShowS
$cshowsPrec :: Int -> UpdateRoutingProfileConcurrencyResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateRoutingProfileConcurrencyResponse x
-> UpdateRoutingProfileConcurrencyResponse
forall x.
UpdateRoutingProfileConcurrencyResponse
-> Rep UpdateRoutingProfileConcurrencyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRoutingProfileConcurrencyResponse x
-> UpdateRoutingProfileConcurrencyResponse
$cfrom :: forall x.
UpdateRoutingProfileConcurrencyResponse
-> Rep UpdateRoutingProfileConcurrencyResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRoutingProfileConcurrencyResponse' 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.
newUpdateRoutingProfileConcurrencyResponse ::
  UpdateRoutingProfileConcurrencyResponse
newUpdateRoutingProfileConcurrencyResponse :: UpdateRoutingProfileConcurrencyResponse
newUpdateRoutingProfileConcurrencyResponse =
  UpdateRoutingProfileConcurrencyResponse
UpdateRoutingProfileConcurrencyResponse'

instance
  Prelude.NFData
    UpdateRoutingProfileConcurrencyResponse
  where
  rnf :: UpdateRoutingProfileConcurrencyResponse -> ()
rnf UpdateRoutingProfileConcurrencyResponse
_ = ()