{-# 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.MediaLive.DeleteInput
-- 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 the input end point
module Amazonka.MediaLive.DeleteInput
  ( -- * Creating a Request
    DeleteInput (..),
    newDeleteInput,

    -- * Request Lenses
    deleteInput_inputId,

    -- * Destructuring the Response
    DeleteInputResponse (..),
    newDeleteInputResponse,

    -- * Response Lenses
    deleteInputResponse_httpStatus,
  )
where

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

-- | Placeholder documentation for DeleteInputRequest
--
-- /See:/ 'newDeleteInput' smart constructor.
data DeleteInput = DeleteInput'
  { -- | Unique ID of the input
    DeleteInput -> Text
inputId :: Prelude.Text
  }
  deriving (DeleteInput -> DeleteInput -> Bool
(DeleteInput -> DeleteInput -> Bool)
-> (DeleteInput -> DeleteInput -> Bool) -> Eq DeleteInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInput -> DeleteInput -> Bool
$c/= :: DeleteInput -> DeleteInput -> Bool
== :: DeleteInput -> DeleteInput -> Bool
$c== :: DeleteInput -> DeleteInput -> Bool
Prelude.Eq, ReadPrec [DeleteInput]
ReadPrec DeleteInput
Int -> ReadS DeleteInput
ReadS [DeleteInput]
(Int -> ReadS DeleteInput)
-> ReadS [DeleteInput]
-> ReadPrec DeleteInput
-> ReadPrec [DeleteInput]
-> Read DeleteInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInput]
$creadListPrec :: ReadPrec [DeleteInput]
readPrec :: ReadPrec DeleteInput
$creadPrec :: ReadPrec DeleteInput
readList :: ReadS [DeleteInput]
$creadList :: ReadS [DeleteInput]
readsPrec :: Int -> ReadS DeleteInput
$creadsPrec :: Int -> ReadS DeleteInput
Prelude.Read, Int -> DeleteInput -> ShowS
[DeleteInput] -> ShowS
DeleteInput -> String
(Int -> DeleteInput -> ShowS)
-> (DeleteInput -> String)
-> ([DeleteInput] -> ShowS)
-> Show DeleteInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInput] -> ShowS
$cshowList :: [DeleteInput] -> ShowS
show :: DeleteInput -> String
$cshow :: DeleteInput -> String
showsPrec :: Int -> DeleteInput -> ShowS
$cshowsPrec :: Int -> DeleteInput -> ShowS
Prelude.Show, (forall x. DeleteInput -> Rep DeleteInput x)
-> (forall x. Rep DeleteInput x -> DeleteInput)
-> Generic DeleteInput
forall x. Rep DeleteInput x -> DeleteInput
forall x. DeleteInput -> Rep DeleteInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteInput x -> DeleteInput
$cfrom :: forall x. DeleteInput -> Rep DeleteInput x
Prelude.Generic)

-- |
-- Create a value of 'DeleteInput' 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:
--
-- 'inputId', 'deleteInput_inputId' - Unique ID of the input
newDeleteInput ::
  -- | 'inputId'
  Prelude.Text ->
  DeleteInput
newDeleteInput :: Text -> DeleteInput
newDeleteInput Text
pInputId_ =
  DeleteInput' :: Text -> DeleteInput
DeleteInput' {$sel:inputId:DeleteInput' :: Text
inputId = Text
pInputId_}

-- | Unique ID of the input
deleteInput_inputId :: Lens.Lens' DeleteInput Prelude.Text
deleteInput_inputId :: (Text -> f Text) -> DeleteInput -> f DeleteInput
deleteInput_inputId = (DeleteInput -> Text)
-> (DeleteInput -> Text -> DeleteInput)
-> Lens DeleteInput DeleteInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInput' {Text
inputId :: Text
$sel:inputId:DeleteInput' :: DeleteInput -> Text
inputId} -> Text
inputId) (\s :: DeleteInput
s@DeleteInput' {} Text
a -> DeleteInput
s {$sel:inputId:DeleteInput' :: Text
inputId = Text
a} :: DeleteInput)

instance Core.AWSRequest DeleteInput where
  type AWSResponse DeleteInput = DeleteInputResponse
  request :: DeleteInput -> Request DeleteInput
request = Service -> DeleteInput -> Request DeleteInput
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteInput
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteInput)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteInput))
-> Logger
-> Service
-> Proxy DeleteInput
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteInput)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteInputResponse
DeleteInputResponse'
            (Int -> DeleteInputResponse)
-> Either String Int -> Either String DeleteInputResponse
forall (f :: * -> *) a b. Functor 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 DeleteInput

instance Prelude.NFData DeleteInput

instance Core.ToHeaders DeleteInput where
  toHeaders :: DeleteInput -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteInput -> 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 DeleteInput where
  toPath :: DeleteInput -> ByteString
toPath DeleteInput' {Text
inputId :: Text
$sel:inputId:DeleteInput' :: DeleteInput -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/prod/inputs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
inputId]

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

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

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

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

instance Prelude.NFData DeleteInputResponse