{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.MediaConvert.Types.HopDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HopDestination = HopDestination'
{
HopDestination -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
HopDestination -> Maybe Text
queue :: Prelude.Maybe Prelude.Text,
HopDestination -> Maybe Int
waitMinutes :: Prelude.Maybe Prelude.Int
}
deriving (HopDestination -> HopDestination -> Bool
(HopDestination -> HopDestination -> Bool)
-> (HopDestination -> HopDestination -> Bool) -> Eq HopDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HopDestination -> HopDestination -> Bool
$c/= :: HopDestination -> HopDestination -> Bool
== :: HopDestination -> HopDestination -> Bool
$c== :: HopDestination -> HopDestination -> Bool
Prelude.Eq, ReadPrec [HopDestination]
ReadPrec HopDestination
Int -> ReadS HopDestination
ReadS [HopDestination]
(Int -> ReadS HopDestination)
-> ReadS [HopDestination]
-> ReadPrec HopDestination
-> ReadPrec [HopDestination]
-> Read HopDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HopDestination]
$creadListPrec :: ReadPrec [HopDestination]
readPrec :: ReadPrec HopDestination
$creadPrec :: ReadPrec HopDestination
readList :: ReadS [HopDestination]
$creadList :: ReadS [HopDestination]
readsPrec :: Int -> ReadS HopDestination
$creadsPrec :: Int -> ReadS HopDestination
Prelude.Read, Int -> HopDestination -> ShowS
[HopDestination] -> ShowS
HopDestination -> String
(Int -> HopDestination -> ShowS)
-> (HopDestination -> String)
-> ([HopDestination] -> ShowS)
-> Show HopDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HopDestination] -> ShowS
$cshowList :: [HopDestination] -> ShowS
show :: HopDestination -> String
$cshow :: HopDestination -> String
showsPrec :: Int -> HopDestination -> ShowS
$cshowsPrec :: Int -> HopDestination -> ShowS
Prelude.Show, (forall x. HopDestination -> Rep HopDestination x)
-> (forall x. Rep HopDestination x -> HopDestination)
-> Generic HopDestination
forall x. Rep HopDestination x -> HopDestination
forall x. HopDestination -> Rep HopDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HopDestination x -> HopDestination
$cfrom :: forall x. HopDestination -> Rep HopDestination x
Prelude.Generic)
newHopDestination ::
HopDestination
newHopDestination :: HopDestination
newHopDestination =
HopDestination' :: Maybe Int -> Maybe Text -> Maybe Int -> HopDestination
HopDestination'
{ $sel:priority:HopDestination' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:queue:HopDestination' :: Maybe Text
queue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:waitMinutes:HopDestination' :: Maybe Int
waitMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
hopDestination_priority :: Lens.Lens' HopDestination (Prelude.Maybe Prelude.Int)
hopDestination_priority :: (Maybe Int -> f (Maybe Int)) -> HopDestination -> f HopDestination
hopDestination_priority = (HopDestination -> Maybe Int)
-> (HopDestination -> Maybe Int -> HopDestination)
-> Lens HopDestination HopDestination (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HopDestination' {Maybe Int
priority :: Maybe Int
$sel:priority:HopDestination' :: HopDestination -> Maybe Int
priority} -> Maybe Int
priority) (\s :: HopDestination
s@HopDestination' {} Maybe Int
a -> HopDestination
s {$sel:priority:HopDestination' :: Maybe Int
priority = Maybe Int
a} :: HopDestination)
hopDestination_queue :: Lens.Lens' HopDestination (Prelude.Maybe Prelude.Text)
hopDestination_queue :: (Maybe Text -> f (Maybe Text))
-> HopDestination -> f HopDestination
hopDestination_queue = (HopDestination -> Maybe Text)
-> (HopDestination -> Maybe Text -> HopDestination)
-> Lens HopDestination HopDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HopDestination' {Maybe Text
queue :: Maybe Text
$sel:queue:HopDestination' :: HopDestination -> Maybe Text
queue} -> Maybe Text
queue) (\s :: HopDestination
s@HopDestination' {} Maybe Text
a -> HopDestination
s {$sel:queue:HopDestination' :: Maybe Text
queue = Maybe Text
a} :: HopDestination)
hopDestination_waitMinutes :: Lens.Lens' HopDestination (Prelude.Maybe Prelude.Int)
hopDestination_waitMinutes :: (Maybe Int -> f (Maybe Int)) -> HopDestination -> f HopDestination
hopDestination_waitMinutes = (HopDestination -> Maybe Int)
-> (HopDestination -> Maybe Int -> HopDestination)
-> Lens HopDestination HopDestination (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HopDestination' {Maybe Int
waitMinutes :: Maybe Int
$sel:waitMinutes:HopDestination' :: HopDestination -> Maybe Int
waitMinutes} -> Maybe Int
waitMinutes) (\s :: HopDestination
s@HopDestination' {} Maybe Int
a -> HopDestination
s {$sel:waitMinutes:HopDestination' :: Maybe Int
waitMinutes = Maybe Int
a} :: HopDestination)
instance Core.FromJSON HopDestination where
parseJSON :: Value -> Parser HopDestination
parseJSON =
String
-> (Object -> Parser HopDestination)
-> Value
-> Parser HopDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HopDestination"
( \Object
x ->
Maybe Int -> Maybe Text -> Maybe Int -> HopDestination
HopDestination'
(Maybe Int -> Maybe Text -> Maybe Int -> HopDestination)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Int -> HopDestination)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"priority")
Parser (Maybe Text -> Maybe Int -> HopDestination)
-> Parser (Maybe Text) -> Parser (Maybe Int -> HopDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"queue")
Parser (Maybe Int -> HopDestination)
-> Parser (Maybe Int) -> Parser HopDestination
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"waitMinutes")
)
instance Prelude.Hashable HopDestination
instance Prelude.NFData HopDestination
instance Core.ToJSON HopDestination where
toJSON :: HopDestination -> Value
toJSON HopDestination' {Maybe Int
Maybe Text
waitMinutes :: Maybe Int
queue :: Maybe Text
priority :: Maybe Int
$sel:waitMinutes:HopDestination' :: HopDestination -> Maybe Int
$sel:queue:HopDestination' :: HopDestination -> Maybe Text
$sel:priority:HopDestination' :: HopDestination -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"priority" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
priority,
(Text
"queue" 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
queue,
(Text
"waitMinutes" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
waitMinutes
]
)