{-# 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.DocumentationPartLocation where
import Amazonka.APIGateway.Types.DocumentationPartType
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data DocumentationPartLocation = DocumentationPartLocation'
{
DocumentationPartLocation -> Maybe Text
method :: Prelude.Maybe Prelude.Text,
DocumentationPartLocation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DocumentationPartLocation -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
DocumentationPartLocation -> Maybe Text
statusCode :: Prelude.Maybe Prelude.Text,
DocumentationPartLocation -> DocumentationPartType
type' :: DocumentationPartType
}
deriving (DocumentationPartLocation -> DocumentationPartLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentationPartLocation -> DocumentationPartLocation -> Bool
$c/= :: DocumentationPartLocation -> DocumentationPartLocation -> Bool
== :: DocumentationPartLocation -> DocumentationPartLocation -> Bool
$c== :: DocumentationPartLocation -> DocumentationPartLocation -> Bool
Prelude.Eq, ReadPrec [DocumentationPartLocation]
ReadPrec DocumentationPartLocation
Int -> ReadS DocumentationPartLocation
ReadS [DocumentationPartLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentationPartLocation]
$creadListPrec :: ReadPrec [DocumentationPartLocation]
readPrec :: ReadPrec DocumentationPartLocation
$creadPrec :: ReadPrec DocumentationPartLocation
readList :: ReadS [DocumentationPartLocation]
$creadList :: ReadS [DocumentationPartLocation]
readsPrec :: Int -> ReadS DocumentationPartLocation
$creadsPrec :: Int -> ReadS DocumentationPartLocation
Prelude.Read, Int -> DocumentationPartLocation -> ShowS
[DocumentationPartLocation] -> ShowS
DocumentationPartLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentationPartLocation] -> ShowS
$cshowList :: [DocumentationPartLocation] -> ShowS
show :: DocumentationPartLocation -> String
$cshow :: DocumentationPartLocation -> String
showsPrec :: Int -> DocumentationPartLocation -> ShowS
$cshowsPrec :: Int -> DocumentationPartLocation -> ShowS
Prelude.Show, forall x.
Rep DocumentationPartLocation x -> DocumentationPartLocation
forall x.
DocumentationPartLocation -> Rep DocumentationPartLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentationPartLocation x -> DocumentationPartLocation
$cfrom :: forall x.
DocumentationPartLocation -> Rep DocumentationPartLocation x
Prelude.Generic)
newDocumentationPartLocation ::
DocumentationPartType ->
DocumentationPartLocation
newDocumentationPartLocation :: DocumentationPartType -> DocumentationPartLocation
newDocumentationPartLocation DocumentationPartType
pType_ =
DocumentationPartLocation'
{ $sel:method:DocumentationPartLocation' :: Maybe Text
method =
forall a. Maybe a
Prelude.Nothing,
$sel:name:DocumentationPartLocation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:path:DocumentationPartLocation' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
$sel:statusCode:DocumentationPartLocation' :: Maybe Text
statusCode = forall a. Maybe a
Prelude.Nothing,
$sel:type':DocumentationPartLocation' :: DocumentationPartType
type' = DocumentationPartType
pType_
}
documentationPartLocation_method :: Lens.Lens' DocumentationPartLocation (Prelude.Maybe Prelude.Text)
documentationPartLocation_method :: Lens' DocumentationPartLocation (Maybe Text)
documentationPartLocation_method = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPartLocation' {Maybe Text
method :: Maybe Text
$sel:method:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
method} -> Maybe Text
method) (\s :: DocumentationPartLocation
s@DocumentationPartLocation' {} Maybe Text
a -> DocumentationPartLocation
s {$sel:method:DocumentationPartLocation' :: Maybe Text
method = Maybe Text
a} :: DocumentationPartLocation)
documentationPartLocation_name :: Lens.Lens' DocumentationPartLocation (Prelude.Maybe Prelude.Text)
documentationPartLocation_name :: Lens' DocumentationPartLocation (Maybe Text)
documentationPartLocation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPartLocation' {Maybe Text
name :: Maybe Text
$sel:name:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
name} -> Maybe Text
name) (\s :: DocumentationPartLocation
s@DocumentationPartLocation' {} Maybe Text
a -> DocumentationPartLocation
s {$sel:name:DocumentationPartLocation' :: Maybe Text
name = Maybe Text
a} :: DocumentationPartLocation)
documentationPartLocation_path :: Lens.Lens' DocumentationPartLocation (Prelude.Maybe Prelude.Text)
documentationPartLocation_path :: Lens' DocumentationPartLocation (Maybe Text)
documentationPartLocation_path = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPartLocation' {Maybe Text
path :: Maybe Text
$sel:path:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
path} -> Maybe Text
path) (\s :: DocumentationPartLocation
s@DocumentationPartLocation' {} Maybe Text
a -> DocumentationPartLocation
s {$sel:path:DocumentationPartLocation' :: Maybe Text
path = Maybe Text
a} :: DocumentationPartLocation)
documentationPartLocation_statusCode :: Lens.Lens' DocumentationPartLocation (Prelude.Maybe Prelude.Text)
documentationPartLocation_statusCode :: Lens' DocumentationPartLocation (Maybe Text)
documentationPartLocation_statusCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPartLocation' {Maybe Text
statusCode :: Maybe Text
$sel:statusCode:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
statusCode} -> Maybe Text
statusCode) (\s :: DocumentationPartLocation
s@DocumentationPartLocation' {} Maybe Text
a -> DocumentationPartLocation
s {$sel:statusCode:DocumentationPartLocation' :: Maybe Text
statusCode = Maybe Text
a} :: DocumentationPartLocation)
documentationPartLocation_type :: Lens.Lens' DocumentationPartLocation DocumentationPartType
documentationPartLocation_type :: Lens' DocumentationPartLocation DocumentationPartType
documentationPartLocation_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentationPartLocation' {DocumentationPartType
type' :: DocumentationPartType
$sel:type':DocumentationPartLocation' :: DocumentationPartLocation -> DocumentationPartType
type'} -> DocumentationPartType
type') (\s :: DocumentationPartLocation
s@DocumentationPartLocation' {} DocumentationPartType
a -> DocumentationPartLocation
s {$sel:type':DocumentationPartLocation' :: DocumentationPartType
type' = DocumentationPartType
a} :: DocumentationPartLocation)
instance Data.FromJSON DocumentationPartLocation where
parseJSON :: Value -> Parser DocumentationPartLocation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DocumentationPartLocation"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocumentationPartType
-> DocumentationPartLocation
DocumentationPartLocation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"method")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"path")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"statusCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
)
instance Prelude.Hashable DocumentationPartLocation where
hashWithSalt :: Int -> DocumentationPartLocation -> Int
hashWithSalt Int
_salt DocumentationPartLocation' {Maybe Text
DocumentationPartType
type' :: DocumentationPartType
statusCode :: Maybe Text
path :: Maybe Text
name :: Maybe Text
method :: Maybe Text
$sel:type':DocumentationPartLocation' :: DocumentationPartLocation -> DocumentationPartType
$sel:statusCode:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:path:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:name:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:method:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
method
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DocumentationPartType
type'
instance Prelude.NFData DocumentationPartLocation where
rnf :: DocumentationPartLocation -> ()
rnf DocumentationPartLocation' {Maybe Text
DocumentationPartType
type' :: DocumentationPartType
statusCode :: Maybe Text
path :: Maybe Text
name :: Maybe Text
method :: Maybe Text
$sel:type':DocumentationPartLocation' :: DocumentationPartLocation -> DocumentationPartType
$sel:statusCode:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:path:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:name:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:method:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
method
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DocumentationPartType
type'
instance Data.ToJSON DocumentationPartLocation where
toJSON :: DocumentationPartLocation -> Value
toJSON DocumentationPartLocation' {Maybe Text
DocumentationPartType
type' :: DocumentationPartType
statusCode :: Maybe Text
path :: Maybe Text
name :: Maybe Text
method :: Maybe Text
$sel:type':DocumentationPartLocation' :: DocumentationPartLocation -> DocumentationPartType
$sel:statusCode:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:path:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:name:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
$sel:method:DocumentationPartLocation' :: DocumentationPartLocation -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"method" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
method,
(Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Key
"path" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
path,
(Key
"statusCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
statusCode,
forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DocumentationPartType
type')
]
)