{-# 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.ElasticTranscoder.Types.PipelineOutputConfig where
import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.Permission
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PipelineOutputConfig = PipelineOutputConfig'
{
PipelineOutputConfig -> Maybe Text
bucket :: Prelude.Maybe Prelude.Text,
PipelineOutputConfig -> Maybe Text
storageClass :: Prelude.Maybe Prelude.Text,
PipelineOutputConfig -> Maybe [Permission]
permissions :: Prelude.Maybe [Permission]
}
deriving (PipelineOutputConfig -> PipelineOutputConfig -> Bool
(PipelineOutputConfig -> PipelineOutputConfig -> Bool)
-> (PipelineOutputConfig -> PipelineOutputConfig -> Bool)
-> Eq PipelineOutputConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineOutputConfig -> PipelineOutputConfig -> Bool
$c/= :: PipelineOutputConfig -> PipelineOutputConfig -> Bool
== :: PipelineOutputConfig -> PipelineOutputConfig -> Bool
$c== :: PipelineOutputConfig -> PipelineOutputConfig -> Bool
Prelude.Eq, ReadPrec [PipelineOutputConfig]
ReadPrec PipelineOutputConfig
Int -> ReadS PipelineOutputConfig
ReadS [PipelineOutputConfig]
(Int -> ReadS PipelineOutputConfig)
-> ReadS [PipelineOutputConfig]
-> ReadPrec PipelineOutputConfig
-> ReadPrec [PipelineOutputConfig]
-> Read PipelineOutputConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineOutputConfig]
$creadListPrec :: ReadPrec [PipelineOutputConfig]
readPrec :: ReadPrec PipelineOutputConfig
$creadPrec :: ReadPrec PipelineOutputConfig
readList :: ReadS [PipelineOutputConfig]
$creadList :: ReadS [PipelineOutputConfig]
readsPrec :: Int -> ReadS PipelineOutputConfig
$creadsPrec :: Int -> ReadS PipelineOutputConfig
Prelude.Read, Int -> PipelineOutputConfig -> ShowS
[PipelineOutputConfig] -> ShowS
PipelineOutputConfig -> String
(Int -> PipelineOutputConfig -> ShowS)
-> (PipelineOutputConfig -> String)
-> ([PipelineOutputConfig] -> ShowS)
-> Show PipelineOutputConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineOutputConfig] -> ShowS
$cshowList :: [PipelineOutputConfig] -> ShowS
show :: PipelineOutputConfig -> String
$cshow :: PipelineOutputConfig -> String
showsPrec :: Int -> PipelineOutputConfig -> ShowS
$cshowsPrec :: Int -> PipelineOutputConfig -> ShowS
Prelude.Show, (forall x. PipelineOutputConfig -> Rep PipelineOutputConfig x)
-> (forall x. Rep PipelineOutputConfig x -> PipelineOutputConfig)
-> Generic PipelineOutputConfig
forall x. Rep PipelineOutputConfig x -> PipelineOutputConfig
forall x. PipelineOutputConfig -> Rep PipelineOutputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PipelineOutputConfig x -> PipelineOutputConfig
$cfrom :: forall x. PipelineOutputConfig -> Rep PipelineOutputConfig x
Prelude.Generic)
newPipelineOutputConfig ::
PipelineOutputConfig
newPipelineOutputConfig :: PipelineOutputConfig
newPipelineOutputConfig =
PipelineOutputConfig' :: Maybe Text
-> Maybe Text -> Maybe [Permission] -> PipelineOutputConfig
PipelineOutputConfig'
{ $sel:bucket:PipelineOutputConfig' :: Maybe Text
bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:storageClass:PipelineOutputConfig' :: Maybe Text
storageClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:permissions:PipelineOutputConfig' :: Maybe [Permission]
permissions = Maybe [Permission]
forall a. Maybe a
Prelude.Nothing
}
pipelineOutputConfig_bucket :: Lens.Lens' PipelineOutputConfig (Prelude.Maybe Prelude.Text)
pipelineOutputConfig_bucket :: (Maybe Text -> f (Maybe Text))
-> PipelineOutputConfig -> f PipelineOutputConfig
pipelineOutputConfig_bucket = (PipelineOutputConfig -> Maybe Text)
-> (PipelineOutputConfig -> Maybe Text -> PipelineOutputConfig)
-> Lens
PipelineOutputConfig PipelineOutputConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineOutputConfig' {Maybe Text
bucket :: Maybe Text
$sel:bucket:PipelineOutputConfig' :: PipelineOutputConfig -> Maybe Text
bucket} -> Maybe Text
bucket) (\s :: PipelineOutputConfig
s@PipelineOutputConfig' {} Maybe Text
a -> PipelineOutputConfig
s {$sel:bucket:PipelineOutputConfig' :: Maybe Text
bucket = Maybe Text
a} :: PipelineOutputConfig)
pipelineOutputConfig_storageClass :: Lens.Lens' PipelineOutputConfig (Prelude.Maybe Prelude.Text)
pipelineOutputConfig_storageClass :: (Maybe Text -> f (Maybe Text))
-> PipelineOutputConfig -> f PipelineOutputConfig
pipelineOutputConfig_storageClass = (PipelineOutputConfig -> Maybe Text)
-> (PipelineOutputConfig -> Maybe Text -> PipelineOutputConfig)
-> Lens
PipelineOutputConfig PipelineOutputConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineOutputConfig' {Maybe Text
storageClass :: Maybe Text
$sel:storageClass:PipelineOutputConfig' :: PipelineOutputConfig -> Maybe Text
storageClass} -> Maybe Text
storageClass) (\s :: PipelineOutputConfig
s@PipelineOutputConfig' {} Maybe Text
a -> PipelineOutputConfig
s {$sel:storageClass:PipelineOutputConfig' :: Maybe Text
storageClass = Maybe Text
a} :: PipelineOutputConfig)
pipelineOutputConfig_permissions :: Lens.Lens' PipelineOutputConfig (Prelude.Maybe [Permission])
pipelineOutputConfig_permissions :: (Maybe [Permission] -> f (Maybe [Permission]))
-> PipelineOutputConfig -> f PipelineOutputConfig
pipelineOutputConfig_permissions = (PipelineOutputConfig -> Maybe [Permission])
-> (PipelineOutputConfig
-> Maybe [Permission] -> PipelineOutputConfig)
-> Lens
PipelineOutputConfig
PipelineOutputConfig
(Maybe [Permission])
(Maybe [Permission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineOutputConfig' {Maybe [Permission]
permissions :: Maybe [Permission]
$sel:permissions:PipelineOutputConfig' :: PipelineOutputConfig -> Maybe [Permission]
permissions} -> Maybe [Permission]
permissions) (\s :: PipelineOutputConfig
s@PipelineOutputConfig' {} Maybe [Permission]
a -> PipelineOutputConfig
s {$sel:permissions:PipelineOutputConfig' :: Maybe [Permission]
permissions = Maybe [Permission]
a} :: PipelineOutputConfig) ((Maybe [Permission] -> f (Maybe [Permission]))
-> PipelineOutputConfig -> f PipelineOutputConfig)
-> ((Maybe [Permission] -> f (Maybe [Permission]))
-> Maybe [Permission] -> f (Maybe [Permission]))
-> (Maybe [Permission] -> f (Maybe [Permission]))
-> PipelineOutputConfig
-> f PipelineOutputConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Permission] [Permission] [Permission] [Permission]
-> Iso
(Maybe [Permission])
(Maybe [Permission])
(Maybe [Permission])
(Maybe [Permission])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Permission] [Permission] [Permission] [Permission]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON PipelineOutputConfig where
parseJSON :: Value -> Parser PipelineOutputConfig
parseJSON =
String
-> (Object -> Parser PipelineOutputConfig)
-> Value
-> Parser PipelineOutputConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PipelineOutputConfig"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe [Permission] -> PipelineOutputConfig
PipelineOutputConfig'
(Maybe Text
-> Maybe Text -> Maybe [Permission] -> PipelineOutputConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Permission] -> PipelineOutputConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Bucket")
Parser (Maybe Text -> Maybe [Permission] -> PipelineOutputConfig)
-> Parser (Maybe Text)
-> Parser (Maybe [Permission] -> PipelineOutputConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StorageClass")
Parser (Maybe [Permission] -> PipelineOutputConfig)
-> Parser (Maybe [Permission]) -> Parser PipelineOutputConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Permission]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Permissions" Parser (Maybe (Maybe [Permission]))
-> Maybe [Permission] -> Parser (Maybe [Permission])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Permission]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable PipelineOutputConfig
instance Prelude.NFData PipelineOutputConfig
instance Core.ToJSON PipelineOutputConfig where
toJSON :: PipelineOutputConfig -> Value
toJSON PipelineOutputConfig' {Maybe [Permission]
Maybe Text
permissions :: Maybe [Permission]
storageClass :: Maybe Text
bucket :: Maybe Text
$sel:permissions:PipelineOutputConfig' :: PipelineOutputConfig -> Maybe [Permission]
$sel:storageClass:PipelineOutputConfig' :: PipelineOutputConfig -> Maybe Text
$sel:bucket:PipelineOutputConfig' :: PipelineOutputConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Bucket" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bucket,
(Text
"StorageClass" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
storageClass,
(Text
"Permissions" Text -> [Permission] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Permission] -> Pair) -> Maybe [Permission] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Permission]
permissions
]
)