{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BasePathMapping = BasePathMapping'
{
BasePathMapping -> Maybe Text
stage :: Prelude.Maybe Prelude.Text,
BasePathMapping -> Maybe Text
basePath :: Prelude.Maybe Prelude.Text,
BasePathMapping -> Maybe Text
restApiId :: Prelude.Maybe Prelude.Text
}
deriving (BasePathMapping -> BasePathMapping -> Bool
(BasePathMapping -> BasePathMapping -> Bool)
-> (BasePathMapping -> BasePathMapping -> Bool)
-> Eq BasePathMapping
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]
(Int -> ReadS BasePathMapping)
-> ReadS [BasePathMapping]
-> ReadPrec BasePathMapping
-> ReadPrec [BasePathMapping]
-> Read 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
(Int -> BasePathMapping -> ShowS)
-> (BasePathMapping -> String)
-> ([BasePathMapping] -> ShowS)
-> Show BasePathMapping
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. BasePathMapping -> Rep BasePathMapping x)
-> (forall x. Rep BasePathMapping x -> BasePathMapping)
-> Generic BasePathMapping
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' :: Maybe Text -> Maybe Text -> Maybe Text -> BasePathMapping
BasePathMapping'
{ $sel:stage:BasePathMapping' :: Maybe Text
stage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:basePath:BasePathMapping' :: Maybe Text
basePath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:restApiId:BasePathMapping' :: Maybe Text
restApiId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
basePathMapping_stage :: Lens.Lens' BasePathMapping (Prelude.Maybe Prelude.Text)
basePathMapping_stage :: (Maybe Text -> f (Maybe Text))
-> BasePathMapping -> f BasePathMapping
basePathMapping_stage = (BasePathMapping -> Maybe Text)
-> (BasePathMapping -> Maybe Text -> BasePathMapping)
-> Lens BasePathMapping BasePathMapping (Maybe Text) (Maybe Text)
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)
basePathMapping_basePath :: Lens.Lens' BasePathMapping (Prelude.Maybe Prelude.Text)
basePathMapping_basePath :: (Maybe Text -> f (Maybe Text))
-> BasePathMapping -> f BasePathMapping
basePathMapping_basePath = (BasePathMapping -> Maybe Text)
-> (BasePathMapping -> Maybe Text -> BasePathMapping)
-> Lens BasePathMapping BasePathMapping (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> BasePathMapping -> f BasePathMapping
basePathMapping_restApiId = (BasePathMapping -> Maybe Text)
-> (BasePathMapping -> Maybe Text -> BasePathMapping)
-> Lens BasePathMapping BasePathMapping (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON BasePathMapping where
parseJSON :: Value -> Parser BasePathMapping
parseJSON =
String
-> (Object -> Parser BasePathMapping)
-> Value
-> Parser BasePathMapping
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BasePathMapping"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> BasePathMapping
BasePathMapping'
(Maybe Text -> Maybe Text -> Maybe Text -> BasePathMapping)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> BasePathMapping)
forall (f :: * -> *) a b. Functor 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
"stage")
Parser (Maybe Text -> Maybe Text -> BasePathMapping)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BasePathMapping)
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
"basePath")
Parser (Maybe Text -> BasePathMapping)
-> Parser (Maybe Text) -> Parser BasePathMapping
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
"restApiId")
)
instance Prelude.Hashable BasePathMapping
instance Prelude.NFData BasePathMapping