{-# 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.SageMaker.DeleteMonitoringSchedule
-- 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 a monitoring schedule. Also stops the schedule had not already
-- been stopped. This does not delete the job execution history of the
-- monitoring schedule.
module Amazonka.SageMaker.DeleteMonitoringSchedule
  ( -- * Creating a Request
    DeleteMonitoringSchedule (..),
    newDeleteMonitoringSchedule,

    -- * Request Lenses
    deleteMonitoringSchedule_monitoringScheduleName,

    -- * Destructuring the Response
    DeleteMonitoringScheduleResponse (..),
    newDeleteMonitoringScheduleResponse,
  )
where

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
import Amazonka.SageMaker.Types

-- | /See:/ 'newDeleteMonitoringSchedule' smart constructor.
data DeleteMonitoringSchedule = DeleteMonitoringSchedule'
  { -- | The name of the monitoring schedule to delete.
    DeleteMonitoringSchedule -> Text
monitoringScheduleName :: Prelude.Text
  }
  deriving (DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool
(DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool)
-> (DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool)
-> Eq DeleteMonitoringSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool
$c/= :: DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool
== :: DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool
$c== :: DeleteMonitoringSchedule -> DeleteMonitoringSchedule -> Bool
Prelude.Eq, ReadPrec [DeleteMonitoringSchedule]
ReadPrec DeleteMonitoringSchedule
Int -> ReadS DeleteMonitoringSchedule
ReadS [DeleteMonitoringSchedule]
(Int -> ReadS DeleteMonitoringSchedule)
-> ReadS [DeleteMonitoringSchedule]
-> ReadPrec DeleteMonitoringSchedule
-> ReadPrec [DeleteMonitoringSchedule]
-> Read DeleteMonitoringSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMonitoringSchedule]
$creadListPrec :: ReadPrec [DeleteMonitoringSchedule]
readPrec :: ReadPrec DeleteMonitoringSchedule
$creadPrec :: ReadPrec DeleteMonitoringSchedule
readList :: ReadS [DeleteMonitoringSchedule]
$creadList :: ReadS [DeleteMonitoringSchedule]
readsPrec :: Int -> ReadS DeleteMonitoringSchedule
$creadsPrec :: Int -> ReadS DeleteMonitoringSchedule
Prelude.Read, Int -> DeleteMonitoringSchedule -> ShowS
[DeleteMonitoringSchedule] -> ShowS
DeleteMonitoringSchedule -> String
(Int -> DeleteMonitoringSchedule -> ShowS)
-> (DeleteMonitoringSchedule -> String)
-> ([DeleteMonitoringSchedule] -> ShowS)
-> Show DeleteMonitoringSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMonitoringSchedule] -> ShowS
$cshowList :: [DeleteMonitoringSchedule] -> ShowS
show :: DeleteMonitoringSchedule -> String
$cshow :: DeleteMonitoringSchedule -> String
showsPrec :: Int -> DeleteMonitoringSchedule -> ShowS
$cshowsPrec :: Int -> DeleteMonitoringSchedule -> ShowS
Prelude.Show, (forall x.
 DeleteMonitoringSchedule -> Rep DeleteMonitoringSchedule x)
-> (forall x.
    Rep DeleteMonitoringSchedule x -> DeleteMonitoringSchedule)
-> Generic DeleteMonitoringSchedule
forall x.
Rep DeleteMonitoringSchedule x -> DeleteMonitoringSchedule
forall x.
DeleteMonitoringSchedule -> Rep DeleteMonitoringSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteMonitoringSchedule x -> DeleteMonitoringSchedule
$cfrom :: forall x.
DeleteMonitoringSchedule -> Rep DeleteMonitoringSchedule x
Prelude.Generic)

-- |
-- Create a value of 'DeleteMonitoringSchedule' 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:
--
-- 'monitoringScheduleName', 'deleteMonitoringSchedule_monitoringScheduleName' - The name of the monitoring schedule to delete.
newDeleteMonitoringSchedule ::
  -- | 'monitoringScheduleName'
  Prelude.Text ->
  DeleteMonitoringSchedule
newDeleteMonitoringSchedule :: Text -> DeleteMonitoringSchedule
newDeleteMonitoringSchedule Text
pMonitoringScheduleName_ =
  DeleteMonitoringSchedule' :: Text -> DeleteMonitoringSchedule
DeleteMonitoringSchedule'
    { $sel:monitoringScheduleName:DeleteMonitoringSchedule' :: Text
monitoringScheduleName =
        Text
pMonitoringScheduleName_
    }

-- | The name of the monitoring schedule to delete.
deleteMonitoringSchedule_monitoringScheduleName :: Lens.Lens' DeleteMonitoringSchedule Prelude.Text
deleteMonitoringSchedule_monitoringScheduleName :: (Text -> f Text)
-> DeleteMonitoringSchedule -> f DeleteMonitoringSchedule
deleteMonitoringSchedule_monitoringScheduleName = (DeleteMonitoringSchedule -> Text)
-> (DeleteMonitoringSchedule -> Text -> DeleteMonitoringSchedule)
-> Lens DeleteMonitoringSchedule DeleteMonitoringSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMonitoringSchedule' {Text
monitoringScheduleName :: Text
$sel:monitoringScheduleName:DeleteMonitoringSchedule' :: DeleteMonitoringSchedule -> Text
monitoringScheduleName} -> Text
monitoringScheduleName) (\s :: DeleteMonitoringSchedule
s@DeleteMonitoringSchedule' {} Text
a -> DeleteMonitoringSchedule
s {$sel:monitoringScheduleName:DeleteMonitoringSchedule' :: Text
monitoringScheduleName = Text
a} :: DeleteMonitoringSchedule)

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

instance Prelude.Hashable DeleteMonitoringSchedule

instance Prelude.NFData DeleteMonitoringSchedule

instance Core.ToHeaders DeleteMonitoringSchedule where
  toHeaders :: DeleteMonitoringSchedule -> [Header]
toHeaders =
    [Header] -> DeleteMonitoringSchedule -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SageMaker.DeleteMonitoringSchedule" ::
                          Prelude.ByteString
                      ),
            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 DeleteMonitoringSchedule where
  toJSON :: DeleteMonitoringSchedule -> Value
toJSON DeleteMonitoringSchedule' {Text
monitoringScheduleName :: Text
$sel:monitoringScheduleName:DeleteMonitoringSchedule' :: DeleteMonitoringSchedule -> 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
"MonitoringScheduleName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
monitoringScheduleName
              )
          ]
      )

instance Core.ToPath DeleteMonitoringSchedule where
  toPath :: DeleteMonitoringSchedule -> ByteString
toPath = ByteString -> DeleteMonitoringSchedule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

instance
  Prelude.NFData
    DeleteMonitoringScheduleResponse