{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ApiGatewayV2.CreateApiMapping
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an API mapping.
module Amazonka.ApiGatewayV2.CreateApiMapping
  ( -- * Creating a Request
    CreateApiMapping (..),
    newCreateApiMapping,

    -- * Request Lenses
    createApiMapping_apiMappingKey,
    createApiMapping_domainName,
    createApiMapping_stage,
    createApiMapping_apiId,

    -- * Destructuring the Response
    CreateApiMappingResponse (..),
    newCreateApiMappingResponse,

    -- * Response Lenses
    createApiMappingResponse_stage,
    createApiMappingResponse_apiId,
    createApiMappingResponse_apiMappingKey,
    createApiMappingResponse_apiMappingId,
    createApiMappingResponse_httpStatus,
  )
where

import Amazonka.ApiGatewayV2.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Creates a new ApiMapping resource to represent an API mapping.
--
-- /See:/ 'newCreateApiMapping' smart constructor.
data CreateApiMapping = CreateApiMapping'
  { -- | The API mapping key.
    CreateApiMapping -> Maybe Text
apiMappingKey :: Prelude.Maybe Prelude.Text,
    -- | The domain name.
    CreateApiMapping -> Text
domainName :: Prelude.Text,
    -- | The API stage.
    CreateApiMapping -> Text
stage :: Prelude.Text,
    -- | The API identifier.
    CreateApiMapping -> Text
apiId :: Prelude.Text
  }
  deriving (CreateApiMapping -> CreateApiMapping -> Bool
(CreateApiMapping -> CreateApiMapping -> Bool)
-> (CreateApiMapping -> CreateApiMapping -> Bool)
-> Eq CreateApiMapping
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApiMapping -> CreateApiMapping -> Bool
$c/= :: CreateApiMapping -> CreateApiMapping -> Bool
== :: CreateApiMapping -> CreateApiMapping -> Bool
$c== :: CreateApiMapping -> CreateApiMapping -> Bool
Prelude.Eq, ReadPrec [CreateApiMapping]
ReadPrec CreateApiMapping
Int -> ReadS CreateApiMapping
ReadS [CreateApiMapping]
(Int -> ReadS CreateApiMapping)
-> ReadS [CreateApiMapping]
-> ReadPrec CreateApiMapping
-> ReadPrec [CreateApiMapping]
-> Read CreateApiMapping
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApiMapping]
$creadListPrec :: ReadPrec [CreateApiMapping]
readPrec :: ReadPrec CreateApiMapping
$creadPrec :: ReadPrec CreateApiMapping
readList :: ReadS [CreateApiMapping]
$creadList :: ReadS [CreateApiMapping]
readsPrec :: Int -> ReadS CreateApiMapping
$creadsPrec :: Int -> ReadS CreateApiMapping
Prelude.Read, Int -> CreateApiMapping -> ShowS
[CreateApiMapping] -> ShowS
CreateApiMapping -> String
(Int -> CreateApiMapping -> ShowS)
-> (CreateApiMapping -> String)
-> ([CreateApiMapping] -> ShowS)
-> Show CreateApiMapping
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApiMapping] -> ShowS
$cshowList :: [CreateApiMapping] -> ShowS
show :: CreateApiMapping -> String
$cshow :: CreateApiMapping -> String
showsPrec :: Int -> CreateApiMapping -> ShowS
$cshowsPrec :: Int -> CreateApiMapping -> ShowS
Prelude.Show, (forall x. CreateApiMapping -> Rep CreateApiMapping x)
-> (forall x. Rep CreateApiMapping x -> CreateApiMapping)
-> Generic CreateApiMapping
forall x. Rep CreateApiMapping x -> CreateApiMapping
forall x. CreateApiMapping -> Rep CreateApiMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateApiMapping x -> CreateApiMapping
$cfrom :: forall x. CreateApiMapping -> Rep CreateApiMapping x
Prelude.Generic)

-- |
-- Create a value of 'CreateApiMapping' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'apiMappingKey', 'createApiMapping_apiMappingKey' - The API mapping key.
--
-- 'domainName', 'createApiMapping_domainName' - The domain name.
--
-- 'stage', 'createApiMapping_stage' - The API stage.
--
-- 'apiId', 'createApiMapping_apiId' - The API identifier.
newCreateApiMapping ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'stage'
  Prelude.Text ->
  -- | 'apiId'
  Prelude.Text ->
  CreateApiMapping
