@@ -93,6 +93,19 @@ def __eq__(self, other):
93
93
return False
94
94
95
95
96
+ class MetricUnitType :
97
+ """
98
+ MetricUnitType enum
99
+ """
100
+
101
+ BYTES = 'BYTES'
102
+ BYTES_PER_SECOND = 'BYTES_PER_SECOND'
103
+ COUNT = 'COUNT'
104
+ COUNT_PER_SECOND = 'COUNT_PER_SECOND'
105
+ MEGABYTES = 'MEGABYTES'
106
+ SECONDS = 'SECONDS'
107
+
108
+
96
109
class MessageContext (rpc .Shape ):
97
110
"""
98
111
MessageContext
@@ -564,6 +577,83 @@ def __eq__(self, other):
564
577
return False
565
578
566
579
580
+ class Metric (rpc .Shape ):
581
+ """
582
+ Metric
583
+
584
+ All attributes are None by default, and may be set by keyword in the constructor.
585
+
586
+ Keyword Args:
587
+ name:
588
+ unit: MetricUnitType enum value
589
+ value:
590
+
591
+ Attributes:
592
+ name:
593
+ unit: MetricUnitType enum value
594
+ value:
595
+ """
596
+
597
+ def __init__ (self , * ,
598
+ name : typing .Optional [str ] = None ,
599
+ unit : typing .Optional [str ] = None ,
600
+ value : typing .Optional [float ] = None ):
601
+ super ().__init__ ()
602
+ self .name = name # type: typing.Optional[str]
603
+ self .unit = unit # type: typing.Optional[str]
604
+ self .value = value # type: typing.Optional[float]
605
+
606
+ def set_name (self , name : str ):
607
+ self .name = name
608
+ return self
609
+
610
+ def set_unit (self , unit : str ):
611
+ self .unit = unit
612
+ return self
613
+
614
+ def set_value (self , value : float ):
615
+ self .value = value
616
+ return self
617
+
618
+
619
+ def _to_payload (self ):
620
+ payload = {}
621
+ if self .name is not None :
622
+ payload ['name' ] = self .name
623
+ if self .unit is not None :
624
+ payload ['unit' ] = self .unit
625
+ if self .value is not None :
626
+ payload ['value' ] = self .value
627
+ return payload
628
+
629
+ @classmethod
630
+ def _from_payload (cls , payload ):
631
+ new = cls ()
632
+ if 'name' in payload :
633
+ new .name = payload ['name' ]
634
+ if 'unit' in payload :
635
+ new .unit = payload ['unit' ]
636
+ if 'value' in payload :
637
+ new .value = float (payload ['value' ])
638
+ return new
639
+
640
+ @classmethod
641
+ def _model_name (cls ):
642
+ return 'aws.greengrass#Metric'
643
+
644
+ def __repr__ (self ):
645
+ attrs = []
646
+ for attr , val in self .__dict__ .items ():
647
+ if val is not None :
648
+ attrs .append ('%s=%r' % (attr , val ))
649
+ return '%s(%s)' % (self .__class__ .__name__ , ', ' .join (attrs ))
650
+
651
+ def __eq__ (self , other ):
652
+ if isinstance (other , self .__class__ ):
653
+ return self .__dict__ == other .__dict__
654
+ return False
655
+
656
+
567
657
class LifecycleState :
568
658
"""
569
659
LifecycleState enum
@@ -5295,6 +5385,94 @@ def __eq__(self, other):
5295
5385
return False
5296
5386
5297
5387
5388
+ class PutComponentMetricResponse (rpc .Shape ):
5389
+ """
5390
+ PutComponentMetricResponse
5391
+ """
5392
+
5393
+ def __init__ (self ):
5394
+ super ().__init__ ()
5395
+
5396
+
5397
+ def _to_payload (self ):
5398
+ payload = {}
5399
+ return payload
5400
+
5401
+ @classmethod
5402
+ def _from_payload (cls , payload ):
5403
+ new = cls ()
5404
+ return new
5405
+
5406
+ @classmethod
5407
+ def _model_name (cls ):
5408
+ return 'aws.greengrass#PutComponentMetricResponse'
5409
+
5410
+ def __repr__ (self ):
5411
+ attrs = []
5412
+ for attr , val in self .__dict__ .items ():
5413
+ if val is not None :
5414
+ attrs .append ('%s=%r' % (attr , val ))
5415
+ return '%s(%s)' % (self .__class__ .__name__ , ', ' .join (attrs ))
5416
+
5417
+ def __eq__ (self , other ):
5418
+ if isinstance (other , self .__class__ ):
5419
+ return self .__dict__ == other .__dict__
5420
+ return False
5421
+
5422
+
5423
+ class PutComponentMetricRequest (rpc .Shape ):
5424
+ """
5425
+ PutComponentMetricRequest
5426
+
5427
+ All attributes are None by default, and may be set by keyword in the constructor.
5428
+
5429
+ Keyword Args:
5430
+ metrics:
5431
+
5432
+ Attributes:
5433
+ metrics:
5434
+ """
5435
+
5436
+ def __init__ (self , * ,
5437
+ metrics : typing .Optional [typing .List [Metric ]] = None ):
5438
+ super ().__init__ ()
5439
+ self .metrics = metrics # type: typing.Optional[typing.List[Metric]]
5440
+
5441
+ def set_metrics (self , metrics : typing .List [Metric ]):
5442
+ self .metrics = metrics
5443
+ return self
5444
+
5445
+
5446
+ def _to_payload (self ):
5447
+ payload = {}
5448
+ if self .metrics is not None :
5449
+ payload ['metrics' ] = [i ._to_payload () for i in self .metrics ]
5450
+ return payload
5451
+
5452
+ @classmethod
5453
+ def _from_payload (cls , payload ):
5454
+ new = cls ()
5455
+ if 'metrics' in payload :
5456
+ new .metrics = [Metric ._from_payload (i ) for i in payload ['metrics' ]]
5457
+ return new
5458
+
5459
+ @classmethod
5460
+ def _model_name (cls ):
5461
+ return 'aws.greengrass#PutComponentMetricRequest'
5462
+
5463
+ def __repr__ (self ):
5464
+ attrs = []
5465
+ for attr , val in self .__dict__ .items ():
5466
+ if val is not None :
5467
+ attrs .append ('%s=%r' % (attr , val ))
5468
+ return '%s(%s)' % (self .__class__ .__name__ , ', ' .join (attrs ))
5469
+
5470
+ def __eq__ (self , other ):
5471
+ if isinstance (other , self .__class__ ):
5472
+ return self .__dict__ == other .__dict__
5473
+ return False
5474
+
5475
+
5298
5476
class InvalidArgumentsError (GreengrassCoreIPCError ):
5299
5477
"""
5300
5478
InvalidArgumentsError
@@ -6078,6 +6256,7 @@ def __eq__(self, other):
6078
6256
PostComponentUpdateEvent ,
6079
6257
MQTTMessage ,
6080
6258
MQTTCredential ,
6259
+ Metric ,
6081
6260
JsonMessage ,
6082
6261
ConfigurationUpdateEvent ,
6083
6262
CertificateUpdate ,
@@ -6148,6 +6327,8 @@ def __eq__(self, other):
6148
6327
SubscribeToValidateConfigurationUpdatesRequest ,
6149
6328
DeferComponentUpdateResponse ,
6150
6329
DeferComponentUpdateRequest ,
6330
+ PutComponentMetricResponse ,
6331
+ PutComponentMetricRequest ,
6151
6332
InvalidArgumentsError ,
6152
6333
DeleteThingShadowResponse ,
6153
6334
DeleteThingShadowRequest ,
@@ -6539,6 +6720,28 @@ def _response_stream_type(cls):
6539
6720
return None
6540
6721
6541
6722
6723
+ class _PutComponentMetricOperation (rpc .ClientOperation ):
6724
+ @classmethod
6725
+ def _model_name (cls ):
6726
+ return 'aws.greengrass#PutComponentMetric'
6727
+
6728
+ @classmethod
6729
+ def _request_type (cls ):
6730
+ return PutComponentMetricRequest
6731
+
6732
+ @classmethod
6733
+ def _request_stream_type (cls ):
6734
+ return None
6735
+
6736
+ @classmethod
6737
+ def _response_type (cls ):
6738
+ return PutComponentMetricResponse
6739
+
6740
+ @classmethod
6741
+ def _response_stream_type (cls ):
6742
+ return None
6743
+
6744
+
6542
6745
class _RestartComponentOperation (rpc .ClientOperation ):
6543
6746
@classmethod
6544
6747
def _model_name (cls ):
0 commit comments