{-# 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.UpdateVirtualService
-- 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 virtual service in a specified service mesh.
module Amazonka.AppMesh.UpdateVirtualService
  ( -- * Creating a Request
    UpdateVirtualService (..),
    newUpdateVirtualService,

    -- * Request Lenses
    updateVirtualService_clientToken,
    updateVirtualService_meshOwner,
    updateVirtualService_meshName,
    updateVirtualService_spec,
    updateVirtualService_virtualServiceName,

    -- * Destructuring the Response
    UpdateVirtualServiceResponse (..),
    newUpdateVirtualServiceResponse,

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

-- |
-- Create a value of 'UpdateVirtualService' 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', 'updateVirtualService_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', 'updateVirtualService_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>.
--
-- 'meshName', 'updateVirtualService_meshName' - The name of the service mesh that the virtual service resides in.
--
-- 'spec', 'updateVirtualService_spec' - The new virtual service specification to apply. This overwrites the
-- existing data.
--
-- 'virtualServiceName', 'updateVirtualService_virtualServiceName' - The name of the virtual service to update.
newUpdateVirtualService ::
  -- | 'meshName'
  Prelude.Text ->
  -- | 'spec'
  VirtualServiceSpec ->
  -- | 'virtualServiceName'
  Prelude.Text ->
  UpdateVirtualService
newUpdateVirtualService :: Text -> VirtualServiceSpec -> Text -> UpdateVirtualService
newUpdateVirtualService
  Text
pMeshName_
  VirtualServiceSpec
pSpec_
  Text
pVirtualServiceName_ =
    UpdateVirtualService' :: Maybe Text
-> Maybe Text
-> Text
-> VirtualServiceSpec
-> Text
-> UpdateVirtualService
UpdateVirtualService'
      { $sel:clientToken:UpdateVirtualService' :: Maybe Text
clientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:meshOwner:UpdateVirtualService' :: Maybe Text
meshOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:meshName:UpdateVirtualService' :: Text
meshName = Text
pMeshName_,
        $sel:spec:UpdateVirtualService' :: VirtualServiceSpec
spec = VirtualServiceSpec
pSpec_,
        $sel:virtualServiceName:UpdateVirtualService' :: Text
virtualServiceName = Text
pVirtualServiceName_
      }

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

-- | 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>.
updateVirtualService_meshOwner :: Lens.Lens' UpdateVirtualService (Prelude.Maybe Prelude.Text)
updateVirtualService_meshOwner :: (Maybe Text -> f (Maybe Text))
-> UpdateVirtualService -> f UpdateVirtualService
updateVirtualService_meshOwner = (UpdateVirtualService -> Maybe Text)
-> (UpdateVirtualService -> Maybe Text -> UpdateVirtualService)
-> Lens
     UpdateVirtualService UpdateVirtualService (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualService' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:UpdateVirtualService' :: UpdateVirtualService -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: UpdateVirtualService
s@UpdateVirtualService' {} Maybe Text
a -> UpdateVirtualService
s {$sel:meshOwner:UpdateVirtualService' :: Maybe Text
meshOwner = Maybe Text
a} :: UpdateVirtualService)

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

-- | The new virtual service specification to apply. This overwrites the
-- existing data.
updateVirtualService_spec :: Lens.Lens' UpdateVirtualService VirtualServiceSpec
updateVirtualService_spec :: (VirtualServiceSpec -> f VirtualServiceSpec)
-> UpdateVirtualService -> f UpdateVirtualService
updateVirtualService_spec = (UpdateVirtualService -> VirtualServiceSpec)
-> (UpdateVirtualService
    -> VirtualServiceSpec -> UpdateVirtualService)
-> Lens
     UpdateVirtualService
     UpdateVirtualService
     VirtualServiceSpec
     VirtualServiceSpec
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualService' {VirtualServiceSpec
spec :: VirtualServiceSpec
$sel:spec:UpdateVirtualService' :: UpdateVirtualService -> VirtualServiceSpec
spec} -> VirtualServiceSpec
spec) (\s :: UpdateVirtualService
s@UpdateVirtualService' {} VirtualServiceSpec
a -> UpdateVirtualService
s {$sel:spec:UpdateVirtualService' :: VirtualServiceSpec
spec = VirtualServiceSpec
a} :: UpdateVirtualService)

