{-# 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.ImageBuilder.DeleteImagePipeline
-- 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)
--
-- Deletes an image pipeline.
module Amazonka.ImageBuilder.DeleteImagePipeline
  ( -- * Creating a Request
    DeleteImagePipeline (..),
    newDeleteImagePipeline,

    -- * Request Lenses
    deleteImagePipeline_imagePipelineArn,

    -- * Destructuring the Response
    DeleteImagePipelineResponse (..),
    newDeleteImagePipelineResponse,

    -- * Response Lenses
    deleteImagePipelineResponse_requestId,
    deleteImagePipelineResponse_imagePipelineArn,
    deleteImagePipelineResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

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

-- |
-- Create a value of 'DeleteImagePipeline' 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:
--
-- 'imagePipelineArn', 'deleteImagePipeline_imagePipelineArn' - The Amazon Resource Name (ARN) of the image pipeline to delete.
newDeleteImagePipeline ::
  -- | 'imagePipelineArn'
  Prelude.Text ->
  DeleteImagePipeline
newDeleteImagePipeline :: Text -> DeleteImagePipeline
newDeleteImagePipeline Text
pImagePipelineArn_ =
  DeleteImagePipeline' :: Text -> DeleteImagePipeline
DeleteImagePipeline'
    { $sel:imagePipelineArn:DeleteImagePipeline' :: Text
imagePipelineArn =
        Text
pImagePipelineArn_
    }

-- | The Amazon Resource Name (ARN) of the image pipeline to delete.
deleteImagePipeline_imagePipelineArn :: Lens.Lens' DeleteImagePipeline Prelude.Text
deleteImagePipeline_imagePipelineArn :: (Text -> f Text) -> DeleteImagePipeline -> f DeleteImagePipeline
deleteImagePipeline_imagePipelineArn = (DeleteImagePipeline -> Text)
-> (DeleteImagePipeline -> Text -> DeleteImagePipeline)
-> Lens DeleteImagePipeline DeleteImagePipeline Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImagePipeline' {Text
imagePipelineArn :: Text
$sel:imagePipelineArn:DeleteImagePipeline' :: DeleteImagePipeline -> Text
imagePipelineArn} -> Text
imagePipelineArn) (\s :: DeleteImagePipeline
s@DeleteImagePipeline' {} Text
a -> DeleteImagePipeline
s {$sel:imagePipelineArn:DeleteImagePipeline' :: Text
imagePipelineArn = Text
a} :: DeleteImagePipeline)

instance Core.AWSRequest DeleteImagePipeline where
  type
    AWSResponse DeleteImagePipeline =
      DeleteImagePipelineResponse
  request :: DeleteImagePipeline -> Request DeleteImagePipeline
request = Service -> DeleteImagePipeline -> Request DeleteImagePipeline
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteImagePipeline
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteImagePipeline)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DeleteImagePipeline))
-> Logger
-> Service
-> Proxy DeleteImagePipeline
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteImagePipeline)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> DeleteImagePipelineResponse
DeleteImagePipelineResponse'
            (Maybe Text -> Maybe Text -> Int -> DeleteImagePipelineResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> DeleteImagePipelineResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"requestId")
            Either String (Maybe Text -> Int -> DeleteImagePipelineResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteImagePipelineResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"imagePipelineArn")
            Either String (Int -> DeleteImagePipelineResponse)
-> Either String Int -> Either String DeleteImagePipelineResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteImagePipeline

instance Prelude.NFData DeleteImagePipeline

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

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

instance Core.ToQuery DeleteImagePipeline where
  toQuery :: DeleteImagePipeline -> QueryString
toQuery DeleteImagePipeline' {Text
imagePipelineArn :: Text
$sel:imagePipelineArn:DeleteImagePipeline' :: DeleteImagePipeline -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"imagePipelineArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
imagePipelineArn]

