{-# 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.CreateQueue
-- 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.
--
-- Creates a new queue for the specified Amazon Connect instance.
module Amazonka.Connect.CreateQueue
  ( -- * Creating a Request
    CreateQueue (..),
    newCreateQueue,

    -- * Request Lenses
    createQueue_maxContacts,
    createQueue_quickConnectIds,
    createQueue_outboundCallerConfig,
    createQueue_description,
    createQueue_tags,
    createQueue_instanceId,
    createQueue_name,
    createQueue_hoursOfOperationId,

    -- * Destructuring the Response
    CreateQueueResponse (..),
    newCreateQueueResponse,

    -- * Response Lenses
    createQueueResponse_queueArn,
    createQueueResponse_queueId,
    createQueueResponse_httpStatus,
  )
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:/ 'newCreateQueue' smart constructor.
data CreateQueue = CreateQueue'
  { -- | The maximum number of contacts that can be in the queue before it is
    -- considered full.
    CreateQueue -> Maybe Natural
maxContacts :: Prelude.Maybe Prelude.Natural,
    -- | The quick connects available to agents who are working the queue.
    CreateQueue -> Maybe (NonEmpty Text)
quickConnectIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The outbound caller ID name, number, and outbound whisper flow.
    CreateQueue -> Maybe OutboundCallerConfig
outboundCallerConfig :: Prelude.Maybe OutboundCallerConfig,
    -- | The description of the queue.
    CreateQueue -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    CreateQueue -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    CreateQueue -> Text
instanceId :: Prelude.Text,
    -- | The name of the queue.
    CreateQueue -> Text
name :: Prelude.Text,
    -- | The identifier for the hours of operation.
    CreateQueue -> Text
hoursOfOperationId :: Prelude.Text
  }
  deriving (CreateQueue -> CreateQueue -> Bool
(CreateQueue -> CreateQueue -> Bool)
-> (CreateQueue -> CreateQueue -> Bool) -> Eq CreateQueue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQueue -> CreateQueue -> Bool
$c/= :: CreateQueue -> CreateQueue -> Bool
== :: CreateQueue -> CreateQueue -> Bool
$c== :: CreateQueue -> CreateQueue -> Bool
Prelude.Eq, ReadPrec [CreateQueue]
ReadPrec CreateQueue
Int -> ReadS CreateQueue
ReadS [CreateQueue]
(Int -> ReadS CreateQueue)
-> ReadS [CreateQueue]
-> ReadPrec CreateQueue
-> ReadPrec [CreateQueue]
-> Read CreateQueue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQueue]
$creadListPrec :: ReadPrec [CreateQueue]
readPrec :: ReadPrec CreateQueue
$creadPrec :: ReadPrec CreateQueue
readList :: ReadS [CreateQueue]
$creadList :: ReadS [CreateQueue]
readsPrec :: Int -> ReadS CreateQueue
$creadsPrec :: Int -> ReadS CreateQueue
Prelude.Read, Int -> CreateQueue -> ShowS
[CreateQueue] -> ShowS
CreateQueue -> String
(Int -> CreateQueue -> ShowS)
-> (CreateQueue -> String)
-> ([CreateQueue] -> ShowS)
-> Show CreateQueue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQueue] -> ShowS
$cshowList :: [CreateQueue] -> ShowS
show :: CreateQueue -> String
$cshow :: CreateQueue -> String
showsPrec :: Int -> CreateQueue -> ShowS
$cshowsPrec :: Int -> CreateQueue -> ShowS
Prelude.Show, (forall x. CreateQueue -> Rep CreateQueue x)
-> (forall x. Rep CreateQueue x -> CreateQueue)
-> Generic CreateQueue
forall x. Rep CreateQueue x -> CreateQueue
forall x. CreateQueue -> Rep CreateQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateQueue x -> CreateQueue
$cfrom :: forall x. CreateQueue -> Rep CreateQueue x
Prelude.Generic)

