{-# 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.StopMonitoringSchedule
-- 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)
--
-- Stops a previously started monitoring schedule.
module Amazonka.SageMaker.StopMonitoringSchedule
  ( -- * Creating a Request
    StopMonitoringSchedule (..),
    newStopMonitoringSchedule,

    -- * Request Lenses
    stopMonitoringSchedule_monitoringScheduleName,

    -- * Destructuring the Response
    StopMonitoringScheduleResponse (..),
    newStopMonitoringScheduleResponse,
  )
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:/ 'newStopMonitoringSchedule' smart constructor.
data StopMonitoringSchedule = StopMonitoringSchedule'
  { -- | The name of the schedule to stop.
    StopMonitoringSchedule -> Text
monitoringScheduleName :: Prelude.Text
  }
  deriving (StopMonitoringSchedule -> StopMonitoringSchedule -> Bool
(StopMonitoringSchedule -> StopMonitoringSchedule -> Bool)
-> (StopMonitoringSchedule -> StopMonitoringSchedule -> Bool)
-> Eq StopMonitoringSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopMonitoringSchedule -> StopMonitoringSchedule -> Bool
$c/= :: StopMonitoringSchedule -> StopMonitoringSchedule -> Bool
== :: StopMonitoringSchedule -> StopMonitoringSchedule -> Bool
$c== :: StopMonitoringSchedule -> StopMonitoringSchedule -> Bool
Prelude.Eq, ReadPrec [StopMonitoringSchedule]
ReadPrec StopMonitoringSchedule
Int -> ReadS StopMonitoringSchedule
ReadS [StopMonitoringSchedule]
(Int -> ReadS StopMonitoringSchedule)
-> ReadS [StopMonitoringSchedule]
-> ReadPrec StopMonitoringSchedule
-> ReadPrec [StopMonitoringSchedule]
-> Read StopMonitoringSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopMonitoringSchedule]
$creadListPrec :: ReadPrec [StopMonitoringSchedule]
readPrec :: ReadPrec StopMonitoringSchedule
$creadPrec :: ReadPrec StopMonitoringSchedule
readList :: ReadS [StopMonitoringSchedule]
$creadList :: ReadS [StopMonitoringSchedule]
readsPrec :: Int -> ReadS StopMonitoringSchedule
$creadsPrec :: Int -> ReadS StopMonitoringSchedule
Prelude.Read, Int -> StopMonitoringSchedule -> ShowS
[StopMonitoringSchedule] -> ShowS
StopMonitoringSchedule -> String
(Int -> StopMonitoringSchedule -> ShowS)
-> (StopMonitoringSchedule -> String)
-> ([StopMonitoringSchedule] -> ShowS)
-> Show StopMonitoringSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopMonitoringSchedule] -> ShowS
$cshowList :: [StopMonitoringSchedule] -> ShowS
show :: StopMonitoringSchedule -> String
$cshow :: StopMonitoringSchedule -> String
showsPrec :: Int -> StopMonitoringSchedule -> ShowS
$cshowsPrec :: Int -> StopMonitoringSchedule -> ShowS
Prelude.Show, (forall x. StopMonitoringSchedule -> Rep StopMonitoringSchedule x)
-> (forall x.
    Rep StopMonitoringSchedule x -> StopMonitoringSchedule)
-> Generic StopMonitoringSchedule
forall x. Rep StopMonitoringSchedule x -> StopMonitoringSchedule
forall x. StopMonitoringSchedule -> Rep StopMonitoringSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopMonitoringSchedule x -> StopMonitoringSchedule
$cfrom :: forall x. StopMonitoringSchedule -> Rep StopMonitoringSchedule x
Prelude.Generic)

-- |
-- Create a value of 'StopMonitoringSchedule' 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', 'stopMonitoringSchedule_monitoringScheduleName' - The name of the schedule to stop.
newStopMonitoringSchedule ::
  -- | 'monitoringScheduleName'
  Prelude.Text ->
  StopMonitoringSchedule
newStopMonitoringSchedule :: Text -> StopMonitoringSchedule
newStopMonitoringSchedule Text
pMonitoringScheduleName_ =
  StopMonitoringSchedule' :: Text -> StopMonitoringSchedule
StopMonitoringSchedule'
    { $sel:monitoringScheduleName:StopMonitoringSchedule' :: Text
monitoringScheduleName =
        Text
pMonitoringScheduleName_
    }

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

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

instance Prelude.Hashable StopMonitoringSchedule

instance Prelude.NFData StopMonitoringSchedule

instance Core.ToHeaders StopMonitoringSchedule where
  toHeaders :: StopMonitoringSchedule -> [Header]
toHeaders =
    [Header] -> StopMonitoringSchedule -> [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.StopMonitoringSchedule" ::
                          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 StopMonitoringSchedule where
  toJSON :: StopMonitoringSchedule -> Value
toJSON StopMonitoringSchedule' {Text
monitoringScheduleName :: Text
$sel:monitoringScheduleName:StopMonitoringSchedule' :: StopMonitoringSchedule -> 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 StopMonitoringSchedule where
  toPath :: StopMonitoringSchedule -> ByteString
toPath = ByteString -> StopMonitoringSchedule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

instance
  Prelude.NFData
    StopMonitoringScheduleResponse