-- | /See:/ 'newDeleteImagePipelineResponse' smart constructor.
data DeleteImagePipelineResponse = DeleteImagePipelineResponse'
  { -- | The request ID that uniquely identifies this request.
    DeleteImagePipelineResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the image pipeline that was deleted.
    DeleteImagePipelineResponse -> Maybe Text
imagePipelineArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DeleteImagePipelineResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteImagePipelineResponse -> DeleteImagePipelineResponse -> Bool
(DeleteImagePipelineResponse
 -> DeleteImagePipelineResponse -> Bool)
-> (DeleteImagePipelineResponse
    -> DeleteImagePipelineResponse -> Bool)
-> Eq DeleteImagePipelineResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteImagePipelineResponse -> DeleteImagePipelineResponse -> Bool
$c/= :: DeleteImagePipelineResponse -> DeleteImagePipelineResponse -> Bool
== :: DeleteImagePipelineResponse -> DeleteImagePipelineResponse -> Bool
$c== :: DeleteImagePipelineResponse -> DeleteImagePipelineResponse -> Bool
Prelude.Eq, ReadPrec [DeleteImagePipelineResponse]
ReadPrec DeleteImagePipelineResponse
Int -> ReadS DeleteImagePipelineResponse
ReadS [DeleteImagePipelineResponse]
(Int -> ReadS DeleteImagePipelineResponse)
-> ReadS [DeleteImagePipelineResponse]
-> ReadPrec DeleteImagePipelineResponse
-> ReadPrec [DeleteImagePipelineResponse]
-> Read DeleteImagePipelineResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteImagePipelineResponse]
$creadListPrec :: ReadPrec [DeleteImagePipelineResponse]
readPrec :: ReadPrec DeleteImagePipelineResponse
$creadPrec :: ReadPrec DeleteImagePipelineResponse
readList :: ReadS [DeleteImagePipelineResponse]
$creadList :: ReadS [DeleteImagePipelineResponse]
readsPrec :: Int -> ReadS DeleteImagePipelineResponse
$creadsPrec :: Int -> ReadS DeleteImagePipelineResponse
Prelude.Read, Int -> DeleteImagePipelineResponse -> ShowS
[DeleteImagePipelineResponse] -> ShowS
DeleteImagePipelineResponse -> String
(Int -> DeleteImagePipelineResponse -> ShowS)
-> (DeleteImagePipelineResponse -> String)
-> ([DeleteImagePipelineResponse] -> ShowS)
-> Show DeleteImagePipelineResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteImagePipelineResponse] -> ShowS
$cshowList :: [DeleteImagePipelineResponse] -> ShowS
show :: DeleteImagePipelineResponse -> String
$cshow :: DeleteImagePipelineResponse -> String
showsPrec :: Int -> DeleteImagePipelineResponse -> ShowS
$cshowsPrec :: Int -> DeleteImagePipelineResponse -> ShowS
Prelude.Show, (forall x.
 DeleteImagePipelineResponse -> Rep DeleteImagePipelineResponse x)
-> (forall x.
    Rep DeleteImagePipelineResponse x -> DeleteImagePipelineResponse)
-> Generic DeleteImagePipelineResponse
forall x.
Rep DeleteImagePipelineResponse x -> DeleteImagePipelineResponse
forall x.
DeleteImagePipelineResponse -> Rep DeleteImagePipelineResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteImagePipelineResponse x -> DeleteImagePipelineResponse
$cfrom :: forall x.
DeleteImagePipelineResponse -> Rep DeleteImagePipelineResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteImagePipelineResponse' 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:
--
-- 'requestId', 'deleteImagePipelineResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'imagePipelineArn', 'deleteImagePipelineResponse_imagePipelineArn' - The Amazon Resource Name (ARN) of the image pipeline that was deleted.
--
-- 'httpStatus', 'deleteImagePipelineResponse_httpStatus' - The response's http status code.
newDeleteImagePipelineResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteImagePipelineResponse
newDeleteImagePipelineResponse :: Int -> DeleteImagePipelineResponse
newDeleteImagePipelineResponse Int
pHttpStatus_ =
  DeleteImagePipelineResponse' :: Maybe Text -> Maybe Text -> Int -> DeleteImagePipelineResponse
DeleteImagePipelineResponse'
    { $sel:requestId:DeleteImagePipelineResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imagePipelineArn:DeleteImagePipelineResponse' :: Maybe Text
imagePipelineArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DeleteImagePipelineResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The request ID that uniquely identifies this request.
deleteImagePipelineResponse_requestId :: Lens.Lens' DeleteImagePipelineResponse (Prelude.Maybe Prelude.Text)
deleteImagePipelineResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteImagePipelineResponse -> f DeleteImagePipelineResponse
deleteImagePipelineResponse_requestId = (DeleteImagePipelineResponse -> Maybe Text)
-> (DeleteImagePipelineResponse
    -> Maybe Text -> DeleteImagePipelineResponse)
-> Lens
     DeleteImagePipelineResponse
     DeleteImagePipelineResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImagePipelineResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteImagePipelineResponse' :: DeleteImagePipelineResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteImagePipelineResponse
s@DeleteImagePipelineResponse' {} Maybe Text
a -> DeleteImagePipelineResponse
s {$sel:requestId:DeleteImagePipelineResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteImagePipelineResponse)

-- | The Amazon Resource Name (ARN) of the image pipeline that was deleted.
deleteImagePipelineResponse_imagePipelineArn :: Lens.Lens' DeleteImagePipelineResponse (Prelude.Maybe Prelude.Text)
deleteImagePipelineResponse_imagePipelineArn :: (Maybe Text -> f (Maybe Text))
-> DeleteImagePipelineResponse -> f DeleteImagePipelineResponse
deleteImagePipelineResponse_imagePipelineArn = (DeleteImagePipelineResponse -> Maybe Text)
-> (DeleteImagePipelineResponse
    -> Maybe Text -> DeleteImagePipelineResponse)
-> Lens
     DeleteImagePipelineResponse
     DeleteImagePipelineResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteImagePipelineResponse' {Maybe Text
imagePipelineArn :: Maybe Text
$sel:imagePipelineArn:DeleteImagePipelineResponse' :: DeleteImagePipelineResponse -> Maybe Text
imagePipelineArn} -> Maybe Text
imagePipelineArn) (\s :: DeleteImagePipelineResponse
s@DeleteImagePipelineResponse' {} Maybe Text
a -> DeleteImagePipelineResponse
s {$sel:imagePipelineArn:DeleteImagePipelineResponse' :: Maybe Text
imagePipelineArn = Maybe Text
a} :: DeleteImagePipelineResponse)

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

instance Prelude.NFData DeleteImagePipelineResponse