{-# 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.MediaPackage.Types.AdsOnDeliveryRestrictions
-- 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.MediaPackage.Types.AdsOnDeliveryRestrictions
  ( AdsOnDeliveryRestrictions
      ( ..,
        AdsOnDeliveryRestrictions_BOTH,
        AdsOnDeliveryRestrictions_NONE,
        AdsOnDeliveryRestrictions_RESTRICTED,
        AdsOnDeliveryRestrictions_UNRESTRICTED
      ),
  )
where

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

-- | This setting allows the delivery restriction flags on SCTE-35
-- segmentation descriptors to determine whether a message signals an ad.
-- Choosing \"NONE\" means no SCTE-35 messages become ads. Choosing
-- \"RESTRICTED\" means SCTE-35 messages of the types specified in
-- AdTriggers that contain delivery restrictions will be treated as ads.
-- Choosing \"UNRESTRICTED\" means SCTE-35 messages of the types specified
-- in AdTriggers that do not contain delivery restrictions will be treated
-- as ads. Choosing \"BOTH\" means all SCTE-35 messages of the types
-- specified in AdTriggers will be treated as ads. Note that Splice Insert
-- messages do not have these flags and are always treated as ads if
-- specified in AdTriggers.
newtype AdsOnDeliveryRestrictions = AdsOnDeliveryRestrictions'
  { AdsOnDeliveryRestrictions -> Text
fromAdsOnDeliveryRestrictions ::
      Core.Text
  }
  deriving stock
    ( Int -> AdsOnDeliveryRestrictions -> ShowS
[AdsOnDeliveryRestrictions] -> ShowS
AdsOnDeliveryRestrictions -> String
(Int -> AdsOnDeliveryRestrictions -> ShowS)
-> (AdsOnDeliveryRestrictions -> String)
-> ([AdsOnDeliveryRestrictions] -> ShowS)
-> Show AdsOnDeliveryRestrictions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdsOnDeliveryRestrictions] -> ShowS
$cshowList :: [AdsOnDeliveryRestrictions] -> ShowS
show :: AdsOnDeliveryRestrictions -> String
$cshow :: AdsOnDeliveryRestrictions -> String
showsPrec :: Int -> AdsOnDeliveryRestrictions -> ShowS
$cshowsPrec :: Int -> AdsOnDeliveryRestrictions -> ShowS
Prelude.Show,
      ReadPrec [AdsOnDeliveryRestrictions]
ReadPrec AdsOnDeliveryRestrictions
Int -> ReadS AdsOnDeliveryRestrictions
ReadS [AdsOnDeliveryRestrictions]
(Int -> ReadS AdsOnDeliveryRestrictions)
-> ReadS [AdsOnDeliveryRestrictions]
-> ReadPrec AdsOnDeliveryRestrictions
-> ReadPrec [AdsOnDeliveryRestrictions]
-> Read AdsOnDeliveryRestrictions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdsOnDeliveryRestrictions]
$creadListPrec :: ReadPrec [AdsOnDeliveryRestrictions]
readPrec :: ReadPrec AdsOnDeliveryRestrictions
$creadPrec :: ReadPrec AdsOnDeliveryRestrictions
readList :: ReadS [AdsOnDeliveryRestrictions]
$creadList :: ReadS [AdsOnDeliveryRestrictions]
readsPrec :: Int -> ReadS AdsOnDeliveryRestrictions
$creadsPrec :: Int -> ReadS AdsOnDeliveryRestrictions
Prelude.Read,
      AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
(AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool)
-> (AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool)
-> Eq AdsOnDeliveryRestrictions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
$c/= :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
== :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
$c== :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
Prelude.Eq,
      Eq AdsOnDeliveryRestrictions
Eq AdsOnDeliveryRestrictions
-> (AdsOnDeliveryRestrictions
    -> AdsOnDeliveryRestrictions -> Ordering)
-> (AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool)
-> (AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool)
-> (AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool)
-> (AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool)
-> (AdsOnDeliveryRestrictions
    -> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions)
-> (AdsOnDeliveryRestrictions
    -> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions)
-> Ord AdsOnDeliveryRestrictions
AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Ordering
AdsOnDeliveryRestrictions
-> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions
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 :: AdsOnDeliveryRestrictions
-> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions
$cmin :: AdsOnDeliveryRestrictions
-> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions
max :: AdsOnDeliveryRestrictions
-> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions
$cmax :: AdsOnDeliveryRestrictions
-> AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions
>= :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
$c>= :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
> :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
$c> :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
<= :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
$c<= :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
< :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
$c< :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Bool
compare :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Ordering
$ccompare :: AdsOnDeliveryRestrictions -> AdsOnDeliveryRestrictions -> Ordering
$cp1Ord :: Eq AdsOnDeliveryRestrictions
Prelude.Ord,
      (forall x.
 AdsOnDeliveryRestrictions -> Rep AdsOnDeliveryRestrictions x)
-> (forall x.
    Rep AdsOnDeliveryRestrictions x -> AdsOnDeliveryRestrictions)