-- | The name of the virtual service to update.
updateVirtualService_virtualServiceName :: Lens.Lens' UpdateVirtualService Prelude.Text
updateVirtualService_virtualServiceName :: (Text -> f Text) -> UpdateVirtualService -> f UpdateVirtualService
updateVirtualService_virtualServiceName = (UpdateVirtualService -> Text)
-> (UpdateVirtualService -> Text -> UpdateVirtualService)
-> Lens UpdateVirtualService UpdateVirtualService Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualService' {Text
virtualServiceName :: Text
$sel:virtualServiceName:UpdateVirtualService' :: UpdateVirtualService -> Text
virtualServiceName} -> Text
virtualServiceName) (\s :: UpdateVirtualService
s@UpdateVirtualService' {} Text
a -> UpdateVirtualService
s {$sel:virtualServiceName:UpdateVirtualService' :: Text
virtualServiceName = Text
a} :: UpdateVirtualService)

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

instance Prelude.Hashable UpdateVirtualService

instance Prelude.NFData UpdateVirtualService

instance Core.ToHeaders UpdateVirtualService where
  toHeaders :: UpdateVirtualService -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateVirtualService -> 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 UpdateVirtualService where
  toJSON :: UpdateVirtualService -> Value
toJSON UpdateVirtualService' {Maybe Text
Text
VirtualServiceSpec
virtualServiceName :: Text
spec :: VirtualServiceSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualServiceName:UpdateVirtualService' :: UpdateVirtualService -> Text
$sel:spec:UpdateVirtualService' :: UpdateVirtualService -> VirtualServiceSpec
$sel:meshName:UpdateVirtualService' :: UpdateVirtualService -> Text
$sel:meshOwner:UpdateVirtualService' :: UpdateVirtualService -> Maybe Text
$sel:clientToken:UpdateVirtualService' :: UpdateVirtualService -> 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 -> VirtualServiceSpec -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VirtualServiceSpec
spec)
          ]
      )

instance Core.ToPath UpdateVirtualService where
  toPath :: UpdateVirtualService -> ByteString
toPath UpdateVirtualService' {Maybe Text
Text
VirtualServiceSpec
virtualServiceName :: Text
spec :: VirtualServiceSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualServiceName:UpdateVirtualService' :: UpdateVirtualService -> Text
$sel:spec:UpdateVirtualService' :: UpdateVirtualService -> VirtualServiceSpec
$sel:meshName:UpdateVirtualService' :: UpdateVirtualService -> Text
$sel:meshOwner:UpdateVirtualService' :: UpdateVirtualService -> Maybe Text
$sel:clientToken:UpdateVirtualService' :: UpdateVirtualService -> 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
"/virtualServices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
virtualServiceName
      ]

instance Core.ToQuery UpdateVirtualService where
  toQuery :: UpdateVirtualService -> QueryString
toQuery UpdateVirtualService' {Maybe Text
Text
VirtualServiceSpec
virtualServiceName :: Text
spec :: VirtualServiceSpec
meshName :: Text
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualServiceName:UpdateVirtualService' :: UpdateVirtualService -> Text
$sel:spec:UpdateVirtualService' :: UpdateVirtualService -> VirtualServiceSpec
$sel:meshName:UpdateVirtualService' :: UpdateVirtualService -> Text
$sel:meshOwner:UpdateVirtualService' :: UpdateVirtualService -> Maybe Text
$sel:clientToken:UpdateVirtualService' :: UpdateVirtualService -> 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:/ 'newUpdateVirtualServiceResponse' smart constructor.
data UpdateVirtualServiceResponse = UpdateVirtualServiceResponse'
  { -- | The response's http status code.
    UpdateVirtualServiceResponse -> Int
httpStatus :: Prelude.Int,
    -- | A full description of the virtual service that was updated.
    UpdateVirtualServiceResponse -> VirtualServiceData
virtualService :: VirtualServiceData
  }
  deriving (UpdateVirtualServiceResponse
-> UpdateVirtualServiceResponse -> Bool
(UpdateVirtualServiceResponse
 -> UpdateVirtualServiceResponse -> Bool)
-> (UpdateVirtualServiceResponse
    -> UpdateVirtualServiceResponse -> Bool)
-> Eq UpdateVirtualServiceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVirtualServiceResponse
-> UpdateVirtualServiceResponse -> Bool
$c/= :: UpdateVirtualServiceResponse
-> UpdateVirtualServiceResponse -> Bool
== :: UpdateVirtualServiceResponse
-> UpdateVirtualServiceResponse -> Bool
$c== :: UpdateVirtualServiceResponse
-> UpdateVirtualServiceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateVirtualServiceResponse]
ReadPrec UpdateVirtualServiceResponse
Int -> ReadS UpdateVirtualServiceResponse
ReadS [UpdateVirtualServiceResponse]
(Int -> ReadS UpdateVirtualServiceResponse)
-> ReadS [UpdateVirtualServiceResponse]
-> ReadPrec UpdateVirtualServiceResponse
-> ReadPrec [UpdateVirtualServiceResponse]
-> Read UpdateVirtualServiceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVirtualServiceResponse]
$creadListPrec :: ReadPrec [UpdateVirtualServiceResponse]
readPrec :: ReadPrec UpdateVirtualServiceResponse
$creadPrec :: ReadPrec UpdateVirtualServiceResponse
readList :: ReadS [UpdateVirtualServiceResponse]
$creadList :: ReadS [UpdateVirtualServiceResponse]
readsPrec :: Int -> ReadS UpdateVirtualServiceResponse
$creadsPrec :: Int -> ReadS UpdateVirtualServiceResponse
Prelude.Read, Int -> UpdateVirtualServiceResponse -> ShowS
[UpdateVirtualServiceResponse] -> ShowS
UpdateVirtualServiceResponse -> String
(Int -> UpdateVirtualServiceResponse -> ShowS)
-> (UpdateVirtualServiceResponse -> String)
-> ([UpdateVirtualServiceResponse] -> ShowS)
-> Show UpdateVirtualServiceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVirtualServiceResponse] -> ShowS
$cshowList :: [UpdateVirtualServiceResponse] -> ShowS
show :: UpdateVirtualServiceResponse -> String
$cshow :: UpdateVirtualServiceResponse -> String
showsPrec :: Int -> UpdateVirtualServiceResponse -> ShowS
$cshowsPrec :: Int -> UpdateVirtualServiceResponse -> ShowS
Prelude.Show, (forall x.
 UpdateVirtualServiceResponse -> Rep UpdateVirtualServiceResponse x)
