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

-- | Hls S3 Settings
--
-- /See:/ 'newHlsS3Settings' smart constructor.
data HlsS3Settings = HlsS3Settings'
  { -- | Specify the canned ACL to apply to each S3 request. Defaults to none.
    HlsS3Settings -> Maybe S3CannedAcl
cannedAcl :: Prelude.Maybe S3CannedAcl
  }
  deriving (HlsS3Settings -> HlsS3Settings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsS3Settings -> HlsS3Settings -> Bool
$c/= :: HlsS3Settings -> HlsS3Settings -> Bool
== :: HlsS3Settings -> HlsS3Settings -> Bool
$c== :: HlsS3Settings -> HlsS3Settings -> Bool
Prelude.Eq, ReadPrec [HlsS3Settings]
ReadPrec HlsS3Settings
Int -> ReadS HlsS3Settings
ReadS [HlsS3Settings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsS3Settings]
$creadListPrec :: ReadPrec [HlsS3Settings]
readPrec :: ReadPrec HlsS3Settings
$creadPrec :: ReadPrec HlsS3Settings
readList :: ReadS [HlsS3Settings]
$creadList :: ReadS [HlsS3Settings]
readsPrec :: Int -> ReadS HlsS3Settings
$creadsPrec :: Int -> ReadS HlsS3Settings
Prelude.Read, Int -> HlsS3Settings -> ShowS
[HlsS3Settings] -> ShowS
HlsS3Settings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsS3Settings] -> ShowS
$cshowList :: [HlsS3Settings] -> ShowS
show :: HlsS3Settings -> String
$cshow :: HlsS3Settings -> String
showsPrec :: Int -> HlsS3Settings -> ShowS
$cshowsPrec :: Int -> HlsS3Settings -> ShowS
Prelude.Show, forall x. Rep HlsS3Settings x -> HlsS3Settings
forall x. HlsS3Settings -> Rep HlsS3Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HlsS3Settings x -> HlsS3Settings
$cfrom :: forall x. HlsS3Settings -> Rep HlsS3Settings x
Prelude.Generic)

-- |
-- Create a value of 'HlsS3Settings' 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:
--
-- 'cannedAcl', 'hlsS3Settings_cannedAcl' - Specify the canned ACL to apply to each S3 request. Defaults to none.
newHlsS3Settings ::
  HlsS3Settings
newHlsS3Settings :: HlsS3Settings
newHlsS3Settings =
  HlsS3Settings' {$sel:cannedAcl:HlsS3Settings' :: Maybe S3CannedAcl
cannedAcl = forall a. Maybe a
Prelude.Nothing}

-- | Specify the canned ACL to apply to each S3 request. Defaults to none.
hlsS3Settings_cannedAcl :: Lens.Lens' HlsS3Settings (Prelude.Maybe S3CannedAcl)
hlsS3Settings_cannedAcl :: Lens' HlsS3Settings (Maybe S3CannedAcl)
hlsS3Settings_cannedAcl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsS3Settings' {Maybe S3CannedAcl
cannedAcl :: Maybe S3CannedAcl
$sel:cannedAcl:HlsS3Settings' :: HlsS3Settings -> Maybe S3CannedAcl
cannedAcl} -> Maybe S3CannedAcl
cannedAcl) (\s :: HlsS3Settings
s@HlsS3Settings' {} Maybe S3CannedAcl
a -> HlsS3Settings
s {$sel:cannedAcl:HlsS3Settings' :: Maybe S3CannedAcl
cannedAcl = Maybe S3CannedAcl
a} :: HlsS3Settings)

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

instance Prelude.Hashable HlsS3Settings where
  hashWithSalt :: Int -> HlsS3Settings -> Int
hashWithSalt Int
_salt HlsS3Settings' {Maybe S3CannedAcl
cannedAcl :: Maybe S3CannedAcl
$sel:cannedAcl:HlsS3Settings' :: HlsS3Settings -> Maybe S3CannedAcl
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3CannedAcl
cannedAcl

instance Prelude.NFData HlsS3Settings where
  rnf :: HlsS3Settings -> ()
rnf HlsS3Settings' {Maybe S3CannedAcl
cannedAcl :: Maybe S3CannedAcl
$sel:cannedAcl:HlsS3Settings' :: HlsS3Settings -> Maybe S3CannedAcl
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe S3CannedAcl
cannedAcl

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