{-# 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.UpdatePipelineNotifications
(
UpdatePipelineNotifications (..),
newUpdatePipelineNotifications,
updatePipelineNotifications_id,
updatePipelineNotifications_notifications,
UpdatePipelineNotificationsResponse (..),
newUpdatePipelineNotificationsResponse,
updatePipelineNotificationsResponse_pipeline,
updatePipelineNotificationsResponse_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 UpdatePipelineNotifications = UpdatePipelineNotifications'
{
UpdatePipelineNotifications -> Text
id :: Prelude.Text,
UpdatePipelineNotifications -> Notifications
notifications :: Notifications
}
deriving (UpdatePipelineNotifications -> UpdatePipelineNotifications -> Bool
(UpdatePipelineNotifications
-> UpdatePipelineNotifications -> Bool)
-> (UpdatePipelineNotifications
-> UpdatePipelineNotifications -> Bool)
-> Eq UpdatePipelineNotifications
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePipelineNotifications -> UpdatePipelineNotifications -> Bool
$c/= :: UpdatePipelineNotifications -> UpdatePipelineNotifications -> Bool
== :: UpdatePipelineNotifications -> UpdatePipelineNotifications -> Bool
$c== :: UpdatePipelineNotifications -> UpdatePipelineNotifications -> Bool
Prelude.Eq, ReadPrec [UpdatePipelineNotifications]
ReadPrec UpdatePipelineNotifications
Int -> ReadS UpdatePipelineNotifications
ReadS [UpdatePipelineNotifications]
(Int -> ReadS UpdatePipelineNotifications)
-> ReadS [UpdatePipelineNotifications]
-> ReadPrec UpdatePipelineNotifications
-> ReadPrec [UpdatePipelineNotifications]
-> Read UpdatePipelineNotifications
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePipelineNotifications]
$creadListPrec :: ReadPrec [UpdatePipelineNotifications]
readPrec :: ReadPrec UpdatePipelineNotifications
$creadPrec :: ReadPrec UpdatePipelineNotifications
readList :: ReadS [UpdatePipelineNotifications]
$creadList :: ReadS [UpdatePipelineNotifications]
readsPrec :: Int -> ReadS UpdatePipelineNotifications
$creadsPrec :: Int -> ReadS UpdatePipelineNotifications
Prelude.Read, Int -> UpdatePipelineNotifications -> ShowS
[UpdatePipelineNotifications] -> ShowS
UpdatePipelineNotifications -> String
(Int -> UpdatePipelineNotifications -> ShowS)
-> (UpdatePipelineNotifications -> String)
-> ([UpdatePipelineNotifications] -> ShowS)
-> Show UpdatePipelineNotifications
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePipelineNotifications] -> ShowS
$cshowList :: [UpdatePipelineNotifications] -> ShowS
show :: UpdatePipelineNotifications -> String
$cshow :: UpdatePipelineNotifications -> String
showsPrec :: Int -> UpdatePipelineNotifications -> ShowS
$cshowsPrec :: Int -> UpdatePipelineNotifications -> ShowS
Prelude.Show, (forall x.
UpdatePipelineNotifications -> Rep UpdatePipelineNotifications x)
-> (forall x.
Rep UpdatePipelineNotifications x -> UpdatePipelineNotifications)
-> Generic UpdatePipelineNotifications
forall x.
Rep UpdatePipelineNotifications x -> UpdatePipelineNotifications
forall x.
UpdatePipelineNotifications -> Rep UpdatePipelineNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePipelineNotifications x -> UpdatePipelineNotifications
$cfrom :: forall x.
UpdatePipelineNotifications -> Rep UpdatePipelineNotifications x
Prelude.Generic)
newUpdatePipelineNotifications ::
Prelude.Text ->
Notifications ->
UpdatePipelineNotifications
newUpdatePipelineNotifications :: Text -> Notifications -> UpdatePipelineNotifications
newUpdatePipelineNotifications Text
pId_ Notifications
pNotifications_ =
UpdatePipelineNotifications' :: Text -> Notifications -> UpdatePipelineNotifications
UpdatePipelineNotifications'
{ $sel:id:UpdatePipelineNotifications' :: Text
id = Text
pId_,
$sel:notifications:UpdatePipelineNotifications' :: Notifications
notifications = Notifications
pNotifications_
}
updatePipelineNotifications_id :: Lens.Lens' UpdatePipelineNotifications Prelude.Text
updatePipelineNotifications_id :: (Text -> f Text)
-> UpdatePipelineNotifications -> f UpdatePipelineNotifications
updatePipelineNotifications_id = (UpdatePipelineNotifications -> Text)
-> (UpdatePipelineNotifications
-> Text -> UpdatePipelineNotifications)
-> Lens
UpdatePipelineNotifications UpdatePipelineNotifications Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineNotifications' {Text
id :: Text
$sel:id:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Text
id} -> Text
id) (\s :: UpdatePipelineNotifications
s@UpdatePipelineNotifications' {} Text
a -> UpdatePipelineNotifications
s {$sel:id:UpdatePipelineNotifications' :: Text
id = Text
a} :: UpdatePipelineNotifications)
updatePipelineNotifications_notifications :: Lens.Lens' UpdatePipelineNotifications Notifications
updatePipelineNotifications_notifications :: (Notifications -> f Notifications)
-> UpdatePipelineNotifications -> f UpdatePipelineNotifications
updatePipelineNotifications_notifications = (UpdatePipelineNotifications -> Notifications)
-> (UpdatePipelineNotifications
-> Notifications -> UpdatePipelineNotifications)
-> Lens
UpdatePipelineNotifications
UpdatePipelineNotifications
Notifications
Notifications
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineNotifications' {Notifications
notifications :: Notifications
$sel:notifications:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Notifications
notifications} -> Notifications
notifications) (\s :: UpdatePipelineNotifications
s@UpdatePipelineNotifications' {} Notifications
a -> UpdatePipelineNotifications
s {$sel:notifications:UpdatePipelineNotifications' :: Notifications
notifications = Notifications
a} :: UpdatePipelineNotifications)
instance Core.AWSRequest UpdatePipelineNotifications where
type
AWSResponse UpdatePipelineNotifications =
UpdatePipelineNotificationsResponse
request :: UpdatePipelineNotifications -> Request UpdatePipelineNotifications
request = Service
-> UpdatePipelineNotifications
-> Request UpdatePipelineNotifications
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdatePipelineNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePipelineNotifications)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdatePipelineNotifications))
-> Logger
-> Service
-> Proxy UpdatePipelineNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePipelineNotifications)))
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 -> UpdatePipelineNotificationsResponse
UpdatePipelineNotificationsResponse'
(Maybe Pipeline -> Int -> UpdatePipelineNotificationsResponse)
-> Either String (Maybe Pipeline)
-> Either String (Int -> UpdatePipelineNotificationsResponse)
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 -> UpdatePipelineNotificationsResponse)
-> Either String Int
-> Either String UpdatePipelineNotificationsResponse
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 UpdatePipelineNotifications
instance Prelude.NFData UpdatePipelineNotifications
instance Core.ToHeaders UpdatePipelineNotifications where
toHeaders :: UpdatePipelineNotifications -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdatePipelineNotifications -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdatePipelineNotifications where
toJSON :: UpdatePipelineNotifications -> Value
toJSON UpdatePipelineNotifications' {Text
Notifications
notifications :: Notifications
id :: Text
$sel:notifications:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Notifications
$sel:id:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> 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
"Notifications" Text -> Notifications -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Notifications
notifications)
]
)
instance Core.ToPath UpdatePipelineNotifications where
toPath :: UpdatePipelineNotifications -> ByteString
toPath UpdatePipelineNotifications' {Text
Notifications
notifications :: Notifications
id :: Text
$sel:notifications:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Notifications
$sel:id:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> 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
"/notifications"
]
instance Core.ToQuery UpdatePipelineNotifications where
toQuery :: UpdatePipelineNotifications -> QueryString
toQuery = QueryString -> UpdatePipelineNotifications -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdatePipelineNotificationsResponse = UpdatePipelineNotificationsResponse'
{
UpdatePipelineNotificationsResponse -> Maybe Pipeline
pipeline :: Prelude.Maybe Pipeline,
UpdatePipelineNotificationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool
(UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool)
-> (UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool)
-> Eq UpdatePipelineNotificationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool
$c/= :: UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool
== :: UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool
$c== :: UpdatePipelineNotificationsResponse
-> UpdatePipelineNotificationsResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePipelineNotificationsResponse]
ReadPrec UpdatePipelineNotificationsResponse
Int -> ReadS UpdatePipelineNotificationsResponse
ReadS [UpdatePipelineNotificationsResponse]
(Int -> ReadS UpdatePipelineNotificationsResponse)
-> ReadS [UpdatePipelineNotificationsResponse]
-> ReadPrec UpdatePipelineNotificationsResponse
-> ReadPrec [UpdatePipelineNotificationsResponse]
-> Read UpdatePipelineNotificationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePipelineNotificationsResponse]
$creadListPrec :: ReadPrec [UpdatePipelineNotificationsResponse]
readPrec :: ReadPrec UpdatePipelineNotificationsResponse
$creadPrec :: ReadPrec UpdatePipelineNotificationsResponse
readList :: ReadS [UpdatePipelineNotificationsResponse]
$creadList :: ReadS [UpdatePipelineNotificationsResponse]
readsPrec :: Int -> ReadS UpdatePipelineNotificationsResponse
$creadsPrec :: Int -> ReadS UpdatePipelineNotificationsResponse
Prelude.Read, Int -> UpdatePipelineNotificationsResponse -> ShowS
[UpdatePipelineNotificationsResponse] -> ShowS
UpdatePipelineNotificationsResponse -> String
(Int -> UpdatePipelineNotificationsResponse -> ShowS)
-> (UpdatePipelineNotificationsResponse -> String)
-> ([UpdatePipelineNotificationsResponse] -> ShowS)
-> Show UpdatePipelineNotificationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePipelineNotificationsResponse] -> ShowS
$cshowList :: [UpdatePipelineNotificationsResponse] -> ShowS
show :: UpdatePipelineNotificationsResponse -> String
$cshow :: UpdatePipelineNotificationsResponse -> String
showsPrec :: Int -> UpdatePipelineNotificationsResponse -> ShowS
$cshowsPrec :: Int -> UpdatePipelineNotificationsResponse -> ShowS
Prelude.Show, (forall x.
UpdatePipelineNotificationsResponse
-> Rep UpdatePipelineNotificationsResponse x)
-> (forall x.
Rep UpdatePipelineNotificationsResponse x
-> UpdatePipelineNotificationsResponse)
-> Generic UpdatePipelineNotificationsResponse
forall x.
Rep UpdatePipelineNotificationsResponse x
-> UpdatePipelineNotificationsResponse
forall x.
UpdatePipelineNotificationsResponse
-> Rep UpdatePipelineNotificationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePipelineNotificationsResponse x
-> UpdatePipelineNotificationsResponse
$cfrom :: forall x.
UpdatePipelineNotificationsResponse
-> Rep UpdatePipelineNotificationsResponse x
Prelude.Generic)
newUpdatePipelineNotificationsResponse ::
Prelude.Int ->
UpdatePipelineNotificationsResponse
newUpdatePipelineNotificationsResponse :: Int -> UpdatePipelineNotificationsResponse
newUpdatePipelineNotificationsResponse Int
pHttpStatus_ =
UpdatePipelineNotificationsResponse' :: Maybe Pipeline -> Int -> UpdatePipelineNotificationsResponse
UpdatePipelineNotificationsResponse'
{ $sel:pipeline:UpdatePipelineNotificationsResponse' :: Maybe Pipeline
pipeline =
Maybe Pipeline
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdatePipelineNotificationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updatePipelineNotificationsResponse_pipeline :: Lens.Lens' UpdatePipelineNotificationsResponse (Prelude.Maybe Pipeline)
updatePipelineNotificationsResponse_pipeline :: (Maybe Pipeline -> f (Maybe Pipeline))
-> UpdatePipelineNotificationsResponse
-> f UpdatePipelineNotificationsResponse
updatePipelineNotificationsResponse_pipeline = (UpdatePipelineNotificationsResponse -> Maybe Pipeline)
-> (UpdatePipelineNotificationsResponse
-> Maybe Pipeline -> UpdatePipelineNotificationsResponse)
-> Lens
UpdatePipelineNotificationsResponse
UpdatePipelineNotificationsResponse
(Maybe Pipeline)
(Maybe Pipeline)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineNotificationsResponse' {Maybe Pipeline
pipeline :: Maybe Pipeline
$sel:pipeline:UpdatePipelineNotificationsResponse' :: UpdatePipelineNotificationsResponse -> Maybe Pipeline
pipeline} -> Maybe Pipeline
pipeline) (\s :: UpdatePipelineNotificationsResponse
s@UpdatePipelineNotificationsResponse' {} Maybe Pipeline
a -> UpdatePipelineNotificationsResponse
s {$sel:pipeline:UpdatePipelineNotificationsResponse' :: Maybe Pipeline
pipeline = Maybe Pipeline
a} :: UpdatePipelineNotificationsResponse)
updatePipelineNotificationsResponse_httpStatus :: Lens.Lens' UpdatePipelineNotificationsResponse Prelude.Int
updatePipelineNotificationsResponse_httpStatus :: (Int -> f Int)
-> UpdatePipelineNotificationsResponse
-> f UpdatePipelineNotificationsResponse
updatePipelineNotificationsResponse_httpStatus = (UpdatePipelineNotificationsResponse -> Int)
-> (UpdatePipelineNotificationsResponse
-> Int -> UpdatePipelineNotificationsResponse)
-> Lens
UpdatePipelineNotificationsResponse
UpdatePipelineNotificationsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePipelineNotificationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdatePipelineNotificationsResponse' :: UpdatePipelineNotificationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdatePipelineNotificationsResponse
s@UpdatePipelineNotificationsResponse' {} Int
a -> UpdatePipelineNotificationsResponse
s {$sel:httpStatus:UpdatePipelineNotificationsResponse' :: Int
httpStatus = Int
a} :: UpdatePipelineNotificationsResponse)
instance
Prelude.NFData
UpdatePipelineNotificationsResponse