-- |
-- Create a value of 'CreateQueue' 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:
--
-- 'maxContacts', 'createQueue_maxContacts' - The maximum number of contacts that can be in the queue before it is
-- considered full.
--
-- 'quickConnectIds', 'createQueue_quickConnectIds' - The quick connects available to agents who are working the queue.
--
-- 'outboundCallerConfig', 'createQueue_outboundCallerConfig' - The outbound caller ID name, number, and outbound whisper flow.
--
-- 'description', 'createQueue_description' - The description of the queue.
--
-- 'tags', 'createQueue_tags' - One or more tags.
--
-- 'instanceId', 'createQueue_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'name', 'createQueue_name' - The name of the queue.
--
-- 'hoursOfOperationId', 'createQueue_hoursOfOperationId' - The identifier for the hours of operation.
newCreateQueue ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'hoursOfOperationId'
  Prelude.Text ->
  CreateQueue
newCreateQueue :: Text -> Text -> Text -> CreateQueue
newCreateQueue
  Text
pInstanceId_
  Text
pName_
  Text
pHoursOfOperationId_ =
    CreateQueue' :: Maybe Natural
-> Maybe (NonEmpty Text)
-> Maybe OutboundCallerConfig
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> CreateQueue
CreateQueue'
      { $sel:maxContacts:CreateQueue' :: Maybe Natural
maxContacts = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:quickConnectIds:CreateQueue' :: Maybe (NonEmpty Text)
quickConnectIds = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:outboundCallerConfig:CreateQueue' :: Maybe OutboundCallerConfig
outboundCallerConfig = Maybe OutboundCallerConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateQueue' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateQueue' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:CreateQueue' :: Text
instanceId = Text
pInstanceId_,
        $sel:name:CreateQueue' :: Text
name = Text
pName_,
        $sel:hoursOfOperationId:CreateQueue' :: Text
hoursOfOperationId = Text
pHoursOfOperationId_
      }

-- | The maximum number of contacts that can be in the queue before it is
-- considered full.
createQueue_maxContacts :: Lens.Lens' CreateQueue (Prelude.Maybe Prelude.Natural)
createQueue_maxContacts :: (Maybe Natural -> f (Maybe Natural))
-> CreateQueue -> f CreateQueue
createQueue_maxContacts = (CreateQueue -> Maybe Natural)
-> (CreateQueue -> Maybe Natural -> CreateQueue)
-> Lens CreateQueue CreateQueue (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Maybe Natural
maxContacts :: Maybe Natural
$sel:maxContacts:CreateQueue' :: CreateQueue -> Maybe Natural
maxContacts} -> Maybe Natural
maxContacts) (\s :: CreateQueue
s@CreateQueue' {} Maybe Natural
a -> CreateQueue
s {$sel:maxContacts:CreateQueue' :: Maybe Natural
maxContacts = Maybe Natural
a} :: CreateQueue)

-- | The quick connects available to agents who are working the queue.
createQueue_quickConnectIds :: Lens.Lens' CreateQueue (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createQueue_quickConnectIds :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateQueue -> f CreateQueue
createQueue_quickConnectIds = (CreateQueue -> Maybe (NonEmpty Text))
-> (CreateQueue -> Maybe (NonEmpty Text) -> CreateQueue)
-> Lens
     CreateQueue
     CreateQueue
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Maybe (NonEmpty Text)
quickConnectIds :: Maybe (NonEmpty Text)
$sel:quickConnectIds:CreateQueue' :: CreateQueue -> Maybe (NonEmpty Text)
quickConnectIds} -> Maybe (NonEmpty Text)
quickConnectIds) (\s :: CreateQueue
s@CreateQueue' {} Maybe (NonEmpty Text)
a -> CreateQueue
s {$sel:quickConnectIds:CreateQueue' :: Maybe (NonEmpty Text)
quickConnectIds = Maybe (NonEmpty Text)
a} :: CreateQueue) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> CreateQueue -> f CreateQueue)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateQueue
-> f CreateQueue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The outbound caller ID name, number, and outbound whisper flow.
createQueue_outboundCallerConfig :: Lens.Lens' CreateQueue (Prelude.Maybe OutboundCallerConfig)
createQueue_outboundCallerConfig :: (Maybe OutboundCallerConfig -> f (Maybe OutboundCallerConfig))
-> CreateQueue -> f CreateQueue
createQueue_outboundCallerConfig = (CreateQueue -> Maybe OutboundCallerConfig)
-> (CreateQueue -> Maybe OutboundCallerConfig -> CreateQueue)
-> Lens
     CreateQueue
     CreateQueue
     (Maybe OutboundCallerConfig)
     (Maybe OutboundCallerConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Maybe OutboundCallerConfig
outboundCallerConfig :: Maybe OutboundCallerConfig
$sel:outboundCallerConfig:CreateQueue' :: CreateQueue -> Maybe OutboundCallerConfig
outboundCallerConfig} -> Maybe OutboundCallerConfig
outboundCallerConfig) (\s :: CreateQueue
s@CreateQueue' {} Maybe OutboundCallerConfig
a -> CreateQueue
s {$sel:outboundCallerConfig:CreateQueue' :: Maybe OutboundCallerConfig
outboundCallerConfig = Maybe OutboundCallerConfig
a} :: CreateQueue)

