{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticTranscoder.Types
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
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]
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
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.
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'
{ $sel:id:UpdatePipelineNotifications' :: Text
id = Text
pId_,
$sel:notifications:UpdatePipelineNotifications' :: Notifications
notifications = Notifications
pNotifications_
}
updatePipelineNotifications_id :: Lens.Lens' UpdatePipelineNotifications Prelude.Text
updatePipelineNotifications_id :: Lens' UpdatePipelineNotifications Text
updatePipelineNotifications_id = 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 :: Lens' UpdatePipelineNotifications Notifications
updatePipelineNotifications_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 :: (Service -> Service)
-> UpdatePipelineNotifications
-> Request UpdatePipelineNotifications
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 UpdatePipelineNotifications
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePipelineNotifications)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Pipeline -> Int -> UpdatePipelineNotificationsResponse
UpdatePipelineNotificationsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Pipeline")
forall (f :: * -> *) a b. Applicative f => 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 UpdatePipelineNotifications where
hashWithSalt :: Int -> UpdatePipelineNotifications -> Int
hashWithSalt Int
_salt UpdatePipelineNotifications' {Text
Notifications
notifications :: Notifications
id :: Text
$sel:notifications:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Notifications
$sel:id:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Notifications
notifications
instance Prelude.NFData UpdatePipelineNotifications where
rnf :: UpdatePipelineNotifications -> ()
rnf UpdatePipelineNotifications' {Text
Notifications
notifications :: Notifications
id :: Text
$sel:notifications:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Notifications
$sel:id:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Notifications
notifications
instance Data.ToHeaders UpdatePipelineNotifications where
toHeaders :: UpdatePipelineNotifications -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"Notifications" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Notifications
notifications)
]
)
instance Data.ToPath UpdatePipelineNotifications where
toPath :: UpdatePipelineNotifications -> ByteString
toPath UpdatePipelineNotifications' {Text
Notifications
notifications :: Notifications
id :: Text
$sel:notifications:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Notifications
$sel:id:UpdatePipelineNotifications' :: UpdatePipelineNotifications -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2012-09-25/pipelines/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
id,
ByteString
"/notifications"
]
instance Data.ToQuery UpdatePipelineNotifications where
toQuery :: UpdatePipelineNotifications -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:pipeline:UpdatePipelineNotificationsResponse' :: Maybe Pipeline
pipeline =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdatePipelineNotificationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updatePipelineNotificationsResponse_pipeline :: Lens.Lens' UpdatePipelineNotificationsResponse (Prelude.Maybe Pipeline)
updatePipelineNotificationsResponse_pipeline :: Lens' UpdatePipelineNotificationsResponse (Maybe Pipeline)
updatePipelineNotificationsResponse_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 :: Lens' UpdatePipelineNotificationsResponse Int
updatePipelineNotificationsResponse_httpStatus = 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
where
rnf :: UpdatePipelineNotificationsResponse -> ()
rnf UpdatePipelineNotificationsResponse' {Int
Maybe Pipeline
httpStatus :: Int
pipeline :: Maybe Pipeline
$sel:httpStatus:UpdatePipelineNotificationsResponse' :: UpdatePipelineNotificationsResponse -> Int
$sel:pipeline:UpdatePipelineNotificationsResponse' :: UpdatePipelineNotificationsResponse -> Maybe Pipeline
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Pipeline
pipeline
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus