{-# 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.EndpointInfo
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.EndpointInfo where

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

-- | Details about a customer endpoint that was compared in an Inference
-- Recommender job.
--
-- /See:/ 'newEndpointInfo' smart constructor.
data EndpointInfo = EndpointInfo'
  { -- | The name of a customer\'s endpoint.
    EndpointInfo -> Text
endpointName :: Prelude.Text
  }
  deriving (EndpointInfo -> EndpointInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointInfo -> EndpointInfo -> Bool
$c/= :: EndpointInfo -> EndpointInfo -> Bool
== :: EndpointInfo -> EndpointInfo -> Bool
$c== :: EndpointInfo -> EndpointInfo -> Bool
Prelude.Eq, ReadPrec [EndpointInfo]
ReadPrec EndpointInfo
Int -> ReadS EndpointInfo
ReadS [EndpointInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointInfo]
$creadListPrec :: ReadPrec [EndpointInfo]
readPrec :: ReadPrec EndpointInfo
$creadPrec :: ReadPrec EndpointInfo
readList :: ReadS [EndpointInfo]
$creadList :: ReadS [EndpointInfo]
readsPrec :: Int -> ReadS EndpointInfo
$creadsPrec :: Int -> ReadS EndpointInfo
Prelude.Read, Int -> EndpointInfo -> ShowS
[EndpointInfo] -> ShowS
EndpointInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointInfo] -> ShowS
$cshowList :: [EndpointInfo] -> ShowS
show :: EndpointInfo -> String
$cshow :: EndpointInfo -> String
showsPrec :: Int -> EndpointInfo -> ShowS
$cshowsPrec :: Int -> EndpointInfo -> ShowS
Prelude.Show, forall x. Rep EndpointInfo x -> EndpointInfo
forall x. EndpointInfo -> Rep EndpointInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointInfo x -> EndpointInfo
$cfrom :: forall x. EndpointInfo -> Rep EndpointInfo x
Prelude.Generic)

-- |
-- Create a value of 'EndpointInfo' 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', 'endpointInfo_endpointName' - The name of a customer\'s endpoint.
newEndpointInfo ::
  -- | 'endpointName'
  Prelude.Text ->
  EndpointInfo
newEndpointInfo :: Text -> EndpointInfo
newEndpointInfo Text
pEndpointName_ =
  EndpointInfo' {$sel:endpointName:EndpointInfo' :: Text
endpointName = Text
pEndpointName_}

-- | The name of a customer\'s endpoint.
endpointInfo_endpointName :: Lens.Lens' EndpointInfo Prelude.Text
endpointInfo_endpointName :: Lens' EndpointInfo Text
endpointInfo_endpointName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointInfo' {Text
endpointName :: Text
$sel:endpointName:EndpointInfo' :: EndpointInfo -> Text
endpointName} -> Text
endpointName) (\s :: EndpointInfo
s@EndpointInfo' {} Text
a -> EndpointInfo
s {$sel:endpointName:EndpointInfo' :: Text
endpointName = Text
a} :: EndpointInfo)

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

instance Prelude.Hashable EndpointInfo where
  hashWithSalt :: Int -> EndpointInfo -> Int
hashWithSalt Int
_salt EndpointInfo' {Text
endpointName :: Text
$sel:endpointName:EndpointInfo' :: EndpointInfo -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointName

instance Prelude.NFData EndpointInfo where
  rnf :: EndpointInfo -> ()
rnf EndpointInfo' {Text
endpointName :: Text
$sel:endpointName:EndpointInfo' :: EndpointInfo -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
endpointName

instance Data.ToJSON EndpointInfo where
  toJSON :: EndpointInfo -> Value
toJSON EndpointInfo' {Text
endpointName :: Text
$sel:endpointName:EndpointInfo' :: EndpointInfo -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"EndpointName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpointName)]
      )