{-# 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.APIGateway.Types.DocumentationVersion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DocumentationVersion = DocumentationVersion'
{
DocumentationVersion -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
DocumentationVersion -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
DocumentationVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (DocumentationVersion -> DocumentationVersion -> Bool
(DocumentationVersion -> DocumentationVersion -> Bool)
-> (DocumentationVersion -> DocumentationVersion -> Bool)
-> Eq DocumentationVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentationVersion -> DocumentationVersion -> Bool
$c/= :: DocumentationVersion -> DocumentationVersion -> Bool
== :: DocumentationVersion -> DocumentationVersion -> Bool
$c== :: DocumentationVersion -> DocumentationVersion -> Bool
Prelude.Eq, ReadPrec [DocumentationVersion]
ReadPrec DocumentationVersion
Int -> ReadS DocumentationVersion
ReadS [DocumentationVersion]
(Int -> ReadS DocumentationVersion)
-> ReadS [DocumentationVersion]
-> ReadPrec DocumentationVersion
-> ReadPrec [DocumentationVersion]
-> Read DocumentationVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentationVersion]
$creadListPrec :: ReadPrec [DocumentationVersion]
readPrec :: ReadPrec DocumentationVersion
$creadPrec :: ReadPrec DocumentationVersion
readList :: ReadS [DocumentationVersion]
$creadList :: ReadS [DocumentationVersion]
readsPrec :: Int -> ReadS DocumentationVersion
$creadsPrec :: Int -> ReadS DocumentationVersion
Prelude.Read, Int -> DocumentationVersion -> ShowS
[DocumentationVersion] -> ShowS
DocumentationVersion -> String
(Int -> DocumentationVersion -> ShowS)
-> (DocumentationVersion -> String)
-> ([DocumentationVersion] -> ShowS)
-> Show DocumentationVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentationVersion] -> ShowS
$cshowList :: [DocumentationVersion] -> ShowS
show :: DocumentationVersion -> String
$cshow :: DocumentationVersion -> String
showsPrec :: Int -> DocumentationVersion -> ShowS
$cshowsPrec :: Int -> DocumentationVersion -> ShowS
Prelude.Show, (forall x. DocumentationVersion -> Rep DocumentationVersion x)
-> (forall x. Rep DocumentationVersion x -> DocumentationVersion)
-> Generic DocumentationVersion
forall x. Rep DocumentationVersion x -> DocumentationVersion
forall x. DocumentationVersion -> Rep DocumentationVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentationVersion x -> DocumentationVersion
$cfrom :: forall x. DocumentationVersion -> Rep DocumentationVersion x
Prelude.Generic)
newDocumentationVersion ::
DocumentationVersion
newDocumentationVersion :: DocumentationVersion
newDocumentationVersion =
DocumentationVersion' :: Maybe POSIX -> Maybe Text -> Maybe Text -> DocumentationVersion
DocumentationVersion'
{ $sel:createdDate:DocumentationVersion' :: Maybe POSIX
createdDate =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:version:DocumentationVersion' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:DocumentationVersion' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
documentationVersion_createdDate :: Lens.Lens' DocumentationVersion (Prelude.Maybe Prelude.UTCTime)
documentationVersion_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DocumentationVersion -> f DocumentationVersion
documentationVersion_createdDate = (DocumentationVersion -> Maybe POSIX)
-> (DocumentationVersion -> Maybe POSIX -> DocumentationVersion)
-> Lens
DocumentationVersion
DocumentationVersion
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationVersion' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:DocumentationVersion' :: DocumentationVersion -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: DocumentationVersion
s@DocumentationVersion' {} Maybe POSIX
a -> DocumentationVersion
s {$sel:createdDate:DocumentationVersion' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: DocumentationVersion) ((Maybe POSIX -> f (Maybe POSIX))
-> DocumentationVersion -> f DocumentationVersion)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DocumentationVersion
-> f DocumentationVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
documentationVersion_version :: Lens.Lens' DocumentationVersion (Prelude.Maybe Prelude.Text)
documentationVersion_version :: (Maybe Text -> f (Maybe Text))
-> DocumentationVersion -> f DocumentationVersion
documentationVersion_version = (DocumentationVersion -> Maybe Text)
-> (DocumentationVersion -> Maybe Text -> DocumentationVersion)
-> Lens
DocumentationVersion DocumentationVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationVersion' {Maybe Text
version :: Maybe Text
$sel:version:DocumentationVersion' :: DocumentationVersion -> Maybe Text
version} -> Maybe Text
version) (\s :: DocumentationVersion
s@DocumentationVersion' {} Maybe Text
a -> DocumentationVersion
s {$sel:version:DocumentationVersion' :: Maybe Text
version = Maybe Text
a} :: DocumentationVersion)
documentationVersion_description :: Lens.Lens' DocumentationVersion (Prelude.Maybe Prelude.Text)
documentationVersion_description :: (Maybe Text -> f (Maybe Text))
-> DocumentationVersion -> f DocumentationVersion
documentationVersion_description = (DocumentationVersion -> Maybe Text)
-> (DocumentationVersion -> Maybe Text -> DocumentationVersion)
-> Lens
DocumentationVersion DocumentationVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationVersion' {Maybe Text
description :: Maybe Text
$sel:description:DocumentationVersion' :: DocumentationVersion -> Maybe Text
description} -> Maybe Text
description) (\s :: DocumentationVersion
s@DocumentationVersion' {} Maybe Text
a -> DocumentationVersion
s {$sel:description:DocumentationVersion' :: Maybe Text
description = Maybe Text
a} :: DocumentationVersion)
instance Core.FromJSON DocumentationVersion where
parseJSON :: Value -> Parser DocumentationVersion
parseJSON =
String
-> (Object -> Parser DocumentationVersion)
-> Value
-> Parser DocumentationVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DocumentationVersion"
( \Object
x ->
Maybe POSIX -> Maybe Text -> Maybe Text -> DocumentationVersion
DocumentationVersion'
(Maybe POSIX -> Maybe Text -> Maybe Text -> DocumentationVersion)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> DocumentationVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
Parser (Maybe Text -> Maybe Text -> DocumentationVersion)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> DocumentationVersion)
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
"version")
Parser (Maybe Text -> DocumentationVersion)
-> Parser (Maybe Text) -> Parser DocumentationVersion
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
"description")
)
instance Prelude.Hashable DocumentationVersion
instance Prelude.NFData DocumentationVersion