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

instance Prelude.NFData AcceptInputDeviceTransfer

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

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

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

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