{-# 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.MediaConvert.GetJobTemplate
(
GetJobTemplate (..),
newGetJobTemplate,
getJobTemplate_name,
GetJobTemplateResponse (..),
newGetJobTemplateResponse,
getJobTemplateResponse_jobTemplate,
getJobTemplateResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetJobTemplate = GetJobTemplate'
{
GetJobTemplate -> Text
name :: Prelude.Text
}
deriving (GetJobTemplate -> GetJobTemplate -> Bool
(GetJobTemplate -> GetJobTemplate -> Bool)
-> (GetJobTemplate -> GetJobTemplate -> Bool) -> Eq GetJobTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetJobTemplate -> GetJobTemplate -> Bool
$c/= :: GetJobTemplate -> GetJobTemplate -> Bool
== :: GetJobTemplate -> GetJobTemplate -> Bool
$c== :: GetJobTemplate -> GetJobTemplate -> Bool
Prelude.Eq, ReadPrec [GetJobTemplate]
ReadPrec GetJobTemplate
Int -> ReadS GetJobTemplate
ReadS [GetJobTemplate]
(Int -> ReadS GetJobTemplate)
-> ReadS [GetJobTemplate]
-> ReadPrec GetJobTemplate
-> ReadPrec [GetJobTemplate]
-> Read GetJobTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetJobTemplate]
$creadListPrec :: ReadPrec [GetJobTemplate]
readPrec :: ReadPrec GetJobTemplate
$creadPrec :: ReadPrec GetJobTemplate
readList :: ReadS [GetJobTemplate]
$creadList :: ReadS [GetJobTemplate]
readsPrec :: Int -> ReadS GetJobTemplate
$creadsPrec :: Int -> ReadS GetJobTemplate
Prelude.Read, Int -> GetJobTemplate -> ShowS
[GetJobTemplate] -> ShowS
GetJobTemplate -> String
(Int -> GetJobTemplate -> ShowS)
-> (GetJobTemplate -> String)
-> ([GetJobTemplate] -> ShowS)
-> Show GetJobTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetJobTemplate] -> ShowS
$cshowList :: [GetJobTemplate] -> ShowS
show :: GetJobTemplate -> String
$cshow :: GetJobTemplate -> String
showsPrec :: Int -> GetJobTemplate -> ShowS
$cshowsPrec :: Int -> GetJobTemplate -> ShowS
Prelude.Show, (forall x. GetJobTemplate -> Rep GetJobTemplate x)
-> (forall x. Rep GetJobTemplate x -> GetJobTemplate)
-> Generic GetJobTemplate
forall x. Rep GetJobTemplate x -> GetJobTemplate
forall x. GetJobTemplate -> Rep GetJobTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetJobTemplate x -> GetJobTemplate
$cfrom :: forall x. GetJobTemplate -> Rep GetJobTemplate x
Prelude.Generic)
newGetJobTemplate ::
Prelude.Text ->
GetJobTemplate
newGetJobTemplate :: Text -> GetJobTemplate
newGetJobTemplate Text
pName_ =
GetJobTemplate' :: Text -> GetJobTemplate
GetJobTemplate' {$sel:name:GetJobTemplate' :: Text
name = Text
pName_}
getJobTemplate_name :: Lens.Lens' GetJobTemplate Prelude.Text
getJobTemplate_name :: (Text -> f Text) -> GetJobTemplate -> f GetJobTemplate
getJobTemplate_name = (GetJobTemplate -> Text)
-> (GetJobTemplate -> Text -> GetJobTemplate)
-> Lens GetJobTemplate GetJobTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobTemplate' {Text
name :: Text
$sel:name:GetJobTemplate' :: GetJobTemplate -> Text
name} -> Text
name) (\s :: GetJobTemplate
s@GetJobTemplate' {} Text
a -> GetJobTemplate
s {$sel:name:GetJobTemplate' :: Text
name = Text
a} :: GetJobTemplate)
instance Core.AWSRequest GetJobTemplate where
type
AWSResponse GetJobTemplate =
GetJobTemplateResponse
request :: GetJobTemplate -> Request GetJobTemplate
request = Service -> GetJobTemplate -> Request GetJobTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetJobTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetJobTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetJobTemplate))
-> Logger
-> Service
-> Proxy GetJobTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetJobTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe JobTemplate -> Int -> GetJobTemplateResponse
GetJobTemplateResponse'
(Maybe JobTemplate -> Int -> GetJobTemplateResponse)
-> Either String (Maybe JobTemplate)
-> Either String (Int -> GetJobTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe JobTemplate)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jobTemplate")
Either String (Int -> GetJobTemplateResponse)
-> Either String Int -> Either String GetJobTemplateResponse
forall (f :: * -> *) a b. Applicative f => 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 GetJobTemplate
instance Prelude.NFData GetJobTemplate
instance Core.ToHeaders GetJobTemplate where
toHeaders :: GetJobTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetJobTemplate -> 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.ToPath GetJobTemplate where
toPath :: GetJobTemplate -> ByteString
toPath GetJobTemplate' {Text
name :: Text
$sel:name:GetJobTemplate' :: GetJobTemplate -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2017-08-29/jobTemplates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name]
instance Core.ToQuery GetJobTemplate where
toQuery :: GetJobTemplate -> QueryString
toQuery = QueryString -> GetJobTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetJobTemplateResponse = GetJobTemplateResponse'
{
GetJobTemplateResponse -> Maybe JobTemplate
jobTemplate :: Prelude.Maybe JobTemplate,
GetJobTemplateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetJobTemplateResponse -> GetJobTemplateResponse -> Bool
(GetJobTemplateResponse -> GetJobTemplateResponse -> Bool)
-> (GetJobTemplateResponse -> GetJobTemplateResponse -> Bool)
-> Eq GetJobTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetJobTemplateResponse -> GetJobTemplateResponse -> Bool
$c/= :: GetJobTemplateResponse -> GetJobTemplateResponse -> Bool
== :: GetJobTemplateResponse -> GetJobTemplateResponse -> Bool
$c== :: GetJobTemplateResponse -> GetJobTemplateResponse -> Bool
Prelude.Eq, ReadPrec [GetJobTemplateResponse]
ReadPrec GetJobTemplateResponse
Int -> ReadS GetJobTemplateResponse
ReadS [GetJobTemplateResponse]
(Int -> ReadS GetJobTemplateResponse)
-> ReadS [GetJobTemplateResponse]
-> ReadPrec GetJobTemplateResponse
-> ReadPrec [GetJobTemplateResponse]
-> Read GetJobTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetJobTemplateResponse]
$creadListPrec :: ReadPrec [GetJobTemplateResponse]
readPrec :: ReadPrec GetJobTemplateResponse
$creadPrec :: ReadPrec GetJobTemplateResponse
readList :: ReadS [GetJobTemplateResponse]
$creadList :: ReadS [GetJobTemplateResponse]
readsPrec :: Int -> ReadS GetJobTemplateResponse
$creadsPrec :: Int -> ReadS GetJobTemplateResponse
Prelude.Read, Int -> GetJobTemplateResponse -> ShowS
[GetJobTemplateResponse] -> ShowS
GetJobTemplateResponse -> String
(Int -> GetJobTemplateResponse -> ShowS)
-> (GetJobTemplateResponse -> String)
-> ([GetJobTemplateResponse] -> ShowS)
-> Show GetJobTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetJobTemplateResponse] -> ShowS
$cshowList :: [GetJobTemplateResponse] -> ShowS
show :: GetJobTemplateResponse -> String
$cshow :: GetJobTemplateResponse -> String
showsPrec :: Int -> GetJobTemplateResponse -> ShowS
$cshowsPrec :: Int -> GetJobTemplateResponse -> ShowS
Prelude.Show, (forall x. GetJobTemplateResponse -> Rep GetJobTemplateResponse x)
-> (forall x.
Rep GetJobTemplateResponse x -> GetJobTemplateResponse)
-> Generic GetJobTemplateResponse
forall x. Rep GetJobTemplateResponse x -> GetJobTemplateResponse
forall x. GetJobTemplateResponse -> Rep GetJobTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetJobTemplateResponse x -> GetJobTemplateResponse
$cfrom :: forall x. GetJobTemplateResponse -> Rep GetJobTemplateResponse x
Prelude.Generic)
newGetJobTemplateResponse ::
Prelude.Int ->
GetJobTemplateResponse
newGetJobTemplateResponse :: Int -> GetJobTemplateResponse
newGetJobTemplateResponse Int
pHttpStatus_ =
GetJobTemplateResponse' :: Maybe JobTemplate -> Int -> GetJobTemplateResponse
GetJobTemplateResponse'
{ $sel:jobTemplate:GetJobTemplateResponse' :: Maybe JobTemplate
jobTemplate =
Maybe JobTemplate
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetJobTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getJobTemplateResponse_jobTemplate :: Lens.Lens' GetJobTemplateResponse (Prelude.Maybe JobTemplate)
getJobTemplateResponse_jobTemplate :: (Maybe JobTemplate -> f (Maybe JobTemplate))
-> GetJobTemplateResponse -> f GetJobTemplateResponse
getJobTemplateResponse_jobTemplate = (GetJobTemplateResponse -> Maybe JobTemplate)
-> (GetJobTemplateResponse
-> Maybe JobTemplate -> GetJobTemplateResponse)
-> Lens
GetJobTemplateResponse
GetJobTemplateResponse
(Maybe JobTemplate)
(Maybe JobTemplate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobTemplateResponse' {Maybe JobTemplate
jobTemplate :: Maybe JobTemplate
$sel:jobTemplate:GetJobTemplateResponse' :: GetJobTemplateResponse -> Maybe JobTemplate
jobTemplate} -> Maybe JobTemplate
jobTemplate) (\s :: GetJobTemplateResponse
s@GetJobTemplateResponse' {} Maybe JobTemplate
a -> GetJobTemplateResponse
s {$sel:jobTemplate:GetJobTemplateResponse' :: Maybe JobTemplate
jobTemplate = Maybe JobTemplate
a} :: GetJobTemplateResponse)
getJobTemplateResponse_httpStatus :: Lens.Lens' GetJobTemplateResponse Prelude.Int
getJobTemplateResponse_httpStatus :: (Int -> f Int)
-> GetJobTemplateResponse -> f GetJobTemplateResponse
getJobTemplateResponse_httpStatus = (GetJobTemplateResponse -> Int)
-> (GetJobTemplateResponse -> Int -> GetJobTemplateResponse)
-> Lens GetJobTemplateResponse GetJobTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetJobTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetJobTemplateResponse' :: GetJobTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetJobTemplateResponse
s@GetJobTemplateResponse' {} Int
a -> GetJobTemplateResponse
s {$sel:httpStatus:GetJobTemplateResponse' :: Int
httpStatus = Int
a} :: GetJobTemplateResponse)
instance Prelude.NFData GetJobTemplateResponse