{-# 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.ArchiveContainerSettings
-- 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.MediaLive.Types.ArchiveContainerSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.M2tsSettings
import Amazonka.MediaLive.Types.RawSettings
import qualified Amazonka.Prelude as Prelude

-- | Archive Container Settings
--
-- /See:/ 'newArchiveContainerSettings' smart constructor.
data ArchiveContainerSettings = ArchiveContainerSettings'
  { ArchiveContainerSettings -> Maybe M2tsSettings
m2tsSettings :: Prelude.Maybe M2tsSettings,
    ArchiveContainerSettings -> Maybe RawSettings
rawSettings :: Prelude.Maybe RawSettings
  }
  deriving (ArchiveContainerSettings -> ArchiveContainerSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArchiveContainerSettings -> ArchiveContainerSettings -> Bool
$c/= :: ArchiveContainerSettings -> ArchiveContainerSettings -> Bool
== :: ArchiveContainerSettings -> ArchiveContainerSettings -> Bool
$c== :: ArchiveContainerSettings -> ArchiveContainerSettings -> Bool
Prelude.Eq, ReadPrec [ArchiveContainerSettings]
ReadPrec ArchiveContainerSettings
Int -> ReadS ArchiveContainerSettings
ReadS [ArchiveContainerSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArchiveContainerSettings]
$creadListPrec :: ReadPrec [ArchiveContainerSettings]
readPrec :: ReadPrec ArchiveContainerSettings
$creadPrec :: ReadPrec ArchiveContainerSettings
readList :: ReadS [ArchiveContainerSettings]
$creadList :: ReadS [ArchiveContainerSettings]
readsPrec :: Int -> ReadS ArchiveContainerSettings
$creadsPrec :: Int -> ReadS ArchiveContainerSettings
Prelude.Read, Int -> ArchiveContainerSettings -> ShowS
[ArchiveContainerSettings] -> ShowS
ArchiveContainerSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArchiveContainerSettings] -> ShowS
$cshowList :: [ArchiveContainerSettings] -> ShowS
show :: ArchiveContainerSettings -> String
$cshow :: ArchiveContainerSettings -> String
showsPrec :: Int -> ArchiveContainerSettings -> ShowS
$cshowsPrec :: Int -> ArchiveContainerSettings -> ShowS
Prelude.Show, forall x.
Rep ArchiveContainerSettings x -> ArchiveContainerSettings
forall x.
ArchiveContainerSettings -> Rep ArchiveContainerSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ArchiveContainerSettings x -> ArchiveContainerSettings
$cfrom :: forall x.
ArchiveContainerSettings -> Rep ArchiveContainerSettings x
Prelude.Generic)

-- |
-- Create a value of 'ArchiveContainerSettings' 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:
--
-- 'm2tsSettings', 'archiveContainerSettings_m2tsSettings' - Undocumented member.
--
-- 'rawSettings', 'archiveContainerSettings_rawSettings' - Undocumented member.
newArchiveContainerSettings ::
  ArchiveContainerSettings
newArchiveContainerSettings :: ArchiveContainerSettings
newArchiveContainerSettings =
  ArchiveContainerSettings'
    { $sel:m2tsSettings:ArchiveContainerSettings' :: Maybe M2tsSettings
m2tsSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:rawSettings:ArchiveContainerSettings' :: Maybe RawSettings
rawSettings = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
archiveContainerSettings_m2tsSettings :: Lens.Lens' ArchiveContainerSettings (Prelude.Maybe M2tsSettings)
archiveContainerSettings_m2tsSettings :: Lens' ArchiveContainerSettings (Maybe M2tsSettings)
archiveContainerSettings_m2tsSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveContainerSettings' {Maybe M2tsSettings
m2tsSettings :: Maybe M2tsSettings
$sel:m2tsSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe M2tsSettings
m2tsSettings} -> Maybe M2tsSettings
m2tsSettings) (\s :: ArchiveContainerSettings
s@ArchiveContainerSettings' {} Maybe M2tsSettings
a -> ArchiveContainerSettings
s {$sel:m2tsSettings:ArchiveContainerSettings' :: Maybe M2tsSettings
m2tsSettings = Maybe M2tsSettings
a} :: ArchiveContainerSettings)

-- | Undocumented member.
archiveContainerSettings_rawSettings :: Lens.Lens' ArchiveContainerSettings (Prelude.Maybe RawSettings)
archiveContainerSettings_rawSettings :: Lens' ArchiveContainerSettings (Maybe RawSettings)
archiveContainerSettings_rawSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveContainerSettings' {Maybe RawSettings
rawSettings :: Maybe RawSettings
$sel:rawSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe RawSettings
rawSettings} -> Maybe RawSettings
rawSettings) (\s :: ArchiveContainerSettings
s@ArchiveContainerSettings' {} Maybe RawSettings
a -> ArchiveContainerSettings
s {$sel:rawSettings:ArchiveContainerSettings' :: Maybe RawSettings
rawSettings = Maybe RawSettings
a} :: ArchiveContainerSettings)

instance Data.FromJSON ArchiveContainerSettings where
  parseJSON :: Value -> Parser ArchiveContainerSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ArchiveContainerSettings"
      ( \Object
x ->
          Maybe M2tsSettings -> Maybe RawSettings -> ArchiveContainerSettings
ArchiveContainerSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"m2tsSettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"rawSettings")
      )

instance Prelude.Hashable ArchiveContainerSettings where
  hashWithSalt :: Int -> ArchiveContainerSettings -> Int
hashWithSalt Int
_salt ArchiveContainerSettings' {Maybe M2tsSettings
Maybe RawSettings
rawSettings :: Maybe RawSettings
m2tsSettings :: Maybe M2tsSettings
$sel:rawSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe RawSettings
$sel:m2tsSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe M2tsSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe M2tsSettings
m2tsSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RawSettings
rawSettings

instance Prelude.NFData ArchiveContainerSettings where
  rnf :: ArchiveContainerSettings -> ()
rnf ArchiveContainerSettings' {Maybe M2tsSettings
Maybe RawSettings
rawSettings :: Maybe RawSettings
m2tsSettings :: Maybe M2tsSettings
$sel:rawSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe RawSettings
$sel:m2tsSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe M2tsSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe M2tsSettings
m2tsSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RawSettings
rawSettings

instance Data.ToJSON ArchiveContainerSettings where
  toJSON :: ArchiveContainerSettings -> Value
toJSON ArchiveContainerSettings' {Maybe M2tsSettings
Maybe RawSettings
rawSettings :: Maybe RawSettings
m2tsSettings :: Maybe M2tsSettings
$sel:rawSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe RawSettings
$sel:m2tsSettings:ArchiveContainerSettings' :: ArchiveContainerSettings -> Maybe M2tsSettings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"m2tsSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe M2tsSettings
m2tsSettings,
            (Key
"rawSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RawSettings
rawSettings
          ]
      )