{-# 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.AppMesh.UpdateGatewayRoute
-- 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)
--
-- Updates an existing gateway route that is associated to a specified
-- virtual gateway in a service mesh.
module Amazonka.AppMesh.UpdateGatewayRoute
  ( -- * Creating a Request
    UpdateGatewayRoute (..),
    newUpdateGatewayRoute,

    -- * Request Lenses
    updateGatewayRoute_clientToken,
    updateGatewayRoute_meshOwner,
    updateGatewayRoute_gatewayRouteName,
    updateGatewayRoute_meshName,
    updateGatewayRoute_spec,
    updateGatewayRoute_virtualGatewayName,

    -- * Destructuring the Response
    UpdateGatewayRouteResponse (..),
    newUpdateGatewayRouteResponse,

    -- * Response Lenses
    updateGatewayRouteResponse_httpStatus,
    updateGatewayRouteResponse_gatewayRoute,
  )
where

import Amazonka.AppMesh.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

-- | /See:/ 'newUpdateGatewayRoute' smart constructor.
data UpdateGatewayRoute = UpdateGatewayRoute'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. Up to 36 letters, numbers, hyphens, and
    -- underscores are allowed.
    UpdateGatewayRoute -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The AWS IAM account ID of the service mesh owner. If the account ID is
    -- not your own, then it\'s the ID of the account that shared the mesh with
    -- your account. For more information about mesh sharing, see
    -- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
    UpdateGatewayRoute -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the gateway route to update.
    UpdateGatewayRoute -> Text
gatewayRouteName :: Prelude.Text,
    -- | The name of the service mesh that the gateway route resides in.
    UpdateGatewayRoute -> Text
meshName :: Prelude.Text,
    -- | The new gateway route specification to apply. This overwrites the
    -- existing data.
    UpdateGatewayRoute -> GatewayRouteSpec
spec :: GatewayRouteSpec,
    -- | The name of the virtual gateway that the gateway route is associated
    -- with.
    UpdateGatewayRoute -> Text
virtualGatewayName :: Prelude.Text
  }
  deriving (UpdateGatewayRoute -> UpdateGatewayRoute -> Bool
(UpdateGatewayRoute -> UpdateGatewayRoute -> Bool)
-> (UpdateGatewayRoute -> UpdateGatewayRoute -> Bool)
-> Eq UpdateGatewayRoute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGatewayRoute -> UpdateGatewayRoute -> Bool
$c/= :: UpdateGatewayRoute -> UpdateGatewayRoute -> Bool
== :: UpdateGatewayRoute -> UpdateGatewayRoute -> Bool
$c== :: UpdateGatewayRoute -> UpdateGatewayRoute -> Bool
Prelude.Eq, ReadPrec [UpdateGatewayRoute]
ReadPrec UpdateGatewayRoute
Int -> ReadS UpdateGatewayRoute
ReadS [UpdateGatewayRoute]
(Int -> ReadS UpdateGatewayRoute)
-> ReadS [UpdateGatewayRoute]
-> ReadPrec UpdateGatewayRoute
-> ReadPrec [UpdateGatewayRoute]
-> Read UpdateGatewayRoute
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGatewayRoute]
$creadListPrec :: ReadPrec [UpdateGatewayRoute]
readPrec :: ReadPrec UpdateGatewayRoute
$creadPrec :: ReadPrec UpdateGatewayRoute
readList :: ReadS [UpdateGatewayRoute]
$creadList :: ReadS [UpdateGatewayRoute]
readsPrec :: Int -> ReadS UpdateGatewayRoute
$creadsPrec :: Int -> ReadS UpdateGatewayRoute
Prelude.Read, Int -> UpdateGatewayRoute -> ShowS
[UpdateGatewayRoute] -> ShowS
UpdateGatewayRoute -> String
(Int -> UpdateGatewayRoute -> ShowS)
-> (UpdateGatewayRoute -> String)
-> ([UpdateGatewayRoute] -> ShowS)
-> Show UpdateGatewayRoute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGatewayRoute] -> ShowS
$cshowList :: [UpdateGatewayRoute] -> ShowS
show :: UpdateGatewayRoute -> String
$cshow :: UpdateGatewayRoute -> String
showsPrec :: Int -> UpdateGatewayRoute -> ShowS
$cshowsPrec :: Int -> UpdateGatewayRoute -> ShowS
Prelude.Show, (forall x. UpdateGatewayRoute -> Rep UpdateGatewayRoute x)
-> (forall x. Rep UpdateGatewayRoute x -> UpdateGatewayRoute)
-> Generic UpdateGatewayRoute
forall x. Rep UpdateGatewayRoute x -> UpdateGatewayRoute
forall x. UpdateGatewayRoute -> Rep UpdateGatewayRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateGatewayRoute x -> UpdateGatewayRoute
$cfrom :: forall x. UpdateGatewayRoute -> Rep UpdateGatewayRoute x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGatewayRoute' 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:
--
-- 'clientToken', 'updateGatewayRoute_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Up to 36 letters, numbers, hyphens, and
-- underscores are allowed.
--
-- 'meshOwner', 'updateGatewayRoute_meshOwner' - The AWS IAM account ID of the service mesh owner. If the account ID is
-- not your own, then it\'s the ID of the account that shared the mesh with
-- your account. For more information about mesh sharing, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
--
-- 'gatewayRouteName', 'updateGatewayRoute_gatewayRouteName' - The name of the gateway route to update.
--
-- 'meshName', 'updateGatewayRoute_meshName' - The name of the service mesh that the gateway route resides in.
--
-- 'spec', 'updateGatewayRoute_spec' - The new gateway route specification to apply. This overwrites the
-- existing data.
--
-- 'virtualGatewayName', 'updateGatewayRoute_virtualGatewayName' - The name of the virtual gateway that the gateway route is associated
-- with.
newUpdateGatewayRoute ::
  -- | 'gatewayRouteName'
  Prelude.Text ->
  -- | 'meshName'
  Prelude.Text ->
  -- | 'spec'
  GatewayRouteSpec ->
  -- | 'virtualGatewayName'
  Prelude.Text ->
  UpdateGatewayRoute