-- | The description of the queue.
createQueue_description :: Lens.Lens' CreateQueue (Prelude.Maybe Prelude.Text)
createQueue_description :: (Maybe Text -> f (Maybe Text)) -> CreateQueue -> f CreateQueue
createQueue_description = (CreateQueue -> Maybe Text)
-> (CreateQueue -> Maybe Text -> CreateQueue)
-> Lens CreateQueue CreateQueue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Maybe Text
description :: Maybe Text
$sel:description:CreateQueue' :: CreateQueue -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateQueue
s@CreateQueue' {} Maybe Text
a -> CreateQueue
s {$sel:description:CreateQueue' :: Maybe Text
description = Maybe Text
a} :: CreateQueue)

-- | One or more tags.
createQueue_tags :: Lens.Lens' CreateQueue (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createQueue_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateQueue -> f CreateQueue
createQueue_tags = (CreateQueue -> Maybe (HashMap Text Text))
-> (CreateQueue -> Maybe (HashMap Text Text) -> CreateQueue)
-> Lens
     CreateQueue
     CreateQueue
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateQueue' :: CreateQueue -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateQueue
s@CreateQueue' {} Maybe (HashMap Text Text)
a -> CreateQueue
s {$sel:tags:CreateQueue' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateQueue) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateQueue -> f CreateQueue)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateQueue
-> f CreateQueue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The name of the queue.
createQueue_name :: Lens.Lens' CreateQueue Prelude.Text
createQueue_name :: (Text -> f Text) -> CreateQueue -> f CreateQueue
createQueue_name = (CreateQueue -> Text)
-> (CreateQueue -> Text -> CreateQueue)
-> Lens CreateQueue CreateQueue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Text
name :: Text
$sel:name:CreateQueue' :: CreateQueue -> Text
name} -> Text
name) (\s :: CreateQueue
s@CreateQueue' {} Text
a -> CreateQueue
s {$sel:name:CreateQueue' :: Text
name = Text
a} :: CreateQueue)

-- | The identifier for the hours of operation.
createQueue_hoursOfOperationId :: Lens.Lens' CreateQueue Prelude.Text
createQueue_hoursOfOperationId :: (Text -> f Text) -> CreateQueue -> f CreateQueue
createQueue_hoursOfOperationId = (CreateQueue -> Text)
-> (CreateQueue -> Text -> CreateQueue)
-> Lens CreateQueue CreateQueue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueue' {Text
hoursOfOperationId :: Text
$sel:hoursOfOperationId:CreateQueue' :: CreateQueue -> Text
hoursOfOperationId} -> Text
hoursOfOperationId) (\s :: CreateQueue
s@CreateQueue' {} Text
a -> CreateQueue
s {$sel:hoursOfOperationId:CreateQueue' :: Text
hoursOfOperationId = Text
a} :: CreateQueue)

