{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SageMakerEdge.SendHeartbeat
(
SendHeartbeat (..),
newSendHeartbeat,
sendHeartbeat_agentMetrics,
sendHeartbeat_models,
sendHeartbeat_agentVersion,
sendHeartbeat_deviceName,
sendHeartbeat_deviceFleetName,
SendHeartbeatResponse (..),
newSendHeartbeatResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMakerEdge.Types
data SendHeartbeat = SendHeartbeat'
{
SendHeartbeat -> Maybe [EdgeMetric]
agentMetrics :: Prelude.Maybe [EdgeMetric],
SendHeartbeat -> Maybe [Model]
models :: Prelude.Maybe [Model],
SendHeartbeat -> Text
agentVersion :: Prelude.Text,
SendHeartbeat -> Text
deviceName :: Prelude.Text,
SendHeartbeat -> Text
deviceFleetName :: Prelude.Text
}
deriving (SendHeartbeat -> SendHeartbeat -> Bool
(SendHeartbeat -> SendHeartbeat -> Bool)
-> (SendHeartbeat -> SendHeartbeat -> Bool) -> Eq SendHeartbeat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendHeartbeat -> SendHeartbeat -> Bool
$c/= :: SendHeartbeat -> SendHeartbeat -> Bool
== :: SendHeartbeat -> SendHeartbeat -> Bool
$c== :: SendHeartbeat -> SendHeartbeat -> Bool
Prelude.Eq, ReadPrec [SendHeartbeat]
ReadPrec SendHeartbeat
Int -> ReadS SendHeartbeat
ReadS [SendHeartbeat]
(Int -> ReadS SendHeartbeat)
-> ReadS [SendHeartbeat]
-> ReadPrec SendHeartbeat
-> ReadPrec [SendHeartbeat]
-> Read SendHeartbeat
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendHeartbeat]
$creadListPrec :: ReadPrec [SendHeartbeat]
readPrec :: ReadPrec SendHeartbeat
$creadPrec :: ReadPrec SendHeartbeat
readList :: ReadS [SendHeartbeat]
$creadList :: ReadS [SendHeartbeat]
readsPrec :: Int -> ReadS SendHeartbeat
$creadsPrec :: Int -> ReadS SendHeartbeat
Prelude.Read, Int -> SendHeartbeat -> ShowS
[SendHeartbeat] -> ShowS
SendHeartbeat -> String
(Int -> SendHeartbeat -> ShowS)
-> (SendHeartbeat -> String)
-> ([SendHeartbeat] -> ShowS)
-> Show SendHeartbeat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendHeartbeat] -> ShowS
$cshowList :: [SendHeartbeat] -> ShowS
show :: SendHeartbeat -> String
$cshow :: SendHeartbeat -> String
showsPrec :: Int -> SendHeartbeat -> ShowS
$cshowsPrec :: Int -> SendHeartbeat -> ShowS
Prelude.Show, (forall x. SendHeartbeat -> Rep SendHeartbeat x)
-> (forall x. Rep SendHeartbeat x -> SendHeartbeat)
-> Generic SendHeartbeat
forall x. Rep SendHeartbeat x -> SendHeartbeat
forall x. SendHeartbeat -> Rep SendHeartbeat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendHeartbeat x -> SendHeartbeat
$cfrom :: forall x. SendHeartbeat -> Rep SendHeartbeat x
Prelude.Generic)
newSendHeartbeat ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
SendHeartbeat
newSendHeartbeat :: Text -> Text -> Text -> SendHeartbeat
newSendHeartbeat
Text
pAgentVersion_
Text
pDeviceName_
Text
pDeviceFleetName_ =
SendHeartbeat' :: Maybe [EdgeMetric]
-> Maybe [Model] -> Text -> Text -> Text -> SendHeartbeat
SendHeartbeat'
{ $sel:agentMetrics:SendHeartbeat' :: Maybe [EdgeMetric]
agentMetrics = Maybe [EdgeMetric]
forall a. Maybe a
Prelude.Nothing,
$sel:models:SendHeartbeat' :: Maybe [Model]
models = Maybe [Model]
forall a. Maybe a
Prelude.Nothing,
$sel:agentVersion:SendHeartbeat' :: Text
agentVersion = Text
pAgentVersion_,
$sel:deviceName:SendHeartbeat' :: Text
deviceName = Text
pDeviceName_,
$sel:deviceFleetName:SendHeartbeat' :: Text
deviceFleetName = Text
pDeviceFleetName_
}
sendHeartbeat_agentMetrics :: Lens.Lens' SendHeartbeat (Prelude.Maybe [EdgeMetric])
sendHeartbeat_agentMetrics :: (Maybe [EdgeMetric] -> f (Maybe [EdgeMetric]))
-> SendHeartbeat -> f SendHeartbeat
sendHeartbeat_agentMetrics = (SendHeartbeat -> Maybe [EdgeMetric])
-> (SendHeartbeat -> Maybe [EdgeMetric] -> SendHeartbeat)
-> Lens
SendHeartbeat
SendHeartbeat
(Maybe [EdgeMetric])
(Maybe [EdgeMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendHeartbeat' {Maybe [EdgeMetric]
agentMetrics :: Maybe [EdgeMetric]
$sel:agentMetrics:SendHeartbeat' :: SendHeartbeat -> Maybe [EdgeMetric]
agentMetrics} -> Maybe [EdgeMetric]
agentMetrics) (\s :: SendHeartbeat
s@SendHeartbeat' {} Maybe [EdgeMetric]
a -> SendHeartbeat
s {$sel:agentMetrics:SendHeartbeat' :: Maybe [EdgeMetric]
agentMetrics = Maybe [EdgeMetric]
a} :: SendHeartbeat) ((Maybe [EdgeMetric] -> f (Maybe [EdgeMetric]))
-> SendHeartbeat -> f SendHeartbeat)
-> ((Maybe [EdgeMetric] -> f (Maybe [EdgeMetric]))
-> Maybe [EdgeMetric] -> f (Maybe [EdgeMetric]))
-> (Maybe [EdgeMetric] -> f (Maybe [EdgeMetric]))
-> SendHeartbeat
-> f SendHeartbeat
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EdgeMetric] [EdgeMetric] [EdgeMetric] [EdgeMetric]
-> Iso
(Maybe [EdgeMetric])
(Maybe [EdgeMetric])
(Maybe [EdgeMetric])
(Maybe [EdgeMetric])
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 [EdgeMetric] [EdgeMetric] [EdgeMetric] [EdgeMetric]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sendHeartbeat_models :: Lens.Lens' SendHeartbeat (Prelude.Maybe [Model])
sendHeartbeat_models :: (Maybe [Model] -> f (Maybe [Model]))
-> SendHeartbeat -> f SendHeartbeat
sendHeartbeat_models = (SendHeartbeat -> Maybe [Model])
-> (SendHeartbeat -> Maybe [Model] -> SendHeartbeat)
-> Lens SendHeartbeat SendHeartbeat (Maybe [Model]) (Maybe [Model])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendHeartbeat' {Maybe [Model]
models :: Maybe [Model]
$sel:models:SendHeartbeat' :: SendHeartbeat -> Maybe [Model]
models} -> Maybe [Model]
models) (\s :: SendHeartbeat
s@SendHeartbeat' {} Maybe [Model]
a -> SendHeartbeat
s {$sel:models:SendHeartbeat' :: Maybe [Model]
models = Maybe [Model]
a} :: SendHeartbeat) ((Maybe [Model] -> f (Maybe [Model]))
-> SendHeartbeat -> f SendHeartbeat)
-> ((Maybe [Model] -> f (Maybe [Model]))
-> Maybe [Model] -> f (Maybe [Model]))
-> (Maybe [Model] -> f (Maybe [Model]))
-> SendHeartbeat
-> f SendHeartbeat
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Model] [Model] [Model] [Model]
-> Iso
(Maybe [Model]) (Maybe [Model]) (Maybe [Model]) (Maybe [Model])
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 [Model] [Model] [Model] [Model]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sendHeartbeat_agentVersion :: Lens.Lens' SendHeartbeat Prelude.Text
sendHeartbeat_agentVersion :: (Text -> f Text) -> SendHeartbeat -> f SendHeartbeat
sendHeartbeat_agentVersion = (SendHeartbeat -> Text)
-> (SendHeartbeat -> Text -> SendHeartbeat)
-> Lens SendHeartbeat SendHeartbeat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendHeartbeat' {Text
agentVersion :: Text
$sel:agentVersion:SendHeartbeat' :: SendHeartbeat -> Text
agentVersion} -> Text
agentVersion) (\s :: SendHeartbeat
s@SendHeartbeat' {} Text
a -> SendHeartbeat
s {$sel:agentVersion:SendHeartbeat' :: Text
agentVersion = Text
a} :: SendHeartbeat)
sendHeartbeat_deviceName :: Lens.Lens' SendHeartbeat Prelude.Text
sendHeartbeat_deviceName :: (Text -> f Text) -> SendHeartbeat -> f SendHeartbeat
sendHeartbeat_deviceName = (SendHeartbeat -> Text)
-> (SendHeartbeat -> Text -> SendHeartbeat)
-> Lens SendHeartbeat SendHeartbeat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendHeartbeat' {Text
deviceName :: Text
$sel:deviceName:SendHeartbeat' :: SendHeartbeat -> Text
deviceName} -> Text
deviceName) (\s :: SendHeartbeat
s@SendHeartbeat' {} Text
a -> SendHeartbeat
s {$sel:deviceName:SendHeartbeat' :: Text
deviceName = Text
a} :: SendHeartbeat)
sendHeartbeat_deviceFleetName :: Lens.Lens' SendHeartbeat Prelude.Text
sendHeartbeat_deviceFleetName :: (Text -> f Text) -> SendHeartbeat -> f SendHeartbeat
sendHeartbeat_deviceFleetName = (SendHeartbeat -> Text)
-> (SendHeartbeat -> Text -> SendHeartbeat)
-> Lens SendHeartbeat SendHeartbeat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendHeartbeat' {Text
deviceFleetName :: Text
$sel:deviceFleetName:SendHeartbeat' :: SendHeartbeat -> Text
deviceFleetName} -> Text
deviceFleetName) (\s :: SendHeartbeat
s@SendHeartbeat' {} Text
a -> SendHeartbeat
s {$sel:deviceFleetName:SendHeartbeat' :: Text
deviceFleetName = Text
a} :: SendHeartbeat)
instance Core.AWSRequest SendHeartbeat where
type
AWSResponse SendHeartbeat =
SendHeartbeatResponse
request :: SendHeartbeat -> Request SendHeartbeat
request = Service -> SendHeartbeat -> Request SendHeartbeat
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendHeartbeat
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendHeartbeat)))
response =
AWSResponse SendHeartbeat
-> Logger
-> Service
-> Proxy SendHeartbeat
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendHeartbeat)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SendHeartbeat
SendHeartbeatResponse
SendHeartbeatResponse'
instance Prelude.Hashable SendHeartbeat
instance Prelude.NFData SendHeartbeat
instance Core.ToHeaders SendHeartbeat where
toHeaders :: SendHeartbeat -> [Header]
toHeaders =
[Header] -> SendHeartbeat -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendHeartbeat where
toJSON :: SendHeartbeat -> Value
toJSON SendHeartbeat' {Maybe [EdgeMetric]
Maybe [Model]
Text
deviceFleetName :: Text
deviceName :: Text
agentVersion :: Text
models :: Maybe [Model]
agentMetrics :: Maybe [EdgeMetric]
$sel:deviceFleetName:SendHeartbeat' :: SendHeartbeat -> Text
$sel:deviceName:SendHeartbeat' :: SendHeartbeat -> Text
$sel:agentVersion:SendHeartbeat' :: SendHeartbeat -> Text
$sel:models:SendHeartbeat' :: SendHeartbeat -> Maybe [Model]
$sel:agentMetrics:SendHeartbeat' :: SendHeartbeat -> Maybe [EdgeMetric]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AgentMetrics" Text -> [EdgeMetric] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([EdgeMetric] -> Pair) -> Maybe [EdgeMetric] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EdgeMetric]
agentMetrics,
(Text
"Models" Text -> [Model] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Model] -> Pair) -> Maybe [Model] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Model]
models,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AgentVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
agentVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeviceFleetName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceFleetName)
]
)
instance Core.ToPath SendHeartbeat where
toPath :: SendHeartbeat -> ByteString
toPath = ByteString -> SendHeartbeat -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/SendHeartbeat"
instance Core.ToQuery SendHeartbeat where
toQuery :: SendHeartbeat -> QueryString
toQuery = QueryString -> SendHeartbeat -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendHeartbeatResponse = SendHeartbeatResponse'
{
}
deriving (SendHeartbeatResponse -> SendHeartbeatResponse -> Bool
(SendHeartbeatResponse -> SendHeartbeatResponse -> Bool)
-> (SendHeartbeatResponse -> SendHeartbeatResponse -> Bool)
-> Eq SendHeartbeatResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendHeartbeatResponse -> SendHeartbeatResponse -> Bool
$c/= :: SendHeartbeatResponse -> SendHeartbeatResponse -> Bool
== :: SendHeartbeatResponse -> SendHeartbeatResponse -> Bool
$c== :: SendHeartbeatResponse -> SendHeartbeatResponse -> Bool
Prelude.Eq, ReadPrec [SendHeartbeatResponse]
ReadPrec SendHeartbeatResponse
Int -> ReadS SendHeartbeatResponse
ReadS [SendHeartbeatResponse]
(Int -> ReadS SendHeartbeatResponse)
-> ReadS [SendHeartbeatResponse]
-> ReadPrec SendHeartbeatResponse
-> ReadPrec [SendHeartbeatResponse]
-> Read SendHeartbeatResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendHeartbeatResponse]
$creadListPrec :: ReadPrec [SendHeartbeatResponse]
readPrec :: ReadPrec SendHeartbeatResponse
$creadPrec :: ReadPrec SendHeartbeatResponse
readList :: ReadS [SendHeartbeatResponse]
$creadList :: ReadS [SendHeartbeatResponse]
readsPrec :: Int -> ReadS SendHeartbeatResponse
$creadsPrec :: Int -> ReadS SendHeartbeatResponse
Prelude.Read, Int -> SendHeartbeatResponse -> ShowS
[SendHeartbeatResponse] -> ShowS
SendHeartbeatResponse -> String
(Int -> SendHeartbeatResponse -> ShowS)
-> (SendHeartbeatResponse -> String)
-> ([SendHeartbeatResponse] -> ShowS)
-> Show SendHeartbeatResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendHeartbeatResponse] -> ShowS
$cshowList :: [SendHeartbeatResponse] -> ShowS
show :: SendHeartbeatResponse -> String
$cshow :: SendHeartbeatResponse -> String
showsPrec :: Int -> SendHeartbeatResponse -> ShowS
$cshowsPrec :: Int -> SendHeartbeatResponse -> ShowS
Prelude.Show, (forall x. SendHeartbeatResponse -> Rep SendHeartbeatResponse x)
-> (forall x. Rep SendHeartbeatResponse x -> SendHeartbeatResponse)
-> Generic SendHeartbeatResponse
forall x. Rep SendHeartbeatResponse x -> SendHeartbeatResponse
forall x. SendHeartbeatResponse -> Rep SendHeartbeatResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendHeartbeatResponse x -> SendHeartbeatResponse
$cfrom :: forall x. SendHeartbeatResponse -> Rep SendHeartbeatResponse x
Prelude.Generic)
newSendHeartbeatResponse ::
SendHeartbeatResponse
newSendHeartbeatResponse :: SendHeartbeatResponse
newSendHeartbeatResponse = SendHeartbeatResponse
SendHeartbeatResponse'
instance Prelude.NFData SendHeartbeatResponse