{-# 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.UpdateQueue
(
UpdateQueue (..),
newUpdateQueue,
updateQueue_status,
updateQueue_description,
updateQueue_reservationPlanSettings,
updateQueue_name,
UpdateQueueResponse (..),
newUpdateQueueResponse,
updateQueueResponse_queue,
updateQueueResponse_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 UpdateQueue = UpdateQueue'
{
UpdateQueue -> Maybe QueueStatus
status :: Prelude.Maybe QueueStatus,
UpdateQueue -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateQueue -> Maybe ReservationPlanSettings
reservationPlanSettings :: Prelude.Maybe ReservationPlanSettings,
UpdateQueue -> Text
name :: Prelude.Text
}
deriving (UpdateQueue -> UpdateQueue -> Bool
(UpdateQueue -> UpdateQueue -> Bool)
-> (UpdateQueue -> UpdateQueue -> Bool) -> Eq UpdateQueue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateQueue -> UpdateQueue -> Bool
$c/= :: UpdateQueue -> UpdateQueue -> Bool
== :: UpdateQueue -> UpdateQueue -> Bool
$c== :: UpdateQueue -> UpdateQueue -> Bool
Prelude.Eq, ReadPrec [UpdateQueue]
ReadPrec UpdateQueue
Int -> ReadS UpdateQueue
ReadS [UpdateQueue]
(Int -> ReadS UpdateQueue)
-> ReadS [UpdateQueue]
-> ReadPrec UpdateQueue
-> ReadPrec [UpdateQueue]
-> Read UpdateQueue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateQueue]
$creadListPrec :: ReadPrec [UpdateQueue]
readPrec :: ReadPrec UpdateQueue
$creadPrec :: ReadPrec UpdateQueue
readList :: ReadS [UpdateQueue]
$creadList :: ReadS [UpdateQueue]
readsPrec :: Int -> ReadS UpdateQueue
$creadsPrec :: Int -> ReadS UpdateQueue
Prelude.Read, Int -> UpdateQueue -> ShowS
[UpdateQueue] -> ShowS
UpdateQueue -> String
(Int -> UpdateQueue -> ShowS)
-> (UpdateQueue -> String)
-> ([UpdateQueue] -> ShowS)
-> Show UpdateQueue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateQueue] -> ShowS
$cshowList :: [UpdateQueue] -> ShowS
show :: UpdateQueue -> String
$cshow :: UpdateQueue -> String
showsPrec :: Int -> UpdateQueue -> ShowS
$cshowsPrec :: Int -> UpdateQueue -> ShowS
Prelude.Show, (forall x. UpdateQueue -> Rep UpdateQueue x)
-> (forall x. Rep UpdateQueue x -> UpdateQueue)
-> Generic UpdateQueue
forall x. Rep UpdateQueue x -> UpdateQueue
forall x. UpdateQueue -> Rep UpdateQueue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateQueue x -> UpdateQueue
$cfrom :: forall x. UpdateQueue -> Rep UpdateQueue x
Prelude.Generic)
newUpdateQueue ::
Prelude.Text ->
UpdateQueue
newUpdateQueue :: Text -> UpdateQueue
newUpdateQueue Text
pName_ =
UpdateQueue' :: Maybe QueueStatus
-> Maybe Text
-> Maybe ReservationPlanSettings
-> Text
-> UpdateQueue
UpdateQueue'
{ $sel:status:UpdateQueue' :: Maybe QueueStatus
status = Maybe QueueStatus
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateQueue' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reservationPlanSettings:UpdateQueue' :: Maybe ReservationPlanSettings
reservationPlanSettings = Maybe ReservationPlanSettings
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateQueue' :: Text
name = Text
pName_
}
updateQueue_status :: Lens.Lens' UpdateQueue (Prelude.Maybe QueueStatus)
updateQueue_status :: (Maybe QueueStatus -> f (Maybe QueueStatus))
-> UpdateQueue -> f UpdateQueue
updateQueue_status = (UpdateQueue -> Maybe QueueStatus)
-> (UpdateQueue -> Maybe QueueStatus -> UpdateQueue)
-> Lens
UpdateQueue UpdateQueue (Maybe QueueStatus) (Maybe QueueStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateQueue' {Maybe QueueStatus
status :: Maybe QueueStatus
$sel:status:UpdateQueue' :: UpdateQueue -> Maybe QueueStatus
status} -> Maybe QueueStatus
status) (\s :: UpdateQueue
s@UpdateQueue' {} Maybe QueueStatus
a -> UpdateQueue
s {$sel:status:UpdateQueue' :: Maybe QueueStatus
status = Maybe QueueStatus
a} :: UpdateQueue)
updateQueue_description :: Lens.Lens' UpdateQueue (Prelude.Maybe Prelude.Text)
updateQueue_description :: (Maybe Text -> f (Maybe Text)) -> UpdateQueue -> f UpdateQueue
updateQueue_description = (UpdateQueue -> Maybe Text)
-> (UpdateQueue -> Maybe Text -> UpdateQueue)
-> Lens UpdateQueue UpdateQueue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateQueue' {Maybe Text
description :: Maybe Text
$sel:description:UpdateQueue' :: UpdateQueue -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateQueue
s@UpdateQueue' {} Maybe Text
a -> UpdateQueue
s {$sel:description:UpdateQueue' :: Maybe Text
description = Maybe Text
a} :: UpdateQueue)
updateQueue_reservationPlanSettings :: Lens.Lens' UpdateQueue (Prelude.Maybe ReservationPlanSettings)
updateQueue_reservationPlanSettings :: (Maybe ReservationPlanSettings
-> f (Maybe ReservationPlanSettings))
-> UpdateQueue -> f UpdateQueue
updateQueue_reservationPlanSettings = (UpdateQueue -> Maybe ReservationPlanSettings)
-> (UpdateQueue -> Maybe ReservationPlanSettings -> UpdateQueue)
-> Lens
UpdateQueue
UpdateQueue
(Maybe ReservationPlanSettings)
(Maybe ReservationPlanSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateQueue' {Maybe ReservationPlanSettings
reservationPlanSettings :: Maybe ReservationPlanSettings
$sel:reservationPlanSettings:UpdateQueue' :: UpdateQueue -> Maybe ReservationPlanSettings
reservationPlanSettings} -> Maybe ReservationPlanSettings
reservationPlanSettings) (\s :: UpdateQueue
s@UpdateQueue' {} Maybe ReservationPlanSettings
a -> UpdateQueue
s {$sel:reservationPlanSettings:UpdateQueue' :: Maybe ReservationPlanSettings
reservationPlanSettings = Maybe ReservationPlanSettings
a} :: UpdateQueue)
updateQueue_name :: Lens.Lens' UpdateQueue Prelude.Text
updateQueue_name :: (Text -> f Text) -> UpdateQueue -> f UpdateQueue
updateQueue_name = (UpdateQueue -> Text)
-> (UpdateQueue -> Text -> UpdateQueue)
-> Lens UpdateQueue UpdateQueue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateQueue' {Text
name :: Text
$sel:name:UpdateQueue' :: UpdateQueue -> Text
name} -> Text
name) (\s :: UpdateQueue
s@UpdateQueue' {} Text
a -> UpdateQueue
s {$sel:name:UpdateQueue' :: Text
name = Text
a} :: UpdateQueue)
instance Core.AWSRequest UpdateQueue where
type AWSResponse UpdateQueue = UpdateQueueResponse
request :: UpdateQueue -> Request UpdateQueue
request = Service -> UpdateQueue -> Request UpdateQueue
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateQueue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateQueue)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateQueue))
-> Logger
-> Service
-> Proxy UpdateQueue
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateQueue)))
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 Queue -> Int -> UpdateQueueResponse
UpdateQueueResponse'
(Maybe Queue -> Int -> UpdateQueueResponse)
-> Either String (Maybe Queue)
-> Either String (Int -> UpdateQueueResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Queue)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"queue")
Either String (Int -> UpdateQueueResponse)
-> Either String Int -> Either String UpdateQueueResponse
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 UpdateQueue
instance Prelude.NFData UpdateQueue
instance Core.ToHeaders UpdateQueue where
toHeaders :: UpdateQueue -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateQueue -> 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.ToJSON UpdateQueue where
toJSON :: UpdateQueue -> Value
toJSON UpdateQueue' {Maybe Text
Maybe QueueStatus
Maybe ReservationPlanSettings
Text
name :: Text
reservationPlanSettings :: Maybe ReservationPlanSettings
description :: Maybe Text
status :: Maybe QueueStatus
$sel:name:UpdateQueue' :: UpdateQueue -> Text
$sel:reservationPlanSettings:UpdateQueue' :: UpdateQueue -> Maybe ReservationPlanSettings
$sel:description:UpdateQueue' :: UpdateQueue -> Maybe Text
$sel:status:UpdateQueue' :: UpdateQueue -> Maybe QueueStatus
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"status" Text -> QueueStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (QueueStatus -> Pair) -> Maybe QueueStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe QueueStatus
status,
(Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
(Text
"reservationPlanSettings" Text -> ReservationPlanSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ReservationPlanSettings -> Pair)
-> Maybe ReservationPlanSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReservationPlanSettings
reservationPlanSettings
]
)
instance Core.ToPath UpdateQueue where
toPath :: UpdateQueue -> ByteString
toPath UpdateQueue' {Maybe Text
Maybe QueueStatus
Maybe ReservationPlanSettings
Text
name :: Text
reservationPlanSettings :: Maybe ReservationPlanSettings
description :: Maybe Text
status :: Maybe QueueStatus
$sel:name:UpdateQueue' :: UpdateQueue -> Text
$sel:reservationPlanSettings:UpdateQueue' :: UpdateQueue -> Maybe ReservationPlanSettings
$sel:description:UpdateQueue' :: UpdateQueue -> Maybe Text
$sel:status:UpdateQueue' :: UpdateQueue -> Maybe QueueStatus
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2017-08-29/queues/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name]
instance Core.ToQuery UpdateQueue where
toQuery :: UpdateQueue -> QueryString
toQuery = QueryString -> UpdateQueue -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateQueueResponse = UpdateQueueResponse'
{
UpdateQueueResponse -> Maybe Queue
queue :: Prelude.Maybe Queue,
UpdateQueueResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateQueueResponse -> UpdateQueueResponse -> Bool
(UpdateQueueResponse -> UpdateQueueResponse -> Bool)
-> (UpdateQueueResponse -> UpdateQueueResponse -> Bool)
-> Eq UpdateQueueResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateQueueResponse -> UpdateQueueResponse -> Bool
$c/= :: UpdateQueueResponse -> UpdateQueueResponse -> Bool
== :: UpdateQueueResponse -> UpdateQueueResponse -> Bool
$c== :: UpdateQueueResponse -> UpdateQueueResponse -> Bool
Prelude.Eq, ReadPrec [UpdateQueueResponse]
ReadPrec UpdateQueueResponse
Int -> ReadS UpdateQueueResponse
ReadS [UpdateQueueResponse]
(Int -> ReadS UpdateQueueResponse)
-> ReadS [UpdateQueueResponse]
-> ReadPrec UpdateQueueResponse
-> ReadPrec [UpdateQueueResponse]
-> Read UpdateQueueResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateQueueResponse]
$creadListPrec :: ReadPrec [UpdateQueueResponse]
readPrec :: ReadPrec UpdateQueueResponse
$creadPrec :: ReadPrec UpdateQueueResponse
readList :: ReadS [UpdateQueueResponse]
$creadList :: ReadS [UpdateQueueResponse]
readsPrec :: Int -> ReadS UpdateQueueResponse
$creadsPrec :: Int -> ReadS UpdateQueueResponse
Prelude.Read, Int -> UpdateQueueResponse -> ShowS
[UpdateQueueResponse] -> ShowS
UpdateQueueResponse -> String
(Int -> UpdateQueueResponse -> ShowS)
-> (UpdateQueueResponse -> String)
-> ([UpdateQueueResponse] -> ShowS)
-> Show UpdateQueueResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateQueueResponse] -> ShowS
$cshowList :: [UpdateQueueResponse] -> ShowS
show :: UpdateQueueResponse -> String
$cshow :: UpdateQueueResponse -> String
showsPrec :: Int -> UpdateQueueResponse -> ShowS
$cshowsPrec :: Int -> UpdateQueueResponse -> ShowS
Prelude.Show, (forall x. UpdateQueueResponse -> Rep UpdateQueueResponse x)
-> (forall x. Rep UpdateQueueResponse x -> UpdateQueueResponse)
-> Generic UpdateQueueResponse
forall x. Rep UpdateQueueResponse x -> UpdateQueueResponse
forall x. UpdateQueueResponse -> Rep UpdateQueueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateQueueResponse x -> UpdateQueueResponse
$cfrom :: forall x. UpdateQueueResponse -> Rep UpdateQueueResponse x
Prelude.Generic)
newUpdateQueueResponse ::
Prelude.Int ->
UpdateQueueResponse
newUpdateQueueResponse :: Int -> UpdateQueueResponse
newUpdateQueueResponse Int
pHttpStatus_ =
UpdateQueueResponse' :: Maybe Queue -> Int -> UpdateQueueResponse
UpdateQueueResponse'
{ $sel:queue:UpdateQueueResponse' :: Maybe Queue
queue = Maybe Queue
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateQueueResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateQueueResponse_queue :: Lens.Lens' UpdateQueueResponse (Prelude.Maybe Queue)
updateQueueResponse_queue :: (Maybe Queue -> f (Maybe Queue))
-> UpdateQueueResponse -> f UpdateQueueResponse
updateQueueResponse_queue = (UpdateQueueResponse -> Maybe Queue)
-> (UpdateQueueResponse -> Maybe Queue -> UpdateQueueResponse)
-> Lens
UpdateQueueResponse UpdateQueueResponse (Maybe Queue) (Maybe Queue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateQueueResponse' {Maybe Queue
queue :: Maybe Queue
$sel:queue:UpdateQueueResponse' :: UpdateQueueResponse -> Maybe Queue
queue} -> Maybe Queue
queue) (\s :: UpdateQueueResponse
s@UpdateQueueResponse' {} Maybe Queue
a -> UpdateQueueResponse
s {$sel:queue:UpdateQueueResponse' :: Maybe Queue
queue = Maybe Queue
a} :: UpdateQueueResponse)
updateQueueResponse_httpStatus :: Lens.Lens' UpdateQueueResponse Prelude.Int
updateQueueResponse_httpStatus :: (Int -> f Int) -> UpdateQueueResponse -> f UpdateQueueResponse
updateQueueResponse_httpStatus = (UpdateQueueResponse -> Int)
-> (UpdateQueueResponse -> Int -> UpdateQueueResponse)
-> Lens UpdateQueueResponse UpdateQueueResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateQueueResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateQueueResponse' :: UpdateQueueResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateQueueResponse
s@UpdateQueueResponse' {} Int
a -> UpdateQueueResponse
s {$sel:httpStatus:UpdateQueueResponse' :: Int
httpStatus = Int
a} :: UpdateQueueResponse)
instance Prelude.NFData UpdateQueueResponse