instance Core.AWSRequest CreateQueue where
  type AWSResponse CreateQueue = CreateQueueResponse
  request :: CreateQueue -> Request CreateQueue
request = Service -> CreateQueue -> Request CreateQueue
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateQueue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateQueue)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateQueue))
-> Logger
-> Service
-> Proxy CreateQueue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateQueue)))
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 Text -> Maybe Text -> Int -> CreateQueueResponse
CreateQueueResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateQueueResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateQueueResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"QueueArn")
            Either String (Maybe Text -> Int -> CreateQueueResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateQueueResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"QueueId")
            Either String (Int -> CreateQueueResponse)
-> Either String Int -> Either String CreateQueueResponse
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 CreateQueue

instance Prelude.NFData CreateQueue

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

instance Core.ToJSON CreateQueue where
  toJSON :: CreateQueue -> Value
toJSON CreateQueue' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Maybe OutboundCallerConfig
Text
hoursOfOperationId :: Text
name :: Text
instanceId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
outboundCallerConfig :: Maybe OutboundCallerConfig
quickConnectIds :: Maybe (NonEmpty Text)
maxContacts :: Maybe Natural
$sel:hoursOfOperationId:CreateQueue' :: CreateQueue -> Text
$sel:name:CreateQueue' :: CreateQueue -> Text
$sel:instanceId:CreateQueue' :: CreateQueue -> Text
$sel:tags:CreateQueue' :: CreateQueue -> Maybe (HashMap Text Text)
$sel:description:CreateQueue' :: CreateQueue -> Maybe Text
$sel:outboundCallerConfig:CreateQueue' :: CreateQueue -> Maybe OutboundCallerConfig
$sel:quickConnectIds:CreateQueue' :: CreateQueue -> Maybe (NonEmpty Text)
$sel:maxContacts:CreateQueue' :: CreateQueue -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MaxContacts" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxContacts,
            (Text
"QuickConnectIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
quickConnectIds,
            (Text
"OutboundCallerConfig" Text -> OutboundCallerConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (OutboundCallerConfig -> Pair)
-> Maybe OutboundCallerConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OutboundCallerConfig
outboundCallerConfig,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"HoursOfOperationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
hoursOfOperationId)
          ]
      )

instance Core.ToPath CreateQueue where
  toPath :: CreateQueue -> ByteString
toPath CreateQueue' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Maybe OutboundCallerConfig
Text
hoursOfOperationId :: Text
name :: Text
instanceId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
outboundCallerConfig :: Maybe OutboundCallerConfig
quickConnectIds :: Maybe (NonEmpty Text)
maxContacts :: Maybe Natural
$sel:hoursOfOperationId:CreateQueue' :: CreateQueue -> Text
$sel:name:CreateQueue' :: CreateQueue -> Text
$sel:instanceId:CreateQueue' :: CreateQueue -> Text
$sel:tags:CreateQueue' :: CreateQueue -> Maybe (HashMap Text Text)
$sel:description:CreateQueue' :: CreateQueue -> Maybe Text
$sel:outboundCallerConfig:CreateQueue' :: CreateQueue -> Maybe OutboundCallerConfig
$sel:quickConnectIds:CreateQueue' :: CreateQueue -> Maybe (NonEmpty Text)
$sel:maxContacts:CreateQueue' :: CreateQueue -> Maybe Natural
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/queues/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId]

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

