reach_commons 0.15.4__py3-none-any.whl → 0.15.6__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.
@@ -442,6 +442,8 @@ class SmsProcessorSQSNotifier(SQSClient):
442
442
  long_url: str = None,
443
443
  delay_seconds=2,
444
444
  send_at=None,
445
+ message_type=None,
446
+ campaign_id=None,
445
447
  ):
446
448
  message_data = {
447
449
  "body": body,
@@ -450,9 +452,50 @@ class SmsProcessorSQSNotifier(SQSClient):
450
452
  "message_id": message_id,
451
453
  "long_url": long_url,
452
454
  }
453
- if send_at:
454
- message_data["send_at"] = send_at
455
455
 
456
+ message_data.update(
457
+ {
458
+ k: v
459
+ for k, v in {
460
+ "send_at": send_at,
461
+ "message_type": message_type,
462
+ "campaign_id": campaign_id,
463
+ }.items()
464
+ if v is not None
465
+ }
466
+ )
467
+
468
+ message_attributes = {"service_name": self.SERVICE_NAME}
469
+
470
+ return self.publish(
471
+ message_data=message_data,
472
+ message_attributes=message_attributes,
473
+ delay_seconds=delay_seconds,
474
+ )
475
+
476
+
477
+ class POSApiPullerSQSNotifier(SQSClient):
478
+ SERVICE_NAME = "POSApiPullerSQSNotifier"
479
+ TOPIC_NAME = "pos-api-messages-queue"
480
+ DEFAULT_REGION = "us-east-1"
481
+
482
+ def __init__(
483
+ self,
484
+ region_name=DEFAULT_REGION,
485
+ logger=get_reach_logger(),
486
+ env=os.environ.get("ENV", "Staging"),
487
+ ):
488
+ super().__init__(
489
+ region_name=region_name,
490
+ logger=logger,
491
+ topic_name=f"{env}-{self.TOPIC_NAME}",
492
+ )
493
+
494
+ def notify_for_send_message(
495
+ self,
496
+ message_data: dict,
497
+ delay_seconds=2,
498
+ ):
456
499
  message_attributes = {"service_name": self.SERVICE_NAME}
457
500
 
458
501
  return self.publish(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reach_commons
3
- Version: 0.15.4
3
+ Version: 0.15.6
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: Wilson Moraes
@@ -21,11 +21,11 @@ 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=HDJ3lnKm6Jah2asizUDtQErlVSjrcV9lOfBPHzUVguY,4526
23
23
  reach_commons/reach_aws/s3.py,sha256=KLWvlQVakaaGfFg3110QHc1PlxCb1pUhmJQ-VggLEj4,1962
24
- reach_commons/reach_aws/sqs.py,sha256=kN7QjYj59zOa_lTOHVVk4jnd9w3qyLFAGfs_gydBUBM,14258
24
+ reach_commons/reach_aws/sqs.py,sha256=Xm4JzYX76NJmAFhHFA4cKyRVpXCkuFFWZIqsbDnkeKI,15420
25
25
  reach_commons/reach_base_model.py,sha256=uMmDGjwKTZ3h7f8Pfvc99FCsAt5eZNlUJnLLbB5EqGY,2907
26
26
  reach_commons/redis_manager.py,sha256=_4FOYPMapwRmWU-5SO1Bm0Cb__Ngkx2hrOPlrJETzX0,1896
27
27
  reach_commons/utils.py,sha256=dMgKIGqTgoSItuBI8oz81gKtW3qi21Jkljv9leS_V88,8475
28
28
  reach_commons/validations.py,sha256=jc78boM62S9Z0Ip_nV1z7I983gGpW2Y7vOCQtmia8OU,964
29
- reach_commons-0.15.4.dist-info/METADATA,sha256=PKr1RUj3ky-NMje4gy1sZYHxGsS8NbhNzrtdFg3Ln2U,1860
30
- reach_commons-0.15.4.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
31
- reach_commons-0.15.4.dist-info/RECORD,,
29
+ reach_commons-0.15.6.dist-info/METADATA,sha256=Ch3Gx0wDre_I41TjRNt5USZdFADcDcnc5OneDEK5_uI,1860
30
+ reach_commons-0.15.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
31
+ reach_commons-0.15.6.dist-info/RECORD,,