{-# 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.DocumentationPart where
import Amazonka.APIGateway.Types.DocumentationPartLocation
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DocumentationPart = DocumentationPart'
{
DocumentationPart -> Maybe DocumentationPartLocation
location :: Prelude.Maybe DocumentationPartLocation,
DocumentationPart -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
DocumentationPart -> Maybe Text
properties :: Prelude.Maybe Prelude.Text
}
deriving (DocumentationPart -> DocumentationPart -> Bool
(DocumentationPart -> DocumentationPart -> Bool)
-> (DocumentationPart -> DocumentationPart -> Bool)
-> Eq DocumentationPart
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentationPart -> DocumentationPart -> Bool
$c/= :: DocumentationPart -> DocumentationPart -> Bool
== :: DocumentationPart -> DocumentationPart -> Bool
$c== :: DocumentationPart -> DocumentationPart -> Bool
Prelude.Eq, ReadPrec [DocumentationPart]
ReadPrec DocumentationPart
Int -> ReadS DocumentationPart
ReadS [DocumentationPart]
(Int -> ReadS DocumentationPart)
-> ReadS [DocumentationPart]
-> ReadPrec DocumentationPart
-> ReadPrec [DocumentationPart]
-> Read DocumentationPart
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentationPart]
$creadListPrec :: ReadPrec [DocumentationPart]
readPrec :: ReadPrec DocumentationPart
$creadPrec :: ReadPrec DocumentationPart
readList :: ReadS [DocumentationPart]
$creadList :: ReadS [DocumentationPart]
readsPrec :: Int -> ReadS DocumentationPart
$creadsPrec :: Int -> ReadS DocumentationPart
Prelude.Read, Int -> DocumentationPart -> ShowS
[DocumentationPart] -> ShowS
DocumentationPart -> String
(Int -> DocumentationPart -> ShowS)
-> (DocumentationPart -> String)
-> ([DocumentationPart] -> ShowS)
-> Show DocumentationPart
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentationPart] -> ShowS
$cshowList :: [DocumentationPart] -> ShowS
show :: DocumentationPart -> String
$cshow :: DocumentationPart -> String
showsPrec :: Int -> DocumentationPart -> ShowS
$cshowsPrec :: Int -> DocumentationPart -> ShowS
Prelude.Show, (forall x. DocumentationPart -> Rep DocumentationPart x)
-> (forall x. Rep DocumentationPart x -> DocumentationPart)
-> Generic DocumentationPart
forall x. Rep DocumentationPart x -> DocumentationPart
forall x. DocumentationPart -> Rep DocumentationPart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentationPart x -> DocumentationPart
$cfrom :: forall x. DocumentationPart -> Rep DocumentationPart x
Prelude.Generic)
newDocumentationPart ::
DocumentationPart
newDocumentationPart :: DocumentationPart
newDocumentationPart =
DocumentationPart' :: Maybe DocumentationPartLocation
-> Maybe Text -> Maybe Text -> DocumentationPart
DocumentationPart'
{ $sel:location:DocumentationPart' :: Maybe DocumentationPartLocation
location = Maybe DocumentationPartLocation
forall a. Maybe a
Prelude.Nothing,
$sel:id:DocumentationPart' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:DocumentationPart' :: Maybe Text
properties = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
documentationPart_location :: Lens.Lens' DocumentationPart (Prelude.Maybe DocumentationPartLocation)
documentationPart_location :: (Maybe DocumentationPartLocation
-> f (Maybe DocumentationPartLocation))
-> DocumentationPart -> f DocumentationPart
documentationPart_location = (DocumentationPart -> Maybe DocumentationPartLocation)
-> (DocumentationPart
-> Maybe DocumentationPartLocation -> DocumentationPart)
-> Lens
DocumentationPart
DocumentationPart
(Maybe DocumentationPartLocation)
(Maybe DocumentationPartLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPart' {Maybe DocumentationPartLocation
location :: Maybe DocumentationPartLocation
$sel:location:DocumentationPart' :: DocumentationPart -> Maybe DocumentationPartLocation
location} -> Maybe DocumentationPartLocation
location) (\s :: DocumentationPart
s@DocumentationPart' {} Maybe DocumentationPartLocation
a -> DocumentationPart
s {$sel:location:DocumentationPart' :: Maybe DocumentationPartLocation
location = Maybe DocumentationPartLocation
a} :: DocumentationPart)
documentationPart_id :: Lens.Lens' DocumentationPart (Prelude.Maybe Prelude.Text)
documentationPart_id :: (Maybe Text -> f (Maybe Text))
-> DocumentationPart -> f DocumentationPart
documentationPart_id = (DocumentationPart -> Maybe Text)
-> (DocumentationPart -> Maybe Text -> DocumentationPart)
-> Lens
DocumentationPart DocumentationPart (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPart' {Maybe Text
id :: Maybe Text
$sel:id:DocumentationPart' :: DocumentationPart -> Maybe Text
id} -> Maybe Text
id) (\s :: DocumentationPart
s@DocumentationPart' {} Maybe Text
a -> DocumentationPart
s {$sel:id:DocumentationPart' :: Maybe Text
id = Maybe Text
a} :: DocumentationPart)
documentationPart_properties :: Lens.Lens' DocumentationPart (Prelude.Maybe Prelude.Text)
documentationPart_properties :: (Maybe Text -> f (Maybe Text))
-> DocumentationPart -> f DocumentationPart
documentationPart_properties = (DocumentationPart -> Maybe Text)
-> (DocumentationPart -> Maybe Text -> DocumentationPart)
-> Lens
DocumentationPart DocumentationPart (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPart' {Maybe Text
properties :: Maybe Text
$sel:properties:DocumentationPart' :: DocumentationPart -> Maybe Text
properties} -> Maybe Text
properties) (\s :: DocumentationPart
s@DocumentationPart' {} Maybe Text
a -> DocumentationPart
s {$sel:properties:DocumentationPart' :: Maybe Text
properties = Maybe Text
a} :: DocumentationPart)
instance Core.FromJSON DocumentationPart where
parseJSON :: Value -> Parser DocumentationPart
parseJSON =
String
-> (Object -> Parser DocumentationPart)
-> Value
-> Parser DocumentationPart
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DocumentationPart"
( \Object
x ->
Maybe DocumentationPartLocation
-> Maybe Text -> Maybe Text -> DocumentationPart
DocumentationPart'
(Maybe DocumentationPartLocation
-> Maybe Text -> Maybe Text -> DocumentationPart)
-> Parser (Maybe DocumentationPartLocation)
-> Parser (Maybe Text -> Maybe Text -> DocumentationPart)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DocumentationPartLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser (Maybe Text -> Maybe Text -> DocumentationPart)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DocumentationPart)
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
"id")
Parser (Maybe Text -> DocumentationPart)
-> Parser (Maybe Text) -> Parser DocumentationPart
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
"properties")
)
instance Prelude.Hashable DocumentationPart
instance Prelude.NFData DocumentationPart