{-# 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.DeleteHoursOfOperation
-- 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)
--
-- Deletes an hours of operation.
module Amazonka.Connect.DeleteHoursOfOperation
  ( -- * Creating a Request
    DeleteHoursOfOperation (..),
    newDeleteHoursOfOperation,

    -- * Request Lenses
    deleteHoursOfOperation_instanceId,
    deleteHoursOfOperation_hoursOfOperationId,

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

-- |
-- Create a value of 'DeleteHoursOfOperation' 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', 'deleteHoursOfOperation_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'hoursOfOperationId', 'deleteHoursOfOperation_hoursOfOperationId' - The identifier for the hours of operation.
newDeleteHoursOfOperation ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'hoursOfOperationId'
  Prelude.Text ->
  DeleteHoursOfOperation
newDeleteHoursOfOperation :: Text -> Text -> DeleteHoursOfOperation
newDeleteHoursOfOperation
  Text
pInstanceId_
  Text
pHoursOfOperationId_ =
    DeleteHoursOfOperation' :: Text -> Text -> DeleteHoursOfOperation
DeleteHoursOfOperation'
      { $sel:instanceId:DeleteHoursOfOperation' :: Text
instanceId = Text
pInstanceId_,
        $sel:hoursOfOperationId:DeleteHoursOfOperation' :: Text
hoursOfOperationId = Text
pHoursOfOperationId_
      }

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

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

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

instance Prelude.Hashable DeleteHoursOfOperation

instance Prelude.NFData DeleteHoursOfOperation

instance Core.ToHeaders DeleteHoursOfOperation where
  toHeaders :: DeleteHoursOfOperation -> [Header]
toHeaders =
    [Header] -> DeleteHoursOfOperation -> [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.ToPath DeleteHoursOfOperation where
  toPath :: DeleteHoursOfOperation -> ByteString
toPath DeleteHoursOfOperation' {Text
hoursOfOperationId :: Text
instanceId :: Text
$sel:hoursOfOperationId:DeleteHoursOfOperation' :: DeleteHoursOfOperation -> Text
$sel:instanceId:DeleteHoursOfOperation' :: DeleteHoursOfOperation -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/hours-of-operations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
hoursOfOperationId
      ]

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

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

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

instance
  Prelude.NFData
    DeleteHoursOfOperationResponse