Repository navigation
feat(event_sources): add support for Amazon Connect Outbound Campaigns - #8702
Open
ASHMEET555 wants to merge 1 commit into
Open
ASHMEET555 wants to merge 1 commit into
ASHMEET555 wants to merge 1 commit into
Conversation
|
Contributor
Author
|
Hi @leandrodamascena , PR is ready for review! Includes Event Source Data Classes, Pydantic v2 Parser models, documentation, and 100% test coverage matching the TypeScript reference implementation. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8702 +/- ##
===========================================
+ Coverage 96.99% 97.00% +0.01%
===========================================
Files 321 323 +2
Lines 16332 16401 +69
Branches 1473 1474 +1
===========================================
+ Hits 15841 15910 +69
Misses 350 350
Partials 141 141 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue number: closes #7976
Summary
Adds support for Amazon Connect Outbound Campaigns custom action block triggers, achieving feature parity with TypeScript implementation (aws-powertools/powertools-lambda-typescript#5502).
Changes
Event Source Data Classes
ConnectOutboundCampaignsEventinaws_lambda_powertools/utilities/data_classes/connect_campaign_event.pywith typed sub-wrappers:ConnectOutboundCampaignInvocationMetadata&ConnectOutboundCampaignContext(CampaignId,RunId,ActionId,CampaignName).ConnectOutboundCampaignItems&ConnectOutboundCampaignCustomerProfile(ProfileId,CustomerData,IdempotencyToken).cached_property json_customer_datato automatically deserialize the embedded campaign JSON string.event.customer_profilesto iterate directly over profiles.aws_lambda_powertools/utilities/data_classes/__init__.py.Parser (Pydantic v2)
ConnectOutboundCampaignsEventModelinaws_lambda_powertools/utilities/parser/models/connect_campaign.py.ConnectInvocationMetadataModel,ConnectCampaignContextModel,ConnectItemsModel, andConnectCustomerProfileModel.CustomerDatais typedAnyby default, allowing developers to extendConnectCustomerProfileModelwith custom Pydantic schemas for campaign payloads.aws_lambda_powertools/utilities/parser/models/__init__.py.Documentation & Examples
docs/utilities/data_classes.md.examples/event_sources/src/connect_outbound_campaigns.py.ConnectOutboundCampaignsEventModelto the built-in models reference table indocs/utilities/parser.md.Tests & Fixtures
tests/events/connectOutboundCampaignsEvent.json(matches AWS documentation and TS fixture).tests/unit/data_classes/required_dependencies/test_connect_campaign_event.py.tests/unit/parser/_pydantic/test_connect_campaign.py.User experience
1. With Event Source Data Classes:
2. With Parser:
Verification
uv run pytest tests/unit/data_classes/required_dependencies/test_connect_campaign_event.py tests/unit/parser/_pydantic/test_connect_campaign.py --cov=aws_lambda_powertools.utilities.data_classes.connect_campaign_event --cov=aws_lambda_powertools.utilities.parser.models.connect_campaign— 4 passed, 100% test coverage.uv run ruff check aws_lambda_powertools/ docs/ examples/ tests/— Passed.uv run ruff format --check— Passed.uv run mypy aws_lambda_powertools/utilities/data_classes/ aws_lambda_powertools/utilities/parser/— Success: no issues found in 98 source files.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.