{-# 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.DisassociateRoutingProfileQueues
-- 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)
--
-- Disassociates a set of queues from a routing profile.
module Amazonka.Connect.DisassociateRoutingProfileQueues
  ( -- * Creating a Request
    DisassociateRoutingProfileQueues (..),
    newDisassociateRoutingProfileQueues,

    -- * Request Lenses
    disassociateRoutingProfileQueues_instanceId,
    disassociateRoutingProfileQueues_routingProfileId,
    disassociateRoutingProfileQueues_queueReferences,

    -- * Destructuring the Response
    DisassociateRoutingProfileQueuesResponse (..),
    newDisassociateRoutingProfileQueuesResponse,
  )
where

import Amazonka.Connect.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:/ 'newDisassociateRoutingProfileQueues' smart constructor.
data DisassociateRoutingProfileQueues = DisassociateRoutingProfileQueues'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DisassociateRoutingProfileQueues -> Text
instanceId :: Prelude.Text,
    -- | The identifier of the routing profile.
    DisassociateRoutingProfileQueues -> Text
routingProfileId :: Prelude.Text,
    -- | The queues to disassociate from this routing profile.
    DisassociateRoutingProfileQueues -> [RoutingProfileQueueReference]
queueReferences :: [RoutingProfileQueueReference]
  }
  deriving (DisassociateRoutingProfileQueues
-> DisassociateRoutingProfileQueues -> Bool
(DisassociateRoutingProfileQueues
 -> DisassociateRoutingProfileQueues -> Bool)
-> (DisassociateRoutingProfileQueues
    -> DisassociateRoutingProfileQueues -> Bool)
-> Eq DisassociateRoutingProfileQueues
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateRoutingProfileQueues
-> DisassociateRoutingProfileQueues -> Bool
$c/= :: DisassociateRoutingProfileQueues
-> DisassociateRoutingProfileQueues -> Bool
== :: DisassociateRoutingProfileQueues
-> DisassociateRoutingProfileQueues -> Bool
$c== :: DisassociateRoutingProfileQueues
-> DisassociateRoutingProfileQueues -> Bool
Prelude.Eq, ReadPrec [DisassociateRoutingProfileQueues]
ReadPrec DisassociateRoutingProfileQueues
Int -> ReadS DisassociateRoutingProfileQueues
ReadS [DisassociateRoutingProfileQueues]
(Int -> ReadS DisassociateRoutingProfileQueues)
-> ReadS [DisassociateRoutingProfileQueues]
-> ReadPrec DisassociateRoutingProfileQueues
-> ReadPrec [DisassociateRoutingProfileQueues]
-> Read DisassociateRoutingProfileQueues
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateRoutingProfileQueues]
$creadListPrec :: ReadPrec [DisassociateRoutingProfileQueues]
readPrec :: ReadPrec DisassociateRoutingProfileQueues
$creadPrec :: ReadPrec DisassociateRoutingProfileQueues
readList :: ReadS [DisassociateRoutingProfileQueues]
$creadList :: ReadS [DisassociateRoutingProfileQueues]
readsPrec :: Int -> ReadS DisassociateRoutingProfileQueues
$creadsPrec :: Int -> ReadS DisassociateRoutingProfileQueues
Prelude.Read, Int -> DisassociateRoutingProfileQueues -> ShowS
[DisassociateRoutingProfileQueues] -> ShowS
DisassociateRoutingProfileQueues -> String
(Int -> DisassociateRoutingProfileQueues -> ShowS)
-> (DisassociateRoutingProfileQueues -> String)
-> ([DisassociateRoutingProfileQueues] -> ShowS)
-> Show DisassociateRoutingProfileQueues
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateRoutingProfileQueues] -> ShowS
$cshowList :: [DisassociateRoutingProfileQueues] -> ShowS
show :: DisassociateRoutingProfileQueues -> String
$cshow :: DisassociateRoutingProfileQueues -> String
showsPrec :: Int -> DisassociateRoutingProfileQueues -> ShowS
$cshowsPrec :: Int -> DisassociateRoutingProfileQueues -> ShowS
Prelude.Show, (forall x.
 DisassociateRoutingProfileQueues
 -> Rep DisassociateRoutingProfileQueues x)
-> (forall x.
    Rep DisassociateRoutingProfileQueues x
    -> DisassociateRoutingProfileQueues)
-> Generic DisassociateRoutingProfileQueues
forall x.
Rep DisassociateRoutingProfileQueues x
-> DisassociateRoutingProfileQueues
forall x.
DisassociateRoutingProfileQueues
-> Rep DisassociateRoutingProfileQueues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateRoutingProfileQueues x
-> DisassociateRoutingProfileQueues
$cfrom :: forall x.
DisassociateRoutingProfileQueues
-> Rep DisassociateRoutingProfileQueues x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateRoutingProfileQueues' 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', 'disassociateRoutingProfileQueues_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'routingProfileId', 'disassociateRoutingProfileQueues_routingProfileId' - The identifier of the routing profile.
--
-- 'queueReferences', 'disassociateRoutingProfileQueues_queueReferences' - The queues to disassociate from this routing profile.
newDisassociateRoutingProfileQueues ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'routingProfileId'
  Prelude.Text ->
  DisassociateRoutingProfileQueues
newDisassociateRoutingProfileQueues :: Text -> Text -> DisassociateRoutingProfileQueues
newDisassociateRoutingProfileQueues
  Text
pInstanceId_
  Text
