{-# 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.BasePathMapping where
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 BasePathMapping = BasePathMapping'
{
BasePathMapping -> Maybe Text
basePath :: Prelude.Maybe Prelude.Text,
BasePathMapping -> Maybe Text
restApiId :: Prelude.Maybe Prelude.Text,
BasePathMapping -> Maybe Text
stage :: Prelude.Maybe Prelude.Text
}
deriving (BasePathMapping -> BasePathMapping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BasePathMapping -> BasePathMapping -> Bool
$c/= :: BasePathMapping -> BasePathMapping -> Bool
== :: BasePathMapping -> BasePathMapping -> Bool
$c== :: BasePathMapping -> BasePathMapping -> Bool
Prelude.Eq, ReadPrec [BasePathMapping]
ReadPrec BasePathMapping
Int -> ReadS BasePathMapping
ReadS [BasePathMapping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BasePathMapping]
$creadListPrec :: ReadPrec [BasePathMapping]
readPrec :: ReadPrec BasePathMapping
$creadPrec :: ReadPrec BasePathMapping
readList :: ReadS [BasePathMapping]
$creadList :: ReadS [BasePathMapping]
readsPrec :: Int -> ReadS BasePathMapping
$creadsPrec :: Int -> ReadS BasePathMapping
Prelude.Read, Int -> BasePathMapping -> ShowS
[BasePathMapping] -> ShowS
BasePathMapping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BasePathMapping] -> ShowS
$cshowList :: [BasePathMapping] -> ShowS
show :: BasePathMapping -> String
$cshow :: BasePathMapping -> String
showsPrec :: Int -> BasePathMapping -> ShowS
$cshowsPrec :: Int -> BasePathMapping -> ShowS
Prelude.Show, forall x. Rep BasePathMapping x -> BasePathMapping
forall x. BasePathMapping -> Rep BasePathMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BasePathMapping x -> BasePathMapping
$cfrom :: forall x. BasePathMapping -> Rep BasePathMapping x
Prelude.Generic)
newBasePathMapping ::
BasePathMapping
newBasePathMapping :: BasePathMapping
newBasePathMapping =
BasePathMapping'
{ $sel:basePath:BasePathMapping' :: Maybe Text
basePath = forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:BasePathMapping' :: Maybe Text
restApiId = forall a. Maybe a
Prelude.Nothing,
$sel:stage:BasePathMapping' :: Maybe Text
stage = forall a. Maybe a
Prelude.Nothing
}
basePathMapping_basePath :: Lens.Lens' BasePathMapping (Prelude.Maybe Prelude.Text)
basePathMapping_basePath :: Lens' BasePathMapping (Maybe Text)
basePathMapping_basePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BasePathMapping' {Maybe Text
basePath :: Maybe Text
$sel:basePath:BasePathMapping' :: BasePathMapping -> Maybe Text
basePath} -> Maybe Text
basePath) (\s :: BasePathMapping
s@BasePathMapping' {} Maybe Text
a -> BasePathMapping
s {$sel:basePath:BasePathMapping' :: Maybe Text
basePath = Maybe Text
a} :: BasePathMapping)
basePathMapping_restApiId :: Lens.Lens' BasePathMapping (Prelude.Maybe Prelude.Text)
basePathMapping_restApiId :: Lens' BasePathMapping (Maybe Text)
basePathMapping_restApiId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BasePathMapping' {Maybe Text
restApiId :: Maybe Text
$sel:restApiId:BasePathMapping' :: BasePathMapping -> Maybe Text
restApiId} -> Maybe Text
restApiId) (\s :: BasePathMapping
s@BasePathMapping' {} Maybe Text
a -> BasePathMapping
s {$sel:restApiId:BasePathMapping' :: Maybe Text
restApiId = Maybe Text
a} :: BasePathMapping)
basePathMapping_stage :: Lens.Lens' BasePathMapping (Prelude.Maybe Prelude.Text)
basePathMapping_stage :: Lens' BasePathMapping (Maybe Text)
basePathMapping_stage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BasePathMapping' {Maybe Text
stage :: Maybe Text
$sel:stage:BasePathMapping' :: BasePathMapping -> Maybe Text
stage} -> Maybe Text
stage) (\s :: BasePathMapping
s@BasePathMapping' {} Maybe Text
a -> BasePathMapping
s {$sel:stage:BasePathMapping' :: Maybe Text
stage = Maybe Text
a} :: BasePathMapping)
instance Data.FromJSON BasePathMapping where
parseJSON :: Value -> Parser BasePathMapping
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BasePathMapping"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> BasePathMapping
BasePathMapping'
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
"basePath")
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
"restApiId")
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
"stage")
)
instance Prelude.Hashable BasePathMapping where
hashWithSalt :: Int -> BasePathMapping -> Int
hashWithSalt Int
_salt BasePathMapping' {Maybe Text
stage :: Maybe Text
restApiId :: Maybe Text
basePath :: Maybe Text
$sel:stage:BasePathMapping' :: BasePathMapping -> Maybe Text
$sel:restApiId:BasePathMapping' :: BasePathMapping -> Maybe Text
$sel:basePath:BasePathMapping' :: BasePathMapping -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
basePath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
restApiId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stage
instance Prelude.NFData BasePathMapping where
rnf :: BasePathMapping -> ()
rnf BasePathMapping' {Maybe Text
stage :: Maybe Text
restApiId :: Maybe Text
basePath :: Maybe Text
$sel:stage:BasePathMapping' :: BasePathMapping -> Maybe Text
$sel:restApiId:BasePathMapping' :: BasePathMapping -> Maybe Text
$sel:basePath:BasePathMapping' :: BasePathMapping -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
basePath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
restApiId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stage