{-# 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.UpdateVirtualRouter
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an existing virtual router in a specified service mesh.
module Amazonka.AppMesh.UpdateVirtualRouter
  ( -- * Creating a Request
    UpdateVirtualRouter (..),
    newUpdateVirtualRouter,

    -- * Request Lenses
    updateVirtualRouter_clientToken,
    updateVirtualRouter_meshOwner,
    updateVirtualRouter_meshName,
    updateVirtualRouter_spec,
    updateVirtualRouter_virtualRouterName,

    -- * Destructuring the Response
    UpdateVirtualRouterResponse (..),
    newUpdateVirtualRouterResponse,

    -- * Response Lenses
    updateVirtualRouterResponse_httpStatus,
    updateVirtualRouterResponse_virtualRouter,
  )
where

import Amazonka.AppMesh.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newUpdateVirtualRouter' smart constructor.
data UpdateVirtualRouter = UpdateVirtualRouter'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. Up to 36 letters, numbers, hyphens, and
    -- underscores are allowed.
    UpdateVirtualRouter -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services 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>.
    UpdateVirtualRouter -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
    -- | The name of the service mesh that the virtual router resides in.
    UpdateVirtualRouter -> Text
meshName :: Prelude.Text,
    -- | The new virtual router specification to apply. This overwrites the
    -- existing data.
    UpdateVirtualRouter -> VirtualRouterSpec
spec :: VirtualRouterSpec,
    -- | The name of the virtual router to update.
    UpdateVirtualRouter -> Text
virtualRouterName :: Prelude.Text
  }
  deriving (UpdateVirtualRouter -> UpdateVirtualRouter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVirtualRouter -> UpdateVirtualRouter -> Bool
$c/= :: UpdateVirtualRouter -> UpdateVirtualRouter -> Bool
== :: UpdateVirtualRouter -> UpdateVirtualRouter -> Bool
$c== :: UpdateVirtualRouter -> UpdateVirtualRouter -> Bool
Prelude.Eq, ReadPrec [UpdateVirtualRouter]
ReadPrec UpdateVirtualRouter
Int -> ReadS UpdateVirtualRouter
ReadS [UpdateVirtualRouter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVirtualRouter]
$creadListPrec :: ReadPrec [UpdateVirtualRouter]
readPrec :: ReadPrec UpdateVirtualRouter
$creadPrec :: ReadPrec UpdateVirtualRouter
readList :: ReadS [UpdateVirtualRouter]
$creadList :: ReadS [UpdateVirtualRouter]
readsPrec :: Int -> ReadS UpdateVirtualRouter
$creadsPrec :: Int -> ReadS UpdateVirtualRouter
Prelude.Read, Int -> UpdateVirtualRouter -> ShowS
[UpdateVirtualRouter] -> ShowS
UpdateVirtualRouter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVirtualRouter] -> ShowS
$cshowList :: [UpdateVirtualRouter] -> ShowS
show :: UpdateVirtualRouter -> String
$cshow :: UpdateVirtualRouter -> String
showsPrec :: Int -> UpdateVirtualRouter -> ShowS
$cshowsPrec :: Int -> UpdateVirtualRouter -> ShowS
Prelude.Show, forall x. Rep UpdateVirtualRouter x -> UpdateVirtualRouter
forall x. UpdateVirtualRouter -> Rep UpdateVirtualRouter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateVirtualRouter x -> UpdateVirtualRouter
$cfrom :: forall x. UpdateVirtualRouter -> Rep UpdateVirtualRouter x
Prelude.Generic)

-- |
-- Create a value of 'UpdateVirtualRouter' 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', 'updateVirtualRouter_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', 'updateVirtualRouter_meshOwner' - The Amazon Web Services 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>.
--
-- 'meshName', 'updateVirtualRouter_meshName' - The name of the service mesh that the virtual router resides in.
--
-- 'spec', 'updateVirtualRouter_spec' - The new virtual router specification to apply. This overwrites the
-- existing data.
--
-- 'virtualRouterName', 'updateVirtualRouter_virtualRouterName' - The name of the virtual router to update.
newUpdateVirtualRouter ::
  -- | 'meshName'
  Prelude.Text ->
  -- | 'spec'
  VirtualRouterSpec ->
  -- | 'virtualRouterName'
  Prelude.Text ->
  UpdateVirtualRouter
newUpdateVirtualRouter :: Text -> VirtualRouterSpec -> Text -> UpdateVirtualRouter
newUpdateVirtualRouter
  Text
pMeshName_
  VirtualRouterSpec
pSpec_
  Text