newCreateApiMapping :: Text -> Text -> Text -> CreateApiMapping
newCreateApiMapping Text
pDomainName_ Text
pStage_ Text
pApiId_ =
  CreateApiMapping' :: Maybe Text -> Text -> Text -> Text -> CreateApiMapping
CreateApiMapping'
    { $sel:apiMappingKey:CreateApiMapping' :: Maybe Text
apiMappingKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:CreateApiMapping' :: Text
domainName = Text
pDomainName_,
      $sel:stage:CreateApiMapping' :: Text
stage = Text
pStage_,
      $sel:apiId:CreateApiMapping' :: Text
apiId = Text
pApiId_
    }

-- | The API mapping key.
createApiMapping_apiMappingKey :: Lens.Lens' CreateApiMapping (Prelude.Maybe Prelude.Text)
createApiMapping_apiMappingKey :: (Maybe Text -> f (Maybe Text))
-> CreateApiMapping -> f CreateApiMapping
createApiMapping_apiMappingKey = (CreateApiMapping -> Maybe Text)
-> (CreateApiMapping -> Maybe Text -> CreateApiMapping)
-> Lens CreateApiMapping CreateApiMapping (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMapping' {Maybe Text
apiMappingKey :: Maybe Text
$sel:apiMappingKey:CreateApiMapping' :: CreateApiMapping -> Maybe Text
apiMappingKey} -> Maybe Text
apiMappingKey) (\s :: CreateApiMapping
s@CreateApiMapping' {} Maybe Text
a -> CreateApiMapping
s {$sel:apiMappingKey:CreateApiMapping' :: Maybe Text
apiMappingKey = Maybe Text
a} :: CreateApiMapping)

-- | The domain name.
createApiMapping_domainName :: Lens.Lens' CreateApiMapping Prelude.Text
createApiMapping_domainName :: (Text -> f Text) -> CreateApiMapping -> f CreateApiMapping
createApiMapping_domainName = (CreateApiMapping -> Text)
-> (CreateApiMapping -> Text -> CreateApiMapping)
-> Lens CreateApiMapping CreateApiMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMapping' {Text
domainName :: Text
$sel:domainName:CreateApiMapping' :: CreateApiMapping -> Text
domainName} -> Text
domainName) (\s :: CreateApiMapping
s@CreateApiMapping' {} Text
a -> CreateApiMapping
s {$sel:domainName:CreateApiMapping' :: Text
domainName = Text
a} :: CreateApiMapping)

-- | The API stage.
createApiMapping_stage :: Lens.Lens' CreateApiMapping Prelude.Text
createApiMapping_stage :: (Text -> f Text) -> CreateApiMapping -> f CreateApiMapping
createApiMapping_stage = (CreateApiMapping -> Text)
-> (CreateApiMapping -> Text -> CreateApiMapping)
-> Lens CreateApiMapping CreateApiMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMapping' {Text
stage :: Text
$sel:stage:CreateApiMapping' :: CreateApiMapping -> Text
stage} -> Text
stage) (\s :: CreateApiMapping
s@CreateApiMapping' {} Text
a -> CreateApiMapping
s {$sel:stage:CreateApiMapping' :: Text
stage = Text
a} :: CreateApiMapping)

-- | The API identifier.
createApiMapping_apiId :: Lens.Lens' CreateApiMapping Prelude.Text
createApiMapping_apiId :: (Text -> f Text) -> CreateApiMapping -> f CreateApiMapping
createApiMapping_apiId = (CreateApiMapping -> Text)
-> (CreateApiMapping -> Text -> CreateApiMapping)
-> Lens CreateApiMapping CreateApiMapping Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMapping' {Text
apiId :: Text
$sel:apiId:CreateApiMapping' :: CreateApiMapping -> Text
apiId} -> Text
apiId) (\s :: CreateApiMapping
s@CreateApiMapping' {} Text
a -> CreateApiMapping
s {$sel:apiId:CreateApiMapping' :: Text
apiId = Text
a} :: CreateApiMapping)

