{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConvert.Types.RuleType
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.RuleType
  ( RuleType
      ( ..,
        RuleType_ALLOWED_RENDITIONS,
        RuleType_FORCE_INCLUDE_RENDITIONS,
        RuleType_MIN_BOTTOM_RENDITION_SIZE,
        RuleType_MIN_TOP_RENDITION_SIZE
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Use Min top rendition size to specify a minimum size for the highest
-- resolution in your ABR stack. * The highest resolution in your ABR stack
-- will be equal to or greater than the value that you enter. For example:
-- If you specify 1280x720 the highest resolution in your ABR stack will be
-- equal to or greater than 1280x720. * If you specify a value for Max
-- resolution, the value that you specify for Min top rendition size must
-- be less than, or equal to, Max resolution. Use Min bottom rendition size
-- to specify a minimum size for the lowest resolution in your ABR stack. *
-- The lowest resolution in your ABR stack will be equal to or greater than
-- the value that you enter. For example: If you specify 640x360 the lowest
-- resolution in your ABR stack will be equal to or greater than to
-- 640x360. * If you specify a Min top rendition size rule, the value that
-- you specify for Min bottom rendition size must be less than, or equal
-- to, Min top rendition size. Use Force include renditions to specify one
-- or more resolutions to include your ABR stack. * (Recommended) To
-- optimize automated ABR, specify as few resolutions as possible. *
-- (Required) The number of resolutions that you specify must be equal to,
-- or less than, the Max renditions setting. * If you specify a Min top
-- rendition size rule, specify at least one resolution that is equal to,
-- or greater than, Min top rendition size. * If you specify a Min bottom
-- rendition size rule, only specify resolutions that are equal to, or
-- greater than, Min bottom rendition size. * If you specify a Force
-- include renditions rule, do not specify a separate rule for Allowed
-- renditions. * Note: The ABR stack may include other resolutions that you
-- do not specify here, depending on the Max renditions setting. Use
-- Allowed renditions to specify a list of possible resolutions in your ABR
-- stack. * (Required) The number of resolutions that you specify must be
-- equal to, or greater than, the Max renditions setting. * MediaConvert
-- will create an ABR stack exclusively from the list of resolutions that
-- you specify. * Some resolutions in the Allowed renditions list may not
-- be included, however you can force a resolution to be included by
-- setting Required to ENABLED. * You must specify at least one resolution
-- that is greater than or equal to any resolutions that you specify in Min
-- top rendition size or Min bottom rendition size. * If you specify
-- Allowed renditions, you must not specify a separate rule for Force
-- include renditions.
newtype RuleType = RuleType'
  { RuleType -> Text
fromRuleType ::
      Data.Text
  }
  deriving stock
    ( Int -> RuleType -> ShowS
[RuleType] -> ShowS
RuleType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleType] -> ShowS
$cshowList :: [RuleType] -> ShowS
show :: RuleType -> String
$cshow :: RuleType -> String
showsPrec :: Int -> RuleType -> ShowS
$cshowsPrec :: Int -> RuleType -> ShowS
Prelude.Show,
      ReadPrec [RuleType]
ReadPrec RuleType
Int -> ReadS RuleType
ReadS [RuleType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleType]
$creadListPrec :: ReadPrec [RuleType]
readPrec :: ReadPrec RuleType
$creadPrec :: ReadPrec RuleType
readList :: ReadS [RuleType]
$creadList :: ReadS [RuleType]
readsPrec :: Int -> ReadS RuleType
$creadsPrec :: Int -> ReadS RuleType
Prelude.Read,
      RuleType -> RuleType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleType -> RuleType -> Bool
$c/= :: RuleType -> RuleType -> Bool
== :: RuleType -> RuleType -> Bool
$c== :: RuleType -> RuleType -> Bool
Prelude.Eq,
      Eq RuleType
RuleType -> RuleType -> Bool
RuleType -> RuleType -> Ordering
RuleType -> RuleType -> RuleType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: RuleType -> RuleType -> RuleType
$cmin :: RuleType -> RuleType -> RuleType
max :: RuleType -> RuleType -> RuleType
$cmax :: RuleType -> RuleType -> RuleType
>= :: RuleType -> RuleType -> Bool
$c>= :: RuleType -> RuleType -> Bool
> :: RuleType -> RuleType -> Bool
$c> :: RuleType -> RuleType -> Bool
<= :: RuleType -> RuleType -> Bool
$c<= :: RuleType -> RuleType -> Bool
< :: RuleType -> RuleType -> Bool
$c< :: RuleType -> RuleType -> Bool
compare :: RuleType -> RuleType -> Ordering
$ccompare :: RuleType -> RuleType -> Ordering
Prelude.Ord,
      forall x. Rep RuleType x -> RuleType
forall x. RuleType -> Rep RuleType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleType x -> RuleType
$cfrom :: forall x. RuleType -> Rep RuleType x
Prelude.Generic
    )
  deriving newtype
    ( Eq RuleType
Int -> RuleType -> Int
RuleType -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: RuleType -> Int
$chash :: RuleType -> Int
hashWithSalt :: Int -> RuleType -> Int
$chashWithSalt :: Int -> RuleType -> Int
Prelude.Hashable,
      RuleType -> ()
forall a. (a -> ()) -> NFData a
rnf :: RuleType -> ()
$crnf :: RuleType -> ()
Prelude.NFData,
      Text -> Either String RuleType
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String RuleType
$cfromText :: Text -> Either String RuleType
Data.FromText,
      RuleType -> Text
forall a. (a -> Text) -> ToText a
toText :: RuleType -> Text
$ctoText :: RuleType -> Text
Data.ToText,
      RuleType -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: RuleType -> ByteString
$ctoBS :: RuleType -> ByteString
Data.ToByteString,
      RuleType -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: RuleType -> ByteStringBuilder
$cbuild :: RuleType -> ByteStringBuilder
Data.ToLog,
      HeaderName -> RuleType -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> RuleType -> [Header]
$ctoHeader :: HeaderName -> RuleType -> [Header]
Data.ToHeader,
      RuleType -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: RuleType -> QueryString
$ctoQuery :: RuleType -> QueryString
Data.ToQuery,
      Value -> Parser [RuleType]
Value -> Parser RuleType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [RuleType]
$cparseJSONList :: Value -> Parser [RuleType]
parseJSON :: Value -> Parser RuleType
$cparseJSON :: Value -> Parser RuleType
Data.FromJSON,
      FromJSONKeyFunction [RuleType]
FromJSONKeyFunction RuleType
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [RuleType]
$cfromJSONKeyList :: FromJSONKeyFunction [RuleType]
fromJSONKey :: FromJSONKeyFunction RuleType
$cfromJSONKey :: FromJSONKeyFunction RuleType
Data.FromJSONKey,
      [RuleType] -> Encoding
[RuleType] -> Value
RuleType -> Encoding
RuleType -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [RuleType] -> Encoding
$ctoEncodingList :: [RuleType] -> Encoding
toJSONList :: [RuleType] -> Value
$ctoJSONList :: [RuleType] -> Value
toEncoding :: RuleType -> Encoding
$ctoEncoding :: RuleType -> Encoding
toJSON :: RuleType -> Value
$ctoJSON :: RuleType -> Value
Data.ToJSON,
      ToJSONKeyFunction [RuleType]
ToJSONKeyFunction RuleType
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [RuleType]
$ctoJSONKeyList :: ToJSONKeyFunction [RuleType]
toJSONKey :: ToJSONKeyFunction RuleType
$ctoJSONKey :: ToJSONKeyFunction RuleType
Data.ToJSONKey,
      [Node] -> Either String RuleType
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String RuleType
$cparseXML :: [Node] -> Either String RuleType
Data.FromXML,
      RuleType -> XML
forall a. (a -> XML) -> ToXML a
toXML :: RuleType -> XML
$ctoXML :: RuleType -> XML
Data.ToXML
    )

pattern RuleType_ALLOWED_RENDITIONS :: RuleType
pattern $bRuleType_ALLOWED_RENDITIONS :: RuleType
$mRuleType_ALLOWED_RENDITIONS :: forall {r}. RuleType -> ((# #) -> r) -> ((# #) -> r) -> r
RuleType_ALLOWED_RENDITIONS = RuleType' "ALLOWED_RENDITIONS"

pattern RuleType_FORCE_INCLUDE_RENDITIONS :: RuleType
pattern $bRuleType_FORCE_INCLUDE_RENDITIONS :: RuleType
$mRuleType_FORCE_INCLUDE_RENDITIONS :: forall {r}. RuleType -> ((# #) -> r) -> ((# #) -> r) -> r
RuleType_FORCE_INCLUDE_RENDITIONS = RuleType' "FORCE_INCLUDE_RENDITIONS"

pattern RuleType_MIN_BOTTOM_RENDITION_SIZE :: RuleType
pattern $bRuleType_MIN_BOTTOM_RENDITION_SIZE :: RuleType
$mRuleType_MIN_BOTTOM_RENDITION_SIZE :: forall {r}. RuleType -> ((# #) -> r) -> ((# #) -> r) -> r
RuleType_MIN_BOTTOM_RENDITION_SIZE = RuleType' "MIN_BOTTOM_RENDITION_SIZE"

pattern RuleType_MIN_TOP_RENDITION_SIZE :: RuleType
pattern $bRuleType_MIN_TOP_RENDITION_SIZE :: RuleType
$mRuleType_MIN_TOP_RENDITION_SIZE :: forall {r}. RuleType -> ((# #) -> r) -> ((# #) -> r) -> r
RuleType_MIN_TOP_RENDITION_SIZE = RuleType' "MIN_TOP_RENDITION_SIZE"

{-# COMPLETE
  RuleType_ALLOWED_RENDITIONS,
  RuleType_FORCE_INCLUDE_RENDITIONS,
  RuleType_MIN_BOTTOM_RENDITION_SIZE,
  RuleType_MIN_TOP_RENDITION_SIZE,
  RuleType'
  #-}