{-# 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.SageMaker.UpdateEndpointWeightsAndCapacities
-- 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 variant weight of one or more variants associated with an
-- existing endpoint, or capacity of one variant associated with an
-- existing endpoint. When it receives the request, Amazon SageMaker sets
-- the endpoint status to @Updating@. After updating the endpoint, it sets
-- the status to @InService@. To check the status of an endpoint, use the
-- DescribeEndpoint API.
module Amazonka.SageMaker.UpdateEndpointWeightsAndCapacities
  ( -- * Creating a Request
    UpdateEndpointWeightsAndCapacities (..),
    newUpdateEndpointWeightsAndCapacities,

    -- * Request Lenses
    updateEndpointWeightsAndCapacities_endpointName,
    updateEndpointWeightsAndCapacities_desiredWeightsAndCapacities,

    -- * Destructuring the Response
    UpdateEndpointWeightsAndCapacitiesResponse (..),
    newUpdateEndpointWeightsAndCapacitiesResponse,

    -- * Response Lenses
    updateEndpointWeightsAndCapacitiesResponse_httpStatus,
    updateEndpointWeightsAndCapacitiesResponse_endpointArn,
  )
where

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
import Amazonka.SageMaker.Types

-- | /See:/ 'newUpdateEndpointWeightsAndCapacities' smart constructor.
data UpdateEndpointWeightsAndCapacities = UpdateEndpointWeightsAndCapacities'
  { -- | The name of an existing Amazon SageMaker endpoint.
    UpdateEndpointWeightsAndCapacities -> Text
endpointName :: Prelude.Text,
    -- | An object that provides new capacity and weight values for a variant.
    UpdateEndpointWeightsAndCapacities
-> NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities :: Prelude.NonEmpty DesiredWeightAndCapacity
  }
  deriving (UpdateEndpointWeightsAndCapacities
-> UpdateEndpointWeightsAndCapacities -> Bool
(UpdateEndpointWeightsAndCapacities
 -> UpdateEndpointWeightsAndCapacities -> Bool)
-> (UpdateEndpointWeightsAndCapacities
    -> UpdateEndpointWeightsAndCapacities -> Bool)
-> Eq UpdateEndpointWeightsAndCapacities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEndpointWeightsAndCapacities
-> UpdateEndpointWeightsAndCapacities -> Bool
$c/= :: UpdateEndpointWeightsAndCapacities
-> UpdateEndpointWeightsAndCapacities -> Bool
== :: UpdateEndpointWeightsAndCapacities
-> UpdateEndpointWeightsAndCapacities -> Bool
$c== :: UpdateEndpointWeightsAndCapacities
-> UpdateEndpointWeightsAndCapacities -> Bool
Prelude.Eq, ReadPrec [UpdateEndpointWeightsAndCapacities]
ReadPrec UpdateEndpointWeightsAndCapacities
Int -> ReadS UpdateEndpointWeightsAndCapacities
ReadS [UpdateEndpointWeightsAndCapacities]
(Int -> ReadS UpdateEndpointWeightsAndCapacities)
-> ReadS [UpdateEndpointWeightsAndCapacities]
-> ReadPrec UpdateEndpointWeightsAndCapacities
-> ReadPrec [UpdateEndpointWeightsAndCapacities]
-> Read UpdateEndpointWeightsAndCapacities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEndpointWeightsAndCapacities]
$creadListPrec :: ReadPrec [UpdateEndpointWeightsAndCapacities]
readPrec :: ReadPrec UpdateEndpointWeightsAndCapacities
$creadPrec :: ReadPrec UpdateEndpointWeightsAndCapacities
readList :: ReadS [UpdateEndpointWeightsAndCapacities]
$creadList :: ReadS [UpdateEndpointWeightsAndCapacities]
readsPrec :: Int -> ReadS UpdateEndpointWeightsAndCapacities
$creadsPrec :: Int -> ReadS UpdateEndpointWeightsAndCapacities
Prelude.Read, Int -> UpdateEndpointWeightsAndCapacities -> ShowS
[UpdateEndpointWeightsAndCapacities] -> ShowS
UpdateEndpointWeightsAndCapacities -> String
(Int -> UpdateEndpointWeightsAndCapacities -> ShowS)
-> (UpdateEndpointWeightsAndCapacities -> String)
-> ([UpdateEndpointWeightsAndCapacities] -> ShowS)
-> Show UpdateEndpointWeightsAndCapacities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEndpointWeightsAndCapacities] -> ShowS
$cshowList :: [UpdateEndpointWeightsAndCapacities] -> ShowS
show :: UpdateEndpointWeightsAndCapacities -> String
$cshow :: UpdateEndpointWeightsAndCapacities -> String
showsPrec :: Int -> UpdateEndpointWeightsAndCapacities -> ShowS
$cshowsPrec :: Int -> UpdateEndpointWeightsAndCapacities -> ShowS
Prelude.Show, (forall x.
 UpdateEndpointWeightsAndCapacities
 -> Rep UpdateEndpointWeightsAndCapacities x)
-> (forall x.
    Rep UpdateEndpointWeightsAndCapacities x
    -> UpdateEndpointWeightsAndCapacities)
-> Generic UpdateEndpointWeightsAndCapacities
forall x.
Rep UpdateEndpointWeightsAndCapacities x
-> UpdateEndpointWeightsAndCapacities
forall x.
UpdateEndpointWeightsAndCapacities
-> Rep UpdateEndpointWeightsAndCapacities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEndpointWeightsAndCapacities x
-> UpdateEndpointWeightsAndCapacities
$cfrom :: forall x.
UpdateEndpointWeightsAndCapacities
-> Rep UpdateEndpointWeightsAndCapacities x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEndpointWeightsAndCapacities' 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:
--
-- 'endpointName', 'updateEndpointWeightsAndCapacities_endpointName' - The name of an existing Amazon SageMaker endpoint.
--
-- 'desiredWeightsAndCapacities', 'updateEndpointWeightsAndCapacities_desiredWeightsAndCapacities' - An object that provides new capacity and weight values for a variant.
newUpdateEndpointWeightsAndCapacities ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'desiredWeightsAndCapacities'
  Prelude.NonEmpty DesiredWeightAndCapacity ->
  UpdateEndpointWeightsAndCapacities
newUpdateEndpointWeightsAndCapacities :: Text
-> NonEmpty DesiredWeightAndCapacity
-> UpdateEndpointWeightsAndCapacities
newUpdateEndpointWeightsAndCapacities
  Text
pEndpointName_
  NonEmpty DesiredWeightAndCapacity
pDesiredWeightsAndCapacities_ =
    UpdateEndpointWeightsAndCapacities' :: Text
-> NonEmpty DesiredWeightAndCapacity
-> UpdateEndpointWeightsAndCapacities
UpdateEndpointWeightsAndCapacities'
      { $sel:endpointName:UpdateEndpointWeightsAndCapacities' :: Text
endpointName =
          Text
pEndpointName_,
        $sel:desiredWeightsAndCapacities:UpdateEndpointWeightsAndCapacities' :: NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities =
          Tagged
  (NonEmpty DesiredWeightAndCapacity)
  (Identity (NonEmpty DesiredWeightAndCapacity))
-> Tagged
     (NonEmpty DesiredWeightAndCapacity)
     (Identity (NonEmpty DesiredWeightAndCapacity))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            (Tagged
   (NonEmpty DesiredWeightAndCapacity)
   (Identity (NonEmpty DesiredWeightAndCapacity))
 -> Tagged
      (NonEmpty DesiredWeightAndCapacity)
      (Identity (NonEmpty DesiredWeightAndCapacity)))
-> NonEmpty DesiredWeightAndCapacity
-> NonEmpty DesiredWeightAndCapacity
forall t b. AReview t b -> b -> t
Lens.# NonEmpty DesiredWeightAndCapacity
pDesiredWeightsAndCapacities_
      }

-- | The name of an existing Amazon SageMaker endpoint.
updateEndpointWeightsAndCapacities_endpointName :: Lens.Lens' UpdateEndpointWeightsAndCapacities Prelude.Text
updateEndpointWeightsAndCapacities_endpointName :: (Text -> f Text)
-> UpdateEndpointWeightsAndCapacities
-> f UpdateEndpointWeightsAndCapacities
updateEndpointWeightsAndCapacities_endpointName = (UpdateEndpointWeightsAndCapacities -> Text)
-> (UpdateEndpointWeightsAndCapacities
    -> Text -> UpdateEndpointWeightsAndCapacities)
