{-# 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 #-}
module Amazonka.MediaConvert.Types.S3DestinationAccessControl where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.S3ObjectCannedAcl
import qualified Amazonka.Prelude as Prelude
data S3DestinationAccessControl = S3DestinationAccessControl'
{
S3DestinationAccessControl -> Maybe S3ObjectCannedAcl
cannedAcl :: Prelude.Maybe S3ObjectCannedAcl
}
deriving (S3DestinationAccessControl -> S3DestinationAccessControl -> Bool
(S3DestinationAccessControl -> S3DestinationAccessControl -> Bool)
-> (S3DestinationAccessControl
-> S3DestinationAccessControl -> Bool)
-> Eq S3DestinationAccessControl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3DestinationAccessControl -> S3DestinationAccessControl -> Bool
$c/= :: S3DestinationAccessControl -> S3DestinationAccessControl -> Bool
== :: S3DestinationAccessControl -> S3DestinationAccessControl -> Bool
$c== :: S3DestinationAccessControl -> S3DestinationAccessControl -> Bool
Prelude.Eq, ReadPrec [S3DestinationAccessControl]
ReadPrec S3DestinationAccessControl
Int -> ReadS S3DestinationAccessControl
ReadS [S3DestinationAccessControl]
(Int -> ReadS S3DestinationAccessControl)
-> ReadS [S3DestinationAccessControl]
-> ReadPrec S3DestinationAccessControl
-> ReadPrec [S3DestinationAccessControl]
-> Read S3DestinationAccessControl
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3DestinationAccessControl]
$creadListPrec :: ReadPrec [S3DestinationAccessControl]
readPrec :: ReadPrec S3DestinationAccessControl
$creadPrec :: ReadPrec S3DestinationAccessControl
readList :: ReadS [S3DestinationAccessControl]
$creadList :: ReadS [S3DestinationAccessControl]
readsPrec :: Int -> ReadS S3DestinationAccessControl
$creadsPrec :: Int -> ReadS S3DestinationAccessControl
Prelude.Read, Int -> S3DestinationAccessControl -> ShowS
[S3DestinationAccessControl] -> ShowS
S3DestinationAccessControl -> String
(Int -> S3DestinationAccessControl -> ShowS)
-> (S3DestinationAccessControl -> String)
-> ([S3DestinationAccessControl] -> ShowS)
-> Show S3DestinationAccessControl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3DestinationAccessControl] -> ShowS
$cshowList :: [S3DestinationAccessControl] -> ShowS
show :: S3DestinationAccessControl -> String
$cshow :: S3DestinationAccessControl -> String
showsPrec :: Int -> S3DestinationAccessControl -> ShowS
$cshowsPrec :: Int -> S3DestinationAccessControl -> ShowS
Prelude.Show, (forall x.
S3DestinationAccessControl -> Rep S3DestinationAccessControl x)
-> (forall x.
Rep S3DestinationAccessControl x -> S3DestinationAccessControl)
-> Generic S3DestinationAccessControl
forall x.
Rep S3DestinationAccessControl x -> S3DestinationAccessControl
forall x.
S3DestinationAccessControl -> Rep S3DestinationAccessControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3DestinationAccessControl x -> S3DestinationAccessControl
$cfrom :: forall x.
S3DestinationAccessControl -> Rep S3DestinationAccessControl x
Prelude.Generic)
newS3DestinationAccessControl ::
S3DestinationAccessControl
newS3DestinationAccessControl :: S3DestinationAccessControl
newS3DestinationAccessControl =
S3DestinationAccessControl' :: Maybe S3ObjectCannedAcl -> S3DestinationAccessControl
S3DestinationAccessControl'
{ $sel:cannedAcl:S3DestinationAccessControl' :: Maybe S3ObjectCannedAcl
cannedAcl =
Maybe S3ObjectCannedAcl
forall a. Maybe a
Prelude.Nothing
}
s3DestinationAccessControl_cannedAcl :: Lens.Lens' S3DestinationAccessControl (Prelude.Maybe S3ObjectCannedAcl)
s3DestinationAccessControl_cannedAcl :: (Maybe S3ObjectCannedAcl -> f (Maybe S3ObjectCannedAcl))
-> S3DestinationAccessControl -> f S3DestinationAccessControl
s3DestinationAccessControl_cannedAcl = (S3DestinationAccessControl -> Maybe S3ObjectCannedAcl)
-> (S3DestinationAccessControl
-> Maybe S3ObjectCannedAcl -> S3DestinationAccessControl)
-> Lens
S3DestinationAccessControl
S3DestinationAccessControl
(Maybe S3ObjectCannedAcl)
(Maybe S3ObjectCannedAcl)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3DestinationAccessControl' {Maybe S3ObjectCannedAcl
cannedAcl :: Maybe S3ObjectCannedAcl
$sel:cannedAcl:S3DestinationAccessControl' :: S3DestinationAccessControl -> Maybe S3ObjectCannedAcl
cannedAcl} -> Maybe S3ObjectCannedAcl
cannedAcl) (\s :: S3DestinationAccessControl
s@S3DestinationAccessControl' {} Maybe S3ObjectCannedAcl
a -> S3DestinationAccessControl
s {$sel:cannedAcl:S3DestinationAccessControl' :: Maybe S3ObjectCannedAcl
cannedAcl = Maybe S3ObjectCannedAcl
a} :: S3DestinationAccessControl)
instance Core.FromJSON S3DestinationAccessControl where
parseJSON :: Value -> Parser S3DestinationAccessControl
parseJSON =
String
-> (Object -> Parser S3DestinationAccessControl)
-> Value
-> Parser S3DestinationAccessControl
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3DestinationAccessControl"
( \Object
x ->
Maybe S3ObjectCannedAcl -> S3DestinationAccessControl
S3DestinationAccessControl'
(Maybe S3ObjectCannedAcl -> S3DestinationAccessControl)
-> Parser (Maybe S3ObjectCannedAcl)
-> Parser S3DestinationAccessControl
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3ObjectCannedAcl)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cannedAcl")
)
instance Prelude.Hashable S3DestinationAccessControl
instance Prelude.NFData S3DestinationAccessControl
instance Core.ToJSON S3DestinationAccessControl where
toJSON :: S3DestinationAccessControl -> Value
toJSON S3DestinationAccessControl' {Maybe S3ObjectCannedAcl
cannedAcl :: Maybe S3ObjectCannedAcl
$sel:cannedAcl:S3DestinationAccessControl' :: S3DestinationAccessControl -> Maybe S3ObjectCannedAcl
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"cannedAcl" Text -> S3ObjectCannedAcl -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3ObjectCannedAcl -> Pair)
-> Maybe S3ObjectCannedAcl -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3ObjectCannedAcl
cannedAcl]
)