newUpdateGatewayRoute :: Text -> Text -> GatewayRouteSpec -> Text -> UpdateGatewayRoute
newUpdateGatewayRoute
  Text
pGatewayRouteName_
  Text
pMeshName_
  GatewayRouteSpec
pSpec_
  Text
pVirtualGatewayName_ =
    UpdateGatewayRoute' :: Maybe Text
-> Maybe Text
-> Text
-> Text
-> GatewayRouteSpec
-> Text
-> UpdateGatewayRoute
UpdateGatewayRoute'
      { $sel:clientToken:UpdateGatewayRoute' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:meshOwner:UpdateGatewayRoute' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:gatewayRouteName:UpdateGatewayRoute' :: Text
gatewayRouteName = Text
pGatewayRouteName_,
        $sel:meshName:UpdateGatewayRoute' :: Text
meshName = Text
pMeshName_,
        $sel:spec:UpdateGatewayRoute' :: GatewayRouteSpec
spec = GatewayRouteSpec
pSpec_,
        $sel:virtualGatewayName:UpdateGatewayRoute' :: Text
virtualGatewayName = Text
pVirtualGatewayName_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Up to 36 letters, numbers, hyphens, and
-- underscores are allowed.
updateGatewayRoute_clientToken :: Lens.Lens' UpdateGatewayRoute (Prelude.Maybe Prelude.Text)
updateGatewayRoute_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateGatewayRoute -> f UpdateGatewayRoute
updateGatewayRoute_clientToken = (UpdateGatewayRoute -> Maybe Text)
-> (UpdateGatewayRoute -> Maybe Text -> UpdateGatewayRoute)
-> Lens
     UpdateGatewayRoute UpdateGatewayRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRoute' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateGatewayRoute
s@UpdateGatewayRoute' {} Maybe Text
a -> UpdateGatewayRoute
s {$sel:clientToken:UpdateGatewayRoute' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateGatewayRoute)

-- | The AWS IAM account ID of the service mesh owner. If the account ID is
-- not your own, then it\'s the ID of the account that shared the mesh with
-- your account. For more information about mesh sharing, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
updateGatewayRoute_meshOwner :: Lens.Lens' UpdateGatewayRoute (Prelude.Maybe Prelude.Text)
updateGatewayRoute_meshOwner :: (Maybe Text -> f (Maybe Text))
-> UpdateGatewayRoute -> f UpdateGatewayRoute
updateGatewayRoute_meshOwner = (UpdateGatewayRoute -> Maybe Text)
-> (UpdateGatewayRoute -> Maybe Text -> UpdateGatewayRoute)
-> Lens
     UpdateGatewayRoute UpdateGatewayRoute (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRoute' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: UpdateGatewayRoute
s@UpdateGatewayRoute' {} Maybe Text
a -> UpdateGatewayRoute
s {$sel:meshOwner:UpdateGatewayRoute' :: Maybe Text
meshOwner = Maybe Text
a} :: UpdateGatewayRoute)

-- | The name of the gateway route to update.
updateGatewayRoute_gatewayRouteName :: Lens.Lens' UpdateGatewayRoute Prelude.Text
updateGatewayRoute_gatewayRouteName :: (Text -> f Text) -> UpdateGatewayRoute -> f UpdateGatewayRoute
updateGatewayRoute_gatewayRouteName = (UpdateGatewayRoute -> Text)
-> (UpdateGatewayRoute -> Text -> UpdateGatewayRoute)
-> Lens UpdateGatewayRoute UpdateGatewayRoute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRoute' {Text
gatewayRouteName :: Text
$sel:gatewayRouteName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
gatewayRouteName} -> Text
gatewayRouteName) (\s :: UpdateGatewayRoute
s@UpdateGatewayRoute' {} Text
a -> UpdateGatewayRoute
s {$sel:gatewayRouteName:UpdateGatewayRoute' :: Text
gatewayRouteName = Text
a} :: UpdateGatewayRoute)

