{-# 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.MediaLive.DeleteSchedule
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Delete all schedule actions on a channel.
module Amazonka.MediaLive.DeleteSchedule
  ( -- * Creating a Request
    DeleteSchedule (..),
    newDeleteSchedule,

    -- * Request Lenses
    deleteSchedule_channelId,

    -- * Destructuring the Response
    DeleteScheduleResponse (..),
    newDeleteScheduleResponse,

    -- * Response Lenses
    deleteScheduleResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Placeholder documentation for DeleteScheduleRequest
--
-- /See:/ 'newDeleteSchedule' smart constructor.
data DeleteSchedule = DeleteSchedule'
  { -- | Id of the channel whose schedule is being deleted.
    DeleteSchedule -> Text
channelId :: Prelude.Text
  }
  deriving (DeleteSchedule -> DeleteSchedule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSchedule -> DeleteSchedule -> Bool
$c/= :: DeleteSchedule -> DeleteSchedule -> Bool
== :: DeleteSchedule -> DeleteSchedule -> Bool
$c== :: DeleteSchedule -> DeleteSchedule -> Bool
Prelude.Eq, ReadPrec [DeleteSchedule]
ReadPrec DeleteSchedule
Int -> ReadS DeleteSchedule
ReadS [DeleteSchedule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSchedule]
$creadListPrec :: ReadPrec [DeleteSchedule]
readPrec :: ReadPrec DeleteSchedule
$creadPrec :: ReadPrec DeleteSchedule
readList :: ReadS [DeleteSchedule]
$creadList :: ReadS [DeleteSchedule]
readsPrec :: Int -> ReadS DeleteSchedule
$creadsPrec :: Int -> ReadS DeleteSchedule
Prelude.Read, Int -> DeleteSchedule -> ShowS
[DeleteSchedule] -> ShowS
DeleteSchedule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSchedule] -> ShowS
$cshowList :: [DeleteSchedule] -> ShowS
show :: DeleteSchedule -> String
$cshow :: DeleteSchedule -> String
showsPrec :: Int -> DeleteSchedule -> ShowS
$cshowsPrec :: Int -> DeleteSchedule -> ShowS
Prelude.Show, forall x. Rep DeleteSchedule x -> DeleteSchedule
forall x. DeleteSchedule -> Rep DeleteSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSchedule x -> DeleteSchedule
$cfrom :: forall x. DeleteSchedule -> Rep DeleteSchedule x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSchedule' 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:
--
-- 'channelId', 'deleteSchedule_channelId' - Id of the channel whose schedule is being deleted.
newDeleteSchedule ::
  -- | 'channelId'
  Prelude.Text ->
  DeleteSchedule
newDeleteSchedule :: Text -> DeleteSchedule
newDeleteSchedule Text
pChannelId_ =
  DeleteSchedule' {$sel:channelId:DeleteSchedule' :: Text
channelId = Text
pChannelId_}

-- | Id of the channel whose schedule is being deleted.
deleteSchedule_channelId :: Lens.Lens' DeleteSchedule Prelude.Text
deleteSchedule_channelId :: Lens' DeleteSchedule Text
deleteSchedule_channelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSchedule' {Text
channelId :: Text
$sel:channelId:DeleteSchedule' :: DeleteSchedule -> Text
channelId} -> Text
channelId) (\s :: DeleteSchedule
s@DeleteSchedule' {} Text
a -> DeleteSchedule
s {$sel:channelId:DeleteSchedule' :: Text
channelId = Text
a} :: DeleteSchedule)

instance Core.AWSRequest DeleteSchedule where
  type
    AWSResponse DeleteSchedule =
      DeleteScheduleResponse
  request :: (Service -> Service) -> DeleteSchedule -> Request DeleteSchedule
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteSchedule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSchedule)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteScheduleResponse
DeleteScheduleResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteSchedule where
  hashWithSalt :: Int -> DeleteSchedule -> Int
hashWithSalt Int
_salt DeleteSchedule' {Text
channelId :: Text
$sel:channelId:DeleteSchedule' :: DeleteSchedule -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelId

instance Prelude.NFData DeleteSchedule where
  rnf :: DeleteSchedule -> ()
rnf DeleteSchedule' {Text
channelId :: Text
$sel:channelId:DeleteSchedule' :: DeleteSchedule -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
channelId

instance Data.ToHeaders DeleteSchedule where
  toHeaders :: DeleteSchedule -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeleteSchedule where
  toPath :: DeleteSchedule -> ByteString
toPath DeleteSchedule' {Text
channelId :: Text
$sel:channelId:DeleteSchedule' :: DeleteSchedule -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/prod/channels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelId, ByteString
"/schedule"]

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

-- | Placeholder documentation for DeleteScheduleResponse
--
-- /See:/ 'newDeleteScheduleResponse' smart constructor.
data DeleteScheduleResponse = DeleteScheduleResponse'
  { -- | The response's http status code.
    DeleteScheduleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteScheduleResponse -> DeleteScheduleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteScheduleResponse -> DeleteScheduleResponse -> Bool
$c/= :: DeleteScheduleResponse -> DeleteScheduleResponse -> Bool
== :: DeleteScheduleResponse -> DeleteScheduleResponse -> Bool
$c== :: DeleteScheduleResponse -> DeleteScheduleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteScheduleResponse]
ReadPrec DeleteScheduleResponse
Int -> ReadS DeleteScheduleResponse
ReadS [DeleteScheduleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteScheduleResponse]
$creadListPrec :: ReadPrec [DeleteScheduleResponse]
readPrec :: ReadPrec DeleteScheduleResponse
$creadPrec :: ReadPrec DeleteScheduleResponse
readList :: ReadS [DeleteScheduleResponse]
$creadList :: ReadS [DeleteScheduleResponse]
readsPrec :: Int -> ReadS DeleteScheduleResponse
$creadsPrec :: Int -> ReadS DeleteScheduleResponse
Prelude.Read, Int -> DeleteScheduleResponse -> ShowS
[DeleteScheduleResponse] -> ShowS
DeleteScheduleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteScheduleResponse] -> ShowS
$cshowList :: [DeleteScheduleResponse] -> ShowS
show :: DeleteScheduleResponse -> String
$cshow :: DeleteScheduleResponse -> String
showsPrec :: Int -> DeleteScheduleResponse -> ShowS
$cshowsPrec :: Int -> DeleteScheduleResponse -> ShowS
Prelude.Show, forall x. Rep DeleteScheduleResponse x -> DeleteScheduleResponse
forall x. DeleteScheduleResponse -> Rep DeleteScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteScheduleResponse x -> DeleteScheduleResponse
$cfrom :: forall x. DeleteScheduleResponse -> Rep DeleteScheduleResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteScheduleResponse' 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:
--
-- 'httpStatus', 'deleteScheduleResponse_httpStatus' - The response's http status code.
newDeleteScheduleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteScheduleResponse
newDeleteScheduleResponse :: Int -> DeleteScheduleResponse
newDeleteScheduleResponse Int
pHttpStatus_ =
  DeleteScheduleResponse' {$sel:httpStatus:DeleteScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData DeleteScheduleResponse where
  rnf :: DeleteScheduleResponse -> ()
rnf DeleteScheduleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteScheduleResponse' :: DeleteScheduleResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus