@@ -21,6 +21,16 @@ namespace Aws
21
21
{
22
22
class GreengrassCoreIpcClient ;
23
23
class GreengrassCoreIpcServiceModel ;
24
+ enum MetricUnitType
25
+ {
26
+ METRIC_UNIT_TYPE_BYTES,
27
+ METRIC_UNIT_TYPE_BYTES_PER_SECOND,
28
+ METRIC_UNIT_TYPE_COUNT,
29
+ METRIC_UNIT_TYPE_COUNT_PER_SECOND,
30
+ METRIC_UNIT_TYPE_MEGABYTES,
31
+ METRIC_UNIT_TYPE_SECONDS
32
+ };
33
+
24
34
class MessageContext : public AbstractShapeBase
25
35
{
26
36
public:
@@ -257,6 +267,36 @@ namespace Aws
257
267
CONFIGURATION_VALIDITY_STATUS_REJECTED
258
268
};
259
269
270
+ class Metric : public AbstractShapeBase
271
+ {
272
+ public:
273
+ Metric () noexcept {}
274
+ Metric (const Metric &) = default ;
275
+ void SetName (const Aws::Crt::String &name) noexcept { m_name = name; }
276
+ Aws::Crt::Optional<Aws::Crt::String> GetName () noexcept { return m_name; }
277
+ void SetUnit (MetricUnitType unit) noexcept ;
278
+ Aws::Crt::Optional<MetricUnitType> GetUnit () noexcept ;
279
+ void SetValue (const double &value) noexcept { m_value = value; }
280
+ Aws::Crt::Optional<double > GetValue () noexcept { return m_value; }
281
+ void SerializeToJsonObject (Aws::Crt::JsonObject &payloadObject) const noexcept override ;
282
+ static void s_loadFromJsonView (Metric &, const Aws::Crt::JsonView &) noexcept ;
283
+ static Aws::Crt::ScopedResource<AbstractShapeBase> s_allocateFromPayload (
284
+ Aws::Crt::StringView,
285
+ Aws::Crt::Allocator *) noexcept ;
286
+ static void s_customDeleter (Metric *) noexcept ;
287
+ /* This needs to be defined so that `Metric` can be used as a key in maps. */
288
+ bool operator <(const Metric &) const noexcept ;
289
+ static const char *MODEL_NAME;
290
+
291
+ protected:
292
+ Aws::Crt::String GetModelName () const noexcept override ;
293
+
294
+ private:
295
+ Aws::Crt::Optional<Aws::Crt::String> m_name;
296
+ Aws::Crt::Optional<Aws::Crt::String> m_unit;
297
+ Aws::Crt::Optional<double > m_value;
298
+ };
299
+
260
300
class BinaryMessage : public AbstractShapeBase
261
301
{
262
302
public:
@@ -1899,6 +1939,51 @@ namespace Aws
1899
1939
Aws::Crt::Optional<Aws::Crt::String> m_componentName;
1900
1940
};
1901
1941
1942
+ class PutComponentMetricResponse : public AbstractShapeBase
1943
+ {
1944
+ public:
1945
+ PutComponentMetricResponse () noexcept {}
1946
+ PutComponentMetricResponse (const PutComponentMetricResponse &) = default ;
1947
+ void SerializeToJsonObject (Aws::Crt::JsonObject &payloadObject) const noexcept override ;
1948
+ static void s_loadFromJsonView (PutComponentMetricResponse &, const Aws::Crt::JsonView &) noexcept ;
1949
+ static Aws::Crt::ScopedResource<AbstractShapeBase> s_allocateFromPayload (
1950
+ Aws::Crt::StringView,
1951
+ Aws::Crt::Allocator *) noexcept ;
1952
+ static void s_customDeleter (PutComponentMetricResponse *) noexcept ;
1953
+ /* This needs to be defined so that `PutComponentMetricResponse` can be used as a key in maps. */
1954
+ bool operator <(const PutComponentMetricResponse &) const noexcept ;
1955
+ static const char *MODEL_NAME;
1956
+
1957
+ protected:
1958
+ Aws::Crt::String GetModelName () const noexcept override ;
1959
+
1960
+ private:
1961
+ };
1962
+
1963
+ class PutComponentMetricRequest : public AbstractShapeBase
1964
+ {
1965
+ public:
1966
+ PutComponentMetricRequest () noexcept {}
1967
+ PutComponentMetricRequest (const PutComponentMetricRequest &) = default ;
1968
+ void SetMetrics (const Aws::Crt::Vector<Metric> &metrics) noexcept { m_metrics = metrics; }
1969
+ Aws::Crt::Optional<Aws::Crt::Vector<Metric>> GetMetrics () noexcept { return m_metrics; }
1970
+ void SerializeToJsonObject (Aws::Crt::JsonObject &payloadObject) const noexcept override ;
1971
+ static void s_loadFromJsonView (PutComponentMetricRequest &, const Aws::Crt::JsonView &) noexcept ;
1972
+ static Aws::Crt::ScopedResource<AbstractShapeBase> s_allocateFromPayload (
1973
+ Aws::Crt::StringView,
1974
+ Aws::Crt::Allocator *) noexcept ;
1975
+ static void s_customDeleter (PutComponentMetricRequest *) noexcept ;
1976
+ /* This needs to be defined so that `PutComponentMetricRequest` can be used as a key in maps. */
1977
+ bool operator <(const PutComponentMetricRequest &) const noexcept ;
1978
+ static const char *MODEL_NAME;
1979
+
1980
+ protected:
1981
+ Aws::Crt::String GetModelName () const noexcept override ;
1982
+
1983
+ private:
1984
+ Aws::Crt::Optional<Aws::Crt::Vector<Metric>> m_metrics;
1985
+ };
1986
+
1902
1987
class PublishToTopicResponse : public AbstractShapeBase
1903
1988
{
1904
1989
public:
@@ -3484,6 +3569,69 @@ namespace Aws
3484
3569
Aws::Crt::String GetModelName () const noexcept override ;
3485
3570
};
3486
3571
3572
+ class PutComponentMetricOperationContext : public OperationModelContext
3573
+ {
3574
+ public:
3575
+ PutComponentMetricOperationContext (const GreengrassCoreIpcServiceModel &serviceModel) noexcept ;
3576
+ Aws::Crt::ScopedResource<AbstractShapeBase> AllocateInitialResponseFromPayload (
3577
+ Aws::Crt::StringView stringView,
3578
+ Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override ;
3579
+ Aws::Crt::ScopedResource<AbstractShapeBase> AllocateStreamingResponseFromPayload (
3580
+ Aws::Crt::StringView stringView,
3581
+ Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) const noexcept override ;
3582
+ Aws::Crt::String GetRequestModelName () const noexcept override ;
3583
+ Aws::Crt::String GetInitialResponseModelName () const noexcept override ;
3584
+ Aws::Crt::Optional<Aws::Crt::String> GetStreamingResponseModelName () const noexcept override ;
3585
+ Aws::Crt::String GetOperationName () const noexcept override ;
3586
+ };
3587
+
3588
+ class PutComponentMetricResult
3589
+ {
3590
+ public:
3591
+ PutComponentMetricResult () noexcept {}
3592
+ PutComponentMetricResult (TaggedResult &&taggedResult) noexcept : m_taggedResult(std::move(taggedResult)) {}
3593
+ PutComponentMetricResponse *GetOperationResponse () const noexcept
3594
+ {
3595
+ return static_cast <PutComponentMetricResponse *>(m_taggedResult.GetOperationResponse ());
3596
+ }
3597
+ /* *
3598
+ * @return true if the response is associated with an expected response;
3599
+ * false if the response is associated with an error.
3600
+ */
3601
+ operator bool () const noexcept { return m_taggedResult == true ; }
3602
+ OperationError *GetOperationError () const noexcept { return m_taggedResult.GetOperationError (); }
3603
+ RpcError GetRpcError () const noexcept { return m_taggedResult.GetRpcError (); }
3604
+ ResultType GetResultType () const noexcept { return m_taggedResult.GetResultType (); }
3605
+
3606
+ private:
3607
+ TaggedResult m_taggedResult;
3608
+ };
3609
+
3610
+ class PutComponentMetricOperation : public ClientOperation
3611
+ {
3612
+ public:
3613
+ PutComponentMetricOperation (
3614
+ ClientConnection &connection,
3615
+ const PutComponentMetricOperationContext &operationContext,
3616
+ Aws::Crt::Allocator *allocator = Aws::Crt::g_allocator) noexcept ;
3617
+ /* *
3618
+ * Used to activate a stream for the `PutComponentMetricOperation`
3619
+ * @param request The request used for the `PutComponentMetricOperation`
3620
+ * @param onMessageFlushCallback An optional callback that is invoked when the request is flushed.
3621
+ * @return An `RpcError` that can be used to check whether the stream was activated.
3622
+ */
3623
+ std::future<RpcError> Activate (
3624
+ const PutComponentMetricRequest &request,
3625
+ OnMessageFlushCallback onMessageFlushCallback = nullptr ) noexcept ;
3626
+ /* *
3627
+ * Retrieve the result from activating the stream.
3628
+ */
3629
+ std::future<PutComponentMetricResult> GetResult () noexcept ;
3630
+
3631
+ protected:
3632
+ Aws::Crt::String GetModelName () const noexcept override ;
3633
+ };
3634
+
3487
3635
class DeferComponentUpdateOperationContext : public OperationModelContext
3488
3636
{
3489
3637
public:
@@ -5482,6 +5630,7 @@ namespace Aws
5482
5630
PublishToIoTCoreOperationContext m_publishToIoTCoreOperationContext;
5483
5631
SubscribeToConfigurationUpdateOperationContext m_subscribeToConfigurationUpdateOperationContext;
5484
5632
DeleteThingShadowOperationContext m_deleteThingShadowOperationContext;
5633
+ PutComponentMetricOperationContext m_putComponentMetricOperationContext;
5485
5634
DeferComponentUpdateOperationContext m_deferComponentUpdateOperationContext;
5486
5635
SubscribeToValidateConfigurationUpdatesOperationContext
5487
5636
m_subscribeToValidateConfigurationUpdatesOperationContext;
0 commit comments