-> (forall x.
    Rep UpdateVirtualServiceResponse x -> UpdateVirtualServiceResponse)
-> Generic UpdateVirtualServiceResponse
forall x.
Rep UpdateVirtualServiceResponse x -> UpdateVirtualServiceResponse
forall x.
UpdateVirtualServiceResponse -> Rep UpdateVirtualServiceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateVirtualServiceResponse x -> UpdateVirtualServiceResponse
$cfrom :: forall x.
UpdateVirtualServiceResponse -> Rep UpdateVirtualServiceResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateVirtualServiceResponse' 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', 'updateVirtualServiceResponse_httpStatus' - The response's http status code.
--
-- 'virtualService', 'updateVirtualServiceResponse_virtualService' - A full description of the virtual service that was updated.
newUpdateVirtualServiceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'virtualService'
  VirtualServiceData ->
  UpdateVirtualServiceResponse
newUpdateVirtualServiceResponse :: Int -> VirtualServiceData -> UpdateVirtualServiceResponse
newUpdateVirtualServiceResponse
  Int
pHttpStatus_
  VirtualServiceData
pVirtualService_ =
    UpdateVirtualServiceResponse' :: Int -> VirtualServiceData -> UpdateVirtualServiceResponse
UpdateVirtualServiceResponse'
      { $sel:httpStatus:UpdateVirtualServiceResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:virtualService:UpdateVirtualServiceResponse' :: VirtualServiceData
virtualService = VirtualServiceData
pVirtualService_
      }

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

-- | A full description of the virtual service that was updated.
updateVirtualServiceResponse_virtualService :: Lens.Lens' UpdateVirtualServiceResponse VirtualServiceData
updateVirtualServiceResponse_virtualService :: (VirtualServiceData -> f VirtualServiceData)
-> UpdateVirtualServiceResponse -> f UpdateVirtualServiceResponse
updateVirtualServiceResponse_virtualService = (UpdateVirtualServiceResponse -> VirtualServiceData)
-> (UpdateVirtualServiceResponse
    -> VirtualServiceData -> UpdateVirtualServiceResponse)
-> Lens
     UpdateVirtualServiceResponse
     UpdateVirtualServiceResponse
     VirtualServiceData
     VirtualServiceData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVirtualServiceResponse' {VirtualServiceData
virtualService :: VirtualServiceData
$sel:virtualService:UpdateVirtualServiceResponse' :: UpdateVirtualServiceResponse -> VirtualServiceData
virtualService} -> VirtualServiceData
virtualService) (\s :: UpdateVirtualServiceResponse
s@UpdateVirtualServiceResponse' {} VirtualServiceData
a -> UpdateVirtualServiceResponse
s {$sel:virtualService:UpdateVirtualServiceResponse' :: VirtualServiceData
virtualService = VirtualServiceData
a} :: UpdateVirtualServiceResponse)

instance Prelude.NFData UpdateVirtualServiceResponse