{-# 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.Endpoint
-- 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.Endpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.DataCaptureConfigSummary
import Amazonka.SageMaker.Types.EndpointStatus
import Amazonka.SageMaker.Types.MonitoringSchedule
import Amazonka.SageMaker.Types.ProductionVariantSummary
import Amazonka.SageMaker.Types.Tag

-- | A hosted endpoint for real-time inference.
--
-- /See:/ 'newEndpoint' smart constructor.
data Endpoint = Endpoint'
  { -- | If the endpoint failed, the reason it failed.
    Endpoint -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | A list of the production variants hosted on the endpoint. Each
    -- production variant is a model.
    Endpoint -> Maybe (NonEmpty ProductionVariantSummary)
productionVariants :: Prelude.Maybe (Prelude.NonEmpty ProductionVariantSummary),
    -- | A list of monitoring schedules for the endpoint. For information about
    -- model monitoring, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor.html Amazon SageMaker Model Monitor>.
    Endpoint -> Maybe [MonitoringSchedule]
monitoringSchedules :: Prelude.Maybe [MonitoringSchedule],
    Endpoint -> Maybe DataCaptureConfigSummary
dataCaptureConfig :: Prelude.Maybe DataCaptureConfigSummary,
    -- | A list of the tags associated with the endpoint. For more information,
    -- see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services resources>
    -- in the /Amazon Web Services General Reference Guide/.
    Endpoint -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the endpoint.
    Endpoint -> Text
endpointName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the endpoint.
    Endpoint -> Text
endpointArn :: Prelude.Text,
    -- | The endpoint configuration associated with the endpoint.
    Endpoint -> Text
endpointConfigName :: Prelude.Text,
    -- | The status of the endpoint.
    Endpoint -> EndpointStatus
endpointStatus :: EndpointStatus,
    -- | The time that the endpoint was created.
    Endpoint -> POSIX
creationTime :: Core.POSIX,
    -- | The last time the endpoint was modified.
    Endpoint -> POSIX
lastModifiedTime :: Core.POSIX
  }
  deriving (Endpoint -> Endpoint -> Bool
(Endpoint -> Endpoint -> Bool)
-> (Endpoint -> Endpoint -> Bool) -> Eq Endpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Endpoint -> Endpoint -> Bool
$c/= :: Endpoint -> Endpoint -> Bool
== :: Endpoint -> Endpoint -> Bool
$c== :: Endpoint -> Endpoint -> Bool
Prelude.Eq, ReadPrec [Endpoint]
ReadPrec Endpoint
Int -> ReadS Endpoint
ReadS [Endpoint]
(Int -> ReadS Endpoint)
-> ReadS [Endpoint]
-> ReadPrec Endpoint
-> ReadPrec [Endpoint]
-> Read Endpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Endpoint]
$creadListPrec :: ReadPrec [Endpoint]
readPrec :: ReadPrec Endpoint
$creadPrec :: ReadPrec Endpoint
readList :: ReadS [Endpoint]
$creadList :: ReadS [Endpoint]
readsPrec :: Int -> ReadS Endpoint
$creadsPrec :: Int -> ReadS Endpoint
Prelude.Read, Int -> Endpoint -> ShowS
[Endpoint] -> ShowS
Endpoint -> String
(Int -> Endpoint -> ShowS)
-> (Endpoint -> String) -> ([Endpoint] -> ShowS) -> Show Endpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Endpoint] -> ShowS
$cshowList :: [Endpoint] -> ShowS
show :: Endpoint -> String
$cshow :: Endpoint -> String
showsPrec :: Int -> Endpoint -> ShowS
$cshowsPrec :: Int -> Endpoint -> ShowS
Prelude.Show, (forall x. Endpoint -> Rep Endpoint x)
-> (forall x. Rep Endpoint x -> Endpoint) -> Generic Endpoint
forall x. Rep Endpoint x -> Endpoint
forall x. Endpoint -> Rep Endpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Endpoint x -> Endpoint
$cfrom :: forall x. Endpoint -> Rep Endpoint x
Prelude.Generic)

