{-# 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.StopInferenceRecommendationsJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Stops an Inference Recommender job.
module Amazonka.SageMaker.StopInferenceRecommendationsJob
  ( -- * Creating a Request
    StopInferenceRecommendationsJob (..),
    newStopInferenceRecommendationsJob,

    -- * Request Lenses
    stopInferenceRecommendationsJob_jobName,

    -- * Destructuring the Response
    StopInferenceRecommendationsJobResponse (..),
    newStopInferenceRecommendationsJobResponse,
  )
where

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

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

-- |
-- Create a value of 'StopInferenceRecommendationsJob' 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:
--
-- 'jobName', 'stopInferenceRecommendationsJob_jobName' - The name of the job you want to stop.
newStopInferenceRecommendationsJob ::
  -- | 'jobName'
  Prelude.Text ->
  StopInferenceRecommendationsJob
newStopInferenceRecommendationsJob :: Text -> StopInferenceRecommendationsJob
newStopInferenceRecommendationsJob Text
pJobName_ =
  StopInferenceRecommendationsJob'
    { $sel:jobName:StopInferenceRecommendationsJob' :: Text
jobName =
        Text
pJobName_
    }

-- | The name of the job you want to stop.
stopInferenceRecommendationsJob_jobName :: Lens.Lens' StopInferenceRecommendationsJob Prelude.Text
stopInferenceRecommendationsJob_jobName :: Lens' StopInferenceRecommendationsJob Text
stopInferenceRecommendationsJob_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopInferenceRecommendationsJob' {Text
jobName :: Text
$sel:jobName:StopInferenceRecommendationsJob' :: StopInferenceRecommendationsJob -> Text
jobName} -> Text
jobName) (\s :: StopInferenceRecommendationsJob
s@StopInferenceRecommendationsJob' {} Text
a -> StopInferenceRecommendationsJob
s {$sel:jobName:StopInferenceRecommendationsJob' :: Text
jobName = Text
a} :: StopInferenceRecommendationsJob)

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

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

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

instance
  Data.ToHeaders
    StopInferenceRecommendationsJob
  where
  toHeaders :: StopInferenceRecommendationsJob -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"SageMaker.StopInferenceRecommendationsJob" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON StopInferenceRecommendationsJob where
  toJSON :: StopInferenceRecommendationsJob -> Value
toJSON StopInferenceRecommendationsJob' {Text
jobName :: Text
$sel:jobName:StopInferenceRecommendationsJob' :: StopInferenceRecommendationsJob -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"JobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobName)]
      )

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

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

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

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

instance
  Prelude.NFData
    StopInferenceRecommendationsJobResponse
  where
  rnf :: StopInferenceRecommendationsJobResponse -> ()
rnf StopInferenceRecommendationsJobResponse
_ = ()