instance Core.AWSRequest CreateApiMapping where
  type
    AWSResponse CreateApiMapping =
      CreateApiMappingResponse
  request :: CreateApiMapping -> Request CreateApiMapping
request = Service -> CreateApiMapping -> Request CreateApiMapping
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateApiMapping
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApiMapping)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateApiMapping))
-> Logger
-> Service
-> Proxy CreateApiMapping
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApiMapping)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateApiMappingResponse
CreateApiMappingResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateApiMappingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> CreateApiMappingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"stage")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Int -> CreateApiMappingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> CreateApiMappingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiId")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> CreateApiMappingResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateApiMappingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiMappingKey")
            Either String (Maybe Text -> Int -> CreateApiMappingResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateApiMappingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"apiMappingId")
            Either String (Int -> CreateApiMappingResponse)
-> Either String Int -> Either String CreateApiMappingResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateApiMapping

instance Prelude.NFData CreateApiMapping

instance Core.ToHeaders CreateApiMapping where
  toHeaders :: CreateApiMapping -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateApiMapping -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateApiMapping where
  toJSON :: CreateApiMapping -> Value
toJSON CreateApiMapping' {Maybe Text
Text
apiId :: Text
stage :: Text
domainName :: Text
apiMappingKey :: Maybe Text
$sel:apiId:CreateApiMapping' :: CreateApiMapping -> Text
$sel:stage:CreateApiMapping' :: CreateApiMapping -> Text
$sel:domainName:CreateApiMapping' :: CreateApiMapping -> Text
$sel:apiMappingKey:CreateApiMapping' :: CreateApiMapping -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"apiMappingKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
apiMappingKey,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"stage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
stage),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"apiId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
apiId)
          ]
      )

instance Core.ToPath CreateApiMapping where
  toPath :: CreateApiMapping -> ByteString
toPath CreateApiMapping' {Maybe Text
Text
apiId :: Text
stage :: Text
domainName :: Text
apiMappingKey :: Maybe Text
$sel:apiId:CreateApiMapping' :: CreateApiMapping -> Text
$sel:stage:CreateApiMapping' :: CreateApiMapping -> Text
$sel:domainName:CreateApiMapping' :: CreateApiMapping -> Text
$sel:apiMappingKey:CreateApiMapping' :: CreateApiMapping -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/domainnames/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName,
        ByteString
"/apimappings"
      ]

instance Core.ToQuery CreateApiMapping where
  toQuery :: CreateApiMapping -> QueryString
toQuery = QueryString -> CreateApiMapping -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateApiMappingResponse' smart constructor.
data CreateApiMappingResponse = CreateApiMappingResponse'
  { -- | The API stage.
    CreateApiMappingResponse -> Maybe Text
stage :: Prelude.Maybe Prelude.Text,
    -- | The API identifier.
    CreateApiMappingResponse -> Maybe Text
apiId :: Prelude.Maybe Prelude.Text,
    -- | The API mapping key.
    CreateApiMappingResponse -> Maybe Text
apiMappingKey :: Prelude.Maybe Prelude.Text,
    -- | The API mapping identifier.
    CreateApiMappingResponse -> Maybe Text
apiMappingId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateApiMappingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateApiMappingResponse -> CreateApiMappingResponse -> Bool
(CreateApiMappingResponse -> CreateApiMappingResponse -> Bool)
-> (CreateApiMappingResponse -> CreateApiMappingResponse -> Bool)
-> Eq CreateApiMappingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApiMappingResponse -> CreateApiMappingResponse -> Bool
$c/= :: CreateApiMappingResponse -> CreateApiMappingResponse -> Bool
== :: CreateApiMappingResponse -> CreateApiMappingResponse -> Bool
$c== :: CreateApiMappingResponse -> CreateApiMappingResponse -> Bool
Prelude.Eq, ReadPrec [CreateApiMappingResponse]
ReadPrec CreateApiMappingResponse
Int -> ReadS CreateApiMappingResponse
ReadS [CreateApiMappingResponse]
(Int -> ReadS CreateApiMappingResponse)
-> ReadS [CreateApiMappingResponse]
-> ReadPrec CreateApiMappingResponse
-> ReadPrec [CreateApiMappingResponse]
-> Read CreateApiMappingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApiMappingResponse]
$creadListPrec :: ReadPrec [CreateApiMappingResponse]
readPrec :: ReadPrec CreateApiMappingResponse
$creadPrec :: ReadPrec CreateApiMappingResponse
readList :: ReadS [CreateApiMappingResponse]
$creadList :: ReadS [CreateApiMappingResponse]
readsPrec :: Int -> ReadS CreateApiMappingResponse
$creadsPrec :: Int -> ReadS CreateApiMappingResponse
Prelude.Read, Int -> CreateApiMappingResponse -> ShowS
[CreateApiMappingResponse] -> ShowS
CreateApiMappingResponse -> String
(Int -> CreateApiMappingResponse -> ShowS)
-> (CreateApiMappingResponse -> String)
-> ([CreateApiMappingResponse] -> ShowS)
-> Show CreateApiMappingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApiMappingResponse] -> ShowS
$cshowList :: [CreateApiMappingResponse] -> ShowS
show :: CreateApiMappingResponse -> String
$cshow :: CreateApiMappingResponse -> String
showsPrec :: Int -> CreateApiMappingResponse -> ShowS
$cshowsPrec :: Int -> CreateApiMappingResponse -> ShowS
Prelude.Show, (forall x.
 CreateApiMappingResponse -> Rep CreateApiMappingResponse x)