-- |
-- Create a value of 'Endpoint' 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:
--
-- 'failureReason', 'endpoint_failureReason' - If the endpoint failed, the reason it failed.
--
-- 'productionVariants', 'endpoint_productionVariants' - A list of the production variants hosted on the endpoint. Each
-- production variant is a model.
--
-- 'monitoringSchedules', 'endpoint_monitoringSchedules' - A list of monitoring schedules for the endpoint. For information about
-- model monitoring, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor.html Amazon SageMaker Model Monitor>.
--
-- 'dataCaptureConfig', 'endpoint_dataCaptureConfig' - Undocumented member.
--
-- 'tags', 'endpoint_tags' - A list of the tags associated with the endpoint. For more information,
-- see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services resources>
-- in the /Amazon Web Services General Reference Guide/.
--
-- 'endpointName', 'endpoint_endpointName' - The name of the endpoint.
--
-- 'endpointArn', 'endpoint_endpointArn' - The Amazon Resource Name (ARN) of the endpoint.
--
-- 'endpointConfigName', 'endpoint_endpointConfigName' - The endpoint configuration associated with the endpoint.
--
-- 'endpointStatus', 'endpoint_endpointStatus' - The status of the endpoint.
--
-- 'creationTime', 'endpoint_creationTime' - The time that the endpoint was created.
--
-- 'lastModifiedTime', 'endpoint_lastModifiedTime' - The last time the endpoint was modified.
newEndpoint ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'endpointArn'
  Prelude.Text ->
  -- | 'endpointConfigName'
  Prelude.Text ->
  -- | 'endpointStatus'
  EndpointStatus ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'lastModifiedTime'
  Prelude.UTCTime ->
  Endpoint
newEndpoint :: Text
-> Text -> Text -> EndpointStatus -> UTCTime -> UTCTime -> Endpoint
newEndpoint
  Text
pEndpointName_
  Text
pEndpointArn_
  Text
pEndpointConfigName_
  EndpointStatus
pEndpointStatus_
  UTCTime
pCreationTime_
  UTCTime
pLastModifiedTime_ =
    Endpoint' :: Maybe Text
-> Maybe (NonEmpty ProductionVariantSummary)
-> Maybe [MonitoringSchedule]
-> Maybe DataCaptureConfigSummary
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> EndpointStatus
-> POSIX
-> POSIX
-> Endpoint
Endpoint'
      { $sel:failureReason:Endpoint' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:productionVariants:Endpoint' :: Maybe (NonEmpty ProductionVariantSummary)
productionVariants = Maybe (NonEmpty ProductionVariantSummary)
forall a. Maybe a
Prelude.Nothing,
        $sel:monitoringSchedules:Endpoint' :: Maybe [MonitoringSchedule]
monitoringSchedules = Maybe [MonitoringSchedule]
forall a. Maybe a
Prelude.Nothing,
        $sel:dataCaptureConfig:Endpoint' :: Maybe DataCaptureConfigSummary
dataCaptureConfig = Maybe DataCaptureConfigSummary
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:Endpoint' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:endpointName:Endpoint' :: Text
endpointName = Text
pEndpointName_,
        $sel:endpointArn:Endpoint' :: Text
endpointArn = Text
pEndpointArn_,
        $sel:endpointConfigName:Endpoint' :: Text
endpointConfigName = Text
pEndpointConfigName_,
        $sel:endpointStatus:Endpoint' :: EndpointStatus
endpointStatus = EndpointStatus
pEndpointStatus_,
        $sel:creationTime:Endpoint' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:lastModifiedTime:Endpoint' :: POSIX
lastModifiedTime =
          Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_
      }

-- | If the endpoint failed, the reason it failed.
endpoint_failureReason :: Lens.Lens' Endpoint (Prelude.Maybe Prelude.Text)
endpoint_failureReason :: (Maybe Text -> f (Maybe Text)) -> Endpoint -> f Endpoint
endpoint_failureReason = (Endpoint -> Maybe Text)
-> (Endpoint -> Maybe Text -> Endpoint)
-> Lens Endpoint Endpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:Endpoint' :: Endpoint -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: Endpoint
s@Endpoint' {} Maybe Text
a -> Endpoint
s {$sel:failureReason:Endpoint' :: Maybe Text
failureReason = Maybe Text
a} :: Endpoint)

-- | A list of the production variants hosted on the endpoint. Each
-- production variant is a model.
endpoint_productionVariants :: Lens.Lens' Endpoint (Prelude.Maybe (Prelude.NonEmpty ProductionVariantSummary))
endpoint_productionVariants :: (Maybe (NonEmpty ProductionVariantSummary)
 -> f (Maybe (NonEmpty ProductionVariantSummary)))
-> Endpoint -> f Endpoint
endpoint_productionVariants = (Endpoint -> Maybe (NonEmpty ProductionVariantSummary))
-> (Endpoint
    -> Maybe (NonEmpty ProductionVariantSummary) -> Endpoint)
-> Lens
     Endpoint
     Endpoint
     (Maybe (NonEmpty ProductionVariantSummary))
     (Maybe (NonEmpty ProductionVariantSummary))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe (NonEmpty ProductionVariantSummary)
