{-# 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.CancelInputDeviceTransfer
-- 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)
--
-- Cancel an input device transfer that you have requested.
module Amazonka.MediaLive.CancelInputDeviceTransfer
  ( -- * Creating a Request
    CancelInputDeviceTransfer (..),
    newCancelInputDeviceTransfer,

    -- * Request Lenses
    cancelInputDeviceTransfer_inputDeviceId,

    -- * Destructuring the Response
    CancelInputDeviceTransferResponse (..),
    newCancelInputDeviceTransferResponse,

    -- * Response Lenses
    cancelInputDeviceTransferResponse_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 CancelInputDeviceTransferRequest
--
-- /See:/ 'newCancelInputDeviceTransfer' smart constructor.
data CancelInputDeviceTransfer = CancelInputDeviceTransfer'
  { -- | The unique ID of the input device to cancel. For example,
    -- hd-123456789abcdef.
    CancelInputDeviceTransfer -> Text
inputDeviceId :: Prelude.Text
  }
  deriving (CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool
(CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool)
-> (CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool)
-> Eq CancelInputDeviceTransfer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool
$c/= :: CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool
== :: CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool
$c== :: CancelInputDeviceTransfer -> CancelInputDeviceTransfer -> Bool
Prelude.Eq, ReadPrec [CancelInputDeviceTransfer]
ReadPrec CancelInputDeviceTransfer
Int -> ReadS CancelInputDeviceTransfer
ReadS [CancelInputDeviceTransfer]
(Int -> ReadS CancelInputDeviceTransfer)
-> ReadS [CancelInputDeviceTransfer]
-> ReadPrec CancelInputDeviceTransfer
-> ReadPrec [CancelInputDeviceTransfer]
-> Read CancelInputDeviceTransfer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelInputDeviceTransfer]
$creadListPrec :: ReadPrec [CancelInputDeviceTransfer]
readPrec :: ReadPrec CancelInputDeviceTransfer
$creadPrec :: ReadPrec CancelInputDeviceTransfer
readList :: ReadS [CancelInputDeviceTransfer]
$creadList :: ReadS [CancelInputDeviceTransfer]
readsPrec :: Int -> ReadS CancelInputDeviceTransfer
$creadsPrec :: Int -> ReadS CancelInputDeviceTransfer
Prelude.Read, Int -> CancelInputDeviceTransfer -> ShowS
[CancelInputDeviceTransfer] -> ShowS
CancelInputDeviceTransfer -> String
(Int -> CancelInputDeviceTransfer -> ShowS)
-> (CancelInputDeviceTransfer -> String)
-> ([CancelInputDeviceTransfer] -> ShowS)
-> Show CancelInputDeviceTransfer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelInputDeviceTransfer] -> ShowS
$cshowList :: [CancelInputDeviceTransfer] -> ShowS
show :: CancelInputDeviceTransfer -> String
$cshow :: CancelInputDeviceTransfer -> String
showsPrec :: Int -> CancelInputDeviceTransfer -> ShowS
$cshowsPrec :: Int -> CancelInputDeviceTransfer -> ShowS
Prelude.Show, (forall x.
 CancelInputDeviceTransfer -> Rep CancelInputDeviceTransfer x)
-> (forall x.
    Rep CancelInputDeviceTransfer x -> CancelInputDeviceTransfer)
-> Generic CancelInputDeviceTransfer
forall x.
Rep CancelInputDeviceTransfer x -> CancelInputDeviceTransfer
forall x.
CancelInputDeviceTransfer -> Rep CancelInputDeviceTransfer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelInputDeviceTransfer x -> CancelInputDeviceTransfer
$cfrom :: forall x.
CancelInputDeviceTransfer -> Rep CancelInputDeviceTransfer x
Prelude.Generic)

-- |
-- Create a value of 'CancelInputDeviceTransfer' 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:
--
-- 'inputDeviceId', 'cancelInputDeviceTransfer_inputDeviceId' - The unique ID of the input device to cancel. For example,
-- hd-123456789abcdef.
newCancelInputDeviceTransfer ::
  -- | 'inputDeviceId'
  Prelude.Text ->
  CancelInputDeviceTransfer
newCancelInputDeviceTransfer :: Text -> CancelInputDeviceTransfer
newCancelInputDeviceTransfer Text
pInputDeviceId_ =
  CancelInputDeviceTransfer' :: Text -> CancelInputDeviceTransfer
CancelInputDeviceTransfer'
    { $sel:inputDeviceId:CancelInputDeviceTransfer' :: Text
inputDeviceId =
        Text
pInputDeviceId_
    }

-- | The unique ID of the input device to cancel. For example,
-- hd-123456789abcdef.
cancelInputDeviceTransfer_inputDeviceId :: Lens.Lens' CancelInputDeviceTransfer Prelude.Text
cancelInputDeviceTransfer_inputDeviceId :: (Text -> f Text)
-> CancelInputDeviceTransfer -> f CancelInputDeviceTransfer
cancelInputDeviceTransfer_inputDeviceId = (CancelInputDeviceTransfer -> Text)
-> (CancelInputDeviceTransfer -> Text -> CancelInputDeviceTransfer)
-> Lens
     CancelInputDeviceTransfer CancelInputDeviceTransfer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelInputDeviceTransfer' {Text
inputDeviceId :: Text
$sel:inputDeviceId:CancelInputDeviceTransfer' :: CancelInputDeviceTransfer -> Text
inputDeviceId} -> Text
inputDeviceId) (\s :: CancelInputDeviceTransfer
s@CancelInputDeviceTransfer' {} Text
a -> CancelInputDeviceTransfer
s {$sel:inputDeviceId:CancelInputDeviceTransfer' :: Text
inputDeviceId = Text
a} :: CancelInputDeviceTransfer)

instance Core.AWSRequest CancelInputDeviceTransfer where
  type
    AWSResponse CancelInputDeviceTransfer =
      CancelInputDeviceTransferResponse
  request :: CancelInputDeviceTransfer -> Request CancelInputDeviceTransfer
request = Service
-> CancelInputDeviceTransfer -> Request CancelInputDeviceTransfer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CancelInputDeviceTransfer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CancelInputDeviceTransfer)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse CancelInputDeviceTransfer))
-> Logger
-> Service
-> Proxy CancelInputDeviceTransfer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CancelInputDeviceTransfer)))
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 -> CancelInputDeviceTransferResponse
CancelInputDeviceTransferResponse'
            (Int -> CancelInputDeviceTransferResponse)
-> Either String Int
-> Either String CancelInputDeviceTransferResponse
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 CancelInputDeviceTransfer

instance Prelude.NFData CancelInputDeviceTransfer

instance Core.ToHeaders CancelInputDeviceTransfer where
  toHeaders :: CancelInputDeviceTransfer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CancelInputDeviceTransfer -> 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.ToJSON CancelInputDeviceTransfer where
  toJSON :: CancelInputDeviceTransfer -> Value
toJSON = Value -> CancelInputDeviceTransfer -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath CancelInputDeviceTransfer where
  toPath :: CancelInputDeviceTransfer -> ByteString
toPath CancelInputDeviceTransfer' {Text
inputDeviceId :: Text
$sel:inputDeviceId:CancelInputDeviceTransfer' :: CancelInputDeviceTransfer -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/prod/inputDevices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
inputDeviceId,
        ByteString
"/cancel"
      ]

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

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

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

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

instance
  Prelude.NFData
    CancelInputDeviceTransferResponse