{-# 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.MediaConnect.Types.ResourceSpecification where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data ResourceSpecification = ResourceSpecification'
{
ResourceSpecification -> Maybe Int
reservedBitrate :: Prelude.Maybe Prelude.Int,
ResourceSpecification -> ResourceType
resourceType :: ResourceType
}
deriving (ResourceSpecification -> ResourceSpecification -> Bool
(ResourceSpecification -> ResourceSpecification -> Bool)
-> (ResourceSpecification -> ResourceSpecification -> Bool)
-> Eq ResourceSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceSpecification -> ResourceSpecification -> Bool
$c/= :: ResourceSpecification -> ResourceSpecification -> Bool
== :: ResourceSpecification -> ResourceSpecification -> Bool
$c== :: ResourceSpecification -> ResourceSpecification -> Bool
Prelude.Eq, ReadPrec [ResourceSpecification]
ReadPrec ResourceSpecification
Int -> ReadS ResourceSpecification
ReadS [ResourceSpecification]
(Int -> ReadS ResourceSpecification)
-> ReadS [ResourceSpecification]
-> ReadPrec ResourceSpecification
-> ReadPrec [ResourceSpecification]
-> Read ResourceSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceSpecification]
$creadListPrec :: ReadPrec [ResourceSpecification]
readPrec :: ReadPrec ResourceSpecification
$creadPrec :: ReadPrec ResourceSpecification
readList :: ReadS [ResourceSpecification]
$creadList :: ReadS [ResourceSpecification]
readsPrec :: Int -> ReadS ResourceSpecification
$creadsPrec :: Int -> ReadS ResourceSpecification
Prelude.Read, Int -> ResourceSpecification -> ShowS
[ResourceSpecification] -> ShowS
ResourceSpecification -> String
(Int -> ResourceSpecification -> ShowS)
-> (ResourceSpecification -> String)
-> ([ResourceSpecification] -> ShowS)
-> Show ResourceSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceSpecification] -> ShowS
$cshowList :: [ResourceSpecification] -> ShowS
show :: ResourceSpecification -> String
$cshow :: ResourceSpecification -> String
showsPrec :: Int -> ResourceSpecification -> ShowS
$cshowsPrec :: Int -> ResourceSpecification -> ShowS
Prelude.Show, (forall x. ResourceSpecification -> Rep ResourceSpecification x)
-> (forall x. Rep ResourceSpecification x -> ResourceSpecification)
-> Generic ResourceSpecification
forall x. Rep ResourceSpecification x -> ResourceSpecification
forall x. ResourceSpecification -> Rep ResourceSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceSpecification x -> ResourceSpecification
$cfrom :: forall x. ResourceSpecification -> Rep ResourceSpecification x
Prelude.Generic)
newResourceSpecification ::
ResourceType ->
ResourceSpecification
newResourceSpecification :: ResourceType -> ResourceSpecification
newResourceSpecification ResourceType
pResourceType_ =
ResourceSpecification' :: Maybe Int -> ResourceType -> ResourceSpecification
ResourceSpecification'
{ $sel:reservedBitrate:ResourceSpecification' :: Maybe Int
reservedBitrate =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:ResourceSpecification' :: ResourceType
resourceType = ResourceType
pResourceType_
}
resourceSpecification_reservedBitrate :: Lens.Lens' ResourceSpecification (Prelude.Maybe Prelude.Int)
resourceSpecification_reservedBitrate :: (Maybe Int -> f (Maybe Int))
-> ResourceSpecification -> f ResourceSpecification
resourceSpecification_reservedBitrate = (ResourceSpecification -> Maybe Int)
-> (ResourceSpecification -> Maybe Int -> ResourceSpecification)
-> Lens
ResourceSpecification ResourceSpecification (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSpecification' {Maybe Int
reservedBitrate :: Maybe Int
$sel:reservedBitrate:ResourceSpecification' :: ResourceSpecification -> Maybe Int
reservedBitrate} -> Maybe Int
reservedBitrate) (\s :: ResourceSpecification
s@ResourceSpecification' {} Maybe Int
a -> ResourceSpecification
s {$sel:reservedBitrate:ResourceSpecification' :: Maybe Int
reservedBitrate = Maybe Int
a} :: ResourceSpecification)
resourceSpecification_resourceType :: Lens.Lens' ResourceSpecification ResourceType
resourceSpecification_resourceType :: (ResourceType -> f ResourceType)
-> ResourceSpecification -> f ResourceSpecification
resourceSpecification_resourceType = (ResourceSpecification -> ResourceType)
-> (ResourceSpecification -> ResourceType -> ResourceSpecification)
-> Lens
ResourceSpecification
ResourceSpecification
ResourceType
ResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSpecification' {ResourceType
resourceType :: ResourceType
$sel:resourceType:ResourceSpecification' :: ResourceSpecification -> ResourceType
resourceType} -> ResourceType
resourceType) (\s :: ResourceSpecification
s@ResourceSpecification' {} ResourceType
a -> ResourceSpecification
s {$sel:resourceType:ResourceSpecification' :: ResourceType
resourceType = ResourceType
a} :: ResourceSpecification)
instance Core.FromJSON ResourceSpecification where
parseJSON :: Value -> Parser ResourceSpecification
parseJSON =
String
-> (Object -> Parser ResourceSpecification)
-> Value
-> Parser ResourceSpecification
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceSpecification"
( \Object
x ->
Maybe Int -> ResourceType -> ResourceSpecification
ResourceSpecification'
(Maybe Int -> ResourceType -> ResourceSpecification)
-> Parser (Maybe Int)
-> Parser (ResourceType -> ResourceSpecification)
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
"reservedBitrate")
Parser (ResourceType -> ResourceSpecification)
-> Parser ResourceType -> Parser ResourceSpecification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ResourceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resourceType")
)
instance Prelude.Hashable ResourceSpecification
instance Prelude.NFData ResourceSpecification