{-# 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.DisassociateQueueQuickConnects
-- 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)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Disassociates a set of quick connects from a queue.
module Amazonka.Connect.DisassociateQueueQuickConnects
  ( -- * Creating a Request
    DisassociateQueueQuickConnects (..),
    newDisassociateQueueQuickConnects,

    -- * Request Lenses
    disassociateQueueQuickConnects_instanceId,
    disassociateQueueQuickConnects_queueId,
    disassociateQueueQuickConnects_quickConnectIds,

    -- * Destructuring the Response
    DisassociateQueueQuickConnectsResponse (..),
    newDisassociateQueueQuickConnectsResponse,
  )
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:/ 'newDisassociateQueueQuickConnects' smart constructor.
data DisassociateQueueQuickConnects = DisassociateQueueQuickConnects'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DisassociateQueueQuickConnects -> Text
instanceId :: Prelude.Text,
    -- | The identifier for the queue.
    DisassociateQueueQuickConnects -> Text
queueId :: Prelude.Text,
    -- | The quick connects to disassociate from the queue.
    DisassociateQueueQuickConnects -> NonEmpty Text
quickConnectIds :: Prelude.NonEmpty Prelude.Text
  }
  deriving (DisassociateQueueQuickConnects
-> DisassociateQueueQuickConnects -> Bool
(DisassociateQueueQuickConnects
 -> DisassociateQueueQuickConnects -> Bool)
-> (DisassociateQueueQuickConnects
    -> DisassociateQueueQuickConnects -> Bool)
-> Eq DisassociateQueueQuickConnects
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateQueueQuickConnects
-> DisassociateQueueQuickConnects -> Bool
$c/= :: DisassociateQueueQuickConnects
-> DisassociateQueueQuickConnects -> Bool
== :: DisassociateQueueQuickConnects
-> DisassociateQueueQuickConnects -> Bool
$c== :: DisassociateQueueQuickConnects
-> DisassociateQueueQuickConnects -> Bool
Prelude.Eq, ReadPrec [DisassociateQueueQuickConnects]
ReadPrec DisassociateQueueQuickConnects
Int -> ReadS DisassociateQueueQuickConnects
ReadS [DisassociateQueueQuickConnects]
(Int -> ReadS DisassociateQueueQuickConnects)
-> ReadS [DisassociateQueueQuickConnects]
-> ReadPrec DisassociateQueueQuickConnects
-> ReadPrec [DisassociateQueueQuickConnects]
-> Read DisassociateQueueQuickConnects
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateQueueQuickConnects]
$creadListPrec :: ReadPrec [DisassociateQueueQuickConnects]
readPrec :: ReadPrec DisassociateQueueQuickConnects
$creadPrec :: ReadPrec DisassociateQueueQuickConnects
readList :: ReadS [DisassociateQueueQuickConnects]
$creadList :: ReadS [DisassociateQueueQuickConnects]
readsPrec :: Int -> ReadS DisassociateQueueQuickConnects
$creadsPrec :: Int -> ReadS DisassociateQueueQuickConnects
Prelude.Read, Int -> DisassociateQueueQuickConnects -> ShowS
[DisassociateQueueQuickConnects] -> ShowS
DisassociateQueueQuickConnects -> String
(Int -> DisassociateQueueQuickConnects -> ShowS)
-> (DisassociateQueueQuickConnects -> String)
-> ([DisassociateQueueQuickConnects] -> ShowS)
-> Show DisassociateQueueQuickConnects
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateQueueQuickConnects] -> ShowS
$cshowList :: [DisassociateQueueQuickConnects] -> ShowS
show :: DisassociateQueueQuickConnects -> String
$cshow :: DisassociateQueueQuickConnects -> String
showsPrec :: Int -> DisassociateQueueQuickConnects -> ShowS
$cshowsPrec :: Int -> DisassociateQueueQuickConnects -> ShowS
Prelude.Show, (forall x.
 DisassociateQueueQuickConnects
 -> Rep DisassociateQueueQuickConnects x)
-> (forall x.
    Rep DisassociateQueueQuickConnects x
    -> DisassociateQueueQuickConnects)
-> Generic DisassociateQueueQuickConnects
forall x.
Rep DisassociateQueueQuickConnects x
-> DisassociateQueueQuickConnects
forall x.
DisassociateQueueQuickConnects
-> Rep DisassociateQueueQuickConnects x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateQueueQuickConnects x
-> DisassociateQueueQuickConnects
$cfrom :: forall x.
DisassociateQueueQuickConnects
-> Rep DisassociateQueueQuickConnects x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateQueueQuickConnects' 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', 'disassociateQueueQuickConnects_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'queueId', 'disassociateQueueQuickConnects_queueId' - The identifier for the queue.
--
-- 'quickConnectIds', 'disassociateQueueQuickConnects_quickConnectIds' - The quick connects to disassociate from the queue.
newDisassociateQueueQuickConnects ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'queueId'
  Prelude.Text ->
  -- | 'quickConnectIds'
  Prelude.NonEmpty Prelude.Text ->
  DisassociateQueueQuickConnects
