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