{-# 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.UpdateEndpoint
-- 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)
--
-- Deploys the new @EndpointConfig@ specified in the request, switches to
-- using newly created endpoint, and then deletes resources provisioned for
-- the endpoint using the previous @EndpointConfig@ (there is no
-- availability loss).
--
-- When Amazon SageMaker receives the request, it 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.
--
-- You must not delete an @EndpointConfig@ in use by an endpoint that is
-- live or while the @UpdateEndpoint@ or @CreateEndpoint@ operations are
-- being performed on the endpoint. To update an endpoint, you must create
-- a new @EndpointConfig@.
--
-- If you delete the @EndpointConfig@ of an endpoint that is active or
-- being created or updated you may lose visibility into the instance type
-- the endpoint is using. The endpoint must be deleted in order to stop
-- incurring charges.
module Amazonka.SageMaker.UpdateEndpoint
  ( -- * Creating a Request
    UpdateEndpoint (..),
    newUpdateEndpoint,

    -- * Request Lenses
    updateEndpoint_excludeRetainedVariantProperties,
    updateEndpoint_retainAllVariantProperties,
    updateEndpoint_deploymentConfig,
    updateEndpoint_endpointName,
    updateEndpoint_endpointConfigName,

    -- * Destructuring the Response
    UpdateEndpointResponse (..),
    newUpdateEndpointResponse,

    -- * Response Lenses
    updateEndpointResponse_httpStatus,
    updateEndpointResponse_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:/ 'newUpdateEndpoint' smart constructor.
data UpdateEndpoint = UpdateEndpoint'
  { -- | When you are updating endpoint resources with
    -- UpdateEndpointInput$RetainAllVariantProperties, whose value is set to
    -- @true@, @ExcludeRetainedVariantProperties@ specifies the list of type
    -- VariantProperty to override with the values provided by
    -- @EndpointConfig@. If you don\'t specify a value for
    -- @ExcludeAllVariantProperties@, no variant properties are overridden.
    UpdateEndpoint -> Maybe [VariantProperty]
excludeRetainedVariantProperties :: Prelude.Maybe [VariantProperty],
    -- | When updating endpoint resources, enables or disables the retention of
    -- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html variant properties>,
    -- such as the instance count or the variant weight. To retain the variant
    -- properties of an endpoint when updating it, set
    -- @RetainAllVariantProperties@ to @true@. To use the variant properties
    -- specified in a new @EndpointConfig@ call when updating an endpoint, set
    -- @RetainAllVariantProperties@ to @false@. The default is @false@.
    UpdateEndpoint -> Maybe Bool
retainAllVariantProperties :: Prelude.Maybe Prelude.Bool,
    -- | The deployment configuration for the endpoint to be updated.
    UpdateEndpoint -> Maybe DeploymentConfig
deploymentConfig :: Prelude.Maybe DeploymentConfig,
    -- | The name of the endpoint whose configuration you want to update.
    UpdateEndpoint -> Text
endpointName :: Prelude.Text,
    -- | The name of the new endpoint configuration.
    UpdateEndpoint -> Text
endpointConfigName :: Prelude.Text
  }
  deriving (UpdateEndpoint -> UpdateEndpoint -> Bool
(UpdateEndpoint -> UpdateEndpoint -> Bool)
-> (UpdateEndpoint -> UpdateEndpoint -> Bool) -> Eq UpdateEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEndpoint -> UpdateEndpoint -> Bool
$c/= :: UpdateEndpoint -> UpdateEndpoint -> Bool
== :: UpdateEndpoint -> UpdateEndpoint -> Bool
$c== :: UpdateEndpoint -> UpdateEndpoint -> Bool
Prelude.Eq, ReadPrec [UpdateEndpoint]
ReadPrec UpdateEndpoint
Int -> ReadS UpdateEndpoint
ReadS [UpdateEndpoint]
(Int -> ReadS UpdateEndpoint)
-> ReadS [UpdateEndpoint]
-> ReadPrec UpdateEndpoint
-> ReadPrec [UpdateEndpoint]
-> Read UpdateEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEndpoint]
$creadListPrec :: ReadPrec [UpdateEndpoint]
readPrec :: ReadPrec UpdateEndpoint
$creadPrec :: ReadPrec UpdateEndpoint
readList :: ReadS [UpdateEndpoint]
$creadList :: ReadS [UpdateEndpoint]
readsPrec :: Int -> ReadS UpdateEndpoint
$creadsPrec :: Int -> ReadS UpdateEndpoint
Prelude.Read, Int -> UpdateEndpoint -> ShowS
[UpdateEndpoint] -> ShowS
UpdateEndpoint -> String
(Int -> UpdateEndpoint -> ShowS)
-> (UpdateEndpoint -> String)
-> ([UpdateEndpoint] -> ShowS)
-> Show UpdateEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEndpoint] -> ShowS
$cshowList :: [UpdateEndpoint] -> ShowS
show :: UpdateEndpoint -> String
$cshow :: UpdateEndpoint -> String
showsPrec :: Int -> UpdateEndpoint -> ShowS
$cshowsPrec :: Int -> UpdateEndpoint -> ShowS
Prelude.Show, (forall x. UpdateEndpoint -> Rep UpdateEndpoint x)
-> (forall x. Rep UpdateEndpoint x -> UpdateEndpoint)
-> Generic UpdateEndpoint
forall x. Rep UpdateEndpoint x -> UpdateEndpoint
forall x. UpdateEndpoint -> Rep UpdateEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEndpoint x -> UpdateEndpoint
$cfrom :: forall x. UpdateEndpoint -> Rep UpdateEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEndpoint' 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:
--
-- 'excludeRetainedVariantProperties', 'updateEndpoint_excludeRetainedVariantProperties' - When you are updating endpoint resources with
-- UpdateEndpointInput$RetainAllVariantProperties, whose value is set to
-- @true@, @ExcludeRetainedVariantProperties@ specifies the list of type
-- VariantProperty to override with the values provided by
-- @EndpointConfig@. If you don\'t specify a value for
-- @ExcludeAllVariantProperties@, no variant properties are overridden.
--
-- 'retainAllVariantProperties', 'updateEndpoint_retainAllVariantProperties' - When updating endpoint resources, enables or disables the retention of
-- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html variant properties>,
-- such as the instance count or the variant weight. To retain the variant
-- properties of an endpoint when updating it, set
-- @RetainAllVariantProperties@ to @true@. To use the variant properties
-- specified in a new @EndpointConfig@ call when updating an endpoint, set
-- @RetainAllVariantProperties@ to @false@. The default is @false@.
--
-- 'deploymentConfig', 'updateEndpoint_deploymentConfig' - The deployment configuration for the endpoint to be updated.
--
-- 'endpointName', 'updateEndpoint_endpointName' - The name of the endpoint whose configuration you want to update.
--
-- 'endpointConfigName', 'updateEndpoint_endpointConfigName' - The name of the new endpoint configuration.
newUpdateEndpoint ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'endpointConfigName'
  Prelude.Text ->
  UpdateEndpoint