productionVariants :: Maybe (NonEmpty ProductionVariantSummary)
$sel:productionVariants:Endpoint' :: Endpoint -> Maybe (NonEmpty ProductionVariantSummary)
productionVariants} -> Maybe (NonEmpty ProductionVariantSummary)
productionVariants) (\s :: Endpoint
s@Endpoint' {} Maybe (NonEmpty ProductionVariantSummary)
a -> Endpoint
s {$sel:productionVariants:Endpoint' :: Maybe (NonEmpty ProductionVariantSummary)
productionVariants = Maybe (NonEmpty ProductionVariantSummary)
a} :: Endpoint) ((Maybe (NonEmpty ProductionVariantSummary)
  -> f (Maybe (NonEmpty ProductionVariantSummary)))
 -> Endpoint -> f Endpoint)
-> ((Maybe (NonEmpty ProductionVariantSummary)
     -> f (Maybe (NonEmpty ProductionVariantSummary)))
    -> Maybe (NonEmpty ProductionVariantSummary)
    -> f (Maybe (NonEmpty ProductionVariantSummary)))
-> (Maybe (NonEmpty ProductionVariantSummary)
    -> f (Maybe (NonEmpty ProductionVariantSummary)))
-> Endpoint
-> f Endpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty ProductionVariantSummary)
  (NonEmpty ProductionVariantSummary)
  (NonEmpty ProductionVariantSummary)
  (NonEmpty ProductionVariantSummary)
-> Iso
     (Maybe (NonEmpty ProductionVariantSummary))
     (Maybe (NonEmpty ProductionVariantSummary))
     (Maybe (NonEmpty ProductionVariantSummary))
     (Maybe (NonEmpty ProductionVariantSummary))
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
  (NonEmpty ProductionVariantSummary)
  (NonEmpty ProductionVariantSummary)
  (NonEmpty ProductionVariantSummary)
  (NonEmpty ProductionVariantSummary)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of monitoring schedules for the endpoint. For information about
-- model monitoring, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor.html Amazon SageMaker Model Monitor>.
endpoint_monitoringSchedules :: Lens.Lens' Endpoint (Prelude.Maybe [MonitoringSchedule])
endpoint_monitoringSchedules :: (Maybe [MonitoringSchedule] -> f (Maybe [MonitoringSchedule]))
-> Endpoint -> f Endpoint
endpoint_monitoringSchedules = (Endpoint -> Maybe [MonitoringSchedule])
-> (Endpoint -> Maybe [MonitoringSchedule] -> Endpoint)
-> Lens
     Endpoint
     Endpoint
     (Maybe [MonitoringSchedule])
     (Maybe [MonitoringSchedule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe [MonitoringSchedule]
monitoringSchedules :: Maybe [MonitoringSchedule]
$sel:monitoringSchedules:Endpoint' :: Endpoint -> Maybe [MonitoringSchedule]
monitoringSchedules} -> Maybe [MonitoringSchedule]
monitoringSchedules) (\s :: Endpoint
s@Endpoint' {} Maybe [MonitoringSchedule]
a -> Endpoint
s {$sel:monitoringSchedules:Endpoint' :: Maybe [MonitoringSchedule]
monitoringSchedules = Maybe [MonitoringSchedule]
a} :: Endpoint) ((Maybe [MonitoringSchedule] -> f (Maybe [MonitoringSchedule]))
 -> Endpoint -> f Endpoint)
-> ((Maybe [MonitoringSchedule] -> f (Maybe [MonitoringSchedule]))
    -> Maybe [MonitoringSchedule] -> f (Maybe [MonitoringSchedule]))
-> (Maybe [MonitoringSchedule] -> f (Maybe [MonitoringSchedule]))
-> Endpoint
-> f Endpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MonitoringSchedule]
  [MonitoringSchedule]
  [MonitoringSchedule]
  [MonitoringSchedule]
