{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:priority:HopDestination' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
$sel:queue:HopDestination' :: Maybe Text
queue = forall a. Maybe a
Prelude.Nothing,
$sel:waitMinutes:HopDestination' :: Maybe Int
waitMinutes = forall a. Maybe a
Prelude.Nothing
}
hopDestination_priority :: Lens.Lens' HopDestination (Prelude.Maybe Prelude.Int)
hopDestination_priority :: Lens' HopDestination (Maybe Int)
hopDestination_priority = 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 :: Lens' HopDestination (Maybe Text)
hopDestination_queue = 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 :: Lens' HopDestination (Maybe Int)
hopDestination_waitMinutes = 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 Data.FromJSON HopDestination where
parseJSON :: Value -> Parser HopDestination
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HopDestination"
( \Object
x ->
Maybe Int -> Maybe Text -> Maybe Int -> HopDestination
HopDestination'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"priority")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"queue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"waitMinutes")
)
instance Prelude.Hashable HopDestination where
hashWithSalt :: Int -> HopDestination -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
priority
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
waitMinutes
instance Prelude.NFData HopDestination where
rnf :: HopDestination -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
priority
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
waitMinutes
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"priority" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
priority,
(Key
"queue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queue,
(Key
"waitMinutes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
waitMinutes
]
)