-> Lens
     UpdateEndpointWeightsAndCapacities
     UpdateEndpointWeightsAndCapacities
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpointWeightsAndCapacities' {Text
endpointName :: Text
$sel:endpointName:UpdateEndpointWeightsAndCapacities' :: UpdateEndpointWeightsAndCapacities -> Text
endpointName} -> Text
endpointName) (\s :: UpdateEndpointWeightsAndCapacities
s@UpdateEndpointWeightsAndCapacities' {} Text
a -> UpdateEndpointWeightsAndCapacities
s {$sel:endpointName:UpdateEndpointWeightsAndCapacities' :: Text
endpointName = Text
a} :: UpdateEndpointWeightsAndCapacities)

-- | An object that provides new capacity and weight values for a variant.
updateEndpointWeightsAndCapacities_desiredWeightsAndCapacities :: Lens.Lens' UpdateEndpointWeightsAndCapacities (Prelude.NonEmpty DesiredWeightAndCapacity)
updateEndpointWeightsAndCapacities_desiredWeightsAndCapacities :: (NonEmpty DesiredWeightAndCapacity
 -> f (NonEmpty DesiredWeightAndCapacity))
-> UpdateEndpointWeightsAndCapacities
-> f UpdateEndpointWeightsAndCapacities
updateEndpointWeightsAndCapacities_desiredWeightsAndCapacities = (UpdateEndpointWeightsAndCapacities
 -> NonEmpty DesiredWeightAndCapacity)
-> (UpdateEndpointWeightsAndCapacities
    -> NonEmpty DesiredWeightAndCapacity
    -> UpdateEndpointWeightsAndCapacities)
-> Lens
     UpdateEndpointWeightsAndCapacities
     UpdateEndpointWeightsAndCapacities
     (NonEmpty DesiredWeightAndCapacity)
     (NonEmpty DesiredWeightAndCapacity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpointWeightsAndCapacities' {NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities :: NonEmpty DesiredWeightAndCapacity
$sel:desiredWeightsAndCapacities:UpdateEndpointWeightsAndCapacities' :: UpdateEndpointWeightsAndCapacities
-> NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities} -> NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities) (\s :: UpdateEndpointWeightsAndCapacities
s@UpdateEndpointWeightsAndCapacities' {} NonEmpty DesiredWeightAndCapacity
a -> UpdateEndpointWeightsAndCapacities
s {$sel:desiredWeightsAndCapacities:UpdateEndpointWeightsAndCapacities' :: NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities = NonEmpty DesiredWeightAndCapacity
a} :: UpdateEndpointWeightsAndCapacities) ((NonEmpty DesiredWeightAndCapacity
  -> f (NonEmpty DesiredWeightAndCapacity))
 -> UpdateEndpointWeightsAndCapacities
 -> f UpdateEndpointWeightsAndCapacities)
-> ((NonEmpty DesiredWeightAndCapacity
     -> f (NonEmpty DesiredWeightAndCapacity))
    -> NonEmpty DesiredWeightAndCapacity
    -> f (NonEmpty DesiredWeightAndCapacity))
-> (NonEmpty DesiredWeightAndCapacity
    -> f (NonEmpty DesiredWeightAndCapacity))
-> UpdateEndpointWeightsAndCapacities
-> f UpdateEndpointWeightsAndCapacities
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty DesiredWeightAndCapacity
 -> f (NonEmpty DesiredWeightAndCapacity))
-> NonEmpty DesiredWeightAndCapacity
-> f (NonEmpty DesiredWeightAndCapacity)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.Hashable
    UpdateEndpointWeightsAndCapacities

instance
  Prelude.NFData
    UpdateEndpointWeightsAndCapacities

instance
  Core.ToHeaders
    UpdateEndpointWeightsAndCapacities
  where
  toHeaders :: UpdateEndpointWeightsAndCapacities -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> UpdateEndpointWeightsAndCapacities -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SageMaker.UpdateEndpointWeightsAndCapacities" ::
                          Prelude.ByteString
                      ),
            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
    UpdateEndpointWeightsAndCapacities
  where
  toJSON :: UpdateEndpointWeightsAndCapacities -> Value