newUpdateEndpoint :: Text -> Text -> UpdateEndpoint
newUpdateEndpoint Text
pEndpointName_ Text
pEndpointConfigName_ =
  UpdateEndpoint' :: Maybe [VariantProperty]
-> Maybe Bool
-> Maybe DeploymentConfig
-> Text
-> Text
-> UpdateEndpoint
UpdateEndpoint'
    { $sel:excludeRetainedVariantProperties:UpdateEndpoint' :: Maybe [VariantProperty]
excludeRetainedVariantProperties =
        Maybe [VariantProperty]
forall a. Maybe a
Prelude.Nothing,
      $sel:retainAllVariantProperties:UpdateEndpoint' :: Maybe Bool
retainAllVariantProperties = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentConfig:UpdateEndpoint' :: Maybe DeploymentConfig
deploymentConfig = Maybe DeploymentConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointName:UpdateEndpoint' :: Text
endpointName = Text
pEndpointName_,
      $sel:endpointConfigName:UpdateEndpoint' :: Text
endpointConfigName = Text
pEndpointConfigName_
    }

-- | When you are updating endpoint resources with
-- UpdateEndpointInput$RetainAllVariantProperties, whose value is set to
-- @true@, @ExcludeRetainedVariantProperties@ specifies the list of type
-- VariantProperty to override with the values provided by
-- @EndpointConfig@. If you don\'t specify a value for
-- @ExcludeAllVariantProperties@, no variant properties are overridden.
updateEndpoint_excludeRetainedVariantProperties :: Lens.Lens' UpdateEndpoint (Prelude.Maybe [VariantProperty])
updateEndpoint_excludeRetainedVariantProperties :: (Maybe [VariantProperty] -> f (Maybe [VariantProperty]))
-> UpdateEndpoint -> f UpdateEndpoint
updateEndpoint_excludeRetainedVariantProperties = (UpdateEndpoint -> Maybe [VariantProperty])
-> (UpdateEndpoint -> Maybe [VariantProperty] -> UpdateEndpoint)
-> Lens
     UpdateEndpoint
     UpdateEndpoint
     (Maybe [VariantProperty])
     (Maybe [VariantProperty])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpoint' {Maybe [VariantProperty]
