{-# 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 #-}

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

-- |
-- Module      : Amazonka.MediaLive.Types.AvailSettings
-- 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.MediaLive.Types.AvailSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.Scte35SpliceInsert
import Amazonka.MediaLive.Types.Scte35TimeSignalApos
import qualified Amazonka.Prelude as Prelude

-- | Avail Settings
--
-- /See:/ 'newAvailSettings' smart constructor.
data AvailSettings = AvailSettings'
  { AvailSettings -> Maybe Scte35SpliceInsert
scte35SpliceInsert :: Prelude.Maybe Scte35SpliceInsert,
    AvailSettings -> Maybe Scte35TimeSignalApos
scte35TimeSignalApos :: Prelude.Maybe Scte35TimeSignalApos
  }
  deriving (AvailSettings -> AvailSettings -> Bool
(AvailSettings -> AvailSettings -> Bool)
-> (AvailSettings -> AvailSettings -> Bool) -> Eq AvailSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AvailSettings -> AvailSettings -> Bool
$c/= :: AvailSettings -> AvailSettings -> Bool
== :: AvailSettings -> AvailSettings -> Bool
$c== :: AvailSettings -> AvailSettings -> Bool
Prelude.Eq, ReadPrec [AvailSettings]
ReadPrec AvailSettings
Int -> ReadS AvailSettings
ReadS [AvailSettings]
(Int -> ReadS AvailSettings)
-> ReadS [AvailSettings]
-> ReadPrec AvailSettings
-> ReadPrec [AvailSettings]
-> Read AvailSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AvailSettings]
$creadListPrec :: ReadPrec [AvailSettings]
readPrec :: ReadPrec AvailSettings
$creadPrec :: ReadPrec AvailSettings
readList :: ReadS [AvailSettings]
$creadList :: ReadS [AvailSettings]
readsPrec :: Int -> ReadS AvailSettings
$creadsPrec :: Int -> ReadS AvailSettings
Prelude.Read, Int -> AvailSettings -> ShowS
[AvailSettings] -> ShowS
AvailSettings -> String
(Int -> AvailSettings -> ShowS)
-> (AvailSettings -> String)
-> ([AvailSettings] -> ShowS)
-> Show AvailSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AvailSettings] -> ShowS
$cshowList :: [AvailSettings] -> ShowS
show :: AvailSettings -> String
$cshow :: AvailSettings -> String
showsPrec :: Int -> AvailSettings -> ShowS
$cshowsPrec :: Int -> AvailSettings -> ShowS
Prelude.Show, (forall x. AvailSettings -> Rep AvailSettings x)
-> (forall x. Rep AvailSettings x -> AvailSettings)
-> Generic AvailSettings
forall x. Rep AvailSettings x -> AvailSettings
forall x. AvailSettings -> Rep AvailSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AvailSettings x -> AvailSettings
$cfrom :: forall x. AvailSettings -> Rep AvailSettings x
Prelude.Generic)

-- |
-- Create a value of 'AvailSettings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'scte35SpliceInsert', 'availSettings_scte35SpliceInsert' - Undocumented member.
--
-- 'scte35TimeSignalApos', 'availSettings_scte35TimeSignalApos' - Undocumented member.
newAvailSettings ::
  AvailSettings
newAvailSettings :: AvailSettings
newAvailSettings =
  AvailSettings' :: Maybe Scte35SpliceInsert
-> Maybe Scte35TimeSignalApos -> AvailSettings
AvailSettings'
    { $sel:scte35SpliceInsert:AvailSettings' :: Maybe Scte35SpliceInsert
scte35SpliceInsert =
        Maybe Scte35SpliceInsert
forall a. Maybe a
Prelude.Nothing,
      $sel:scte35TimeSignalApos:AvailSettings' :: Maybe Scte35TimeSignalApos
scte35TimeSignalApos = Maybe Scte35TimeSignalApos
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
availSettings_scte35SpliceInsert :: Lens.Lens' AvailSettings (Prelude.Maybe Scte35SpliceInsert)
availSettings_scte35SpliceInsert :: (Maybe Scte35SpliceInsert -> f (Maybe Scte35SpliceInsert))
-> AvailSettings -> f AvailSettings
availSettings_scte35SpliceInsert = (AvailSettings -> Maybe Scte35SpliceInsert)
-> (AvailSettings -> Maybe Scte35SpliceInsert -> AvailSettings)
-> Lens
     AvailSettings
     AvailSettings
     (Maybe Scte35SpliceInsert)
     (Maybe Scte35SpliceInsert)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailSettings' {Maybe Scte35SpliceInsert
scte35SpliceInsert :: Maybe Scte35SpliceInsert
$sel:scte35SpliceInsert:AvailSettings' :: AvailSettings -> Maybe Scte35SpliceInsert
scte35SpliceInsert} -> Maybe Scte35SpliceInsert
scte35SpliceInsert) (\s :: AvailSettings
s@AvailSettings' {} Maybe Scte35SpliceInsert
a -> AvailSettings
s {$sel:scte35SpliceInsert:AvailSettings' :: Maybe Scte35SpliceInsert
scte35SpliceInsert = Maybe Scte35SpliceInsert
a} :: AvailSettings)