pVirtualRouterName_ =
    UpdateVirtualRouter'
      { $sel:clientToken:UpdateVirtualRouter' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
        $sel:meshOwner:UpdateVirtualRouter' :: Maybe Text
meshOwner = forall a. Maybe a
Prelude.Nothing,
        $sel:meshName:UpdateVirtualRouter' :: Text
meshName = Text
pMeshName_,
        $sel:spec:UpdateVirtualRouter' :: VirtualRouterSpec
spec = VirtualRouterSpec
pSpec_,
        $sel:virtualRouterName:UpdateVirtualRouter' :: Text
virtualRouterName = Text
pVirtualRouterName_
      }

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

-- | The Amazon Web Services 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>.
updateVirtualRouter_meshOwner :: Lens.Lens' UpdateVirtualRouter (Prelude.Maybe Prelude.Text)
updateVirtualRouter_meshOwner :: Lens' UpdateVirtualRouter (Maybe Text)
updateVirtualRouter_meshOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualRouter' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: UpdateVirtualRouter
s@UpdateVirtualRouter' {} Maybe Text
a -> UpdateVirtualRouter
s {$sel:meshOwner:UpdateVirtualRouter' :: Maybe Text
meshOwner = Maybe Text
a} :: UpdateVirtualRouter)

-- | The name of the service mesh that the virtual router resides in.
updateVirtualRouter_meshName :: Lens.Lens' UpdateVirtualRouter Prelude.Text
updateVirtualRouter_meshName :: Lens' UpdateVirtualRouter Text
updateVirtualRouter_meshName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualRouter' {Text
meshName :: Text
$sel:meshName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
meshName} -> Text
meshName) (\s :: UpdateVirtualRouter
s@UpdateVirtualRouter' {} Text
a -> UpdateVirtualRouter
s {$sel:meshName:UpdateVirtualRouter' :: Text
meshName = Text
a} :: UpdateVirtualRouter)

-- | The new virtual router specification to apply. This overwrites the
-- existing data.
updateVirtualRouter_spec :: Lens.Lens' UpdateVirtualRouter VirtualRouterSpec
updateVirtualRouter_spec :: Lens' UpdateVirtualRouter VirtualRouterSpec
updateVirtualRouter_spec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualRouter' {VirtualRouterSpec
spec :: VirtualRouterSpec
$sel:spec:UpdateVirtualRouter' :: UpdateVirtualRouter -> VirtualRouterSpec
spec} -> VirtualRouterSpec
spec) (\s :: UpdateVirtualRouter
s@UpdateVirtualRouter' {} VirtualRouterSpec
a -> UpdateVirtualRouter
s {$sel:spec:UpdateVirtualRouter' :: VirtualRouterSpec
spec = VirtualRouterSpec
a} :: UpdateVirtualRouter)

-- | The name of the virtual router to update.
updateVirtualRouter_virtualRouterName :: Lens.Lens' UpdateVirtualRouter Prelude.Text
updateVirtualRouter_virtualRouterName :: Lens' UpdateVirtualRouter Text
updateVirtualRouter_virtualRouterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualRouter' {Text
virtualRouterName :: Text
$sel:virtualRouterName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
virtualRouterName} -> Text
virtualRouterName) (\s :: UpdateVirtualRouter
s@UpdateVirtualRouter' {} Text
a -> UpdateVirtualRouter
s {$sel:virtualRouterName:UpdateVirtualRouter' :: Text
virtualRouterName = Text
a} :: UpdateVirtualRouter)

instance Core.AWSRequest UpdateVirtualRouter where
  type
    AWSResponse UpdateVirtualRouter =
      UpdateVirtualRouterResponse
  request :: (Service -> Service)
-> UpdateVirtualRouter -> Request UpdateVirtualRouter
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateVirtualRouter
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateVirtualRouter)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> VirtualRouterData -> UpdateVirtualRouterResponse
UpdateVirtualRouterResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

instance Prelude.Hashable UpdateVirtualRouter where
  hashWithSalt :: Int -> UpdateVirtualRouter -> Int
hashWithSalt Int
_salt UpdateVirtualRouter' {Maybe Text
Text
VirtualRouterSpec
virtualRouterName :: Text
spec :: VirtualRouterSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualRouterName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:spec:UpdateVirtualRouter' :: UpdateVirtualRouter -> VirtualRouterSpec
$sel:meshName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:meshOwner:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
$sel:clientToken:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
meshOwner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
meshName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VirtualRouterSpec
spec
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
virtualRouterName

instance Prelude.NFData UpdateVirtualRouter where
  rnf :: UpdateVirtualRouter -> ()
