{-# 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-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.FrameCaptureCdnSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(FrameCaptureCdnSettings -> FrameCaptureCdnSettings -> Bool)
-> (FrameCaptureCdnSettings -> FrameCaptureCdnSettings -> Bool)
-> Eq FrameCaptureCdnSettings
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]
(Int -> ReadS FrameCaptureCdnSettings)
-> ReadS [FrameCaptureCdnSettings]
-> ReadPrec FrameCaptureCdnSettings
-> ReadPrec [FrameCaptureCdnSettings]
-> Read 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
(Int -> FrameCaptureCdnSettings -> ShowS)
-> (FrameCaptureCdnSettings -> String)
-> ([FrameCaptureCdnSettings] -> ShowS)
-> Show FrameCaptureCdnSettings
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.
 FrameCaptureCdnSettings -> Rep FrameCaptureCdnSettings x)
-> (forall x.
    Rep FrameCaptureCdnSettings x -> FrameCaptureCdnSettings)
-> Generic FrameCaptureCdnSettings
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' :: Maybe FrameCaptureS3Settings -> FrameCaptureCdnSettings
FrameCaptureCdnSettings'
    { $sel:frameCaptureS3Settings:FrameCaptureCdnSettings' :: Maybe FrameCaptureS3Settings
frameCaptureS3Settings =
        Maybe FrameCaptureS3Settings
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
frameCaptureCdnSettings_frameCaptureS3Settings :: Lens.Lens' FrameCaptureCdnSettings (Prelude.Maybe FrameCaptureS3Settings)
frameCaptureCdnSettings_frameCaptureS3Settings :: (Maybe FrameCaptureS3Settings -> f (Maybe FrameCaptureS3Settings))
-> FrameCaptureCdnSettings -> f FrameCaptureCdnSettings
frameCaptureCdnSettings_frameCaptureS3Settings = (FrameCaptureCdnSettings -> Maybe FrameCaptureS3Settings)
-> (FrameCaptureCdnSettings
    -> Maybe FrameCaptureS3Settings -> FrameCaptureCdnSettings)
-> Lens
     FrameCaptureCdnSettings
     FrameCaptureCdnSettings
     (Maybe FrameCaptureS3Settings)
     (Maybe 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 Core.FromJSON FrameCaptureCdnSettings where
  parseJSON :: Value -> Parser FrameCaptureCdnSettings
parseJSON =
    String
-> (Object -> Parser FrameCaptureCdnSettings)
-> Value
-> Parser FrameCaptureCdnSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FrameCaptureCdnSettings"
      ( \Object
x ->
          Maybe FrameCaptureS3Settings -> FrameCaptureCdnSettings
FrameCaptureCdnSettings'
            (Maybe FrameCaptureS3Settings -> FrameCaptureCdnSettings)
-> Parser (Maybe FrameCaptureS3Settings)
-> Parser FrameCaptureCdnSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FrameCaptureS3Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"frameCaptureS3Settings")
      )

instance Prelude.Hashable FrameCaptureCdnSettings

instance Prelude.NFData FrameCaptureCdnSettings

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