{-# 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.UpdateApiMapping
-- 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)
--
-- The API mapping.
module Amazonka.ApiGatewayV2.UpdateApiMapping
  ( -- * Creating a Request
    UpdateApiMapping (..),
    newUpdateApiMapping,

    -- * Request Lenses
    updateApiMapping_stage,
    updateApiMapping_apiMappingKey,
    updateApiMapping_apiMappingId,
    updateApiMapping_apiId,
    updateApiMapping_domainName,

    -- * Destructuring the Response
    UpdateApiMappingResponse (..),
    newUpdateApiMappingResponse,

    -- * Response Lenses
    updateApiMappingResponse_stage,
    updateApiMappingResponse_apiId,
    updateApiMappingResponse_apiMappingKey,
    updateApiMappingResponse_apiMappingId,
    updateApiMappingResponse_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

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

-- |
-- Create a value of 'UpdateApiMapping' 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', 'updateApiMapping_stage' - The API stage.
--
-- 'apiMappingKey', 'updateApiMapping_apiMappingKey' - The API mapping key.
--
-- 'apiMappingId', 'updateApiMapping_apiMappingId' - The API mapping identifier.
--
-- 'apiId', 'updateApiMapping_apiId' - The API identifier.
--
-- 'domainName', 'updateApiMapping_domainName' - The domain name.
newUpdateApiMapping ::
  -- | 'apiMappingId'
  Prelude.Text ->
  -- | 'apiId'
  Prelude.Text ->
  -- | 'domainName'
  Prelude.Text ->
  UpdateApiMapping
newUpdateApiMapping :: Text -> Text -> Text -> UpdateApiMapping
newUpdateApiMapping
  Text
pApiMappingId_
  Text
pApiId_
  Text
pDomainName_ =
    UpdateApiMapping' :: Maybe Text
-> Maybe Text -> Text -> Text -> Text -> UpdateApiMapping
UpdateApiMapping'
      { $sel:stage:UpdateApiMapping' :: Maybe Text
stage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:apiMappingKey:UpdateApiMapping' :: Maybe Text
apiMappingKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:apiMappingId:UpdateApiMapping' :: Text
apiMappingId = Text
pApiMappingId_,
        $sel:apiId:UpdateApiMapping' :: Text
apiId = Text
pApiId_,
        $sel:domainName:UpdateApiMapping' :: Text
domainName = Text
pDomainName_
      }

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

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

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

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

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

instance Core.AWSRequest UpdateApiMapping where
  type
    AWSResponse UpdateApiMapping =
      UpdateApiMappingResponse
  request :: UpdateApiMapping -> Request UpdateApiMapping
request = Service -> UpdateApiMapping -> Request UpdateApiMapping
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateApiMapping
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApiMapping)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateApiMapping))
-> Logger
-> Service
-> Proxy UpdateApiMapping
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApiMapping)))
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
-> UpdateApiMappingResponse
UpdateApiMappingResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateApiMappingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> UpdateApiMappingResponse)
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 -> UpdateApiMappingResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> UpdateApiMappingResponse)
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 -> UpdateApiMappingResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> UpdateApiMappingResponse)
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 -> UpdateApiMappingResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateApiMappingResponse)
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 -> UpdateApiMappingResponse)
-> Either String Int -> Either String UpdateApiMappingResponse
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 UpdateApiMapping

instance Prelude.NFData UpdateApiMapping

instance Core.ToHeaders UpdateApiMapping where
  toHeaders :: UpdateApiMapping -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateApiMapping -> 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 UpdateApiMapping where
  toJSON :: UpdateApiMapping -> Value
toJSON UpdateApiMapping' {Maybe Text
Text
domainName :: Text
apiId :: Text
apiMappingId :: Text
apiMappingKey :: Maybe Text
stage :: Maybe Text
$sel:domainName:UpdateApiMapping' :: UpdateApiMapping -> Text
$sel:apiId:UpdateApiMapping' :: UpdateApiMapping -> Text
$sel:apiMappingId:UpdateApiMapping' :: UpdateApiMapping -> Text
$sel:apiMappingKey:UpdateApiMapping' :: UpdateApiMapping -> Maybe Text
$sel:stage:UpdateApiMapping' :: UpdateApiMapping -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"stage" 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
stage,
            (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
"apiId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
apiId)
          ]
      )

instance Core.ToPath UpdateApiMapping where
  toPath :: UpdateApiMapping -> ByteString
toPath UpdateApiMapping' {Maybe Text
Text
domainName :: Text
apiId :: Text
apiMappingId :: Text
apiMappingKey :: Maybe Text
stage :: Maybe Text
$sel:domainName:UpdateApiMapping' :: UpdateApiMapping -> Text
$sel:apiId:UpdateApiMapping' :: UpdateApiMapping -> Text
$sel:apiMappingId:UpdateApiMapping' :: UpdateApiMapping -> Text
$sel:apiMappingKey:UpdateApiMapping' :: UpdateApiMapping -> Maybe Text
$sel:stage:UpdateApiMapping' :: UpdateApiMapping -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiMappingId
      ]

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

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

-- |
-- Create a value of 'UpdateApiMappingResponse' 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', 'updateApiMappingResponse_stage' - The API stage.
--
-- 'apiId', 'updateApiMappingResponse_apiId' - The API identifier.
--
-- 'apiMappingKey', 'updateApiMappingResponse_apiMappingKey' - The API mapping key.
--
-- 'apiMappingId', 'updateApiMappingResponse_apiMappingId' - The API mapping identifier.
--
-- 'httpStatus', 'updateApiMappingResponse_httpStatus' - The response's http status code.
newUpdateApiMappingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateApiMappingResponse
newUpdateApiMappingResponse :: Int -> UpdateApiMappingResponse
newUpdateApiMappingResponse Int
pHttpStatus_ =
  UpdateApiMappingResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateApiMappingResponse
UpdateApiMappingResponse'
    { $sel:stage:UpdateApiMappingResponse' :: Maybe Text
stage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiId:UpdateApiMappingResponse' :: Maybe Text
apiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiMappingKey:UpdateApiMappingResponse' :: Maybe Text
apiMappingKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiMappingId:UpdateApiMappingResponse' :: Maybe Text
apiMappingId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateApiMappingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

instance Prelude.NFData UpdateApiMappingResponse