toJSON UpdateEndpointWeightsAndCapacities' {NonEmpty DesiredWeightAndCapacity
Text
desiredWeightsAndCapacities :: NonEmpty DesiredWeightAndCapacity
endpointName :: Text
$sel:desiredWeightsAndCapacities:UpdateEndpointWeightsAndCapacities' :: UpdateEndpointWeightsAndCapacities
-> NonEmpty DesiredWeightAndCapacity
$sel:endpointName:UpdateEndpointWeightsAndCapacities' :: UpdateEndpointWeightsAndCapacities -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EndpointName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"DesiredWeightsAndCapacities"
                  Text -> NonEmpty DesiredWeightAndCapacity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty DesiredWeightAndCapacity
desiredWeightsAndCapacities
              )
          ]
      )

instance
  Core.ToPath
    UpdateEndpointWeightsAndCapacities
  where
  toPath :: UpdateEndpointWeightsAndCapacities -> ByteString
toPath = ByteString -> UpdateEndpointWeightsAndCapacities -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateEndpointWeightsAndCapacitiesResponse' smart constructor.
data UpdateEndpointWeightsAndCapacitiesResponse = UpdateEndpointWeightsAndCapacitiesResponse'
  { -- | The response's http status code.
    UpdateEndpointWeightsAndCapacitiesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the updated endpoint.
    UpdateEndpointWeightsAndCapacitiesResponse -> Text
endpointArn :: Prelude.Text
  }
  deriving (UpdateEndpointWeightsAndCapacitiesResponse
-> UpdateEndpointWeightsAndCapacitiesResponse -> Bool
(UpdateEndpointWeightsAndCapacitiesResponse
 -> UpdateEndpointWeightsAndCapacitiesResponse -> Bool)
-> (UpdateEndpointWeightsAndCapacitiesResponse
    -> UpdateEndpointWeightsAndCapacitiesResponse -> Bool)
-> Eq UpdateEndpointWeightsAndCapacitiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEndpointWeightsAndCapacitiesResponse
-> UpdateEndpointWeightsAndCapacitiesResponse -> Bool
$c/= :: UpdateEndpointWeightsAndCapacitiesResponse
-> UpdateEndpointWeightsAndCapacitiesResponse -> Bool
== :: UpdateEndpointWeightsAndCapacitiesResponse
-> UpdateEndpointWeightsAndCapacitiesResponse -> Bool
$c== :: UpdateEndpointWeightsAndCapacitiesResponse
-> UpdateEndpointWeightsAndCapacitiesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEndpointWeightsAndCapacitiesResponse]
ReadPrec UpdateEndpointWeightsAndCapacitiesResponse
Int -> ReadS UpdateEndpointWeightsAndCapacitiesResponse
ReadS [UpdateEndpointWeightsAndCapacitiesResponse]
(Int -> ReadS UpdateEndpointWeightsAndCapacitiesResponse)
-> ReadS [UpdateEndpointWeightsAndCapacitiesResponse]
-> ReadPrec UpdateEndpointWeightsAndCapacitiesResponse
-> ReadPrec [UpdateEndpointWeightsAndCapacitiesResponse]
-> Read UpdateEndpointWeightsAndCapacitiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEndpointWeightsAndCapacitiesResponse]
$creadListPrec :: ReadPrec [UpdateEndpointWeightsAndCapacitiesResponse]
readPrec :: ReadPrec UpdateEndpointWeightsAndCapacitiesResponse
$creadPrec :: ReadPrec UpdateEndpointWeightsAndCapacitiesResponse
readList :: ReadS [UpdateEndpointWeightsAndCapacitiesResponse]
$creadList :: ReadS [UpdateEndpointWeightsAndCapacitiesResponse]
readsPrec :: Int -> ReadS UpdateEndpointWeightsAndCapacitiesResponse
$creadsPrec :: Int -> ReadS UpdateEndpointWeightsAndCapacitiesResponse
Prelude.Read, Int -> UpdateEndpointWeightsAndCapacitiesResponse -> ShowS
[UpdateEndpointWeightsAndCapacitiesResponse] -> ShowS
UpdateEndpointWeightsAndCapacitiesResponse -> String
(Int -> UpdateEndpointWeightsAndCapacitiesResponse -> ShowS)
-> (UpdateEndpointWeightsAndCapacitiesResponse -> String)
-> ([UpdateEndpointWeightsAndCapacitiesResponse] -> ShowS)
-> Show UpdateEndpointWeightsAndCapacitiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEndpointWeightsAndCapacitiesResponse] -> ShowS
$cshowList :: [UpdateEndpointWeightsAndCapacitiesResponse] -> ShowS
show :: UpdateEndpointWeightsAndCapacitiesResponse -> String
$cshow :: UpdateEndpointWeightsAndCapacitiesResponse -> String
showsPrec :: Int -> UpdateEndpointWeightsAndCapacitiesResponse -> ShowS
$cshowsPrec :: Int -> UpdateEndpointWeightsAndCapacitiesResponse -> ShowS
Prelude.Show, (forall x.
 UpdateEndpointWeightsAndCapacitiesResponse
 -> Rep UpdateEndpointWeightsAndCapacitiesResponse x)
