{-# 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.StartMonitoringSchedule
-- 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)
--
-- Starts a previously stopped monitoring schedule.
--
-- By default, when you successfully create a new schedule, the status of a
-- monitoring schedule is @scheduled@.
module Amazonka.SageMaker.StartMonitoringSchedule
  ( -- * Creating a Request
    StartMonitoringSchedule (..),
    newStartMonitoringSchedule,

    -- * Request Lenses
    startMonitoringSchedule_monitoringScheduleName,

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

-- |
-- Create a value of 'StartMonitoringSchedule' 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', 'startMonitoringSchedule_monitoringScheduleName' - The name of the schedule to start.
newStartMonitoringSchedule ::
  -- | 'monitoringScheduleName'
  Prelude.Text ->
  StartMonitoringSchedule
newStartMonitoringSchedule :: Text -> StartMonitoringSchedule
newStartMonitoringSchedule Text
pMonitoringScheduleName_ =
  StartMonitoringSchedule' :: Text -> StartMonitoringSchedule
StartMonitoringSchedule'
    { $sel:monitoringScheduleName:StartMonitoringSchedule' :: Text
monitoringScheduleName =
        Text
pMonitoringScheduleName_
    }

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

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

instance Prelude.Hashable StartMonitoringSchedule

instance Prelude.NFData StartMonitoringSchedule

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

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

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

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

instance
  Prelude.NFData
    StartMonitoringScheduleResponse