-- | The name of the service mesh that the gateway route resides in.
updateGatewayRoute_meshName :: Lens.Lens' UpdateGatewayRoute Prelude.Text
updateGatewayRoute_meshName :: (Text -> f Text) -> UpdateGatewayRoute -> f UpdateGatewayRoute
updateGatewayRoute_meshName = (UpdateGatewayRoute -> Text)
-> (UpdateGatewayRoute -> Text -> UpdateGatewayRoute)
-> Lens UpdateGatewayRoute UpdateGatewayRoute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRoute' {Text
meshName :: Text
$sel:meshName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
meshName} -> Text
meshName) (\s :: UpdateGatewayRoute
s@UpdateGatewayRoute' {} Text
a -> UpdateGatewayRoute
s {$sel:meshName:UpdateGatewayRoute' :: Text
meshName = Text
a} :: UpdateGatewayRoute)

-- | The new gateway route specification to apply. This overwrites the
-- existing data.
updateGatewayRoute_spec :: Lens.Lens' UpdateGatewayRoute GatewayRouteSpec
updateGatewayRoute_spec :: (GatewayRouteSpec -> f GatewayRouteSpec)
-> UpdateGatewayRoute -> f UpdateGatewayRoute
updateGatewayRoute_spec = (UpdateGatewayRoute -> GatewayRouteSpec)
-> (UpdateGatewayRoute -> GatewayRouteSpec -> UpdateGatewayRoute)
-> Lens
     UpdateGatewayRoute
     UpdateGatewayRoute
     GatewayRouteSpec
     GatewayRouteSpec
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRoute' {GatewayRouteSpec
spec :: GatewayRouteSpec
$sel:spec:UpdateGatewayRoute' :: UpdateGatewayRoute -> GatewayRouteSpec
spec} -> GatewayRouteSpec
spec) (\s :: UpdateGatewayRoute
s@UpdateGatewayRoute' {} GatewayRouteSpec
a -> UpdateGatewayRoute
s {$sel:spec:UpdateGatewayRoute' :: GatewayRouteSpec
spec = GatewayRouteSpec
a} :: UpdateGatewayRoute)

-- | The name of the virtual gateway that the gateway route is associated
-- with.
updateGatewayRoute_virtualGatewayName :: Lens.Lens' UpdateGatewayRoute Prelude.Text
updateGatewayRoute_virtualGatewayName :: (Text -> f Text) -> UpdateGatewayRoute -> f UpdateGatewayRoute
updateGatewayRoute_virtualGatewayName = (UpdateGatewayRoute -> Text)
-> (UpdateGatewayRoute -> Text -> UpdateGatewayRoute)
-> Lens UpdateGatewayRoute UpdateGatewayRoute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRoute' {Text
virtualGatewayName :: Text
$sel:virtualGatewayName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
virtualGatewayName} -> Text
virtualGatewayName) (\s :: UpdateGatewayRoute
s@UpdateGatewayRoute' {} Text
a -> UpdateGatewayRoute
s {$sel:virtualGatewayName:UpdateGatewayRoute' :: Text
virtualGatewayName = Text
a} :: UpdateGatewayRoute)

instance Core.AWSRequest UpdateGatewayRoute where
  type
    AWSResponse UpdateGatewayRoute =
      UpdateGatewayRouteResponse
  request :: UpdateGatewayRoute -> Request UpdateGatewayRoute
request = Service -> UpdateGatewayRoute -> Request UpdateGatewayRoute
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateGatewayRoute
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateGatewayRoute)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateGatewayRoute))
-> Logger
-> Service
-> Proxy UpdateGatewayRoute
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateGatewayRoute)))
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 ->
          Int -> GatewayRouteData -> UpdateGatewayRouteResponse
