{-# 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.ElasticTranscoder.UpdatePipelineStatus
(
UpdatePipelineStatus (..),
newUpdatePipelineStatus,
updatePipelineStatus_id,
updatePipelineStatus_status,
UpdatePipelineStatusResponse (..),
newUpdatePipelineStatusResponse,
updatePipelineStatusResponse_pipeline,
updatePipelineStatusResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdatePipelineStatus = UpdatePipelineStatus'
{
UpdatePipelineStatus -> Text
id :: Prelude.Text,
UpdatePipelineStatus -> Text
status :: Prelude.Text
}
deriving (UpdatePipelineStatus -> UpdatePipelineStatus -> Bool
(UpdatePipelineStatus -> UpdatePipelineStatus -> Bool)
-> (UpdatePipelineStatus -> UpdatePipelineStatus -> Bool)
-> Eq UpdatePipelineStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePipelineStatus -> UpdatePipelineStatus -> Bool
$c/= :: UpdatePipelineStatus -> UpdatePipelineStatus -> Bool
== :: UpdatePipelineStatus -> UpdatePipelineStatus -> Bool
$c== :: UpdatePipelineStatus -> UpdatePipelineStatus -> Bool
Prelude.Eq, ReadPrec [UpdatePipelineStatus]
ReadPrec UpdatePipelineStatus
Int -> ReadS UpdatePipelineStatus
ReadS [UpdatePipelineStatus]
(Int -> ReadS UpdatePipelineStatus)
-> ReadS [UpdatePipelineStatus]
-> ReadPrec UpdatePipelineStatus
-> ReadPrec [UpdatePipelineStatus]
-> Read UpdatePipelineStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePipelineStatus]
$creadListPrec :: ReadPrec [UpdatePipelineStatus]
readPrec :: ReadPrec UpdatePipelineStatus
$creadPrec :: ReadPrec UpdatePipelineStatus
readList :: ReadS [UpdatePipelineStatus]
$creadList :: ReadS [UpdatePipelineStatus]
readsPrec :: Int -> ReadS UpdatePipelineStatus
$creadsPrec :: Int -> ReadS UpdatePipelineStatus
Prelude.Read, Int -> UpdatePipelineStatus -> ShowS
[UpdatePipelineStatus] -> ShowS
UpdatePipelineStatus -> String
(Int -> UpdatePipelineStatus -> ShowS)
-> (UpdatePipelineStatus -> String)
-> ([UpdatePipelineStatus] -> ShowS)
-> Show UpdatePipelineStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePipelineStatus] -> ShowS
$cshowList :: [UpdatePipelineStatus] -> ShowS
show :: UpdatePipelineStatus -> String
$cshow :: UpdatePipelineStatus -> String
showsPrec :: Int -> UpdatePipelineStatus -> ShowS
$cshowsPrec :: Int -> UpdatePipelineStatus -> ShowS
Prelude.Show, (forall x. UpdatePipelineStatus -> Rep UpdatePipelineStatus x)
-> (forall x. Rep UpdatePipelineStatus x -> UpdatePipelineStatus)
-> Generic UpdatePipelineStatus
forall x. Rep UpdatePipelineStatus x -> UpdatePipelineStatus
forall x. UpdatePipelineStatus -> Rep UpdatePipelineStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatePipelineStatus x -> UpdatePipelineStatus
$cfrom :: forall x. UpdatePipelineStatus -> Rep UpdatePipelineStatus x
Prelude.Generic)
newUpdatePipelineStatus ::
Prelude.Text ->
Prelude.Text ->
UpdatePipelineStatus
newUpdatePipelineStatus :: Text -> Text -> UpdatePipelineStatus
newUpdatePipelineStatus Text
pId_ Text
pStatus_ =
UpdatePipelineStatus' :: Text -> Text -> UpdatePipelineStatus
UpdatePipelineStatus' {$sel:id:UpdatePipelineStatus' :: Text
id = Text
pId_, $sel:status:UpdatePipelineStatus' :: Text
status = Text
pStatus_}
updatePipelineStatus_id :: Lens.Lens' UpdatePipelineStatus Prelude.Text
updatePipelineStatus_id :: (Text -> f Text) -> UpdatePipelineStatus -> f UpdatePipelineStatus
updatePipelineStatus_id = (UpdatePipelineStatus -> Text)
-> (UpdatePipelineStatus -> Text -> UpdatePipelineStatus)
-> Lens UpdatePipelineStatus UpdatePipelineStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineStatus' {Text
id :: Text
$sel:id:UpdatePipelineStatus' :: UpdatePipelineStatus -> Text
id} -> Text
id) (\s :: UpdatePipelineStatus
s@UpdatePipelineStatus' {} Text
a -> UpdatePipelineStatus
s {$sel:id:UpdatePipelineStatus' :: Text
id = Text
a} :: UpdatePipelineStatus)
updatePipelineStatus_status :: Lens.Lens' UpdatePipelineStatus Prelude.Text
updatePipelineStatus_status :: (Text -> f Text) -> UpdatePipelineStatus -> f UpdatePipelineStatus
updatePipelineStatus_status = (UpdatePipelineStatus -> Text)
-> (UpdatePipelineStatus -> Text -> UpdatePipelineStatus)
-> Lens UpdatePipelineStatus UpdatePipelineStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineStatus' {Text
status :: Text
$sel:status:UpdatePipelineStatus' :: UpdatePipelineStatus -> Text
status} -> Text
status) (\s :: UpdatePipelineStatus
s@UpdatePipelineStatus' {} Text
a -> UpdatePipelineStatus
s {$sel:status:UpdatePipelineStatus' :: Text
status = Text
a} :: UpdatePipelineStatus)
instance Core.AWSRequest UpdatePipelineStatus where
type
AWSResponse UpdatePipelineStatus =
UpdatePipelineStatusResponse
request :: UpdatePipelineStatus -> Request UpdatePipelineStatus
request = Service -> UpdatePipelineStatus -> Request UpdatePipelineStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdatePipelineStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePipelineStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdatePipelineStatus))
-> Logger
-> Service
-> Proxy UpdatePipelineStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePipelineStatus)))
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 Pipeline -> Int -> UpdatePipelineStatusResponse
UpdatePipelineStatusResponse'
(Maybe Pipeline -> Int -> UpdatePipelineStatusResponse)
-> Either String (Maybe Pipeline)
-> Either String (Int -> UpdatePipelineStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Pipeline)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Pipeline")
Either String (Int -> UpdatePipelineStatusResponse)
-> Either String Int -> Either String UpdatePipelineStatusResponse
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 UpdatePipelineStatus
instance Prelude.NFData UpdatePipelineStatus
instance Core.ToHeaders UpdatePipelineStatus where
toHeaders :: UpdatePipelineStatus -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdatePipelineStatus -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdatePipelineStatus where
toJSON :: UpdatePipelineStatus -> Value
toJSON UpdatePipelineStatus' {Text
status :: Text
id :: Text
$sel:status:UpdatePipelineStatus' :: UpdatePipelineStatus -> Text
$sel:id:UpdatePipelineStatus' :: UpdatePipelineStatus -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
status)]
)
instance Core.ToPath UpdatePipelineStatus where
toPath :: UpdatePipelineStatus -> ByteString
toPath UpdatePipelineStatus' {Text
status :: Text
id :: Text
$sel:status:UpdatePipelineStatus' :: UpdatePipelineStatus -> Text
$sel:id:UpdatePipelineStatus' :: UpdatePipelineStatus -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2012-09-25/pipelines/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id, ByteString
"/status"]
instance Core.ToQuery UpdatePipelineStatus where
toQuery :: UpdatePipelineStatus -> QueryString
toQuery = QueryString -> UpdatePipelineStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdatePipelineStatusResponse = UpdatePipelineStatusResponse'
{
UpdatePipelineStatusResponse -> Maybe Pipeline
pipeline :: Prelude.Maybe Pipeline,
UpdatePipelineStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool
(UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool)
-> (UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool)
-> Eq UpdatePipelineStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool
$c/= :: UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool
== :: UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool
$c== :: UpdatePipelineStatusResponse
-> UpdatePipelineStatusResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePipelineStatusResponse]
ReadPrec UpdatePipelineStatusResponse
Int -> ReadS UpdatePipelineStatusResponse
ReadS [UpdatePipelineStatusResponse]
(Int -> ReadS UpdatePipelineStatusResponse)
-> ReadS [UpdatePipelineStatusResponse]
-> ReadPrec UpdatePipelineStatusResponse
-> ReadPrec [UpdatePipelineStatusResponse]
-> Read UpdatePipelineStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePipelineStatusResponse]
$creadListPrec :: ReadPrec [UpdatePipelineStatusResponse]
readPrec :: ReadPrec UpdatePipelineStatusResponse
$creadPrec :: ReadPrec UpdatePipelineStatusResponse
readList :: ReadS [UpdatePipelineStatusResponse]
$creadList :: ReadS [UpdatePipelineStatusResponse]
readsPrec :: Int -> ReadS UpdatePipelineStatusResponse
$creadsPrec :: Int -> ReadS UpdatePipelineStatusResponse
Prelude.Read, Int -> UpdatePipelineStatusResponse -> ShowS
[UpdatePipelineStatusResponse] -> ShowS
UpdatePipelineStatusResponse -> String
(Int -> UpdatePipelineStatusResponse -> ShowS)
-> (UpdatePipelineStatusResponse -> String)
-> ([UpdatePipelineStatusResponse] -> ShowS)
-> Show UpdatePipelineStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePipelineStatusResponse] -> ShowS
$cshowList :: [UpdatePipelineStatusResponse] -> ShowS
show :: UpdatePipelineStatusResponse -> String
$cshow :: UpdatePipelineStatusResponse -> String
showsPrec :: Int -> UpdatePipelineStatusResponse -> ShowS
$cshowsPrec :: Int -> UpdatePipelineStatusResponse -> ShowS
Prelude.Show, (forall x.
UpdatePipelineStatusResponse -> Rep UpdatePipelineStatusResponse x)
-> (forall x.
Rep UpdatePipelineStatusResponse x -> UpdatePipelineStatusResponse)
-> Generic UpdatePipelineStatusResponse
forall x.
Rep UpdatePipelineStatusResponse x -> UpdatePipelineStatusResponse
forall x.
UpdatePipelineStatusResponse -> Rep UpdatePipelineStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePipelineStatusResponse x -> UpdatePipelineStatusResponse
$cfrom :: forall x.
UpdatePipelineStatusResponse -> Rep UpdatePipelineStatusResponse x
Prelude.Generic)
newUpdatePipelineStatusResponse ::
Prelude.Int ->
UpdatePipelineStatusResponse
newUpdatePipelineStatusResponse :: Int -> UpdatePipelineStatusResponse
newUpdatePipelineStatusResponse Int
pHttpStatus_ =
UpdatePipelineStatusResponse' :: Maybe Pipeline -> Int -> UpdatePipelineStatusResponse
UpdatePipelineStatusResponse'
{ $sel:pipeline:UpdatePipelineStatusResponse' :: Maybe Pipeline
pipeline =
Maybe Pipeline
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdatePipelineStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updatePipelineStatusResponse_pipeline :: Lens.Lens' UpdatePipelineStatusResponse (Prelude.Maybe Pipeline)
updatePipelineStatusResponse_pipeline :: (Maybe Pipeline -> f (Maybe Pipeline))
-> UpdatePipelineStatusResponse -> f UpdatePipelineStatusResponse
updatePipelineStatusResponse_pipeline = (UpdatePipelineStatusResponse -> Maybe Pipeline)
-> (UpdatePipelineStatusResponse
-> Maybe Pipeline -> UpdatePipelineStatusResponse)
-> Lens
UpdatePipelineStatusResponse
UpdatePipelineStatusResponse
(Maybe Pipeline)
(Maybe Pipeline)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineStatusResponse' {Maybe Pipeline
pipeline :: Maybe Pipeline
$sel:pipeline:UpdatePipelineStatusResponse' :: UpdatePipelineStatusResponse -> Maybe Pipeline
pipeline} -> Maybe Pipeline
pipeline) (\s :: UpdatePipelineStatusResponse
s@UpdatePipelineStatusResponse' {} Maybe Pipeline
a -> UpdatePipelineStatusResponse
s {$sel:pipeline:UpdatePipelineStatusResponse' :: Maybe Pipeline
pipeline = Maybe Pipeline
a} :: UpdatePipelineStatusResponse)
updatePipelineStatusResponse_httpStatus :: Lens.Lens' UpdatePipelineStatusResponse Prelude.Int
updatePipelineStatusResponse_httpStatus :: (Int -> f Int)
-> UpdatePipelineStatusResponse -> f UpdatePipelineStatusResponse
updatePipelineStatusResponse_httpStatus = (UpdatePipelineStatusResponse -> Int)
-> (UpdatePipelineStatusResponse
-> Int -> UpdatePipelineStatusResponse)
-> Lens
UpdatePipelineStatusResponse UpdatePipelineStatusResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdatePipelineStatusResponse' :: UpdatePipelineStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdatePipelineStatusResponse
s@UpdatePipelineStatusResponse' {} Int
a -> UpdatePipelineStatusResponse
s {$sel:httpStatus:UpdatePipelineStatusResponse' :: Int
httpStatus = Int
a} :: UpdatePipelineStatusResponse)
instance Prelude.NFData UpdatePipelineStatusResponse