{-# 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.ArchiveCdnSettings
-- 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.ArchiveCdnSettings 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.ArchiveS3Settings
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'ArchiveCdnSettings' 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:
--
-- 'archiveS3Settings', 'archiveCdnSettings_archiveS3Settings' - Undocumented member.
newArchiveCdnSettings ::
  ArchiveCdnSettings
newArchiveCdnSettings :: ArchiveCdnSettings
newArchiveCdnSettings =
  ArchiveCdnSettings'
    { $sel:archiveS3Settings:ArchiveCdnSettings' :: Maybe ArchiveS3Settings
archiveS3Settings =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
archiveCdnSettings_archiveS3Settings :: Lens.Lens' ArchiveCdnSettings (Prelude.Maybe ArchiveS3Settings)
archiveCdnSettings_archiveS3Settings :: Lens' ArchiveCdnSettings (Maybe ArchiveS3Settings)
archiveCdnSettings_archiveS3Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveCdnSettings' {Maybe ArchiveS3Settings
archiveS3Settings :: Maybe ArchiveS3Settings
$sel:archiveS3Settings:ArchiveCdnSettings' :: ArchiveCdnSettings -> Maybe ArchiveS3Settings
archiveS3Settings} -> Maybe ArchiveS3Settings
archiveS3Settings) (\s :: ArchiveCdnSettings
s@ArchiveCdnSettings' {} Maybe ArchiveS3Settings
a -> ArchiveCdnSettings
s {$sel:archiveS3Settings:ArchiveCdnSettings' :: Maybe ArchiveS3Settings
archiveS3Settings = Maybe ArchiveS3Settings
a} :: ArchiveCdnSettings)

instance Data.FromJSON ArchiveCdnSettings where
  parseJSON :: Value -> Parser ArchiveCdnSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ArchiveCdnSettings"
      ( \Object
x ->
          Maybe ArchiveS3Settings -> ArchiveCdnSettings
ArchiveCdnSettings'
            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
"archiveS3Settings")
      )

instance Prelude.Hashable ArchiveCdnSettings where
  hashWithSalt :: Int -> ArchiveCdnSettings -> Int
hashWithSalt Int
_salt ArchiveCdnSettings' {Maybe ArchiveS3Settings
archiveS3Settings :: Maybe ArchiveS3Settings
$sel:archiveS3Settings:ArchiveCdnSettings' :: ArchiveCdnSettings -> Maybe ArchiveS3Settings
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ArchiveS3Settings
archiveS3Settings

instance Prelude.NFData ArchiveCdnSettings where
  rnf :: ArchiveCdnSettings -> ()
rnf ArchiveCdnSettings' {Maybe ArchiveS3Settings
archiveS3Settings :: Maybe ArchiveS3Settings
$sel:archiveS3Settings:ArchiveCdnSettings' :: ArchiveCdnSettings -> Maybe ArchiveS3Settings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ArchiveS3Settings
archiveS3Settings

instance Data.ToJSON ArchiveCdnSettings where
  toJSON :: ArchiveCdnSettings -> Value
toJSON ArchiveCdnSettings' {Maybe ArchiveS3Settings
archiveS3Settings :: Maybe ArchiveS3Settings
$sel:archiveS3Settings:ArchiveCdnSettings' :: ArchiveCdnSettings -> Maybe ArchiveS3Settings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"archiveS3Settings" 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 ArchiveS3Settings
archiveS3Settings
          ]
      )