reach_commons 0.18.28__py3-none-any.whl → 0.18.29__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -657,12 +657,12 @@ class AnomalySQSNotifier(SQSClient):
657
657
 
658
658
  DEFAULT_REGION = "us-east-1"
659
659
  DEFAULT_TOPIC = "reach-data-bridge-messages-queue"
660
+ SERVICE_NAME = "AnomalySQSNotifier"
660
661
 
661
662
  def __init__(
662
663
  self,
663
664
  *,
664
665
  topic_name: str = None,
665
- service_name: str = None,
666
666
  region_name: str = DEFAULT_REGION,
667
667
  logger=None,
668
668
  env: str = os.environ.get("ENV", "Staging"),
@@ -670,13 +670,12 @@ class AnomalySQSNotifier(SQSClient):
670
670
  """
671
671
  Args:
672
672
  topic_name: Nome base da fila (sem prefixo de env). Default: reach-data-bridge-messages-queue
673
- service_name: Nome do serviço para uso no message_attribute. Default: nome da classe.
674
673
  """
675
674
  if logger is None:
676
675
  logger = get_reach_logger()
677
676
 
678
677
  self.env = env
679
- self.service_name = service_name or self.__class__.__name__
678
+
680
679
  base_topic = topic_name or self.DEFAULT_TOPIC
681
680
 
682
681
  super().__init__(
@@ -684,3 +683,16 @@ class AnomalySQSNotifier(SQSClient):
684
683
  logger=logger,
685
684
  topic_name=f"{env}-{base_topic}",
686
685
  )
686
+
687
+ def notify_anomaly(
688
+ self,
689
+ message_data: dict,
690
+ delay_seconds=2,
691
+ ):
692
+ message_attributes = {"service_name": self.SERVICE_NAME}
693
+
694
+ return self.publish(
695
+ message_data=message_data,
696
+ message_attributes=message_attributes,
697
+ delay_seconds=delay_seconds,
698
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reach_commons
3
- Version: 0.18.28
3
+ Version: 0.18.29
4
4
  Summary: Reach Commons is a versatile utility library designed to streamline and enhance development workflows within the Reach ecosystem.
5
5
  License: MIT
6
6
  Author: Engineering
@@ -21,12 +21,12 @@ reach_commons/reach_aws/exceptions.py,sha256=x0RL5ktNtzxg0KykhEVWReBq_dEtciK6B2v
21
21
  reach_commons/reach_aws/firehose.py,sha256=1xFKLWMv3bNo3PPW5gtaL6NqzUDyVil6B768slj2wbY,5674
22
22
  reach_commons/reach_aws/kms.py,sha256=ZOfyJMQUgxJEojRoB7-aCxtATpNx1Ig522IUYH11NZ4,4678
23
23
  reach_commons/reach_aws/s3.py,sha256=2MLlDNFx0SROJBpE_KjJefyrB7lMqTlrYuRhSZx4iKs,3945
24
- reach_commons/reach_aws/sqs.py,sha256=U2WUgxg9n4vBuNfoxVcrNHUZXOvLxiT0gVFm-LiPN1A,21606
24
+ reach_commons/reach_aws/sqs.py,sha256=sRnUNFrgnKVKS6oeVrhfq7FQ3vqFN-L7c8aVVdEiLxE,21793
25
25
  reach_commons/reach_base_model.py,sha256=vgdGDcZr3iXMmyRhmBhOf_LKWB_6QzT3r_Yiyo6OmEk,3009
26
26
  reach_commons/redis_manager.py,sha256=SgUtdtt0eV4bUwsWDankIa9Bjfgcm2DKcmVMQT6ptF0,2946
27
27
  reach_commons/sms_smart_encoding.py,sha256=92y0RmZ0l4ONHpC9qeO5KfViSNq64yE2rc7lhNDSZqE,1241
28
28
  reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
29
29
  reach_commons/validations.py,sha256=CJdWg8qc9ILe3rYHYTLdr2upRspsM_8ghhm4IXX4Pg8,1028
30
- reach_commons-0.18.28.dist-info/METADATA,sha256=EuZa3sbjpLxWjLpKwLAhy2WZUD-mjc3GGdIPzjq-idU,1965
31
- reach_commons-0.18.28.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
32
- reach_commons-0.18.28.dist-info/RECORD,,
30
+ reach_commons-0.18.29.dist-info/METADATA,sha256=HI8O1DlISx2L705y_3cj5_lbEOBoiApn-4ziXqszLJg,1965
31
+ reach_commons-0.18.29.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
32
+ reach_commons-0.18.29.dist-info/RECORD,,