-> Generic AdsOnDeliveryRestrictions
forall x.
Rep AdsOnDeliveryRestrictions x -> AdsOnDeliveryRestrictions
forall x.
AdsOnDeliveryRestrictions -> Rep AdsOnDeliveryRestrictions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdsOnDeliveryRestrictions x -> AdsOnDeliveryRestrictions
$cfrom :: forall x.
AdsOnDeliveryRestrictions -> Rep AdsOnDeliveryRestrictions x
Prelude.Generic
    )
  deriving newtype
    ( Int -> AdsOnDeliveryRestrictions -> Int
AdsOnDeliveryRestrictions -> Int
(Int -> AdsOnDeliveryRestrictions -> Int)
-> (AdsOnDeliveryRestrictions -> Int)
-> Hashable AdsOnDeliveryRestrictions
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: AdsOnDeliveryRestrictions -> Int
$chash :: AdsOnDeliveryRestrictions -> Int
hashWithSalt :: Int -> AdsOnDeliveryRestrictions -> Int
$chashWithSalt :: Int -> AdsOnDeliveryRestrictions -> Int
Prelude.Hashable,
      AdsOnDeliveryRestrictions -> ()
(AdsOnDeliveryRestrictions -> ())
-> NFData AdsOnDeliveryRestrictions
forall a. (a -> ()) -> NFData a
rnf :: AdsOnDeliveryRestrictions -> ()
$crnf :: AdsOnDeliveryRestrictions -> ()
Prelude.NFData,
      Text -> Either String AdsOnDeliveryRestrictions
(Text -> Either String AdsOnDeliveryRestrictions)
-> FromText AdsOnDeliveryRestrictions
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String AdsOnDeliveryRestrictions
$cfromText :: Text -> Either String AdsOnDeliveryRestrictions
Core.FromText,
      AdsOnDeliveryRestrictions -> Text
(AdsOnDeliveryRestrictions -> Text)
-> ToText AdsOnDeliveryRestrictions
forall a. (a -> Text) -> ToText a
toText :: AdsOnDeliveryRestrictions -> Text
$ctoText :: AdsOnDeliveryRestrictions -> Text
Core.ToText,
      AdsOnDeliveryRestrictions -> ByteString
(AdsOnDeliveryRestrictions -> ByteString)
-> ToByteString AdsOnDeliveryRestrictions
forall a. (a -> ByteString) -> ToByteString a
toBS :: AdsOnDeliveryRestrictions -> ByteString
$ctoBS :: AdsOnDeliveryRestrictions -> ByteString
Core.ToByteString,
      AdsOnDeliveryRestrictions -> ByteStringBuilder
(AdsOnDeliveryRestrictions -> ByteStringBuilder)
-> ToLog AdsOnDeliveryRestrictions
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: AdsOnDeliveryRestrictions -> ByteStringBuilder
$cbuild :: AdsOnDeliveryRestrictions -> ByteStringBuilder
Core.ToLog,
      HeaderName -> AdsOnDeliveryRestrictions -> [Header]
(HeaderName -> AdsOnDeliveryRestrictions -> [Header])
-> ToHeader AdsOnDeliveryRestrictions
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> AdsOnDeliveryRestrictions -> [Header]
$ctoHeader :: HeaderName -> AdsOnDeliveryRestrictions -> [Header]
Core.ToHeader,
      AdsOnDeliveryRestrictions -> QueryString
(AdsOnDeliveryRestrictions -> QueryString)
-> ToQuery AdsOnDeliveryRestrictions
forall a. (a -> QueryString) -> ToQuery a
toQuery :: AdsOnDeliveryRestrictions -> QueryString
$ctoQuery :: AdsOnDeliveryRestrictions -> QueryString
Core.ToQuery,
      Value -> Parser [AdsOnDeliveryRestrictions]
Value -> Parser AdsOnDeliveryRestrictions
(Value -> Parser AdsOnDeliveryRestrictions)
-> (Value -> Parser [AdsOnDeliveryRestrictions])
-> FromJSON AdsOnDeliveryRestrictions
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AdsOnDeliveryRestrictions]
$cparseJSONList :: Value -> Parser [AdsOnDeliveryRestrictions]
parseJSON :: Value -> Parser AdsOnDeliveryRestrictions
$cparseJSON :: Value -> Parser AdsOnDeliveryRestrictions
Core.FromJSON,
      FromJSONKeyFunction [AdsOnDeliveryRestrictions]
FromJSONKeyFunction AdsOnDeliveryRestrictions
FromJSONKeyFunction AdsOnDeliveryRestrictions
-> FromJSONKeyFunction [AdsOnDeliveryRestrictions]
-> FromJSONKey AdsOnDeliveryRestrictions
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [AdsOnDeliveryRestrictions]
$cfromJSONKeyList :: FromJSONKeyFunction [AdsOnDeliveryRestrictions]
fromJSONKey :: FromJSONKeyFunction AdsOnDeliveryRestrictions
$cfromJSONKey :: FromJSONKeyFunction AdsOnDeliveryRestrictions
Core.FromJSONKey,
      [AdsOnDeliveryRestrictions] -> Encoding
