{-# 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-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)
--
-- 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.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 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
(RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool)
-> (RejectInputDeviceTransfer -> RejectInputDeviceTransfer -> Bool)
-> Eq RejectInputDeviceTransfer
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]
(Int -> ReadS RejectInputDeviceTransfer)
-> ReadS [RejectInputDeviceTransfer]
-> ReadPrec RejectInputDeviceTransfer
-> ReadPrec [RejectInputDeviceTransfer]
-> Read 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
(Int -> RejectInputDeviceTransfer -> ShowS)
-> (RejectInputDeviceTransfer -> String)
-> ([RejectInputDeviceTransfer] -> ShowS)
-> Show RejectInputDeviceTransfer
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.
 RejectInputDeviceTransfer -> Rep RejectInputDeviceTransfer x)
-> (forall x.
    Rep RejectInputDeviceTransfer x -> RejectInputDeviceTransfer)
-> Generic RejectInputDeviceTransfer
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' :: Text -> RejectInputDeviceTransfer
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 :: (Text -> f Text)
-> RejectInputDeviceTransfer -> f RejectInputDeviceTransfer
rejectInputDeviceTransfer_inputDeviceId = (RejectInputDeviceTransfer -> Text)
-> (RejectInputDeviceTransfer -> Text -> RejectInputDeviceTransfer)
-> Lens
     RejectInputDeviceTransfer RejectInputDeviceTransfer Text Text
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 :: RejectInputDeviceTransfer -> Request RejectInputDeviceTransfer
request = Service
-> RejectInputDeviceTransfer -> Request RejectInputDeviceTransfer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RejectInputDeviceTransfer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RejectInputDeviceTransfer)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse RejectInputDeviceTransfer))
-> Logger
-> Service
-> Proxy RejectInputDeviceTransfer
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RejectInputDeviceTransfer)))
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 -> RejectInputDeviceTransferResponse
RejectInputDeviceTransferResponse'
            (Int -> RejectInputDeviceTransferResponse)
-> Either String Int
-> Either String RejectInputDeviceTransferResponse
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 RejectInputDeviceTransfer

instance Prelude.NFData RejectInputDeviceTransfer

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

instance Core.ToPath RejectInputDeviceTransfer where
  toPath :: RejectInputDeviceTransfer -> ByteString
toPath RejectInputDeviceTransfer' {Text
inputDeviceId :: Text
$sel:inputDeviceId:RejectInputDeviceTransfer' :: RejectInputDeviceTransfer -> 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
"/reject"
      ]

instance Core.ToQuery RejectInputDeviceTransfer where
  toQuery :: RejectInputDeviceTransfer -> QueryString
toQuery = QueryString -> RejectInputDeviceTransfer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(RejectInputDeviceTransferResponse
 -> RejectInputDeviceTransferResponse -> Bool)
-> (RejectInputDeviceTransferResponse
    -> RejectInputDeviceTransferResponse -> Bool)
-> Eq RejectInputDeviceTransferResponse
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]
(Int -> ReadS RejectInputDeviceTransferResponse)
-> ReadS [RejectInputDeviceTransferResponse]
-> ReadPrec RejectInputDeviceTransferResponse
-> ReadPrec [RejectInputDeviceTransferResponse]
-> Read 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
(Int -> RejectInputDeviceTransferResponse -> ShowS)
-> (RejectInputDeviceTransferResponse -> String)
-> ([RejectInputDeviceTransferResponse] -> ShowS)
-> Show RejectInputDeviceTransferResponse
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.
 RejectInputDeviceTransferResponse
 -> Rep RejectInputDeviceTransferResponse x)
-> (forall x.
    Rep RejectInputDeviceTransferResponse x
    -> RejectInputDeviceTransferResponse)
-> Generic RejectInputDeviceTransferResponse
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' :: Int -> RejectInputDeviceTransferResponse
RejectInputDeviceTransferResponse'
    { $sel:httpStatus:RejectInputDeviceTransferResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
rejectInputDeviceTransferResponse_httpStatus :: Lens.Lens' RejectInputDeviceTransferResponse Prelude.Int
rejectInputDeviceTransferResponse_httpStatus :: (Int -> f Int)
-> RejectInputDeviceTransferResponse
-> f RejectInputDeviceTransferResponse
rejectInputDeviceTransferResponse_httpStatus = (RejectInputDeviceTransferResponse -> Int)
-> (RejectInputDeviceTransferResponse
    -> Int -> RejectInputDeviceTransferResponse)
-> Lens
     RejectInputDeviceTransferResponse
     RejectInputDeviceTransferResponse
     Int
     Int
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