newDisassociateQueueQuickConnects :: Text -> Text -> NonEmpty Text -> DisassociateQueueQuickConnects
newDisassociateQueueQuickConnects
  Text
pInstanceId_
  Text
pQueueId_
  NonEmpty Text
pQuickConnectIds_ =
    DisassociateQueueQuickConnects' :: Text -> Text -> NonEmpty Text -> DisassociateQueueQuickConnects
DisassociateQueueQuickConnects'
      { $sel:instanceId:DisassociateQueueQuickConnects' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:queueId:DisassociateQueueQuickConnects' :: Text
queueId = Text
pQueueId_,
        $sel:quickConnectIds:DisassociateQueueQuickConnects' :: NonEmpty Text
quickConnectIds =
          Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pQuickConnectIds_
      }

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

-- | The identifier for the queue.
disassociateQueueQuickConnects_queueId :: Lens.Lens' DisassociateQueueQuickConnects Prelude.Text
disassociateQueueQuickConnects_queueId :: (Text -> f Text)
-> DisassociateQueueQuickConnects
-> f DisassociateQueueQuickConnects
disassociateQueueQuickConnects_queueId = (DisassociateQueueQuickConnects -> Text)
-> (DisassociateQueueQuickConnects
    -> Text -> DisassociateQueueQuickConnects)
-> Lens
     DisassociateQueueQuickConnects
     DisassociateQueueQuickConnects
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateQueueQuickConnects' {Text
queueId :: Text
$sel:queueId:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> Text
queueId} -> Text
queueId) (\s :: DisassociateQueueQuickConnects
s@DisassociateQueueQuickConnects' {} Text
a -> DisassociateQueueQuickConnects
s {$sel:queueId:DisassociateQueueQuickConnects' :: Text
queueId = Text
a} :: DisassociateQueueQuickConnects)

-- | The quick connects to disassociate from the queue.
disassociateQueueQuickConnects_quickConnectIds :: Lens.Lens' DisassociateQueueQuickConnects (Prelude.NonEmpty Prelude.Text)
disassociateQueueQuickConnects_quickConnectIds :: (NonEmpty Text -> f (NonEmpty Text))
-> DisassociateQueueQuickConnects
-> f DisassociateQueueQuickConnects
disassociateQueueQuickConnects_quickConnectIds = (DisassociateQueueQuickConnects -> NonEmpty Text)
-> (DisassociateQueueQuickConnects
    -> NonEmpty Text -> DisassociateQueueQuickConnects)
-> Lens
     DisassociateQueueQuickConnects
     DisassociateQueueQuickConnects
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateQueueQuickConnects' {NonEmpty Text
quickConnectIds :: NonEmpty Text
$sel:quickConnectIds:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> NonEmpty Text
quickConnectIds} -> NonEmpty Text
quickConnectIds) (\s :: DisassociateQueueQuickConnects
s@DisassociateQueueQuickConnects' {} NonEmpty Text
a -> DisassociateQueueQuickConnects
s {$sel:quickConnectIds:DisassociateQueueQuickConnects' :: NonEmpty Text
quickConnectIds = NonEmpty Text
a} :: DisassociateQueueQuickConnects) ((NonEmpty Text -> f (NonEmpty Text))
 -> DisassociateQueueQuickConnects
 -> f DisassociateQueueQuickConnects)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> DisassociateQueueQuickConnects
-> f DisassociateQueueQuickConnects
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.Hashable
    DisassociateQueueQuickConnects

instance
  Prelude.NFData
    DisassociateQueueQuickConnects

instance
  Core.ToHeaders
    DisassociateQueueQuickConnects
  where
  toHeaders :: DisassociateQueueQuickConnects -> [Header]
toHeaders =
    [Header] -> DisassociateQueueQuickConnects -> [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 DisassociateQueueQuickConnects where
  toJSON :: DisassociateQueueQuickConnects -> Value
toJSON DisassociateQueueQuickConnects' {NonEmpty Text
Text
quickConnectIds :: NonEmpty Text
queueId :: Text
instanceId :: Text
$sel:quickConnectIds:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> NonEmpty Text
$sel:queueId:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> Text
$sel:instanceId:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> 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
"QuickConnectIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
quickConnectIds)
          ]
      )

instance Core.ToPath DisassociateQueueQuickConnects where
  toPath :: DisassociateQueueQuickConnects -> ByteString
toPath DisassociateQueueQuickConnects' {NonEmpty Text
Text
quickConnectIds :: NonEmpty Text
queueId :: Text
instanceId :: Text
$sel:quickConnectIds:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> NonEmpty Text
$sel:queueId:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> Text
$sel:instanceId:DisassociateQueueQuickConnects' :: DisassociateQueueQuickConnects -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/queues/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
queueId,
        ByteString
"/disassociate-quick-connects"
      ]

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

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

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

instance
  Prelude.NFData
    DisassociateQueueQuickConnectsResponse