-- | /See:/ 'newCreateQueueResponse' smart constructor.
data CreateQueueResponse = CreateQueueResponse'
  { -- | The Amazon Resource Name (ARN) of the queue.
    CreateQueueResponse -> Maybe Text
queueArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the queue.
    CreateQueueResponse -> Maybe Text
queueId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateQueueResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateQueueResponse -> CreateQueueResponse -> Bool
(CreateQueueResponse -> CreateQueueResponse -> Bool)
-> (CreateQueueResponse -> CreateQueueResponse -> Bool)
-> Eq CreateQueueResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateQueueResponse -> CreateQueueResponse -> Bool
$c/= :: CreateQueueResponse -> CreateQueueResponse -> Bool
== :: CreateQueueResponse -> CreateQueueResponse -> Bool
$c== :: CreateQueueResponse -> CreateQueueResponse -> Bool
Prelude.Eq, ReadPrec [CreateQueueResponse]
ReadPrec CreateQueueResponse
Int -> ReadS CreateQueueResponse
ReadS [CreateQueueResponse]
(Int -> ReadS CreateQueueResponse)
-> ReadS [CreateQueueResponse]
-> ReadPrec CreateQueueResponse
-> ReadPrec [CreateQueueResponse]
-> Read CreateQueueResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateQueueResponse]
$creadListPrec :: ReadPrec [CreateQueueResponse]
readPrec :: ReadPrec CreateQueueResponse
$creadPrec :: ReadPrec CreateQueueResponse
readList :: ReadS [CreateQueueResponse]
$creadList :: ReadS [CreateQueueResponse]
readsPrec :: Int -> ReadS CreateQueueResponse
$creadsPrec :: Int -> ReadS CreateQueueResponse
Prelude.Read, Int -> CreateQueueResponse -> ShowS
[CreateQueueResponse] -> ShowS
CreateQueueResponse -> String
(Int -> CreateQueueResponse -> ShowS)
-> (CreateQueueResponse -> String)
-> ([CreateQueueResponse] -> ShowS)
-> Show CreateQueueResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateQueueResponse] -> ShowS
$cshowList :: [CreateQueueResponse] -> ShowS
show :: CreateQueueResponse -> String
$cshow :: CreateQueueResponse -> String
showsPrec :: Int -> CreateQueueResponse -> ShowS
$cshowsPrec :: Int -> CreateQueueResponse -> ShowS
Prelude.Show, (forall x. CreateQueueResponse -> Rep CreateQueueResponse x)
-> (forall x. Rep CreateQueueResponse x -> CreateQueueResponse)
-> Generic CreateQueueResponse
forall x. Rep CreateQueueResponse x -> CreateQueueResponse
forall x. CreateQueueResponse -> Rep CreateQueueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateQueueResponse x -> CreateQueueResponse
$cfrom :: forall x. CreateQueueResponse -> Rep CreateQueueResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateQueueResponse' 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:
--
-- 'queueArn', 'createQueueResponse_queueArn' - The Amazon Resource Name (ARN) of the queue.
--
-- 'queueId', 'createQueueResponse_queueId' - The identifier for the queue.
--
-- 'httpStatus', 'createQueueResponse_httpStatus' - The response's http status code.
newCreateQueueResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateQueueResponse
newCreateQueueResponse :: Int -> CreateQueueResponse
newCreateQueueResponse Int
pHttpStatus_ =
  CreateQueueResponse' :: Maybe Text -> Maybe Text -> Int -> CreateQueueResponse
CreateQueueResponse'
    { $sel:queueArn:CreateQueueResponse' :: Maybe Text
queueArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:queueId:CreateQueueResponse' :: Maybe Text
queueId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateQueueResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the queue.
createQueueResponse_queueArn :: Lens.Lens' CreateQueueResponse (Prelude.Maybe Prelude.Text)
createQueueResponse_queueArn :: (Maybe Text -> f (Maybe Text))
-> CreateQueueResponse -> f CreateQueueResponse
createQueueResponse_queueArn = (CreateQueueResponse -> Maybe Text)
-> (CreateQueueResponse -> Maybe Text -> CreateQueueResponse)
-> Lens
     CreateQueueResponse CreateQueueResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateQueueResponse' {Maybe Text
queueArn :: Maybe Text
$sel:queueArn:CreateQueueResponse' :: CreateQueueResponse -> Maybe Text
queueArn} -> Maybe Text
queueArn) (\s :: CreateQueueResponse
s@CreateQueueResponse' {} Maybe Text
a -> CreateQueueResponse
s {$sel:queueArn:CreateQueueResponse' :: Maybe Text
queueArn = Maybe Text
a} :: CreateQueueResponse)

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

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

instance Prelude.NFData CreateQueueResponse