[AdsOnDeliveryRestrictions] -> Value
AdsOnDeliveryRestrictions -> Encoding
AdsOnDeliveryRestrictions -> Value
(AdsOnDeliveryRestrictions -> Value)
-> (AdsOnDeliveryRestrictions -> Encoding)
-> ([AdsOnDeliveryRestrictions] -> Value)
-> ([AdsOnDeliveryRestrictions] -> Encoding)
-> ToJSON AdsOnDeliveryRestrictions
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AdsOnDeliveryRestrictions] -> Encoding
$ctoEncodingList :: [AdsOnDeliveryRestrictions] -> Encoding
toJSONList :: [AdsOnDeliveryRestrictions] -> Value
$ctoJSONList :: [AdsOnDeliveryRestrictions] -> Value
toEncoding :: AdsOnDeliveryRestrictions -> Encoding
$ctoEncoding :: AdsOnDeliveryRestrictions -> Encoding
toJSON :: AdsOnDeliveryRestrictions -> Value
$ctoJSON :: AdsOnDeliveryRestrictions -> Value
Core.ToJSON,
      ToJSONKeyFunction [AdsOnDeliveryRestrictions]
ToJSONKeyFunction AdsOnDeliveryRestrictions
ToJSONKeyFunction AdsOnDeliveryRestrictions
-> ToJSONKeyFunction [AdsOnDeliveryRestrictions]
-> ToJSONKey AdsOnDeliveryRestrictions
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [AdsOnDeliveryRestrictions]
$ctoJSONKeyList :: ToJSONKeyFunction [AdsOnDeliveryRestrictions]
toJSONKey :: ToJSONKeyFunction AdsOnDeliveryRestrictions
$ctoJSONKey :: ToJSONKeyFunction AdsOnDeliveryRestrictions
Core.ToJSONKey,
      [Node] -> Either String AdsOnDeliveryRestrictions
([Node] -> Either String AdsOnDeliveryRestrictions)
-> FromXML AdsOnDeliveryRestrictions
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String AdsOnDeliveryRestrictions
$cparseXML :: [Node] -> Either String AdsOnDeliveryRestrictions
Core.FromXML,
      AdsOnDeliveryRestrictions -> XML
(AdsOnDeliveryRestrictions -> XML)
-> ToXML AdsOnDeliveryRestrictions
forall a. (a -> XML) -> ToXML a
toXML :: AdsOnDeliveryRestrictions -> XML
$ctoXML :: AdsOnDeliveryRestrictions -> XML
Core.ToXML
    )

pattern AdsOnDeliveryRestrictions_BOTH :: AdsOnDeliveryRestrictions
pattern $bAdsOnDeliveryRestrictions_BOTH :: AdsOnDeliveryRestrictions
$mAdsOnDeliveryRestrictions_BOTH :: forall r.
AdsOnDeliveryRestrictions -> (Void# -> r) -> (Void# -> r) -> r
AdsOnDeliveryRestrictions_BOTH = AdsOnDeliveryRestrictions' "BOTH"

pattern AdsOnDeliveryRestrictions_NONE :: AdsOnDeliveryRestrictions
pattern $bAdsOnDeliveryRestrictions_NONE :: AdsOnDeliveryRestrictions
$mAdsOnDeliveryRestrictions_NONE :: forall r.
AdsOnDeliveryRestrictions -> (Void# -> r) -> (Void# -> r) -> r
AdsOnDeliveryRestrictions_NONE = AdsOnDeliveryRestrictions' "NONE"

pattern AdsOnDeliveryRestrictions_RESTRICTED :: AdsOnDeliveryRestrictions
pattern $bAdsOnDeliveryRestrictions_RESTRICTED :: AdsOnDeliveryRestrictions
$mAdsOnDeliveryRestrictions_RESTRICTED :: forall r.
AdsOnDeliveryRestrictions -> (Void# -> r) -> (Void# -> r) -> r
AdsOnDeliveryRestrictions_RESTRICTED = AdsOnDeliveryRestrictions' "RESTRICTED"

pattern AdsOnDeliveryRestrictions_UNRESTRICTED :: AdsOnDeliveryRestrictions
pattern $bAdsOnDeliveryRestrictions_UNRESTRICTED :: AdsOnDeliveryRestrictions
$mAdsOnDeliveryRestrictions_UNRESTRICTED :: forall r.
AdsOnDeliveryRestrictions -> (Void# -> r) -> (Void# -> r) -> r
AdsOnDeliveryRestrictions_UNRESTRICTED = AdsOnDeliveryRestrictions' "UNRESTRICTED"

{-# COMPLETE
  AdsOnDeliveryRestrictions_BOTH,
  AdsOnDeliveryRestrictions_NONE,
  AdsOnDeliveryRestrictions_RESTRICTED,
  AdsOnDeliveryRestrictions_UNRESTRICTED,
  AdsOnDeliveryRestrictions'
  #-}