-> (forall x.
    Rep CreateApiMappingResponse x -> CreateApiMappingResponse)
-> Generic CreateApiMappingResponse
forall x.
Rep CreateApiMappingResponse x -> CreateApiMappingResponse
forall x.
CreateApiMappingResponse -> Rep CreateApiMappingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateApiMappingResponse x -> CreateApiMappingResponse
$cfrom :: forall x.
CreateApiMappingResponse -> Rep CreateApiMappingResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateApiMappingResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'stage', 'createApiMappingResponse_stage' - The API stage.
--
-- 'apiId', 'createApiMappingResponse_apiId' - The API identifier.
--
-- 'apiMappingKey', 'createApiMappingResponse_apiMappingKey' - The API mapping key.
--
-- 'apiMappingId', 'createApiMappingResponse_apiMappingId' - The API mapping identifier.
--
-- 'httpStatus', 'createApiMappingResponse_httpStatus' - The response's http status code.
newCreateApiMappingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateApiMappingResponse
newCreateApiMappingResponse :: Int -> CreateApiMappingResponse
newCreateApiMappingResponse Int
pHttpStatus_ =
  CreateApiMappingResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateApiMappingResponse
CreateApiMappingResponse'
    { $sel:stage:CreateApiMappingResponse' :: Maybe Text
stage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:CreateApiMappingResponse' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiMappingKey:CreateApiMappingResponse' :: Maybe Text
apiMappingKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiMappingId:CreateApiMappingResponse' :: Maybe Text
apiMappingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateApiMappingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The API stage.
createApiMappingResponse_stage :: Lens.Lens' CreateApiMappingResponse (Prelude.Maybe Prelude.Text)
createApiMappingResponse_stage :: (Maybe Text -> f (Maybe Text))
-> CreateApiMappingResponse -> f CreateApiMappingResponse
createApiMappingResponse_stage = (CreateApiMappingResponse -> Maybe Text)
-> (CreateApiMappingResponse
    -> Maybe Text -> CreateApiMappingResponse)
-> Lens
     CreateApiMappingResponse
     CreateApiMappingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMappingResponse' {Maybe Text
stage :: Maybe Text
$sel:stage:CreateApiMappingResponse' :: CreateApiMappingResponse -> Maybe Text
stage} -> Maybe Text
stage) (\s :: CreateApiMappingResponse
s@CreateApiMappingResponse' {} Maybe Text
a -> CreateApiMappingResponse
s {$sel:stage:CreateApiMappingResponse' :: Maybe Text
stage = Maybe Text
a} :: CreateApiMappingResponse)

