{-# 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.ApiGatewayV2.Types.ApiMapping where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApiMapping = ApiMapping'
{
ApiMapping -> Maybe Text
apiMappingKey :: Prelude.Maybe Prelude.Text,
ApiMapping -> Maybe Text
apiMappingId :: Prelude.Maybe Prelude.Text,
ApiMapping -> Text
stage :: Prelude.Text,
ApiMapping -> Text
apiId :: Prelude.Text
}
deriving (ApiMapping -> ApiMapping -> Bool
(ApiMapping -> ApiMapping -> Bool)
-> (ApiMapping -> ApiMapping -> Bool) -> Eq ApiMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApiMapping -> ApiMapping -> Bool
$c/= :: ApiMapping -> ApiMapping -> Bool
== :: ApiMapping -> ApiMapping -> Bool
$c== :: ApiMapping -> ApiMapping -> Bool
Prelude.Eq, ReadPrec [ApiMapping]
ReadPrec ApiMapping
Int -> ReadS ApiMapping
ReadS [ApiMapping]
(Int -> ReadS ApiMapping)
-> ReadS [ApiMapping]
-> ReadPrec ApiMapping
-> ReadPrec [ApiMapping]
-> Read ApiMapping
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApiMapping]
$creadListPrec :: ReadPrec [ApiMapping]
readPrec :: ReadPrec ApiMapping
$creadPrec :: ReadPrec ApiMapping
readList :: ReadS [ApiMapping]
$creadList :: ReadS [ApiMapping]
readsPrec :: Int -> ReadS ApiMapping
$creadsPrec :: Int -> ReadS ApiMapping
Prelude.Read, Int -> ApiMapping -> ShowS
[ApiMapping] -> ShowS
ApiMapping -> String
(Int -> ApiMapping -> ShowS)
-> (ApiMapping -> String)
-> ([ApiMapping] -> ShowS)
-> Show ApiMapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApiMapping] -> ShowS
$cshowList :: [ApiMapping] -> ShowS
show :: ApiMapping -> String
$cshow :: ApiMapping -> String
showsPrec :: Int -> ApiMapping -> ShowS
$cshowsPrec :: Int -> ApiMapping -> ShowS
Prelude.Show, (forall x. ApiMapping -> Rep ApiMapping x)
-> (forall x. Rep ApiMapping x -> ApiMapping) -> Generic ApiMapping
forall x. Rep ApiMapping x -> ApiMapping
forall x. ApiMapping -> Rep ApiMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApiMapping x -> ApiMapping
$cfrom :: forall x. ApiMapping -> Rep ApiMapping x
Prelude.Generic)
newApiMapping ::
Prelude.Text ->
Prelude.Text ->
ApiMapping
newApiMapping :: Text -> Text -> ApiMapping
newApiMapping Text
pStage_ Text
pApiId_ =
ApiMapping' :: Maybe Text -> Maybe Text -> Text -> Text -> ApiMapping
ApiMapping'
{ $sel:apiMappingKey:ApiMapping' :: Maybe Text
apiMappingKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:apiMappingId:ApiMapping' :: Maybe Text
apiMappingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:stage:ApiMapping' :: Text
stage = Text
pStage_,
$sel:apiId:ApiMapping' :: Text
apiId = Text
pApiId_
}
apiMapping_apiMappingKey :: Lens.Lens' ApiMapping (Prelude.Maybe Prelude.Text)
apiMapping_apiMappingKey :: (Maybe Text -> f (Maybe Text)) -> ApiMapping -> f ApiMapping
apiMapping_apiMappingKey = (ApiMapping -> Maybe Text)
-> (ApiMapping -> Maybe Text -> ApiMapping)
-> Lens ApiMapping ApiMapping (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiMapping' {Maybe Text
apiMappingKey :: Maybe Text
$sel:apiMappingKey:ApiMapping' :: ApiMapping -> Maybe Text
apiMappingKey} -> Maybe Text
apiMappingKey) (\s :: ApiMapping
s@ApiMapping' {} Maybe Text
a -> ApiMapping
s {$sel:apiMappingKey:ApiMapping' :: Maybe Text
apiMappingKey = Maybe Text
a} :: ApiMapping)
apiMapping_apiMappingId :: Lens.Lens' ApiMapping (Prelude.Maybe Prelude.Text)
apiMapping_apiMappingId :: (Maybe Text -> f (Maybe Text)) -> ApiMapping -> f ApiMapping
apiMapping_apiMappingId = (ApiMapping -> Maybe Text)
-> (ApiMapping -> Maybe Text -> ApiMapping)
-> Lens ApiMapping ApiMapping (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiMapping' {Maybe Text
apiMappingId :: Maybe Text
$sel:apiMappingId:ApiMapping' :: ApiMapping -> Maybe Text
apiMappingId} -> Maybe Text
apiMappingId) (\s :: ApiMapping
s@ApiMapping' {} Maybe Text
a -> ApiMapping
s {$sel:apiMappingId:ApiMapping' :: Maybe Text
apiMappingId = Maybe Text
a} :: ApiMapping)
apiMapping_stage :: Lens.Lens' ApiMapping Prelude.Text
apiMapping_stage :: (Text -> f Text) -> ApiMapping -> f ApiMapping
apiMapping_stage = (ApiMapping -> Text)
-> (ApiMapping -> Text -> ApiMapping)
-> Lens ApiMapping ApiMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiMapping' {Text
stage :: Text
$sel:stage:ApiMapping' :: ApiMapping -> Text
stage} -> Text
stage) (\s :: ApiMapping
s@ApiMapping' {} Text
a -> ApiMapping
s {$sel:stage:ApiMapping' :: Text
stage = Text
a} :: ApiMapping)
apiMapping_apiId :: Lens.Lens' ApiMapping Prelude.Text
apiMapping_apiId :: (Text -> f Text) -> ApiMapping -> f ApiMapping
apiMapping_apiId = (ApiMapping -> Text)
-> (ApiMapping -> Text -> ApiMapping)
-> Lens ApiMapping ApiMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiMapping' {Text
apiId :: Text
$sel:apiId:ApiMapping' :: ApiMapping -> Text
apiId} -> Text
apiId) (\s :: ApiMapping
s@ApiMapping' {} Text
a -> ApiMapping
s {$sel:apiId:ApiMapping' :: Text
apiId = Text
a} :: ApiMapping)
instance Core.FromJSON ApiMapping where
parseJSON :: Value -> Parser ApiMapping
parseJSON =
String
-> (Object -> Parser ApiMapping) -> Value -> Parser ApiMapping
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ApiMapping"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> Text -> ApiMapping
ApiMapping'
(Maybe Text -> Maybe Text -> Text -> Text -> ApiMapping)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> Text -> ApiMapping)
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
"apiMappingKey")
Parser (Maybe Text -> Text -> Text -> ApiMapping)
-> Parser (Maybe Text) -> Parser (Text -> Text -> ApiMapping)
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
"apiMappingId")
Parser (Text -> Text -> ApiMapping)
-> Parser Text -> Parser (Text -> ApiMapping)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"stage")
Parser (Text -> ApiMapping) -> Parser Text -> Parser ApiMapping
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"apiId")
)
instance Prelude.Hashable ApiMapping
instance Prelude.NFData ApiMapping