{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ModelDeployResult
-- 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)
module Amazonka.SageMaker.Types.ModelDeployResult where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the endpoint of the model deployment.
--
-- /See:/ 'newModelDeployResult' smart constructor.
data ModelDeployResult = ModelDeployResult'
  { -- | The name of the endpoint to which the model has been deployed.
    --
    -- If model deployment fails, this field is omitted from the response.
    ModelDeployResult -> Maybe Text
endpointName :: Prelude.Maybe Prelude.Text
  }
  deriving (ModelDeployResult -> ModelDeployResult -> Bool
(ModelDeployResult -> ModelDeployResult -> Bool)
-> (ModelDeployResult -> ModelDeployResult -> Bool)
-> Eq ModelDeployResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelDeployResult -> ModelDeployResult -> Bool
$c/= :: ModelDeployResult -> ModelDeployResult -> Bool
== :: ModelDeployResult -> ModelDeployResult -> Bool
$c== :: ModelDeployResult -> ModelDeployResult -> Bool
Prelude.Eq, ReadPrec [ModelDeployResult]
ReadPrec ModelDeployResult
Int -> ReadS ModelDeployResult
ReadS [ModelDeployResult]
(Int -> ReadS ModelDeployResult)
-> ReadS [ModelDeployResult]
-> ReadPrec ModelDeployResult
-> ReadPrec [ModelDeployResult]
-> Read ModelDeployResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelDeployResult]
$creadListPrec :: ReadPrec [ModelDeployResult]
readPrec :: ReadPrec ModelDeployResult
$creadPrec :: ReadPrec ModelDeployResult
readList :: ReadS [ModelDeployResult]
$creadList :: ReadS [ModelDeployResult]
readsPrec :: Int -> ReadS ModelDeployResult
$creadsPrec :: Int -> ReadS ModelDeployResult
Prelude.Read, Int -> ModelDeployResult -> ShowS
[ModelDeployResult] -> ShowS
ModelDeployResult -> String
(Int -> ModelDeployResult -> ShowS)
-> (ModelDeployResult -> String)
-> ([ModelDeployResult] -> ShowS)
-> Show ModelDeployResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelDeployResult] -> ShowS
$cshowList :: [ModelDeployResult] -> ShowS
show :: ModelDeployResult -> String
$cshow :: ModelDeployResult -> String
showsPrec :: Int -> ModelDeployResult -> ShowS
$cshowsPrec :: Int -> ModelDeployResult -> ShowS
Prelude.Show, (forall x. ModelDeployResult -> Rep ModelDeployResult x)
-> (forall x. Rep ModelDeployResult x -> ModelDeployResult)
-> Generic ModelDeployResult
forall x. Rep ModelDeployResult x -> ModelDeployResult
forall x. ModelDeployResult -> Rep ModelDeployResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelDeployResult x -> ModelDeployResult
$cfrom :: forall x. ModelDeployResult -> Rep ModelDeployResult x
Prelude.Generic)

-- |
-- Create a value of 'ModelDeployResult' 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', 'modelDeployResult_endpointName' - The name of the endpoint to which the model has been deployed.
--
-- If model deployment fails, this field is omitted from the response.
newModelDeployResult ::
  ModelDeployResult
newModelDeployResult :: ModelDeployResult
newModelDeployResult =
  ModelDeployResult' :: Maybe Text -> ModelDeployResult
ModelDeployResult' {$sel:endpointName:ModelDeployResult' :: Maybe Text
endpointName = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The name of the endpoint to which the model has been deployed.
--
-- If model deployment fails, this field is omitted from the response.
modelDeployResult_endpointName :: Lens.Lens' ModelDeployResult (Prelude.Maybe Prelude.Text)
modelDeployResult_endpointName :: (Maybe Text -> f (Maybe Text))
-> ModelDeployResult -> f ModelDeployResult
modelDeployResult_endpointName = (ModelDeployResult -> Maybe Text)
-> (ModelDeployResult -> Maybe Text -> ModelDeployResult)
-> Lens
     ModelDeployResult ModelDeployResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelDeployResult' {Maybe Text
endpointName :: Maybe Text
$sel:endpointName:ModelDeployResult' :: ModelDeployResult -> Maybe Text
endpointName} -> Maybe Text
endpointName) (\s :: ModelDeployResult
s@ModelDeployResult' {} Maybe Text
a -> ModelDeployResult
s {$sel:endpointName:ModelDeployResult' :: Maybe Text
endpointName = Maybe Text
a} :: ModelDeployResult)

instance Core.FromJSON ModelDeployResult where
  parseJSON :: Value -> Parser ModelDeployResult
parseJSON =
    String
-> (Object -> Parser ModelDeployResult)
-> Value
-> Parser ModelDeployResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelDeployResult"
      ( \Object
x ->
          Maybe Text -> ModelDeployResult
ModelDeployResult'
            (Maybe Text -> ModelDeployResult)
-> Parser (Maybe Text) -> Parser ModelDeployResult
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointName")
      )

instance Prelude.Hashable ModelDeployResult

instance Prelude.NFData ModelDeployResult