{-# 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-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)
--
-- 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.Lens as Lens
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
(DeleteSchedule -> DeleteSchedule -> Bool)
-> (DeleteSchedule -> DeleteSchedule -> Bool) -> Eq DeleteSchedule
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]
(Int -> ReadS DeleteSchedule)
-> ReadS [DeleteSchedule]
-> ReadPrec DeleteSchedule
-> ReadPrec [DeleteSchedule]
-> Read 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
(Int -> DeleteSchedule -> ShowS)
-> (DeleteSchedule -> String)
-> ([DeleteSchedule] -> ShowS)
-> Show DeleteSchedule
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. DeleteSchedule -> Rep DeleteSchedule x)
-> (forall x. Rep DeleteSchedule x -> DeleteSchedule)
-> Generic DeleteSchedule
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' :: Text -> DeleteSchedule
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 :: (Text -> f Text) -> DeleteSchedule -> f DeleteSchedule
deleteSchedule_channelId = (DeleteSchedule -> Text)
-> (DeleteSchedule -> Text -> DeleteSchedule)
-> Lens DeleteSchedule DeleteSchedule Text Text
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 :: DeleteSchedule -> Request DeleteSchedule
request = Service -> DeleteSchedule -> Request DeleteSchedule
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteSchedule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSchedule)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteSchedule))
-> Logger
-> Service
-> Proxy DeleteSchedule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteSchedule)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteScheduleResponse
DeleteScheduleResponse'
            (Int -> DeleteScheduleResponse)
-> Either String Int -> Either String DeleteScheduleResponse
forall (f :: * -> *) a b. Functor 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 DeleteSchedule

instance Prelude.NFData DeleteSchedule

instance Core.ToHeaders DeleteSchedule where
  toHeaders :: DeleteSchedule -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteSchedule -> 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.ToPath DeleteSchedule where
  toPath :: DeleteSchedule -> ByteString
toPath DeleteSchedule' {Text
channelId :: Text
$sel:channelId:DeleteSchedule' :: DeleteSchedule -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/prod/channels/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelId, ByteString
"/schedule"]

instance Core.ToQuery DeleteSchedule where
  toQuery :: DeleteSchedule -> QueryString
toQuery = QueryString -> DeleteSchedule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteScheduleResponse -> DeleteScheduleResponse -> Bool)
-> (DeleteScheduleResponse -> DeleteScheduleResponse -> Bool)
-> Eq DeleteScheduleResponse
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]
(Int -> ReadS DeleteScheduleResponse)
-> ReadS [DeleteScheduleResponse]
-> ReadPrec DeleteScheduleResponse
-> ReadPrec [DeleteScheduleResponse]
-> Read 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
(Int -> DeleteScheduleResponse -> ShowS)
-> (DeleteScheduleResponse -> String)
-> ([DeleteScheduleResponse] -> ShowS)
-> Show DeleteScheduleResponse
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. DeleteScheduleResponse -> Rep DeleteScheduleResponse x)
-> (forall x.
    Rep DeleteScheduleResponse x -> DeleteScheduleResponse)
-> Generic DeleteScheduleResponse
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' :: Int -> DeleteScheduleResponse
DeleteScheduleResponse' {$sel:httpStatus:DeleteScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_}

-- | The response's http status code.
deleteScheduleResponse_httpStatus :: Lens.Lens' DeleteScheduleResponse Prelude.Int
deleteScheduleResponse_httpStatus :: (Int -> f Int)
-> DeleteScheduleResponse -> f DeleteScheduleResponse
deleteScheduleResponse_httpStatus = (DeleteScheduleResponse -> Int)
-> (DeleteScheduleResponse -> Int -> DeleteScheduleResponse)
-> Lens DeleteScheduleResponse DeleteScheduleResponse Int Int
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