excludeRetainedVariantProperties :: Maybe [VariantProperty]
$sel:excludeRetainedVariantProperties:UpdateEndpoint' :: UpdateEndpoint -> Maybe [VariantProperty]
excludeRetainedVariantProperties} -> Maybe [VariantProperty]
excludeRetainedVariantProperties) (\s :: UpdateEndpoint
s@UpdateEndpoint' {} Maybe [VariantProperty]
a -> UpdateEndpoint
s {$sel:excludeRetainedVariantProperties:UpdateEndpoint' :: Maybe [VariantProperty]
excludeRetainedVariantProperties = Maybe [VariantProperty]
a} :: UpdateEndpoint) ((Maybe [VariantProperty] -> f (Maybe [VariantProperty]))
 -> UpdateEndpoint -> f UpdateEndpoint)
-> ((Maybe [VariantProperty] -> f (Maybe [VariantProperty]))
    -> Maybe [VariantProperty] -> f (Maybe [VariantProperty]))
-> (Maybe [VariantProperty] -> f (Maybe [VariantProperty]))
-> UpdateEndpoint
-> f UpdateEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VariantProperty]
  [VariantProperty]
  [VariantProperty]
  [VariantProperty]
-> Iso
     (Maybe [VariantProperty])
     (Maybe [VariantProperty])
     (Maybe [VariantProperty])
     (Maybe [VariantProperty])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [VariantProperty]
  [VariantProperty]
  [VariantProperty]
  [VariantProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | When updating endpoint resources, enables or disables the retention of
-- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html variant properties>,
-- such as the instance count or the variant weight. To retain the variant
-- properties of an endpoint when updating it, set
-- @RetainAllVariantProperties@ to @true@. To use the variant properties
-- specified in a new @EndpointConfig@ call when updating an endpoint, set
-- @RetainAllVariantProperties@ to @false@. The default is @false@.
updateEndpoint_retainAllVariantProperties :: Lens.Lens' UpdateEndpoint (Prelude.Maybe Prelude.Bool)
updateEndpoint_retainAllVariantProperties :: (Maybe Bool -> f (Maybe Bool))
-> UpdateEndpoint -> f UpdateEndpoint
updateEndpoint_retainAllVariantProperties = (UpdateEndpoint -> Maybe Bool)
-> (UpdateEndpoint -> Maybe Bool -> UpdateEndpoint)
-> Lens UpdateEndpoint UpdateEndpoint (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpoint' {Maybe Bool
retainAllVariantProperties :: Maybe Bool
$sel:retainAllVariantProperties:UpdateEndpoint' :: UpdateEndpoint -> Maybe Bool
retainAllVariantProperties} -> Maybe Bool
retainAllVariantProperties) (\s :: UpdateEndpoint
s@UpdateEndpoint' {} Maybe Bool
a -> UpdateEndpoint
s {$sel:retainAllVariantProperties:UpdateEndpoint' :: Maybe Bool
retainAllVariantProperties = Maybe Bool
a} :: UpdateEndpoint)