UpdateGatewayRouteResponse'
            (Int -> GatewayRouteData -> UpdateGatewayRouteResponse)
-> Either String Int
-> Either String (GatewayRouteData -> UpdateGatewayRouteResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (GatewayRouteData -> UpdateGatewayRouteResponse)
-> Either String GatewayRouteData
-> Either String UpdateGatewayRouteResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String GatewayRouteData
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance Prelude.Hashable UpdateGatewayRoute

instance Prelude.NFData UpdateGatewayRoute

instance Core.ToHeaders UpdateGatewayRoute where
  toHeaders :: UpdateGatewayRoute -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateGatewayRoute -> 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 UpdateGatewayRoute where
  toJSON :: UpdateGatewayRoute -> Value
toJSON UpdateGatewayRoute' {Maybe Text
Text
GatewayRouteSpec
virtualGatewayName :: Text
spec :: GatewayRouteSpec
meshName :: Text
gatewayRouteName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:spec:UpdateGatewayRoute' :: UpdateGatewayRoute -> GatewayRouteSpec
$sel:meshName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:gatewayRouteName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:meshOwner:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
$sel:clientToken:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"spec" Text -> GatewayRouteSpec -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= GatewayRouteSpec
spec)
          ]
      )

instance Core.ToPath UpdateGatewayRoute where
  toPath :: UpdateGatewayRoute -> ByteString
toPath UpdateGatewayRoute' {Maybe Text
Text
GatewayRouteSpec
virtualGatewayName :: Text
spec :: GatewayRouteSpec
meshName :: Text
gatewayRouteName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:spec:UpdateGatewayRoute' :: UpdateGatewayRoute -> GatewayRouteSpec
$sel:meshName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:gatewayRouteName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:meshOwner:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
$sel:clientToken:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v20190125/meshes/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
meshName,
        ByteString
"/virtualGateway/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualGatewayName,
        ByteString
"/gatewayRoutes/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
gatewayRouteName
      ]

instance Core.ToQuery UpdateGatewayRoute where
  toQuery :: UpdateGatewayRoute -> QueryString
toQuery UpdateGatewayRoute' {Maybe Text
Text
GatewayRouteSpec
virtualGatewayName :: Text
spec :: GatewayRouteSpec
meshName :: Text
gatewayRouteName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:spec:UpdateGatewayRoute' :: UpdateGatewayRoute -> GatewayRouteSpec
$sel:meshName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:gatewayRouteName:UpdateGatewayRoute' :: UpdateGatewayRoute -> Text
$sel:meshOwner:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
$sel:clientToken:UpdateGatewayRoute' :: UpdateGatewayRoute -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"meshOwner" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
meshOwner]

-- | /See:/ 'newUpdateGatewayRouteResponse' smart constructor.
data UpdateGatewayRouteResponse = UpdateGatewayRouteResponse'
  { -- | The response's http status code.
    UpdateGatewayRouteResponse -> Int
httpStatus :: Prelude.Int,
    -- | A full description of the gateway route that was updated.
    UpdateGatewayRouteResponse -> GatewayRouteData
gatewayRoute :: GatewayRouteData
  }
  deriving (UpdateGatewayRouteResponse -> UpdateGatewayRouteResponse -> Bool
(UpdateGatewayRouteResponse -> UpdateGatewayRouteResponse -> Bool)
-> (UpdateGatewayRouteResponse
    -> UpdateGatewayRouteResponse -> Bool)
-> Eq UpdateGatewayRouteResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGatewayRouteResponse -> UpdateGatewayRouteResponse -> Bool
$c/= :: UpdateGatewayRouteResponse -> UpdateGatewayRouteResponse -> Bool
== :: UpdateGatewayRouteResponse -> UpdateGatewayRouteResponse -> Bool
$c== :: UpdateGatewayRouteResponse -> UpdateGatewayRouteResponse -> Bool
Prelude.Eq, ReadPrec [UpdateGatewayRouteResponse]
ReadPrec UpdateGatewayRouteResponse
Int -> ReadS UpdateGatewayRouteResponse
ReadS [UpdateGatewayRouteResponse]
(Int -> ReadS UpdateGatewayRouteResponse)
-> ReadS [UpdateGatewayRouteResponse]
-> ReadPrec UpdateGatewayRouteResponse
-> ReadPrec [UpdateGatewayRouteResponse]
-> Read UpdateGatewayRouteResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGatewayRouteResponse]
$creadListPrec :: ReadPrec [UpdateGatewayRouteResponse]
readPrec :: ReadPrec UpdateGatewayRouteResponse
$creadPrec :: ReadPrec UpdateGatewayRouteResponse
readList :: ReadS [UpdateGatewayRouteResponse]
$creadList :: ReadS [UpdateGatewayRouteResponse]
readsPrec :: Int -> ReadS UpdateGatewayRouteResponse
$creadsPrec :: Int -> ReadS UpdateGatewayRouteResponse
Prelude.Read, Int -> UpdateGatewayRouteResponse -> ShowS
[UpdateGatewayRouteResponse] -> ShowS
UpdateGatewayRouteResponse -> String
(Int -> UpdateGatewayRouteResponse -> ShowS)
-> (UpdateGatewayRouteResponse -> String)
-> ([UpdateGatewayRouteResponse] -> ShowS)
-> Show UpdateGatewayRouteResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGatewayRouteResponse] -> ShowS
$cshowList :: [UpdateGatewayRouteResponse] -> ShowS
show :: UpdateGatewayRouteResponse -> String
$cshow :: UpdateGatewayRouteResponse -> String
showsPrec :: Int -> UpdateGatewayRouteResponse -> ShowS
$cshowsPrec :: Int -> UpdateGatewayRouteResponse -> ShowS
Prelude.Show, (forall x.
 UpdateGatewayRouteResponse -> Rep UpdateGatewayRouteResponse x)
