{-# 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.UpdateQueueHoursOfOperation
-- 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.
--
-- Updates the hours of operation for the specified queue.
module Amazonka.Connect.UpdateQueueHoursOfOperation
  ( -- * Creating a Request
    UpdateQueueHoursOfOperation (..),
    newUpdateQueueHoursOfOperation,

    -- * Request Lenses
    updateQueueHoursOfOperation_instanceId,
    updateQueueHoursOfOperation_queueId,
    updateQueueHoursOfOperation_hoursOfOperationId,

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

-- |
-- Create a value of 'UpdateQueueHoursOfOperation' 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', 'updateQueueHoursOfOperation_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'queueId', 'updateQueueHoursOfOperation_queueId' - The identifier for the queue.
--
-- 'hoursOfOperationId', 'updateQueueHoursOfOperation_hoursOfOperationId' - The identifier for the hours of operation.
newUpdateQueueHoursOfOperation ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'queueId'
  Prelude.Text ->
  -- | 'hoursOfOperationId'
  Prelude.Text ->
  UpdateQueueHoursOfOperation
newUpdateQueueHoursOfOperation :: Text -> Text -> Text -> UpdateQueueHoursOfOperation
newUpdateQueueHoursOfOperation
  Text
pInstanceId_
  Text
pQueueId_
  Text
pHoursOfOperationId_ =
    UpdateQueueHoursOfOperation' :: Text -> Text -> Text -> UpdateQueueHoursOfOperation
UpdateQueueHoursOfOperation'
      { $sel:instanceId:UpdateQueueHoursOfOperation' :: Text
instanceId =
          Text
pInstanceId_,
        $sel:queueId:UpdateQueueHoursOfOperation' :: Text
queueId = Text
pQueueId_,
        $sel:hoursOfOperationId:UpdateQueueHoursOfOperation' :: Text
hoursOfOperationId = Text
pHoursOfOperationId_
      }

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

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

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

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

instance Prelude.Hashable UpdateQueueHoursOfOperation

instance Prelude.NFData UpdateQueueHoursOfOperation

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

instance Core.ToPath UpdateQueueHoursOfOperation where
  toPath :: UpdateQueueHoursOfOperation -> ByteString
toPath UpdateQueueHoursOfOperation' {Text
hoursOfOperationId :: Text
queueId :: Text
instanceId :: Text
$sel:hoursOfOperationId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
$sel:queueId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
$sel:instanceId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> 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
"/hours-of-operation"
      ]

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

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

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

instance
  Prelude.NFData
    UpdateQueueHoursOfOperationResponse