-- | Undocumented member.
availSettings_scte35TimeSignalApos :: Lens.Lens' AvailSettings (Prelude.Maybe Scte35TimeSignalApos)
availSettings_scte35TimeSignalApos :: (Maybe Scte35TimeSignalApos -> f (Maybe Scte35TimeSignalApos))
-> AvailSettings -> f AvailSettings
availSettings_scte35TimeSignalApos = (AvailSettings -> Maybe Scte35TimeSignalApos)
-> (AvailSettings -> Maybe Scte35TimeSignalApos -> AvailSettings)
-> Lens
     AvailSettings
     AvailSettings
     (Maybe Scte35TimeSignalApos)
     (Maybe Scte35TimeSignalApos)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AvailSettings' {Maybe Scte35TimeSignalApos
scte35TimeSignalApos :: Maybe Scte35TimeSignalApos
$sel:scte35TimeSignalApos:AvailSettings' :: AvailSettings -> Maybe Scte35TimeSignalApos
scte35TimeSignalApos} -> Maybe Scte35TimeSignalApos
scte35TimeSignalApos) (\s :: AvailSettings
s@AvailSettings' {} Maybe Scte35TimeSignalApos
a -> AvailSettings
s {$sel:scte35TimeSignalApos:AvailSettings' :: Maybe Scte35TimeSignalApos
scte35TimeSignalApos = Maybe Scte35TimeSignalApos
a} :: AvailSettings)

instance Core.FromJSON AvailSettings where
  parseJSON :: Value -> Parser AvailSettings
parseJSON =
    String
-> (Object -> Parser AvailSettings)
-> Value
-> Parser AvailSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AvailSettings"
      ( \Object
x ->
          Maybe Scte35SpliceInsert
-> Maybe Scte35TimeSignalApos -> AvailSettings
AvailSettings'
            (Maybe Scte35SpliceInsert
 -> Maybe Scte35TimeSignalApos -> AvailSettings)
-> Parser (Maybe Scte35SpliceInsert)
-> Parser (Maybe Scte35TimeSignalApos -> AvailSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Scte35SpliceInsert)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scte35SpliceInsert")
            Parser (Maybe Scte35TimeSignalApos -> AvailSettings)
-> Parser (Maybe Scte35TimeSignalApos) -> Parser AvailSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Scte35TimeSignalApos)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scte35TimeSignalApos")
      )

instance Prelude.Hashable AvailSettings

instance Prelude.NFData AvailSettings

instance Core.ToJSON AvailSettings where
  toJSON :: AvailSettings -> Value
toJSON AvailSettings' {Maybe Scte35SpliceInsert
Maybe Scte35TimeSignalApos
scte35TimeSignalApos :: Maybe Scte35TimeSignalApos
scte35SpliceInsert :: Maybe Scte35SpliceInsert
$sel:scte35TimeSignalApos:AvailSettings' :: AvailSettings -> Maybe Scte35TimeSignalApos
$sel:scte35SpliceInsert:AvailSettings' :: AvailSettings -> Maybe Scte35SpliceInsert
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"scte35SpliceInsert" Text -> Scte35SpliceInsert -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Scte35SpliceInsert -> Pair)
-> Maybe Scte35SpliceInsert -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Scte35SpliceInsert
scte35SpliceInsert,
            (Text
"scte35TimeSignalApos" Text -> Scte35TimeSignalApos -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Scte35TimeSignalApos -> Pair)
-> Maybe Scte35TimeSignalApos -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Scte35TimeSignalApos
scte35TimeSignalApos
          ]
      )