{-# 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.SageMakerGeoSpatial.StopVectorEnrichmentJob
-- 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 the Vector Enrichment job for a given job ARN.
module Amazonka.SageMakerGeoSpatial.StopVectorEnrichmentJob
  ( -- * Creating a Request
    StopVectorEnrichmentJob (..),
    newStopVectorEnrichmentJob,

    -- * Request Lenses
    stopVectorEnrichmentJob_arn,

    -- * Destructuring the Response
    StopVectorEnrichmentJobResponse (..),
    newStopVectorEnrichmentJobResponse,

    -- * Response Lenses
    stopVectorEnrichmentJobResponse_httpStatus,
  )
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.SageMakerGeoSpatial.Types

-- | /See:/ 'newStopVectorEnrichmentJob' smart constructor.
data StopVectorEnrichmentJob = StopVectorEnrichmentJob'
  { -- | The Amazon Resource Name (ARN) of the Vector Enrichment job.
    StopVectorEnrichmentJob -> Text
arn :: Prelude.Text
  }
  deriving (StopVectorEnrichmentJob -> StopVectorEnrichmentJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopVectorEnrichmentJob -> StopVectorEnrichmentJob -> Bool
$c/= :: StopVectorEnrichmentJob -> StopVectorEnrichmentJob -> Bool
== :: StopVectorEnrichmentJob -> StopVectorEnrichmentJob -> Bool
$c== :: StopVectorEnrichmentJob -> StopVectorEnrichmentJob -> Bool
Prelude.Eq, ReadPrec [StopVectorEnrichmentJob]
ReadPrec StopVectorEnrichmentJob
Int -> ReadS StopVectorEnrichmentJob
ReadS [StopVectorEnrichmentJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopVectorEnrichmentJob]
$creadListPrec :: ReadPrec [StopVectorEnrichmentJob]
readPrec :: ReadPrec StopVectorEnrichmentJob
$creadPrec :: ReadPrec StopVectorEnrichmentJob
readList :: ReadS [StopVectorEnrichmentJob]
$creadList :: ReadS [StopVectorEnrichmentJob]
readsPrec :: Int -> ReadS StopVectorEnrichmentJob
$creadsPrec :: Int -> ReadS StopVectorEnrichmentJob
Prelude.Read, Int -> StopVectorEnrichmentJob -> ShowS
[StopVectorEnrichmentJob] -> ShowS
StopVectorEnrichmentJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopVectorEnrichmentJob] -> ShowS
$cshowList :: [StopVectorEnrichmentJob] -> ShowS
show :: StopVectorEnrichmentJob -> String
$cshow :: StopVectorEnrichmentJob -> String
showsPrec :: Int -> StopVectorEnrichmentJob -> ShowS
$cshowsPrec :: Int -> StopVectorEnrichmentJob -> ShowS
Prelude.Show, forall x. Rep StopVectorEnrichmentJob x -> StopVectorEnrichmentJob
forall x. StopVectorEnrichmentJob -> Rep StopVectorEnrichmentJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopVectorEnrichmentJob x -> StopVectorEnrichmentJob
$cfrom :: forall x. StopVectorEnrichmentJob -> Rep StopVectorEnrichmentJob x
Prelude.Generic)

-- |
-- Create a value of 'StopVectorEnrichmentJob' 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:
--
-- 'arn', 'stopVectorEnrichmentJob_arn' - The Amazon Resource Name (ARN) of the Vector Enrichment job.
newStopVectorEnrichmentJob ::
  -- | 'arn'
  Prelude.Text ->
  StopVectorEnrichmentJob
newStopVectorEnrichmentJob :: Text -> StopVectorEnrichmentJob
newStopVectorEnrichmentJob Text
pArn_ =
  StopVectorEnrichmentJob' {$sel:arn:StopVectorEnrichmentJob' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the Vector Enrichment job.
stopVectorEnrichmentJob_arn :: Lens.Lens' StopVectorEnrichmentJob Prelude.Text
stopVectorEnrichmentJob_arn :: Lens' StopVectorEnrichmentJob Text
stopVectorEnrichmentJob_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopVectorEnrichmentJob' {Text
arn :: Text
$sel:arn:StopVectorEnrichmentJob' :: StopVectorEnrichmentJob -> Text
arn} -> Text
arn) (\s :: StopVectorEnrichmentJob
s@StopVectorEnrichmentJob' {} Text
a -> StopVectorEnrichmentJob
s {$sel:arn:StopVectorEnrichmentJob' :: Text
arn = Text
a} :: StopVectorEnrichmentJob)

instance Core.AWSRequest StopVectorEnrichmentJob where
  type
    AWSResponse StopVectorEnrichmentJob =
      StopVectorEnrichmentJobResponse
  request :: (Service -> Service)
-> StopVectorEnrichmentJob -> Request StopVectorEnrichmentJob
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 StopVectorEnrichmentJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StopVectorEnrichmentJob)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> StopVectorEnrichmentJobResponse
StopVectorEnrichmentJobResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

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

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

instance Data.ToHeaders StopVectorEnrichmentJob where
  toHeaders :: StopVectorEnrichmentJob -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

instance Data.ToPath StopVectorEnrichmentJob where
  toPath :: StopVectorEnrichmentJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/vector-enrichment-jobs/stop"

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

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

-- |
-- Create a value of 'StopVectorEnrichmentJobResponse' 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:
--
-- 'httpStatus', 'stopVectorEnrichmentJobResponse_httpStatus' - The response's http status code.
newStopVectorEnrichmentJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StopVectorEnrichmentJobResponse
newStopVectorEnrichmentJobResponse :: Int -> StopVectorEnrichmentJobResponse
newStopVectorEnrichmentJobResponse Int
pHttpStatus_ =
  StopVectorEnrichmentJobResponse'
    { $sel:httpStatus:StopVectorEnrichmentJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
stopVectorEnrichmentJobResponse_httpStatus :: Lens.Lens' StopVectorEnrichmentJobResponse Prelude.Int
stopVectorEnrichmentJobResponse_httpStatus :: Lens' StopVectorEnrichmentJobResponse Int
stopVectorEnrichmentJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopVectorEnrichmentJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopVectorEnrichmentJobResponse' :: StopVectorEnrichmentJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopVectorEnrichmentJobResponse
s@StopVectorEnrichmentJobResponse' {} Int
a -> StopVectorEnrichmentJobResponse
s {$sel:httpStatus:StopVectorEnrichmentJobResponse' :: Int
httpStatus = Int
a} :: StopVectorEnrichmentJobResponse)

instance
  Prelude.NFData
    StopVectorEnrichmentJobResponse
  where
  rnf :: StopVectorEnrichmentJobResponse -> ()
rnf StopVectorEnrichmentJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopVectorEnrichmentJobResponse' :: StopVectorEnrichmentJobResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus