Fixing Queue representation in ConnectEvent.java#482
Fixing Queue representation in ConnectEvent.java#482
Conversation
|
Thanks for taking a look @smirnoal - apologies for missing the tests, I'd just opened that one file in the online editor and hadn't thought to check. I've updated accordingly now, appreciate if you could take another look. |
|
While we're changing the event, I think it would be wise to include all the changes to Queue. |
|
@jonnysw would you take a look at the failed test? |
|
Hi @smirnoal my apologies, I've recently changed job and had forgotten about this. Will try to spend some time on it over the next week if I can. |
|
Hi Team, |
|
Let's try fixing this again |
AWS Connect defines the Queue as an object, not a string. The object contains ARN and name (as well as address and type). I am fixing the Event model so that it correctly deserialised. For reference, I have followed the model used by the Go implementation here: https://github.com/aws/aws-lambda-go/blame/main/events/connect.go
| "PreviousContactId": "4ca32fbd-8f92-46af-92a5-6b0f970f0efe", | ||
| "Queue": null, | ||
| "Queue": { | ||
| "ARN": "arn:aws:connect:eu-central-1:123456789012:instance/9308c2a1-9bc6-4cea-8290-6c0b4a6d38fa/queue/941464de-39b7-4cae-82e9-a44f070ef59e", |
There was a problem hiding this comment.
This needs to be ARN according to their models.
https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html
| @JsonProperty("Queue") abstract Map<String, String> getQueue(); | ||
| @JsonProperty("Queue") abstract void setQueue(Map<String, String> queue); |
There was a problem hiding this comment.
This is a map str str, since queue is just string fields.
|
Closing, solved per #553 |
Issue #, if available:
NA
Description of changes:
At present, when trying to invoke a lambda that uses a ConnectEvent in its handler, it will fail with:
I am fixing the Event model so that it can be correctly deserialised.
AWS Connect defines the Queue as an object when invoking a lambda, not a string. The object contains ARN and Name (as well as Address and Type). See here for the full model:
https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html
For reference, I have followed the model used by the Go implementation here: https://github.com/aws/aws-lambda-go/blame/main/events/connect.go
Target (OCI, Managed Runtime, both):
both
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.