{-# 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.M2tsSegmentationStyle
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.M2tsSegmentationStyle
  ( M2tsSegmentationStyle
      ( ..,
        M2tsSegmentationStyle_MAINTAIN_CADENCE,
        M2tsSegmentationStyle_RESET_CADENCE
      ),
  )
where

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

-- | The segmentation style parameter controls how segmentation markers are
-- inserted into the transport stream. With avails, it is possible that
-- segments may be truncated, which can influence where future segmentation
-- markers are inserted. When a segmentation style of \"reset_cadence\" is
-- selected and a segment is truncated due to an avail, we will reset the
-- segmentation cadence. This means the subsequent segment will have a
-- duration of of $segmentation_time seconds. When a segmentation style of
-- \"maintain_cadence\" is selected and a segment is truncated due to an
-- avail, we will not reset the segmentation cadence. This means the
-- subsequent segment will likely be truncated as well. However, all
-- segments after that will have a duration of $segmentation_time seconds.
-- Note that EBP lookahead is a slight exception to this rule.
newtype M2tsSegmentationStyle = M2tsSegmentationStyle'
  { M2tsSegmentationStyle -> Text
fromM2tsSegmentationStyle ::
      Core.Text
  }
  deriving stock
    ( Int -> M2tsSegmentationStyle -> ShowS
[M2tsSegmentationStyle] -> ShowS
M2tsSegmentationStyle -> String
(Int -> M2tsSegmentationStyle -> ShowS)
-> (M2tsSegmentationStyle -> String)
-> ([M2tsSegmentationStyle] -> ShowS)
-> Show M2tsSegmentationStyle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [M2tsSegmentationStyle] -> ShowS
$cshowList :: [M2tsSegmentationStyle] -> ShowS
show :: M2tsSegmentationStyle -> String
$cshow :: M2tsSegmentationStyle -> String
showsPrec :: Int -> M2tsSegmentationStyle -> ShowS
$cshowsPrec :: Int -> M2tsSegmentationStyle -> ShowS
Prelude.Show,
      ReadPrec [M2tsSegmentationStyle]
ReadPrec M2tsSegmentationStyle
Int -> ReadS M2tsSegmentationStyle
ReadS [M2tsSegmentationStyle]
(Int -> ReadS M2tsSegmentationStyle)
-> ReadS [M2tsSegmentationStyle]
-> ReadPrec M2tsSegmentationStyle
-> ReadPrec [M2tsSegmentationStyle]
-> Read M2tsSegmentationStyle
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [M2tsSegmentationStyle]
$creadListPrec :: ReadPrec [M2tsSegmentationStyle]
readPrec :: ReadPrec M2tsSegmentationStyle
$creadPrec :: ReadPrec M2tsSegmentationStyle
readList :: ReadS [M2tsSegmentationStyle]
$creadList :: ReadS [M2tsSegmentationStyle]
readsPrec :: Int -> ReadS M2tsSegmentationStyle
$creadsPrec :: Int -> ReadS M2tsSegmentationStyle
Prelude.Read,
      M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
(M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool)
-> (M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool)
-> Eq M2tsSegmentationStyle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
$c/= :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
== :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
$c== :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
Prelude.Eq,
      Eq M2tsSegmentationStyle
Eq M2tsSegmentationStyle
-> (M2tsSegmentationStyle -> M2tsSegmentationStyle -> Ordering)
-> (M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool)
-> (M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool)
-> (M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool)
-> (M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool)
-> (M2tsSegmentationStyle
    -> M2tsSegmentationStyle -> M2tsSegmentationStyle)
-> (M2tsSegmentationStyle
    -> M2tsSegmentationStyle -> M2tsSegmentationStyle)
-> Ord M2tsSegmentationStyle
M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
M2tsSegmentationStyle -> M2tsSegmentationStyle -> Ordering
M2tsSegmentationStyle
-> M2tsSegmentationStyle -> M2tsSegmentationStyle
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 :: M2tsSegmentationStyle
-> M2tsSegmentationStyle -> M2tsSegmentationStyle
$cmin :: M2tsSegmentationStyle
-> M2tsSegmentationStyle -> M2tsSegmentationStyle
max :: M2tsSegmentationStyle
-> M2tsSegmentationStyle -> M2tsSegmentationStyle
$cmax :: M2tsSegmentationStyle
-> M2tsSegmentationStyle -> M2tsSegmentationStyle
>= :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
$c>= :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
> :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
$c> :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
<= :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
$c<= :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
< :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
$c< :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Bool
compare :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Ordering
$ccompare :: M2tsSegmentationStyle -> M2tsSegmentationStyle -> Ordering
$cp1Ord :: Eq M2tsSegmentationStyle
Prelude.Ord,
      (forall x. M2tsSegmentationStyle -> Rep M2tsSegmentationStyle x)
-> (forall x. Rep M2tsSegmentationStyle x -> M2tsSegmentationStyle)
-> Generic M2tsSegmentationStyle
forall x. Rep M2tsSegmentationStyle x -> M2tsSegmentationStyle
forall x. M2tsSegmentationStyle -> Rep M2tsSegmentationStyle x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep M2tsSegmentationStyle x -> M2tsSegmentationStyle
$cfrom :: forall x. M2tsSegmentationStyle -> Rep M2tsSegmentationStyle x
Prelude.Generic
    )
  deriving newtype
    ( Int -> M2tsSegmentationStyle -> Int
M2tsSegmentationStyle -> Int
(Int -> M2tsSegmentationStyle -> Int)
-> (M2tsSegmentationStyle -> Int) -> Hashable M2tsSegmentationStyle
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: M2tsSegmentationStyle -> Int
$chash :: M2tsSegmentationStyle -> Int
hashWithSalt :: Int -> M2tsSegmentationStyle -> Int
$chashWithSalt :: Int -> M2tsSegmentationStyle -> Int
Prelude.Hashable,
      M2tsSegmentationStyle -> ()
(M2tsSegmentationStyle -> ()) -> NFData M2tsSegmentationStyle
forall a. (a -> ()) -> NFData a
rnf :: M2tsSegmentationStyle -> ()
$crnf :: M2tsSegmentationStyle -> ()
Prelude.NFData,
      Text -> Either String M2tsSegmentationStyle
(Text -> Either String M2tsSegmentationStyle)
-> FromText M2tsSegmentationStyle
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String M2tsSegmentationStyle
$cfromText :: Text -> Either String M2tsSegmentationStyle
Core.FromText,
      M2tsSegmentationStyle -> Text
(M2tsSegmentationStyle -> Text) -> ToText M2tsSegmentationStyle
forall a. (a -> Text) -> ToText a
toText :: M2tsSegmentationStyle -> Text
$ctoText :: M2tsSegmentationStyle -> Text
Core.ToText,
      M2tsSegmentationStyle -> ByteString
(M2tsSegmentationStyle -> ByteString)
-> ToByteString M2tsSegmentationStyle
forall a. (a -> ByteString) -> ToByteString a
toBS :: M2tsSegmentationStyle -> ByteString
$ctoBS :: M2tsSegmentationStyle -> ByteString
Core.ToByteString,
      M2tsSegmentationStyle -> ByteStringBuilder
(M2tsSegmentationStyle -> ByteStringBuilder)
-> ToLog M2tsSegmentationStyle
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: M2tsSegmentationStyle -> ByteStringBuilder
$cbuild :: M2tsSegmentationStyle -> ByteStringBuilder
Core.ToLog,
      HeaderName -> M2tsSegmentationStyle -> [Header]
(HeaderName -> M2tsSegmentationStyle -> [Header])
-> ToHeader M2tsSegmentationStyle
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> M2tsSegmentationStyle -> [Header]
$ctoHeader :: HeaderName -> M2tsSegmentationStyle -> [Header]
Core.ToHeader,
      M2tsSegmentationStyle -> QueryString
(M2tsSegmentationStyle -> QueryString)
-> ToQuery M2tsSegmentationStyle
forall a. (a -> QueryString) -> ToQuery a
toQuery :: M2tsSegmentationStyle -> QueryString
$ctoQuery :: M2tsSegmentationStyle -> QueryString
Core.ToQuery,
      Value -> Parser [M2tsSegmentationStyle]
Value -> Parser M2tsSegmentationStyle
(Value -> Parser M2tsSegmentationStyle)
-> (Value -> Parser [M2tsSegmentationStyle])
-> FromJSON M2tsSegmentationStyle
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [M2tsSegmentationStyle]
$cparseJSONList :: Value -> Parser [M2tsSegmentationStyle]
parseJSON :: Value -> Parser M2tsSegmentationStyle
$cparseJSON :: Value -> Parser M2tsSegmentationStyle
Core.FromJSON,
      FromJSONKeyFunction [M2tsSegmentationStyle]
FromJSONKeyFunction M2tsSegmentationStyle
FromJSONKeyFunction M2tsSegmentationStyle
-> FromJSONKeyFunction [M2tsSegmentationStyle]
-> FromJSONKey M2tsSegmentationStyle
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [M2tsSegmentationStyle]
$cfromJSONKeyList :: FromJSONKeyFunction [M2tsSegmentationStyle]
fromJSONKey :: FromJSONKeyFunction M2tsSegmentationStyle
$cfromJSONKey :: FromJSONKeyFunction M2tsSegmentationStyle
Core.FromJSONKey,
      [M2tsSegmentationStyle] -> Encoding
[M2tsSegmentationStyle] -> Value
M2tsSegmentationStyle -> Encoding
M2tsSegmentationStyle -> Value
(M2tsSegmentationStyle -> Value)
-> (M2tsSegmentationStyle -> Encoding)
-> ([M2tsSegmentationStyle] -> Value)
-> ([M2tsSegmentationStyle] -> Encoding)
-> ToJSON M2tsSegmentationStyle
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [M2tsSegmentationStyle] -> Encoding
$ctoEncodingList :: [M2tsSegmentationStyle] -> Encoding
toJSONList :: [M2tsSegmentationStyle] -> Value
$ctoJSONList :: [M2tsSegmentationStyle] -> Value
toEncoding :: M2tsSegmentationStyle -> Encoding
$ctoEncoding :: M2tsSegmentationStyle -> Encoding
toJSON :: M2tsSegmentationStyle -> Value
$ctoJSON :: M2tsSegmentationStyle -> Value
Core.ToJSON,
      ToJSONKeyFunction [M2tsSegmentationStyle]
ToJSONKeyFunction M2tsSegmentationStyle
ToJSONKeyFunction M2tsSegmentationStyle
-> ToJSONKeyFunction [M2tsSegmentationStyle]
-> ToJSONKey M2tsSegmentationStyle
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [M2tsSegmentationStyle]
$ctoJSONKeyList :: ToJSONKeyFunction [M2tsSegmentationStyle]
toJSONKey :: ToJSONKeyFunction M2tsSegmentationStyle
$ctoJSONKey :: ToJSONKeyFunction M2tsSegmentationStyle
Core.ToJSONKey,
      [Node] -> Either String M2tsSegmentationStyle
([Node] -> Either String M2tsSegmentationStyle)
-> FromXML M2tsSegmentationStyle
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String M2tsSegmentationStyle
$cparseXML :: [Node] -> Either String M2tsSegmentationStyle
Core.FromXML,
      M2tsSegmentationStyle -> XML
(M2tsSegmentationStyle -> XML) -> ToXML M2tsSegmentationStyle
forall a. (a -> XML) -> ToXML a
toXML :: M2tsSegmentationStyle -> XML
$ctoXML :: M2tsSegmentationStyle -> XML
Core.ToXML
    )

pattern M2tsSegmentationStyle_MAINTAIN_CADENCE :: M2tsSegmentationStyle
pattern $bM2tsSegmentationStyle_MAINTAIN_CADENCE :: M2tsSegmentationStyle
$mM2tsSegmentationStyle_MAINTAIN_CADENCE :: forall r.
M2tsSegmentationStyle -> (Void# -> r) -> (Void# -> r) -> r
M2tsSegmentationStyle_MAINTAIN_CADENCE = M2tsSegmentationStyle' "MAINTAIN_CADENCE"

pattern M2tsSegmentationStyle_RESET_CADENCE :: M2tsSegmentationStyle
pattern $bM2tsSegmentationStyle_RESET_CADENCE :: M2tsSegmentationStyle
$mM2tsSegmentationStyle_RESET_CADENCE :: forall r.
M2tsSegmentationStyle -> (Void# -> r) -> (Void# -> r) -> r
M2tsSegmentationStyle_RESET_CADENCE = M2tsSegmentationStyle' "RESET_CADENCE"

{-# COMPLETE
  M2tsSegmentationStyle_MAINTAIN_CADENCE,
  M2tsSegmentationStyle_RESET_CADENCE,
  M2tsSegmentationStyle'
  #-}