pRoutingProfileId_ =
    DisassociateRoutingProfileQueues' :: Text
-> Text
-> [RoutingProfileQueueReference]
-> DisassociateRoutingProfileQueues
DisassociateRoutingProfileQueues'
      { $sel:instanceId:DisassociateRoutingProfileQueues' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:routingProfileId:DisassociateRoutingProfileQueues' :: Text
routingProfileId = Text
pRoutingProfileId_,
        $sel:queueReferences:DisassociateRoutingProfileQueues' :: [RoutingProfileQueueReference]
queueReferences = [RoutingProfileQueueReference]
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.
disassociateRoutingProfileQueues_instanceId :: Lens.Lens' DisassociateRoutingProfileQueues Prelude.Text
disassociateRoutingProfileQueues_instanceId :: (Text -> f Text)
-> DisassociateRoutingProfileQueues
-> f DisassociateRoutingProfileQueues
disassociateRoutingProfileQueues_instanceId = (DisassociateRoutingProfileQueues -> Text)
-> (DisassociateRoutingProfileQueues
    -> Text -> DisassociateRoutingProfileQueues)
-> Lens
     DisassociateRoutingProfileQueues
     DisassociateRoutingProfileQueues
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRoutingProfileQueues' {Text
instanceId :: Text
$sel:instanceId:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> Text
instanceId} -> Text
instanceId) (\s :: DisassociateRoutingProfileQueues
s@DisassociateRoutingProfileQueues' {} Text
a -> DisassociateRoutingProfileQueues
s {$sel:instanceId:DisassociateRoutingProfileQueues' :: Text
instanceId = Text
a} :: DisassociateRoutingProfileQueues)

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

-- | The queues to disassociate from this routing profile.
disassociateRoutingProfileQueues_queueReferences :: Lens.Lens' DisassociateRoutingProfileQueues [RoutingProfileQueueReference]
disassociateRoutingProfileQueues_queueReferences :: ([RoutingProfileQueueReference]
 -> f [RoutingProfileQueueReference])
-> DisassociateRoutingProfileQueues
-> f DisassociateRoutingProfileQueues
disassociateRoutingProfileQueues_queueReferences = (DisassociateRoutingProfileQueues
 -> [RoutingProfileQueueReference])
-> (DisassociateRoutingProfileQueues
    -> [RoutingProfileQueueReference]
    -> DisassociateRoutingProfileQueues)
-> Lens
     DisassociateRoutingProfileQueues
     DisassociateRoutingProfileQueues
     [RoutingProfileQueueReference]
     [RoutingProfileQueueReference]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateRoutingProfileQueues' {[RoutingProfileQueueReference]
queueReferences :: [RoutingProfileQueueReference]
$sel:queueReferences:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> [RoutingProfileQueueReference]
queueReferences} -> [RoutingProfileQueueReference]
queueReferences) (\s :: DisassociateRoutingProfileQueues
s@DisassociateRoutingProfileQueues' {} [RoutingProfileQueueReference]
a -> DisassociateRoutingProfileQueues
s {$sel:queueReferences:DisassociateRoutingProfileQueues' :: [RoutingProfileQueueReference]
queueReferences = [RoutingProfileQueueReference]
a} :: DisassociateRoutingProfileQueues) (([RoutingProfileQueueReference]
  -> f [RoutingProfileQueueReference])
 -> DisassociateRoutingProfileQueues
 -> f DisassociateRoutingProfileQueues)
-> (([RoutingProfileQueueReference]
     -> f [RoutingProfileQueueReference])
    -> [RoutingProfileQueueReference]
    -> f [RoutingProfileQueueReference])
-> ([RoutingProfileQueueReference]
    -> f [RoutingProfileQueueReference])
-> DisassociateRoutingProfileQueues
-> f DisassociateRoutingProfileQueues
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RoutingProfileQueueReference]
 -> f [RoutingProfileQueueReference])
-> [RoutingProfileQueueReference]
-> f [RoutingProfileQueueReference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.Hashable
    DisassociateRoutingProfileQueues

instance
  Prelude.NFData
    DisassociateRoutingProfileQueues

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

instance Core.ToJSON DisassociateRoutingProfileQueues where
  toJSON :: DisassociateRoutingProfileQueues -> Value
toJSON DisassociateRoutingProfileQueues' {[RoutingProfileQueueReference]
Text
queueReferences :: [RoutingProfileQueueReference]
routingProfileId :: Text
instanceId :: Text
$sel:queueReferences:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> [RoutingProfileQueueReference]
$sel:routingProfileId:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> Text
$sel:instanceId:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"QueueReferences" Text -> [RoutingProfileQueueReference] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [RoutingProfileQueueReference]
queueReferences)
          ]
      )

instance Core.ToPath DisassociateRoutingProfileQueues where
  toPath :: DisassociateRoutingProfileQueues -> ByteString
toPath DisassociateRoutingProfileQueues' {[RoutingProfileQueueReference]
Text
queueReferences :: [RoutingProfileQueueReference]
routingProfileId :: Text
instanceId :: Text
$sel:queueReferences:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> [RoutingProfileQueueReference]
$sel:routingProfileId:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> Text
$sel:instanceId:DisassociateRoutingProfileQueues' :: DisassociateRoutingProfileQueues -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/routing-profiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
routingProfileId,
        ByteString
"/disassociate-queues"
      ]

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

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

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

instance
  Prelude.NFData
    DisassociateRoutingProfileQueuesResponse