-- | The deployment configuration for the endpoint to be updated.
updateEndpoint_deploymentConfig :: Lens.Lens' UpdateEndpoint (Prelude.Maybe DeploymentConfig)
updateEndpoint_deploymentConfig :: (Maybe DeploymentConfig -> f (Maybe DeploymentConfig))
-> UpdateEndpoint -> f UpdateEndpoint
updateEndpoint_deploymentConfig = (UpdateEndpoint -> Maybe DeploymentConfig)
-> (UpdateEndpoint -> Maybe DeploymentConfig -> UpdateEndpoint)
-> Lens
     UpdateEndpoint
     UpdateEndpoint
     (Maybe DeploymentConfig)
     (Maybe DeploymentConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpoint' {Maybe DeploymentConfig
deploymentConfig :: Maybe DeploymentConfig
$sel:deploymentConfig:UpdateEndpoint' :: UpdateEndpoint -> Maybe DeploymentConfig
deploymentConfig} -> Maybe DeploymentConfig
deploymentConfig) (\s :: UpdateEndpoint
s@UpdateEndpoint' {} Maybe DeploymentConfig
a -> UpdateEndpoint
s {$sel:deploymentConfig:UpdateEndpoint' :: Maybe DeploymentConfig
deploymentConfig = Maybe DeploymentConfig
a} :: UpdateEndpoint)

-- | The name of the endpoint whose configuration you want to update.
updateEndpoint_endpointName :: Lens.Lens' UpdateEndpoint Prelude.Text
updateEndpoint_endpointName :: (Text -> f Text) -> UpdateEndpoint -> f UpdateEndpoint
updateEndpoint_endpointName = (UpdateEndpoint -> Text)
-> (UpdateEndpoint -> Text -> UpdateEndpoint)
-> Lens UpdateEndpoint UpdateEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpoint' {Text
endpointName :: Text
$sel:endpointName:UpdateEndpoint' :: UpdateEndpoint -> Text
endpointName} -> Text
endpointName) (\s :: UpdateEndpoint
s@UpdateEndpoint' {} Text
a -> UpdateEndpoint
s {$sel:endpointName:UpdateEndpoint' :: Text
endpointName = Text
a} :: UpdateEndpoint)

-- | The name of the new endpoint configuration.
updateEndpoint_endpointConfigName :: Lens.Lens' UpdateEndpoint Prelude.Text
updateEndpoint_endpointConfigName :: (Text -> f Text) -> UpdateEndpoint -> f UpdateEndpoint
updateEndpoint_endpointConfigName = (UpdateEndpoint -> Text)
-> (UpdateEndpoint -> Text -> UpdateEndpoint)
-> Lens UpdateEndpoint UpdateEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEndpoint' {Text
endpointConfigName :: Text
$sel:endpointConfigName:UpdateEndpoint' :: UpdateEndpoint -> Text
endpointConfigName} -> Text
endpointConfigName) (\s :: UpdateEndpoint
s@UpdateEndpoint' {} Text
a -> UpdateEndpoint
s {$sel:endpointConfigName:UpdateEndpoint' :: Text
endpointConfigName = Text
a} :: UpdateEndpoint)

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

instance Prelude.NFData UpdateEndpoint

instance Core.ToHeaders UpdateEndpoint where
  toHeaders :: UpdateEndpoint -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateEndpoint -> 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.UpdateEndpoint" :: 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 UpdateEndpoint where
  toJSON :: UpdateEndpoint -> Value
toJSON UpdateEndpoint' {Maybe Bool
Maybe [VariantProperty]
Maybe DeploymentConfig
Text
endpointConfigName :: Text
endpointName :: Text
deploymentConfig :: Maybe DeploymentConfig
retainAllVariantProperties :: Maybe Bool
excludeRetainedVariantProperties :: Maybe [VariantProperty]
$sel:endpointConfigName:UpdateEndpoint' :: UpdateEndpoint -> Text
$sel:endpointName:UpdateEndpoint' :: UpdateEndpoint -> Text
$sel:deploymentConfig:UpdateEndpoint' :: UpdateEndpoint -> Maybe DeploymentConfig
$sel:retainAllVariantProperties:UpdateEndpoint' :: UpdateEndpoint -> Maybe Bool
$sel:excludeRetainedVariantProperties:UpdateEndpoint' :: UpdateEndpoint -> Maybe [VariantProperty]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ExcludeRetainedVariantProperties" Text -> [VariantProperty] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([VariantProperty] -> Pair)
-> Maybe [VariantProperty] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VariantProperty]
excludeRetainedVariantProperties,
            (Text
"RetainAllVariantProperties" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
retainAllVariantProperties,
            (Text
"DeploymentConfig" Text -> DeploymentConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DeploymentConfig -> Pair) -> Maybe DeploymentConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeploymentConfig
deploymentConfig,
            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
"EndpointConfigName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointConfigName)
          ]
      )

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

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

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

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

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

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

instance Prelude.NFData UpdateEndpointResponse