Repository: aws-powertools/powertools-lambda-python

Issue:
Feature request: Missing Querystring values from WebSocket data classes
### Use case

The recent data classes introduced in https://github.com/aws-powertools/powertools-lambda-python/pull/6287 do not expose queryStringParameters or multiValueQueryStringParameters  properties

### Solution/User Experience

`
from aws_lambda_powertools.utilities.data_classes import (
    APIGatewayWebSocketEvent,
    event_source,
)

@event_source(data_class=APIGatewayWebSocketEvent)
def lambda_handler(event: APIGatewayWebSocketEvent, context):
    qs1 = event.queryString["param1"]

### Alternative solutions

```markdown

```

### Acknowledgment

- [x] This feature request meets [Powertools for AWS Lambda (Python) Tenets](https://docs.powertools.aws.dev/lambda/python/latest/#tenets)
- [x] Should this be considered in other Powertools for AWS Lambda languages? i.e. [Java](https://github.com/aws-powertools/powertools-lambda-java/), [TypeScript](https://github.com/aws-powertools/powertools-lambda-typescript/), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet/)

Discussion:
@leandrodamascena: Hey @dave-dotnet-overall! Thanks for opening this here. Do you want to send a PR to fix this?@dave-dotnet-overall: @leandrodamascena https://github.com/aws-powertools/powertools-lambda-python/pull/6411@github-actions: ### ⚠️COMMENT VISIBILITY WARNING⚠️
This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a [team member](https://github.com/aws-powertools/powertools-lambda-python/blob/develop/MAINTAINERS.md#current-maintainers) or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Solution patch:
diff --git a/aws_lambda_powertools/utilities/data_classes/api_gateway_websocket_event.py b/aws_lambda_powertools/utilities/data_classes/api_gateway_websocket_event.py
index f71e236f8..bb93cac7f 100644
--- a/aws_lambda_powertools/utilities/data_classes/api_gateway_websocket_event.py
+++ b/aws_lambda_powertools/utilities/data_classes/api_gateway_websocket_event.py
@@ -123,6 +123,14 @@ class APIGatewayWebSocketEvent(DictWrapper):
     def multi_value_headers(self) -> dict[str, list[str]]:
         return CaseInsensitiveDict(self.get("multiValueHeaders"))
 
+    @property
+    def query_string_parameters(self) -> dict[str, str]:
+        return CaseInsensitiveDict(self.get("queryStringParameters"))
+
+    @property
+    def multi_value_query_string_parameters(self) -> dict[str, list[str]]:
+        return CaseInsensitiveDict(self.get("multiValueQueryStringParameters"))
+
     @property
     def request_context(self) -> APIGatewayWebSocketEventRequestContext:
         return APIGatewayWebSocketEventRequestContext(self["requestContext"])


Test patch:
diff --git a/tests/events/apiGatewayWebSocketApiConnect.json b/tests/events/apiGatewayWebSocketApiConnect.json
index 27f8794c9..188d58693 100644
--- a/tests/events/apiGatewayWebSocketApiConnect.json
+++ b/tests/events/apiGatewayWebSocketApiConnect.json
@@ -19,6 +19,15 @@
       "X-Forwarded-Port": ["443"],
       "X-Forwarded-Proto": ["https"]
   },
+  "queryStringParameters": {
+    "userId": "user123",
+    "token": "abc.def.ghi"
+  },
+  "multiValueQueryStringParameters": {
+    "userId": ["123"],
+    "token": ["abc.def.ghi"],
+    "filter": ["new", "unread"]
+  },
   "requestContext": {
       "routeKey": "$connect",
       "eventType": "CONNECT",
diff --git a/tests/events/apiGatewayWebSocketApiDisconnect.json b/tests/events/apiGatewayWebSocketApiDisconnect.json
index f4624562e..4c72f4414 100644
--- a/tests/events/apiGatewayWebSocketApiDisconnect.json
+++ b/tests/events/apiGatewayWebSocketApiDisconnect.json
@@ -11,6 +11,15 @@
         "X-Forwarded-For": [""],
         "x-restapi": [""]
     },
+    "queryStringParameters": {
+        "userId": "user123",
+        "token": "abc.def.ghi"
+    },
+    "multiValueQueryStringParameters": {
+    "userId": ["123"],
+    "token": ["abc.def.ghi"],
+    "filter": ["new", "unread"]
+    },
     "requestContext": {
         "routeKey": "$disconnect",
         "disconnectStatusCode": 1005,
diff --git a/tests/unit/data_classes/required_dependencies/test_api_gateway_websocket_event.py b/tests/unit/data_classes/required_dependencies/test_api_gateway_websocket_event.py
index faee5b172..e06c72b8d 100644
--- a/tests/unit/data_classes/required_dependencies/test_api_gateway_websocket_event.py
+++ b/tests/unit/data_classes/required_dependencies/test_api_gateway_websocket_event.py
@@ -14,6 +14,8 @@ def test_connect_api_gateway_websocket_event():
     assert parsed_event.json_body is None
     assert parsed_event.headers == raw_event["headers"]
     assert parsed_event.multi_value_headers == raw_event["multiValueHeaders"]
+    assert parsed_event.query_string_parameters == raw_event["queryStringParameters"]
+    assert parsed_event.multi_value_query_string_parameters == raw_event["multiValueQueryStringParameters"]
 
     request_context = parsed_event.request_context
     request_context_raw = raw_event["requestContext"]
@@ -84,6 +86,8 @@ def test_message_api_gateway_websocket_event():
     assert parsed_event.json_body == json.loads(raw_event["body"])
     assert parsed_event.headers == {}
     assert parsed_event.multi_value_headers == {}
+    assert parsed_event.query_string_parameters == {}
+    assert parsed_event.multi_value_query_string_parameters == {}
 
     request_context = parsed_event.request_context
     request_context_raw = raw_event["requestContext"]