-- | The API identifier.
createApiMappingResponse_apiId :: Lens.Lens' CreateApiMappingResponse (Prelude.Maybe Prelude.Text)
createApiMappingResponse_apiId :: (Maybe Text -> f (Maybe Text))
-> CreateApiMappingResponse -> f CreateApiMappingResponse
createApiMappingResponse_apiId = (CreateApiMappingResponse -> Maybe Text)
-> (CreateApiMappingResponse
    -> Maybe Text -> CreateApiMappingResponse)
-> Lens
     CreateApiMappingResponse
     CreateApiMappingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMappingResponse' {Maybe Text
apiId :: Maybe Text
$sel:apiId:CreateApiMappingResponse' :: CreateApiMappingResponse -> Maybe Text
apiId} -> Maybe Text
apiId) (\s :: CreateApiMappingResponse
s@CreateApiMappingResponse' {} Maybe Text
a -> CreateApiMappingResponse
s {$sel:apiId:CreateApiMappingResponse' :: Maybe Text
apiId = Maybe Text
a} :: CreateApiMappingResponse)

-- | The API mapping key.
createApiMappingResponse_apiMappingKey :: Lens.Lens' CreateApiMappingResponse (Prelude.Maybe Prelude.Text)
createApiMappingResponse_apiMappingKey :: (Maybe Text -> f (Maybe Text))
-> CreateApiMappingResponse -> f CreateApiMappingResponse
createApiMappingResponse_apiMappingKey = (CreateApiMappingResponse -> Maybe Text)
-> (CreateApiMappingResponse
    -> Maybe Text -> CreateApiMappingResponse)
-> Lens
     CreateApiMappingResponse
     CreateApiMappingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMappingResponse' {Maybe Text
apiMappingKey :: Maybe Text
$sel:apiMappingKey:CreateApiMappingResponse' :: CreateApiMappingResponse -> Maybe Text
apiMappingKey} -> Maybe Text
apiMappingKey) (\s :: CreateApiMappingResponse
s@CreateApiMappingResponse' {} Maybe Text
a -> CreateApiMappingResponse
s {$sel:apiMappingKey:CreateApiMappingResponse' :: Maybe Text
apiMappingKey = Maybe Text
a} :: CreateApiMappingResponse)

-- | The API mapping identifier.
createApiMappingResponse_apiMappingId :: Lens.Lens' CreateApiMappingResponse (Prelude.Maybe Prelude.Text)
createApiMappingResponse_apiMappingId :: (Maybe Text -> f (Maybe Text))
-> CreateApiMappingResponse -> f CreateApiMappingResponse
createApiMappingResponse_apiMappingId = (CreateApiMappingResponse -> Maybe Text)
-> (CreateApiMappingResponse
    -> Maybe Text -> CreateApiMappingResponse)
-> Lens
     CreateApiMappingResponse
     CreateApiMappingResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMappingResponse' {Maybe Text
apiMappingId :: Maybe Text
$sel:apiMappingId:CreateApiMappingResponse' :: CreateApiMappingResponse -> Maybe Text
apiMappingId} -> Maybe Text
apiMappingId) (\s :: CreateApiMappingResponse
s@CreateApiMappingResponse' {} Maybe Text
a -> CreateApiMappingResponse
s {$sel:apiMappingId:CreateApiMappingResponse' :: Maybe Text
apiMappingId = Maybe Text
a} :: CreateApiMappingResponse)

-- | The response's http status code.
createApiMappingResponse_httpStatus :: Lens.Lens' CreateApiMappingResponse Prelude.Int
createApiMappingResponse_httpStatus :: (Int -> f Int)
-> CreateApiMappingResponse -> f CreateApiMappingResponse
createApiMappingResponse_httpStatus = (CreateApiMappingResponse -> Int)
-> (CreateApiMappingResponse -> Int -> CreateApiMappingResponse)
-> Lens CreateApiMappingResponse CreateApiMappingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiMappingResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateApiMappingResponse' :: CreateApiMappingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateApiMappingResponse
s@CreateApiMappingResponse' {} Int
a -> CreateApiMappingResponse
s {$sel:httpStatus:CreateApiMappingResponse' :: Int
httpStatus = Int
a} :: CreateApiMappingResponse)

instance Prelude.NFData CreateApiMappingResponse