{-# 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.RejectInputDeviceTransfer
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Reject the transfer of the specified input device to your AWS account.
module Amazonka.MediaLive.RejectInputDeviceTransfer
  ( -- * Creating a Request
    RejectInputDeviceTransfer (..),
    newRejectInputDeviceTransfer,

    -- * Request Lenses
    rejectInputDeviceTransfer_inputDeviceId,

    -- * Destructuring the Response
    RejectInputDeviceTransferResponse (..),
    newRejectInputDeviceTransferResponse,

    -- * Response Lenses
    rejectInputDeviceTransferResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 RejectInputDeviceTransferRequest
--
-- /See:/ 'newRejectInputDeviceTransfer' smart constructor.
data RejectInputDeviceTransfer = RejectInputDeviceTransfer'
  { -- | The unique ID of the input device to reject. For example,
    -- hd-123456789abcdef.
    RejectInputDeviceTransfer -> Text
inputDeviceId :: Prelude.Text
  }
  deriving (RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool
$c/= :: RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool
== :: RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool
$c== :: RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool
Prelude.Eq, ReadPrec [RejectInputDeviceTransfer]
ReadPrec RejectInputDeviceTransfer
Int -> ReadS RejectInputDeviceTransfer
ReadS [RejectInputDeviceTransfer]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectInputDeviceTransfer]
$creadListPrec :: ReadPrec [RejectInputDeviceTransfer]
readPrec :: ReadPrec RejectInputDeviceTransfer
$creadPrec :: ReadPrec RejectInputDeviceTransfer
readList :: ReadS [RejectInputDeviceTransfer]
$creadList :: ReadS [RejectInputDeviceTransfer]
readsPrec :: Int -> ReadS RejectInputDeviceTransfer
$creadsPrec :: Int -> ReadS RejectInputDeviceTransfer
Prelude.Read, Int -> RejectInputDeviceTransfer -> ShowS
[RejectInputDeviceTransfer] -> ShowS
RejectInputDeviceTransfer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectInputDeviceTransfer] -> ShowS
$cshowList :: [RejectInputDeviceTransfer] -> ShowS
show :: RejectInputDeviceTransfer -> String
$cshow :: RejectInputDeviceTransfer -> String
showsPrec :: Int -> RejectInputDeviceTransfer -> ShowS
$cshowsPrec :: Int -> RejectInputDeviceTransfer -> ShowS
Prelude.Show, forall x.
Rep RejectInputDeviceTransfer x -> RejectInputDeviceTransfer
forall x.
RejectInputDeviceTransfer -> Rep RejectInputDeviceTransfer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectInputDeviceTransfer x -> RejectInputDeviceTransfer
$cfrom :: forall x.
RejectInputDeviceTransfer -> Rep RejectInputDeviceTransfer x
Prelude.Generic)

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

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

instance Core.AWSRequest RejectInputDeviceTransfer where
  type
    AWSResponse RejectInputDeviceTransfer =
      RejectInputDeviceTransferResponse
  request :: (Service -> Service)
-> RejectInputDeviceTransfer -> Request RejectInputDeviceTransfer
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 RejectInputDeviceTransfer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RejectInputDeviceTransfer)))
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 -> RejectInputDeviceTransferResponse
RejectInputDeviceTransferResponse'
            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 RejectInputDeviceTransfer where
  hashWithSalt :: Int -> RejectInputDeviceTransfer -> Int
hashWithSalt Int
_salt RejectInputDeviceTransfer' {Text
inputDeviceId :: Text
$sel:inputDeviceId:RejectInputDeviceTransfer' :: RejectInputDeviceTransfer -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
inputDeviceId

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

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

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

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

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

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

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

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