{-# 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 #-}
module Amazonka.MediaLive.TransferInputDevice
(
TransferInputDevice' (..),
newTransferInputDevice',
transferInputDevice'_targetCustomerId,
transferInputDevice'_targetRegion,
transferInputDevice'_transferMessage,
transferInputDevice'_inputDeviceId,
TransferInputDeviceResponse (..),
newTransferInputDeviceResponse,
transferInputDeviceResponse_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
data TransferInputDevice' = TransferInputDevice''
{
TransferInputDevice' -> Maybe Text
targetCustomerId :: Prelude.Maybe Prelude.Text,
TransferInputDevice' -> Maybe Text
targetRegion :: Prelude.Maybe Prelude.Text,
TransferInputDevice' -> Maybe Text
transferMessage :: Prelude.Maybe Prelude.Text,
TransferInputDevice' -> Text
inputDeviceId :: Prelude.Text
}
deriving (TransferInputDevice' -> TransferInputDevice' -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferInputDevice' -> TransferInputDevice' -> Bool
$c/= :: TransferInputDevice' -> TransferInputDevice' -> Bool
== :: TransferInputDevice' -> TransferInputDevice' -> Bool
$c== :: TransferInputDevice' -> TransferInputDevice' -> Bool
Prelude.Eq, ReadPrec [TransferInputDevice']
ReadPrec TransferInputDevice'
Int -> ReadS TransferInputDevice'
ReadS [TransferInputDevice']
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferInputDevice']
$creadListPrec :: ReadPrec [TransferInputDevice']
readPrec :: ReadPrec TransferInputDevice'
$creadPrec :: ReadPrec TransferInputDevice'
readList :: ReadS [TransferInputDevice']
$creadList :: ReadS [TransferInputDevice']
readsPrec :: Int -> ReadS TransferInputDevice'
$creadsPrec :: Int -> ReadS TransferInputDevice'
Prelude.Read, Int -> TransferInputDevice' -> ShowS
[TransferInputDevice'] -> ShowS
TransferInputDevice' -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferInputDevice'] -> ShowS
$cshowList :: [TransferInputDevice'] -> ShowS
show :: TransferInputDevice' -> String
$cshow :: TransferInputDevice' -> String
showsPrec :: Int -> TransferInputDevice' -> ShowS
$cshowsPrec :: Int -> TransferInputDevice' -> ShowS
Prelude.Show, forall x. Rep TransferInputDevice' x -> TransferInputDevice'
forall x. TransferInputDevice' -> Rep TransferInputDevice' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransferInputDevice' x -> TransferInputDevice'
$cfrom :: forall x. TransferInputDevice' -> Rep TransferInputDevice' x
Prelude.Generic)
newTransferInputDevice' ::
Prelude.Text ->
TransferInputDevice'
newTransferInputDevice' :: Text -> TransferInputDevice'
newTransferInputDevice' Text
pInputDeviceId_ =
TransferInputDevice''
{ $sel:targetCustomerId:TransferInputDevice'' :: Maybe Text
targetCustomerId =
forall a. Maybe a
Prelude.Nothing,
$sel:targetRegion:TransferInputDevice'' :: Maybe Text
targetRegion = forall a. Maybe a
Prelude.Nothing,
$sel:transferMessage:TransferInputDevice'' :: Maybe Text
transferMessage = forall a. Maybe a
Prelude.Nothing,
$sel:inputDeviceId:TransferInputDevice'' :: Text
inputDeviceId = Text
pInputDeviceId_
}
transferInputDevice'_targetCustomerId :: Lens.Lens' TransferInputDevice' (Prelude.Maybe Prelude.Text)
transferInputDevice'_targetCustomerId :: Lens' TransferInputDevice' (Maybe Text)
transferInputDevice'_targetCustomerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferInputDevice'' {Maybe Text
targetCustomerId :: Maybe Text
$sel:targetCustomerId:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
targetCustomerId} -> Maybe Text
targetCustomerId) (\s :: TransferInputDevice'
s@TransferInputDevice'' {} Maybe Text
a -> TransferInputDevice'
s {$sel:targetCustomerId:TransferInputDevice'' :: Maybe Text
targetCustomerId = Maybe Text
a} :: TransferInputDevice')
transferInputDevice'_targetRegion :: Lens.Lens' TransferInputDevice' (Prelude.Maybe Prelude.Text)
transferInputDevice'_targetRegion :: Lens' TransferInputDevice' (Maybe Text)
transferInputDevice'_targetRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferInputDevice'' {Maybe Text
targetRegion :: Maybe Text
$sel:targetRegion:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
targetRegion} -> Maybe Text
targetRegion) (\s :: TransferInputDevice'
s@TransferInputDevice'' {} Maybe Text
a -> TransferInputDevice'
s {$sel:targetRegion:TransferInputDevice'' :: Maybe Text
targetRegion = Maybe Text
a} :: TransferInputDevice')
transferInputDevice'_transferMessage :: Lens.Lens' TransferInputDevice' (Prelude.Maybe Prelude.Text)
transferInputDevice'_transferMessage :: Lens' TransferInputDevice' (Maybe Text)
transferInputDevice'_transferMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferInputDevice'' {Maybe Text
transferMessage :: Maybe Text
$sel:transferMessage:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
transferMessage} -> Maybe Text
transferMessage) (\s :: TransferInputDevice'
s@TransferInputDevice'' {} Maybe Text
a -> TransferInputDevice'
s {$sel:transferMessage:TransferInputDevice'' :: Maybe Text
transferMessage = Maybe Text
a} :: TransferInputDevice')
transferInputDevice'_inputDeviceId :: Lens.Lens' TransferInputDevice' Prelude.Text
transferInputDevice'_inputDeviceId :: Lens' TransferInputDevice' Text
transferInputDevice'_inputDeviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferInputDevice'' {Text
inputDeviceId :: Text
$sel:inputDeviceId:TransferInputDevice'' :: TransferInputDevice' -> Text
inputDeviceId} -> Text
inputDeviceId) (\s :: TransferInputDevice'
s@TransferInputDevice'' {} Text
a -> TransferInputDevice'
s {$sel:inputDeviceId:TransferInputDevice'' :: Text
inputDeviceId = Text
a} :: TransferInputDevice')
instance Core.AWSRequest TransferInputDevice' where
type
AWSResponse TransferInputDevice' =
TransferInputDeviceResponse
request :: (Service -> Service)
-> TransferInputDevice' -> Request TransferInputDevice'
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 TransferInputDevice'
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TransferInputDevice')))
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 -> TransferInputDeviceResponse
TransferInputDeviceResponse'
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 TransferInputDevice' where
hashWithSalt :: Int -> TransferInputDevice' -> Int
hashWithSalt Int
_salt TransferInputDevice'' {Maybe Text
Text
inputDeviceId :: Text
transferMessage :: Maybe Text
targetRegion :: Maybe Text
targetCustomerId :: Maybe Text
$sel:inputDeviceId:TransferInputDevice'' :: TransferInputDevice' -> Text
$sel:transferMessage:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetRegion:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetCustomerId:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetCustomerId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetRegion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transferMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
inputDeviceId
instance Prelude.NFData TransferInputDevice' where
rnf :: TransferInputDevice' -> ()
rnf TransferInputDevice'' {Maybe Text
Text
inputDeviceId :: Text
transferMessage :: Maybe Text
targetRegion :: Maybe Text
targetCustomerId :: Maybe Text
$sel:inputDeviceId:TransferInputDevice'' :: TransferInputDevice' -> Text
$sel:transferMessage:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetRegion:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetCustomerId:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetCustomerId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetRegion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transferMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
inputDeviceId
instance Data.ToHeaders TransferInputDevice' where
toHeaders :: TransferInputDevice' -> 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 TransferInputDevice' where
toJSON :: TransferInputDevice' -> Value
toJSON TransferInputDevice'' {Maybe Text
Text
inputDeviceId :: Text
transferMessage :: Maybe Text
targetRegion :: Maybe Text
targetCustomerId :: Maybe Text
$sel:inputDeviceId:TransferInputDevice'' :: TransferInputDevice' -> Text
$sel:transferMessage:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetRegion:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetCustomerId:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"targetCustomerId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
targetCustomerId,
(Key
"targetRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
targetRegion,
(Key
"transferMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
transferMessage
]
)
instance Data.ToPath TransferInputDevice' where
toPath :: TransferInputDevice' -> ByteString
toPath TransferInputDevice'' {Maybe Text
Text
inputDeviceId :: Text
transferMessage :: Maybe Text
targetRegion :: Maybe Text
targetCustomerId :: Maybe Text
$sel:inputDeviceId:TransferInputDevice'' :: TransferInputDevice' -> Text
$sel:transferMessage:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetRegion:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
$sel:targetCustomerId:TransferInputDevice'' :: TransferInputDevice' -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/prod/inputDevices/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
inputDeviceId,
ByteString
"/transfer"
]
instance Data.ToQuery TransferInputDevice' where
toQuery :: TransferInputDevice' -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data TransferInputDeviceResponse = TransferInputDeviceResponse'
{
TransferInputDeviceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (TransferInputDeviceResponse -> TransferInputDeviceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferInputDeviceResponse -> TransferInputDeviceResponse -> Bool
$c/= :: TransferInputDeviceResponse -> TransferInputDeviceResponse -> Bool
== :: TransferInputDeviceResponse -> TransferInputDeviceResponse -> Bool
$c== :: TransferInputDeviceResponse -> TransferInputDeviceResponse -> Bool
Prelude.Eq, ReadPrec [TransferInputDeviceResponse]
ReadPrec TransferInputDeviceResponse
Int -> ReadS TransferInputDeviceResponse
ReadS [TransferInputDeviceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferInputDeviceResponse]
$creadListPrec :: ReadPrec [TransferInputDeviceResponse]
readPrec :: ReadPrec TransferInputDeviceResponse
$creadPrec :: ReadPrec TransferInputDeviceResponse
readList :: ReadS [TransferInputDeviceResponse]
$creadList :: ReadS [TransferInputDeviceResponse]
readsPrec :: Int -> ReadS TransferInputDeviceResponse
$creadsPrec :: Int -> ReadS TransferInputDeviceResponse
Prelude.Read, Int -> TransferInputDeviceResponse -> ShowS
[TransferInputDeviceResponse] -> ShowS
TransferInputDeviceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferInputDeviceResponse] -> ShowS
$cshowList :: [TransferInputDeviceResponse] -> ShowS
show :: TransferInputDeviceResponse -> String
$cshow :: TransferInputDeviceResponse -> String
showsPrec :: Int -> TransferInputDeviceResponse -> ShowS
$cshowsPrec :: Int -> TransferInputDeviceResponse -> ShowS
Prelude.Show, forall x.
Rep TransferInputDeviceResponse x -> TransferInputDeviceResponse
forall x.
TransferInputDeviceResponse -> Rep TransferInputDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TransferInputDeviceResponse x -> TransferInputDeviceResponse
$cfrom :: forall x.
TransferInputDeviceResponse -> Rep TransferInputDeviceResponse x
Prelude.Generic)
newTransferInputDeviceResponse ::
Prelude.Int ->
TransferInputDeviceResponse
newTransferInputDeviceResponse :: Int -> TransferInputDeviceResponse
newTransferInputDeviceResponse Int
pHttpStatus_ =
TransferInputDeviceResponse'
{ $sel:httpStatus:TransferInputDeviceResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
transferInputDeviceResponse_httpStatus :: Lens.Lens' TransferInputDeviceResponse Prelude.Int
transferInputDeviceResponse_httpStatus :: Lens' TransferInputDeviceResponse Int
transferInputDeviceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferInputDeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:TransferInputDeviceResponse' :: TransferInputDeviceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TransferInputDeviceResponse
s@TransferInputDeviceResponse' {} Int
a -> TransferInputDeviceResponse
s {$sel:httpStatus:TransferInputDeviceResponse' :: Int
httpStatus = Int
a} :: TransferInputDeviceResponse)
instance Prelude.NFData TransferInputDeviceResponse where
rnf :: TransferInputDeviceResponse -> ()
rnf TransferInputDeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:TransferInputDeviceResponse' :: TransferInputDeviceResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus