{-# 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.ModelDashboardEndpoint
-- 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.ModelDashboardEndpoint 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
import Amazonka.SageMaker.Types.EndpointStatus

-- | An endpoint that hosts a model displayed in the Amazon SageMaker Model
-- Dashboard.
--
-- /See:/ 'newModelDashboardEndpoint' smart constructor.
data ModelDashboardEndpoint = ModelDashboardEndpoint'
  { -- | The endpoint name.
    ModelDashboardEndpoint -> Text
endpointName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the endpoint.
    ModelDashboardEndpoint -> Text
endpointArn :: Prelude.Text,
    -- | A timestamp that indicates when the endpoint was created.
    ModelDashboardEndpoint -> POSIX
creationTime :: Data.POSIX,
    -- | The last time the endpoint was modified.
    ModelDashboardEndpoint -> POSIX
lastModifiedTime :: Data.POSIX,
    -- | The endpoint status.
    ModelDashboardEndpoint -> EndpointStatus
endpointStatus :: EndpointStatus
  }
  deriving (ModelDashboardEndpoint -> ModelDashboardEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelDashboardEndpoint -> ModelDashboardEndpoint -> Bool
$c/= :: ModelDashboardEndpoint -> ModelDashboardEndpoint -> Bool
== :: ModelDashboardEndpoint -> ModelDashboardEndpoint -> Bool
$c== :: ModelDashboardEndpoint -> ModelDashboardEndpoint -> Bool
Prelude.Eq, ReadPrec [ModelDashboardEndpoint]
ReadPrec ModelDashboardEndpoint
Int -> ReadS ModelDashboardEndpoint
ReadS [ModelDashboardEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelDashboardEndpoint]
$creadListPrec :: ReadPrec [ModelDashboardEndpoint]
readPrec :: ReadPrec ModelDashboardEndpoint
$creadPrec :: ReadPrec ModelDashboardEndpoint
readList :: ReadS [ModelDashboardEndpoint]
$creadList :: ReadS [ModelDashboardEndpoint]
readsPrec :: Int -> ReadS ModelDashboardEndpoint
$creadsPrec :: Int -> ReadS ModelDashboardEndpoint
Prelude.Read, Int -> ModelDashboardEndpoint -> ShowS
[ModelDashboardEndpoint] -> ShowS
ModelDashboardEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelDashboardEndpoint] -> ShowS
$cshowList :: [ModelDashboardEndpoint] -> ShowS
show :: ModelDashboardEndpoint -> String
$cshow :: ModelDashboardEndpoint -> String
showsPrec :: Int -> ModelDashboardEndpoint -> ShowS
$cshowsPrec :: Int -> ModelDashboardEndpoint -> ShowS
Prelude.Show, forall x. Rep ModelDashboardEndpoint x -> ModelDashboardEndpoint
forall x. ModelDashboardEndpoint -> Rep ModelDashboardEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelDashboardEndpoint x -> ModelDashboardEndpoint
$cfrom :: forall x. ModelDashboardEndpoint -> Rep ModelDashboardEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'ModelDashboardEndpoint' 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', 'modelDashboardEndpoint_endpointName' - The endpoint name.
--
-- 'endpointArn', 'modelDashboardEndpoint_endpointArn' - The Amazon Resource Name (ARN) of the endpoint.
--
-- 'creationTime', 'modelDashboardEndpoint_creationTime' - A timestamp that indicates when the endpoint was created.
--
-- 'lastModifiedTime', 'modelDashboardEndpoint_lastModifiedTime' - The last time the endpoint was modified.
--
-- 'endpointStatus', 'modelDashboardEndpoint_endpointStatus' - The endpoint status.
newModelDashboardEndpoint ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'endpointArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  -- | 'endpointStatus'
  EndpointStatus ->
  ModelDashboardEndpoint
newModelDashboardEndpoint :: Text
-> Text
-> UTCTime
-> UTCTime
-> EndpointStatus
-> ModelDashboardEndpoint
newModelDashboardEndpoint
  Text
pEndpointName_
  Text
pEndpointArn_
  UTCTime
pCreationTime_
  UTCTime
pLastModifiedTime_
  EndpointStatus
pEndpointStatus_ =
    ModelDashboardEndpoint'
      { $sel:endpointName:ModelDashboardEndpoint' :: Text
endpointName =
          Text
pEndpointName_,
        $sel:endpointArn:ModelDashboardEndpoint' :: Text
endpointArn = Text
pEndpointArn_,
        $sel:creationTime:ModelDashboardEndpoint' :: POSIX
creationTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModifiedTime:ModelDashboardEndpoint' :: POSIX
lastModifiedTime =
          forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_,
        $sel:endpointStatus:ModelDashboardEndpoint' :: EndpointStatus
endpointStatus = EndpointStatus
pEndpointStatus_
      }

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

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

-- | A timestamp that indicates when the endpoint was created.
modelDashboardEndpoint_creationTime :: Lens.Lens' ModelDashboardEndpoint Prelude.UTCTime
modelDashboardEndpoint_creationTime :: Lens' ModelDashboardEndpoint UTCTime
modelDashboardEndpoint_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelDashboardEndpoint' {POSIX
creationTime :: POSIX
$sel:creationTime:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> POSIX
creationTime} -> POSIX
creationTime) (\s :: ModelDashboardEndpoint
s@ModelDashboardEndpoint' {} POSIX
a -> ModelDashboardEndpoint
s {$sel:creationTime:ModelDashboardEndpoint' :: POSIX
creationTime = POSIX
a} :: ModelDashboardEndpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The last time the endpoint was modified.
modelDashboardEndpoint_lastModifiedTime :: Lens.Lens' ModelDashboardEndpoint Prelude.UTCTime
modelDashboardEndpoint_lastModifiedTime :: Lens' ModelDashboardEndpoint UTCTime
modelDashboardEndpoint_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelDashboardEndpoint' {POSIX
lastModifiedTime :: POSIX
$sel:lastModifiedTime:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> POSIX
lastModifiedTime} -> POSIX
lastModifiedTime) (\s :: ModelDashboardEndpoint
s@ModelDashboardEndpoint' {} POSIX
a -> ModelDashboardEndpoint
s {$sel:lastModifiedTime:ModelDashboardEndpoint' :: POSIX
lastModifiedTime = POSIX
a} :: ModelDashboardEndpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The endpoint status.
modelDashboardEndpoint_endpointStatus :: Lens.Lens' ModelDashboardEndpoint EndpointStatus
modelDashboardEndpoint_endpointStatus :: Lens' ModelDashboardEndpoint EndpointStatus
modelDashboardEndpoint_endpointStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelDashboardEndpoint' {EndpointStatus
endpointStatus :: EndpointStatus
$sel:endpointStatus:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> EndpointStatus
endpointStatus} -> EndpointStatus
endpointStatus) (\s :: ModelDashboardEndpoint
s@ModelDashboardEndpoint' {} EndpointStatus
a -> ModelDashboardEndpoint
s {$sel:endpointStatus:ModelDashboardEndpoint' :: EndpointStatus
endpointStatus = EndpointStatus
a} :: ModelDashboardEndpoint)

instance Data.FromJSON ModelDashboardEndpoint where
  parseJSON :: Value -> Parser ModelDashboardEndpoint
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelDashboardEndpoint"
      ( \Object
x ->
          Text
-> Text
-> POSIX
-> POSIX
-> EndpointStatus
-> ModelDashboardEndpoint
ModelDashboardEndpoint'
            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")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EndpointArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"LastModifiedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EndpointStatus")
      )

instance Prelude.Hashable ModelDashboardEndpoint where
  hashWithSalt :: Int -> ModelDashboardEndpoint -> Int
hashWithSalt Int
_salt ModelDashboardEndpoint' {Text
POSIX
EndpointStatus
endpointStatus :: EndpointStatus
lastModifiedTime :: POSIX
creationTime :: POSIX
endpointArn :: Text
endpointName :: Text
$sel:endpointStatus:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> EndpointStatus
$sel:lastModifiedTime:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> POSIX
$sel:creationTime:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> POSIX
$sel:endpointArn:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> Text
$sel:endpointName:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModifiedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EndpointStatus
endpointStatus

instance Prelude.NFData ModelDashboardEndpoint where
  rnf :: ModelDashboardEndpoint -> ()
rnf ModelDashboardEndpoint' {Text
POSIX
EndpointStatus
endpointStatus :: EndpointStatus
lastModifiedTime :: POSIX
creationTime :: POSIX
endpointArn :: Text
endpointName :: Text
$sel:endpointStatus:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> EndpointStatus
$sel:lastModifiedTime:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> POSIX
$sel:creationTime:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> POSIX
$sel:endpointArn:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> Text
$sel:endpointName:ModelDashboardEndpoint' :: ModelDashboardEndpoint -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
endpointName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
endpointArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EndpointStatus
endpointStatus