{-# 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 #-}
module Amazonka.MachineLearning.Types.RealtimeEndpointInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MachineLearning.Types.RealtimeEndpointStatus
import qualified Amazonka.Prelude as Prelude
data RealtimeEndpointInfo = RealtimeEndpointInfo'
{
RealtimeEndpointInfo -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
RealtimeEndpointInfo -> Maybe Text
endpointUrl :: Prelude.Maybe Prelude.Text,
RealtimeEndpointInfo -> Maybe RealtimeEndpointStatus
endpointStatus :: Prelude.Maybe RealtimeEndpointStatus,
RealtimeEndpointInfo -> Maybe Int
peakRequestsPerSecond :: Prelude.Maybe Prelude.Int
}
deriving (RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool
(RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool)
-> (RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool)
-> Eq RealtimeEndpointInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool
$c/= :: RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool
== :: RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool
$c== :: RealtimeEndpointInfo -> RealtimeEndpointInfo -> Bool
Prelude.Eq, ReadPrec [RealtimeEndpointInfo]
ReadPrec RealtimeEndpointInfo
Int -> ReadS RealtimeEndpointInfo
ReadS [RealtimeEndpointInfo]
(Int -> ReadS RealtimeEndpointInfo)
-> ReadS [RealtimeEndpointInfo]
-> ReadPrec RealtimeEndpointInfo
-> ReadPrec [RealtimeEndpointInfo]
-> Read RealtimeEndpointInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RealtimeEndpointInfo]
$creadListPrec :: ReadPrec [RealtimeEndpointInfo]
readPrec :: ReadPrec RealtimeEndpointInfo
$creadPrec :: ReadPrec RealtimeEndpointInfo
readList :: ReadS [RealtimeEndpointInfo]
$creadList :: ReadS [RealtimeEndpointInfo]
readsPrec :: Int -> ReadS RealtimeEndpointInfo
$creadsPrec :: Int -> ReadS RealtimeEndpointInfo
Prelude.Read, Int -> RealtimeEndpointInfo -> ShowS
[RealtimeEndpointInfo] -> ShowS
RealtimeEndpointInfo -> String
(Int -> RealtimeEndpointInfo -> ShowS)
-> (RealtimeEndpointInfo -> String)
-> ([RealtimeEndpointInfo] -> ShowS)
-> Show RealtimeEndpointInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RealtimeEndpointInfo] -> ShowS
$cshowList :: [RealtimeEndpointInfo] -> ShowS
show :: RealtimeEndpointInfo -> String
$cshow :: RealtimeEndpointInfo -> String
showsPrec :: Int -> RealtimeEndpointInfo -> ShowS
$cshowsPrec :: Int -> RealtimeEndpointInfo -> ShowS
Prelude.Show, (forall x. RealtimeEndpointInfo -> Rep RealtimeEndpointInfo x)
-> (forall x. Rep RealtimeEndpointInfo x -> RealtimeEndpointInfo)
-> Generic RealtimeEndpointInfo
forall x. Rep RealtimeEndpointInfo x -> RealtimeEndpointInfo
forall x. RealtimeEndpointInfo -> Rep RealtimeEndpointInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RealtimeEndpointInfo x -> RealtimeEndpointInfo
$cfrom :: forall x. RealtimeEndpointInfo -> Rep RealtimeEndpointInfo x
Prelude.Generic)
newRealtimeEndpointInfo ::
RealtimeEndpointInfo
newRealtimeEndpointInfo :: RealtimeEndpointInfo
newRealtimeEndpointInfo =
RealtimeEndpointInfo' :: Maybe POSIX
-> Maybe Text
-> Maybe RealtimeEndpointStatus
-> Maybe Int
-> RealtimeEndpointInfo
RealtimeEndpointInfo'
{ $sel:createdAt:RealtimeEndpointInfo' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:endpointUrl:RealtimeEndpointInfo' :: Maybe Text
endpointUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointStatus:RealtimeEndpointInfo' :: Maybe RealtimeEndpointStatus
endpointStatus = Maybe RealtimeEndpointStatus
forall a. Maybe a
Prelude.Nothing,
$sel:peakRequestsPerSecond:RealtimeEndpointInfo' :: Maybe Int
peakRequestsPerSecond = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
realtimeEndpointInfo_createdAt :: Lens.Lens' RealtimeEndpointInfo (Prelude.Maybe Prelude.UTCTime)
realtimeEndpointInfo_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RealtimeEndpointInfo -> f RealtimeEndpointInfo
realtimeEndpointInfo_createdAt = (RealtimeEndpointInfo -> Maybe POSIX)
-> (RealtimeEndpointInfo -> Maybe POSIX -> RealtimeEndpointInfo)
-> Lens
RealtimeEndpointInfo
RealtimeEndpointInfo
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RealtimeEndpointInfo' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:RealtimeEndpointInfo' :: RealtimeEndpointInfo -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: RealtimeEndpointInfo
s@RealtimeEndpointInfo' {} Maybe POSIX
a -> RealtimeEndpointInfo
s {$sel:createdAt:RealtimeEndpointInfo' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: RealtimeEndpointInfo) ((Maybe POSIX -> f (Maybe POSIX))
-> RealtimeEndpointInfo -> f RealtimeEndpointInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RealtimeEndpointInfo
-> f RealtimeEndpointInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
realtimeEndpointInfo_endpointUrl :: Lens.Lens' RealtimeEndpointInfo (Prelude.Maybe Prelude.Text)
realtimeEndpointInfo_endpointUrl :: (Maybe Text -> f (Maybe Text))
-> RealtimeEndpointInfo -> f RealtimeEndpointInfo
realtimeEndpointInfo_endpointUrl = (RealtimeEndpointInfo -> Maybe Text)
-> (RealtimeEndpointInfo -> Maybe Text -> RealtimeEndpointInfo)
-> Lens
RealtimeEndpointInfo RealtimeEndpointInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RealtimeEndpointInfo' {Maybe Text
endpointUrl :: Maybe Text
$sel:endpointUrl:RealtimeEndpointInfo' :: RealtimeEndpointInfo -> Maybe Text
endpointUrl} -> Maybe Text
endpointUrl) (\s :: RealtimeEndpointInfo
s@RealtimeEndpointInfo' {} Maybe Text
a -> RealtimeEndpointInfo
s {$sel:endpointUrl:RealtimeEndpointInfo' :: Maybe Text
endpointUrl = Maybe Text
a} :: RealtimeEndpointInfo)
realtimeEndpointInfo_endpointStatus :: Lens.Lens' RealtimeEndpointInfo (Prelude.Maybe RealtimeEndpointStatus)
realtimeEndpointInfo_endpointStatus :: (Maybe RealtimeEndpointStatus -> f (Maybe RealtimeEndpointStatus))
-> RealtimeEndpointInfo -> f RealtimeEndpointInfo
realtimeEndpointInfo_endpointStatus = (RealtimeEndpointInfo -> Maybe RealtimeEndpointStatus)
-> (RealtimeEndpointInfo
-> Maybe RealtimeEndpointStatus -> RealtimeEndpointInfo)
-> Lens
RealtimeEndpointInfo
RealtimeEndpointInfo
(Maybe RealtimeEndpointStatus)
(Maybe RealtimeEndpointStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RealtimeEndpointInfo' {Maybe RealtimeEndpointStatus
endpointStatus :: Maybe RealtimeEndpointStatus
$sel:endpointStatus:RealtimeEndpointInfo' :: RealtimeEndpointInfo -> Maybe RealtimeEndpointStatus
endpointStatus} -> Maybe RealtimeEndpointStatus
endpointStatus) (\s :: RealtimeEndpointInfo
s@RealtimeEndpointInfo' {} Maybe RealtimeEndpointStatus
a -> RealtimeEndpointInfo
s {$sel:endpointStatus:RealtimeEndpointInfo' :: Maybe RealtimeEndpointStatus
endpointStatus = Maybe RealtimeEndpointStatus
a} :: RealtimeEndpointInfo)
realtimeEndpointInfo_peakRequestsPerSecond :: Lens.Lens' RealtimeEndpointInfo (Prelude.Maybe Prelude.Int)
realtimeEndpointInfo_peakRequestsPerSecond :: (Maybe Int -> f (Maybe Int))
-> RealtimeEndpointInfo -> f RealtimeEndpointInfo
realtimeEndpointInfo_peakRequestsPerSecond = (RealtimeEndpointInfo -> Maybe Int)
-> (RealtimeEndpointInfo -> Maybe Int -> RealtimeEndpointInfo)
-> Lens
RealtimeEndpointInfo RealtimeEndpointInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RealtimeEndpointInfo' {Maybe Int
peakRequestsPerSecond :: Maybe Int
$sel:peakRequestsPerSecond:RealtimeEndpointInfo' :: RealtimeEndpointInfo -> Maybe Int
peakRequestsPerSecond} -> Maybe Int
peakRequestsPerSecond) (\s :: RealtimeEndpointInfo
s@RealtimeEndpointInfo' {} Maybe Int
a -> RealtimeEndpointInfo
s {$sel:peakRequestsPerSecond:RealtimeEndpointInfo' :: Maybe Int
peakRequestsPerSecond = Maybe Int
a} :: RealtimeEndpointInfo)
instance Core.FromJSON RealtimeEndpointInfo where
parseJSON :: Value -> Parser RealtimeEndpointInfo
parseJSON =
String
-> (Object -> Parser RealtimeEndpointInfo)
-> Value
-> Parser RealtimeEndpointInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RealtimeEndpointInfo"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe RealtimeEndpointStatus
-> Maybe Int
-> RealtimeEndpointInfo
RealtimeEndpointInfo'
(Maybe POSIX
-> Maybe Text
-> Maybe RealtimeEndpointStatus
-> Maybe Int
-> RealtimeEndpointInfo)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe RealtimeEndpointStatus
-> Maybe Int
-> RealtimeEndpointInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
Parser
(Maybe Text
-> Maybe RealtimeEndpointStatus
-> Maybe Int
-> RealtimeEndpointInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe RealtimeEndpointStatus -> Maybe Int -> RealtimeEndpointInfo)
forall (f :: * -> *) a b. Applicative f => 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
"EndpointUrl")
Parser
(Maybe RealtimeEndpointStatus -> Maybe Int -> RealtimeEndpointInfo)
-> Parser (Maybe RealtimeEndpointStatus)
-> Parser (Maybe Int -> RealtimeEndpointInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RealtimeEndpointStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointStatus")
Parser (Maybe Int -> RealtimeEndpointInfo)
-> Parser (Maybe Int) -> Parser RealtimeEndpointInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PeakRequestsPerSecond")
)
instance Prelude.Hashable RealtimeEndpointInfo
instance Prelude.NFData RealtimeEndpointInfo