{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.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:/ '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
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]
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
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.
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'
      { $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 :: Lens' UpdateQueueHoursOfOperation Text
updateQueueHoursOfOperation_instanceId = 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 :: Lens' UpdateQueueHoursOfOperation Text
updateQueueHoursOfOperation_queueId = 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 :: Lens' UpdateQueueHoursOfOperation Text
updateQueueHoursOfOperation_hoursOfOperationId = 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 :: (Service -> Service)
-> UpdateQueueHoursOfOperation
-> Request UpdateQueueHoursOfOperation
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 UpdateQueueHoursOfOperation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateQueueHoursOfOperation)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      UpdateQueueHoursOfOperationResponse
UpdateQueueHoursOfOperationResponse'

instance Prelude.Hashable UpdateQueueHoursOfOperation where
  hashWithSalt :: Int -> UpdateQueueHoursOfOperation -> Int
hashWithSalt Int
_salt UpdateQueueHoursOfOperation' {Text
hoursOfOperationId :: Text
queueId :: Text
instanceId :: Text
$sel:hoursOfOperationId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
$sel:queueId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
$sel:instanceId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
queueId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hoursOfOperationId

instance Prelude.NFData UpdateQueueHoursOfOperation where
  rnf :: UpdateQueueHoursOfOperation -> ()
rnf UpdateQueueHoursOfOperation' {Text
hoursOfOperationId :: Text
queueId :: Text
instanceId :: Text
$sel:hoursOfOperationId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
$sel:queueId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> Text
$sel:instanceId:UpdateQueueHoursOfOperation' :: UpdateQueueHoursOfOperation -> 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
queueId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
hoursOfOperationId

instance Data.ToHeaders UpdateQueueHoursOfOperation where
  toHeaders :: UpdateQueueHoursOfOperation -> [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 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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"HoursOfOperationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hoursOfOperationId)
          ]
      )

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/queues/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId,
        ByteString
"/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
queueId,
        ByteString
"/hours-of-operation"
      ]

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

-- | /See:/ 'newUpdateQueueHoursOfOperationResponse' smart constructor.
data UpdateQueueHoursOfOperationResponse = UpdateQueueHoursOfOperationResponse'
  {
  }
  deriving (UpdateQueueHoursOfOperationResponse
-> UpdateQueueHoursOfOperationResponse -> Bool
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]
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
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.
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
  where
  rnf :: UpdateQueueHoursOfOperationResponse -> ()
rnf UpdateQueueHoursOfOperationResponse
_ = ()