-> Iso
     (Maybe [MonitoringSchedule])
     (Maybe [MonitoringSchedule])
     (Maybe [MonitoringSchedule])
     (Maybe [MonitoringSchedule])
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
  [MonitoringSchedule]
  [MonitoringSchedule]
  [MonitoringSchedule]
  [MonitoringSchedule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
endpoint_dataCaptureConfig :: Lens.Lens' Endpoint (Prelude.Maybe DataCaptureConfigSummary)
endpoint_dataCaptureConfig :: (Maybe DataCaptureConfigSummary
 -> f (Maybe DataCaptureConfigSummary))
-> Endpoint -> f Endpoint
endpoint_dataCaptureConfig = (Endpoint -> Maybe DataCaptureConfigSummary)
-> (Endpoint -> Maybe DataCaptureConfigSummary -> Endpoint)
-> Lens
     Endpoint
     Endpoint
     (Maybe DataCaptureConfigSummary)
     (Maybe DataCaptureConfigSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe DataCaptureConfigSummary
dataCaptureConfig :: Maybe DataCaptureConfigSummary
$sel:dataCaptureConfig:Endpoint' :: Endpoint -> Maybe DataCaptureConfigSummary
dataCaptureConfig} -> Maybe DataCaptureConfigSummary
dataCaptureConfig) (\s :: Endpoint
s@Endpoint' {} Maybe DataCaptureConfigSummary
a -> Endpoint
s {$sel:dataCaptureConfig:Endpoint' :: Maybe DataCaptureConfigSummary
dataCaptureConfig = Maybe DataCaptureConfigSummary
a} :: Endpoint)

-- | A list of the tags associated with the endpoint. For more information,
-- see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services resources>
-- in the /Amazon Web Services General Reference Guide/.
endpoint_tags :: Lens.Lens' Endpoint (Prelude.Maybe [Tag])
endpoint_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Endpoint -> f Endpoint
endpoint_tags = (Endpoint -> Maybe [Tag])
-> (Endpoint -> Maybe [Tag] -> Endpoint)
-> Lens Endpoint Endpoint (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Endpoint' :: Endpoint -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Endpoint
s@Endpoint' {} Maybe [Tag]
a -> Endpoint
s {$sel:tags:Endpoint' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Endpoint) ((Maybe [Tag] -> f (Maybe [Tag])) -> Endpoint -> f Endpoint)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Endpoint
-> f Endpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

-- | The endpoint configuration associated with the endpoint.
endpoint_endpointConfigName :: Lens.Lens' Endpoint Prelude.Text
endpoint_endpointConfigName :: (Text -> f Text) -> Endpoint -> f Endpoint
endpoint_endpointConfigName = (Endpoint -> Text)
-> (Endpoint -> Text -> Endpoint)
-> Lens Endpoint Endpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {Text
endpointConfigName :: Text
$sel:endpointConfigName:Endpoint' :: Endpoint -> Text
endpointConfigName} -> Text
endpointConfigName) (\s :: Endpoint
s@Endpoint' {} Text
a -> Endpoint
s {$sel:endpointConfigName:Endpoint' :: Text
endpointConfigName = Text
a} :: Endpoint)

-- | The status of the endpoint.
endpoint_endpointStatus :: Lens.Lens' Endpoint EndpointStatus
endpoint_endpointStatus :: (EndpointStatus -> f EndpointStatus) -> Endpoint -> f Endpoint
endpoint_endpointStatus = (Endpoint -> EndpointStatus)
-> (Endpoint -> EndpointStatus -> Endpoint)
-> Lens Endpoint Endpoint EndpointStatus EndpointStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {EndpointStatus
endpointStatus :: EndpointStatus
$sel:endpointStatus:Endpoint' :: Endpoint -> EndpointStatus
endpointStatus} -> EndpointStatus
endpointStatus) (\s :: Endpoint
s@Endpoint' {} EndpointStatus
a -> Endpoint
s {$sel:endpointStatus:Endpoint' :: EndpointStatus
endpointStatus = EndpointStatus
a} :: Endpoint)

-- | The time that the endpoint was created.
endpoint_creationTime :: Lens.Lens' Endpoint Prelude.UTCTime
endpoint_creationTime :: (UTCTime -> f UTCTime) -> Endpoint -> f Endpoint
endpoint_creationTime = (Endpoint -> POSIX)
-> (Endpoint -> POSIX -> Endpoint)
-> Lens Endpoint Endpoint POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Endpoint' {POSIX
creationTime :: POSIX
$sel:creationTime:Endpoint' :: Endpoint -> POSIX
creationTime} -> POSIX
creationTime) (\s :: Endpoint
s@Endpoint' {} POSIX
a -> Endpoint
s {$sel:creationTime:Endpoint' :: POSIX
creationTime = POSIX
a} :: Endpoint) ((POSIX -> f POSIX) -> Endpoint -> f Endpoint)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Endpoint
-> f Endpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Core.FromJSON Endpoint where
  parseJSON :: Value -> Parser Endpoint