-> (forall x.
    Rep UpdateGatewayRouteResponse x -> UpdateGatewayRouteResponse)
-> Generic UpdateGatewayRouteResponse
forall x.
Rep UpdateGatewayRouteResponse x -> UpdateGatewayRouteResponse
forall x.
UpdateGatewayRouteResponse -> Rep UpdateGatewayRouteResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateGatewayRouteResponse x -> UpdateGatewayRouteResponse
$cfrom :: forall x.
UpdateGatewayRouteResponse -> Rep UpdateGatewayRouteResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGatewayRouteResponse' 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:
--
-- 'httpStatus', 'updateGatewayRouteResponse_httpStatus' - The response's http status code.
--
-- 'gatewayRoute', 'updateGatewayRouteResponse_gatewayRoute' - A full description of the gateway route that was updated.
newUpdateGatewayRouteResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'gatewayRoute'
  GatewayRouteData ->
  UpdateGatewayRouteResponse
newUpdateGatewayRouteResponse :: Int -> GatewayRouteData -> UpdateGatewayRouteResponse
newUpdateGatewayRouteResponse
  Int
pHttpStatus_
  GatewayRouteData
pGatewayRoute_ =
    UpdateGatewayRouteResponse' :: Int -> GatewayRouteData -> UpdateGatewayRouteResponse
UpdateGatewayRouteResponse'
      { $sel:httpStatus:UpdateGatewayRouteResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:gatewayRoute:UpdateGatewayRouteResponse' :: GatewayRouteData
gatewayRoute = GatewayRouteData
pGatewayRoute_
      }

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

-- | A full description of the gateway route that was updated.
updateGatewayRouteResponse_gatewayRoute :: Lens.Lens' UpdateGatewayRouteResponse GatewayRouteData
updateGatewayRouteResponse_gatewayRoute :: (GatewayRouteData -> f GatewayRouteData)
-> UpdateGatewayRouteResponse -> f UpdateGatewayRouteResponse
updateGatewayRouteResponse_gatewayRoute = (UpdateGatewayRouteResponse -> GatewayRouteData)
-> (UpdateGatewayRouteResponse
    -> GatewayRouteData -> UpdateGatewayRouteResponse)
-> Lens
     UpdateGatewayRouteResponse
     UpdateGatewayRouteResponse
     GatewayRouteData
     GatewayRouteData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGatewayRouteResponse' {GatewayRouteData
gatewayRoute :: GatewayRouteData
$sel:gatewayRoute:UpdateGatewayRouteResponse' :: UpdateGatewayRouteResponse -> GatewayRouteData
gatewayRoute} -> GatewayRouteData
gatewayRoute) (\s :: UpdateGatewayRouteResponse
s@UpdateGatewayRouteResponse' {} GatewayRouteData
a -> UpdateGatewayRouteResponse
s {$sel:gatewayRoute:UpdateGatewayRouteResponse' :: GatewayRouteData
gatewayRoute = GatewayRouteData
a} :: UpdateGatewayRouteResponse)

instance Prelude.NFData UpdateGatewayRouteResponse