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