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

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

-- |
-- Create a value of 'FrameCaptureCdnSettings' 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:
--
-- 'frameCaptureS3Settings', 'frameCaptureCdnSettings_frameCaptureS3Settings' - Undocumented member.
newFrameCaptureCdnSettings ::
  FrameCaptureCdnSettings
newFrameCaptureCdnSettings :: FrameCaptureCdnSettings
newFrameCaptureCdnSettings =
  FrameCaptureCdnSettings'
    { $sel:frameCaptureS3Settings:FrameCaptureCdnSettings' :: Maybe FrameCaptureS3Settings
frameCaptureS3Settings =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
frameCaptureCdnSettings_frameCaptureS3Settings :: Lens.Lens' FrameCaptureCdnSettings (Prelude.Maybe FrameCaptureS3Settings)
frameCaptureCdnSettings_frameCaptureS3Settings :: Lens' FrameCaptureCdnSettings (Maybe FrameCaptureS3Settings)
frameCaptureCdnSettings_frameCaptureS3Settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureCdnSettings' {Maybe FrameCaptureS3Settings
frameCaptureS3Settings :: Maybe FrameCaptureS3Settings
$sel:frameCaptureS3Settings:FrameCaptureCdnSettings' :: FrameCaptureCdnSettings -> Maybe FrameCaptureS3Settings
frameCaptureS3Settings} -> Maybe FrameCaptureS3Settings
frameCaptureS3Settings) (\s :: FrameCaptureCdnSettings
s@FrameCaptureCdnSettings' {} Maybe FrameCaptureS3Settings
a -> FrameCaptureCdnSettings
s {$sel:frameCaptureS3Settings:FrameCaptureCdnSettings' :: Maybe FrameCaptureS3Settings
frameCaptureS3Settings = Maybe FrameCaptureS3Settings
a} :: FrameCaptureCdnSettings)

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

instance Prelude.Hashable FrameCaptureCdnSettings where
  hashWithSalt :: Int -> FrameCaptureCdnSettings -> Int
hashWithSalt Int
_salt FrameCaptureCdnSettings' {Maybe FrameCaptureS3Settings
frameCaptureS3Settings :: Maybe FrameCaptureS3Settings
$sel:frameCaptureS3Settings:FrameCaptureCdnSettings' :: FrameCaptureCdnSettings -> Maybe FrameCaptureS3Settings
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FrameCaptureS3Settings
frameCaptureS3Settings

instance Prelude.NFData FrameCaptureCdnSettings where
  rnf :: FrameCaptureCdnSettings -> ()
rnf FrameCaptureCdnSettings' {Maybe FrameCaptureS3Settings
frameCaptureS3Settings :: Maybe FrameCaptureS3Settings
$sel:frameCaptureS3Settings:FrameCaptureCdnSettings' :: FrameCaptureCdnSettings -> Maybe FrameCaptureS3Settings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FrameCaptureS3Settings
frameCaptureS3Settings

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