{-# 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.StopAutoMLJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- A method for forcing the termination of a running job.
module Amazonka.SageMaker.StopAutoMLJob
  ( -- * Creating a Request
    StopAutoMLJob (..),
    newStopAutoMLJob,

    -- * Request Lenses
    stopAutoMLJob_autoMLJobName,

    -- * Destructuring the Response
    StopAutoMLJobResponse (..),
    newStopAutoMLJobResponse,
  )
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:/ 'newStopAutoMLJob' smart constructor.
data StopAutoMLJob = StopAutoMLJob'
  { -- | The name of the object you are requesting.
    StopAutoMLJob -> Text
autoMLJobName :: Prelude.Text
  }
  deriving (StopAutoMLJob -> StopAutoMLJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopAutoMLJob -> StopAutoMLJob -> Bool
$c/= :: StopAutoMLJob -> StopAutoMLJob -> Bool
== :: StopAutoMLJob -> StopAutoMLJob -> Bool
$c== :: StopAutoMLJob -> StopAutoMLJob -> Bool
Prelude.Eq, ReadPrec [StopAutoMLJob]
ReadPrec StopAutoMLJob
Int -> ReadS StopAutoMLJob
ReadS [StopAutoMLJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopAutoMLJob]
$creadListPrec :: ReadPrec [StopAutoMLJob]
readPrec :: ReadPrec StopAutoMLJob
$creadPrec :: ReadPrec StopAutoMLJob
readList :: ReadS [StopAutoMLJob]
$creadList :: ReadS [StopAutoMLJob]
readsPrec :: Int -> ReadS StopAutoMLJob
$creadsPrec :: Int -> ReadS StopAutoMLJob
Prelude.Read, Int -> StopAutoMLJob -> ShowS
[StopAutoMLJob] -> ShowS
StopAutoMLJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopAutoMLJob] -> ShowS
$cshowList :: [StopAutoMLJob] -> ShowS
show :: StopAutoMLJob -> String
$cshow :: StopAutoMLJob -> String
showsPrec :: Int -> StopAutoMLJob -> ShowS
$cshowsPrec :: Int -> StopAutoMLJob -> ShowS
Prelude.Show, forall x. Rep StopAutoMLJob x -> StopAutoMLJob
forall x. StopAutoMLJob -> Rep StopAutoMLJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopAutoMLJob x -> StopAutoMLJob
$cfrom :: forall x. StopAutoMLJob -> Rep StopAutoMLJob x
Prelude.Generic)

-- |
-- Create a value of 'StopAutoMLJob' 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:
--
-- 'autoMLJobName', 'stopAutoMLJob_autoMLJobName' - The name of the object you are requesting.
newStopAutoMLJob ::
  -- | 'autoMLJobName'
  Prelude.Text ->
  StopAutoMLJob
newStopAutoMLJob :: Text -> StopAutoMLJob
newStopAutoMLJob Text
pAutoMLJobName_ =
  StopAutoMLJob' {$sel:autoMLJobName:StopAutoMLJob' :: Text
autoMLJobName = Text
pAutoMLJobName_}

-- | The name of the object you are requesting.
stopAutoMLJob_autoMLJobName :: Lens.Lens' StopAutoMLJob Prelude.Text
stopAutoMLJob_autoMLJobName :: Lens' StopAutoMLJob Text
stopAutoMLJob_autoMLJobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAutoMLJob' {Text
autoMLJobName :: Text
$sel:autoMLJobName:StopAutoMLJob' :: StopAutoMLJob -> Text
autoMLJobName} -> Text
autoMLJobName) (\s :: StopAutoMLJob
s@StopAutoMLJob' {} Text
a -> StopAutoMLJob
s {$sel:autoMLJobName:StopAutoMLJob' :: Text
autoMLJobName = Text
a} :: StopAutoMLJob)

instance Core.AWSRequest StopAutoMLJob where
  type
    AWSResponse StopAutoMLJob =
      StopAutoMLJobResponse
  request :: (Service -> Service) -> StopAutoMLJob -> Request StopAutoMLJob
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 StopAutoMLJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopAutoMLJob)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull StopAutoMLJobResponse
StopAutoMLJobResponse'

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

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

instance Data.ToHeaders StopAutoMLJob where
  toHeaders :: StopAutoMLJob -> [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.StopAutoMLJob" :: 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 StopAutoMLJob where
  toJSON :: StopAutoMLJob -> Value
toJSON StopAutoMLJob' {Text
autoMLJobName :: Text
$sel:autoMLJobName:StopAutoMLJob' :: StopAutoMLJob -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"AutoMLJobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
autoMLJobName)
          ]
      )

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

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

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

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

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