parseJSON =
    String -> (Object -> Parser Endpoint) -> Value -> Parser Endpoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Endpoint"
      ( \Object
x ->
          Maybe Text
-> Maybe (NonEmpty ProductionVariantSummary)
-> Maybe [MonitoringSchedule]
-> Maybe DataCaptureConfigSummary
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> EndpointStatus
-> POSIX
-> POSIX
-> Endpoint
Endpoint'
            (Maybe Text
 -> Maybe (NonEmpty ProductionVariantSummary)
 -> Maybe [MonitoringSchedule]
 -> Maybe DataCaptureConfigSummary
 -> Maybe [Tag]
 -> Text
 -> Text
 -> Text
 -> EndpointStatus
 -> POSIX
 -> POSIX
 -> Endpoint)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty ProductionVariantSummary)
      -> Maybe [MonitoringSchedule]
      -> Maybe DataCaptureConfigSummary
      -> Maybe [Tag]
      -> Text
      -> Text
      -> Text
      -> EndpointStatus
      -> POSIX
      -> POSIX
      -> Endpoint)
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
"FailureReason")
            Parser
  (Maybe (NonEmpty ProductionVariantSummary)
   -> Maybe [MonitoringSchedule]
   -> Maybe DataCaptureConfigSummary
   -> Maybe [Tag]
   -> Text
   -> Text
   -> Text
   -> EndpointStatus
   -> POSIX
   -> POSIX
   -> Endpoint)
-> Parser (Maybe (NonEmpty ProductionVariantSummary))
-> Parser
     (Maybe [MonitoringSchedule]
      -> Maybe DataCaptureConfigSummary
      -> Maybe [Tag]
      -> Text
      -> Text
      -> Text
      -> EndpointStatus
      -> POSIX
      -> POSIX
      -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (NonEmpty ProductionVariantSummary))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProductionVariants")
            Parser
  (Maybe [MonitoringSchedule]
   -> Maybe DataCaptureConfigSummary
   -> Maybe [Tag]
   -> Text
   -> Text
   -> Text
   -> EndpointStatus
   -> POSIX
   -> POSIX
   -> Endpoint)
-> Parser (Maybe [MonitoringSchedule])
-> Parser
     (Maybe DataCaptureConfigSummary
      -> Maybe [Tag]
      -> Text
      -> Text
      -> Text
      -> EndpointStatus
      -> POSIX
      -> POSIX
      -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MonitoringSchedule]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MonitoringSchedules"
                            Parser (Maybe (Maybe [MonitoringSchedule]))
-> Maybe [MonitoringSchedule]
-> Parser (Maybe [MonitoringSchedule])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MonitoringSchedule]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe DataCaptureConfigSummary
   -> Maybe [Tag]
   -> Text
   -> Text
   -> Text
   -> EndpointStatus
   -> POSIX
   -> POSIX
   -> Endpoint)
-> Parser (Maybe DataCaptureConfigSummary)
-> Parser
     (Maybe [Tag]
      -> Text
      -> Text
      -> Text
      -> EndpointStatus
      -> POSIX
      -> POSIX
      -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataCaptureConfigSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DataCaptureConfig")
            Parser
  (Maybe [Tag]
   -> Text
   -> Text
   -> Text
   -> EndpointStatus
   -> POSIX
   -> POSIX
   -> Endpoint)
-> Parser (Maybe [Tag])
-> Parser
     (Text
      -> Text -> Text -> EndpointStatus -> POSIX -> POSIX -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text
   -> Text -> Text -> EndpointStatus -> POSIX -> POSIX -> Endpoint)
-> Parser Text
-> Parser
     (Text -> Text -> EndpointStatus -> POSIX -> POSIX -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndpointName")
            Parser
  (Text -> Text -> EndpointStatus -> POSIX -> POSIX -> Endpoint)
-> Parser Text
-> Parser (Text -> EndpointStatus -> POSIX -> POSIX -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndpointArn")
            Parser (Text -> EndpointStatus -> POSIX -> POSIX -> Endpoint)
-> Parser Text
-> Parser (EndpointStatus -> POSIX -> POSIX -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndpointConfigName")
            Parser (EndpointStatus -> POSIX -> POSIX -> Endpoint)
-> Parser EndpointStatus -> Parser (POSIX -> POSIX -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser EndpointStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"EndpointStatus")
            Parser (POSIX -> POSIX -> Endpoint)
-> Parser POSIX -> Parser (POSIX -> Endpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationTime")
            Parser (POSIX -> Endpoint) -> Parser POSIX -> Parser Endpoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LastModifiedTime")
      )

instance Prelude.Hashable Endpoint

instance Prelude.NFData Endpoint