rnf UpdateVirtualRouter' {Maybe Text
Text
VirtualRouterSpec
virtualRouterName :: Text
spec :: VirtualRouterSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualRouterName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:spec:UpdateVirtualRouter' :: UpdateVirtualRouter -> VirtualRouterSpec
$sel:meshName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:meshOwner:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
$sel:clientToken:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
meshOwner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
meshName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VirtualRouterSpec
spec
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
virtualRouterName

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

instance Data.ToJSON UpdateVirtualRouter where
  toJSON :: UpdateVirtualRouter -> Value
toJSON UpdateVirtualRouter' {Maybe Text
Text
VirtualRouterSpec
virtualRouterName :: Text
spec :: VirtualRouterSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualRouterName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:spec:UpdateVirtualRouter' :: UpdateVirtualRouter -> VirtualRouterSpec
$sel:meshName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:meshOwner:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
$sel:clientToken:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"spec" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= VirtualRouterSpec
spec)
          ]
      )

instance Data.ToPath UpdateVirtualRouter where
  toPath :: UpdateVirtualRouter -> ByteString
toPath UpdateVirtualRouter' {Maybe Text
Text
VirtualRouterSpec
virtualRouterName :: Text
spec :: VirtualRouterSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualRouterName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:spec:UpdateVirtualRouter' :: UpdateVirtualRouter -> VirtualRouterSpec
$sel:meshName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:meshOwner:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
$sel:clientToken:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v20190125/meshes/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
meshName,
        ByteString
"/virtualRouters/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
virtualRouterName
      ]

instance Data.ToQuery UpdateVirtualRouter where
  toQuery :: UpdateVirtualRouter -> QueryString
toQuery UpdateVirtualRouter' {Maybe Text
Text
VirtualRouterSpec
virtualRouterName :: Text
spec :: VirtualRouterSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualRouterName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:spec:UpdateVirtualRouter' :: UpdateVirtualRouter -> VirtualRouterSpec
$sel:meshName:UpdateVirtualRouter' :: UpdateVirtualRouter -> Text
$sel:meshOwner:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
$sel:clientToken:UpdateVirtualRouter' :: UpdateVirtualRouter -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"meshOwner" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
meshOwner]

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

-- |
-- Create a value of 'UpdateVirtualRouterResponse' 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', 'updateVirtualRouterResponse_httpStatus' - The response's http status code.
--
-- 'virtualRouter', 'updateVirtualRouterResponse_virtualRouter' - A full description of the virtual router that was updated.
newUpdateVirtualRouterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'virtualRouter'
  VirtualRouterData ->
  UpdateVirtualRouterResponse
newUpdateVirtualRouterResponse :: Int -> VirtualRouterData -> UpdateVirtualRouterResponse
newUpdateVirtualRouterResponse
  Int
pHttpStatus_
  VirtualRouterData
pVirtualRouter_ =
    UpdateVirtualRouterResponse'
      { $sel:httpStatus:UpdateVirtualRouterResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:virtualRouter:UpdateVirtualRouterResponse' :: VirtualRouterData
virtualRouter = VirtualRouterData
pVirtualRouter_
      }

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

-- | A full description of the virtual router that was updated.
updateVirtualRouterResponse_virtualRouter :: Lens.Lens' UpdateVirtualRouterResponse VirtualRouterData
updateVirtualRouterResponse_virtualRouter :: Lens' UpdateVirtualRouterResponse VirtualRouterData
updateVirtualRouterResponse_virtualRouter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualRouterResponse' {VirtualRouterData
virtualRouter :: VirtualRouterData
$sel:virtualRouter:UpdateVirtualRouterResponse' :: UpdateVirtualRouterResponse -> VirtualRouterData
virtualRouter} -> VirtualRouterData
virtualRouter) (\s :: UpdateVirtualRouterResponse
s@UpdateVirtualRouterResponse' {} VirtualRouterData
a -> UpdateVirtualRouterResponse
s {$sel:virtualRouter:UpdateVirtualRouterResponse' :: VirtualRouterData
virtualRouter = VirtualRouterData
a} :: UpdateVirtualRouterResponse)

instance Prelude.NFData UpdateVirtualRouterResponse where
  rnf :: UpdateVirtualRouterResponse -> ()
rnf UpdateVirtualRouterResponse' {Int
VirtualRouterData
virtualRouter :: VirtualRouterData
httpStatus :: Int
$sel:virtualRouter:UpdateVirtualRouterResponse' :: UpdateVirtualRouterResponse -> VirtualRouterData
$sel:httpStatus:UpdateVirtualRouterResponse' :: UpdateVirtualRouterResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VirtualRouterData
virtualRouter