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

    -- * Request Lenses
    acceptInputDeviceTransfer_inputDeviceId,

    -- * Destructuring the Response
    AcceptInputDeviceTransferResponse (..),
    newAcceptInputDeviceTransferResponse,

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

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

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

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

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

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

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

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

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

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

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

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