-> (forall x.
    Rep UpdateEndpointWeightsAndCapacitiesResponse x
    -> UpdateEndpointWeightsAndCapacitiesResponse)
-> Generic UpdateEndpointWeightsAndCapacitiesResponse
forall x.
Rep UpdateEndpointWeightsAndCapacitiesResponse x
-> UpdateEndpointWeightsAndCapacitiesResponse
forall x.
UpdateEndpointWeightsAndCapacitiesResponse
-> Rep UpdateEndpointWeightsAndCapacitiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEndpointWeightsAndCapacitiesResponse x
-> UpdateEndpointWeightsAndCapacitiesResponse
$cfrom :: forall x.
UpdateEndpointWeightsAndCapacitiesResponse
-> Rep UpdateEndpointWeightsAndCapacitiesResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEndpointWeightsAndCapacitiesResponse' 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', 'updateEndpointWeightsAndCapacitiesResponse_httpStatus' - The response's http status code.
--
-- 'endpointArn', 'updateEndpointWeightsAndCapacitiesResponse_endpointArn' - The Amazon Resource Name (ARN) of the updated endpoint.
newUpdateEndpointWeightsAndCapacitiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'endpointArn'
  Prelude.Text ->
  UpdateEndpointWeightsAndCapacitiesResponse
newUpdateEndpointWeightsAndCapacitiesResponse :: Int -> Text -> UpdateEndpointWeightsAndCapacitiesResponse
newUpdateEndpointWeightsAndCapacitiesResponse
  Int
pHttpStatus_
  Text
pEndpointArn_ =
    UpdateEndpointWeightsAndCapacitiesResponse' :: Int -> Text -> UpdateEndpointWeightsAndCapacitiesResponse
UpdateEndpointWeightsAndCapacitiesResponse'
      { $sel:httpStatus:UpdateEndpointWeightsAndCapacitiesResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:endpointArn:UpdateEndpointWeightsAndCapacitiesResponse' :: Text
endpointArn = Text
pEndpointArn_
      }

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

-- | The Amazon Resource Name (ARN) of the updated endpoint.
updateEndpointWeightsAndCapacitiesResponse_endpointArn :: Lens.Lens' UpdateEndpointWeightsAndCapacitiesResponse Prelude.Text
updateEndpointWeightsAndCapacitiesResponse_endpointArn :: (Text -> f Text)
-> UpdateEndpointWeightsAndCapacitiesResponse
-> f UpdateEndpointWeightsAndCapacitiesResponse
updateEndpointWeightsAndCapacitiesResponse_endpointArn = (UpdateEndpointWeightsAndCapacitiesResponse -> Text)
-> (UpdateEndpointWeightsAndCapacitiesResponse
    -> Text -> UpdateEndpointWeightsAndCapacitiesResponse)
-> Lens
     UpdateEndpointWeightsAndCapacitiesResponse
     UpdateEndpointWeightsAndCapacitiesResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpointWeightsAndCapacitiesResponse' {Text
endpointArn :: Text
$sel:endpointArn:UpdateEndpointWeightsAndCapacitiesResponse' :: UpdateEndpointWeightsAndCapacitiesResponse -> Text
endpointArn} -> Text
endpointArn) (\s :: UpdateEndpointWeightsAndCapacitiesResponse
s@UpdateEndpointWeightsAndCapacitiesResponse' {} Text
a -> UpdateEndpointWeightsAndCapacitiesResponse
s {$sel:endpointArn:UpdateEndpointWeightsAndCapacitiesResponse' :: Text
endpointArn = Text
a} :: UpdateEndpointWeightsAndCapacitiesResponse)

instance
  Prelude.NFData
    UpdateEndpointWeightsAndCapacitiesResponse