Skip to content

Commit 5dad4fd

Browse files
committed
switch from HashMap to serde_json::Map
Signed-off-by: Craig Disselkoen <[email protected]>
1 parent 52db8a0 commit 5dad4fd

File tree

70 files changed

+394
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+394
-482
lines changed

lambda-events/src/event/activemq/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct ActiveMqEvent {
1818
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
1919
#[cfg(feature = "catch-all-fields")]
2020
#[serde(flatten)]
21-
pub other: HashMap<String, Value>,
21+
pub other: serde_json::Map<String, Value>,
2222
}
2323

2424
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
@@ -54,7 +54,7 @@ pub struct ActiveMqMessage {
5454
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
5555
#[cfg(feature = "catch-all-fields")]
5656
#[serde(flatten)]
57-
pub other: HashMap<String, Value>,
57+
pub other: serde_json::Map<String, Value>,
5858
}
5959

6060
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
@@ -67,7 +67,7 @@ pub struct ActiveMqDestination {
6767
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
6868
#[cfg(feature = "catch-all-fields")]
6969
#[serde(flatten)]
70-
pub other: HashMap<String, Value>,
70+
pub other: serde_json::Map<String, Value>,
7171
}
7272

7373
#[cfg(test)]

lambda-events/src/event/alb/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use query_map::QueryMap;
99
use serde::{Deserialize, Serialize};
1010
#[cfg(feature = "catch-all-fields")]
1111
use serde_json::Value;
12-
#[cfg(feature = "catch-all-fields")]
13-
use std::collections::HashMap;
1412

1513
/// `AlbTargetGroupRequest` contains data originating from the ALB Lambda target group integration
1614
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
@@ -39,7 +37,7 @@ pub struct AlbTargetGroupRequest {
3937
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
4038
#[cfg(feature = "catch-all-fields")]
4139
#[serde(flatten)]
42-
pub other: HashMap<String, Value>,
40+
pub other: serde_json::Map<String, Value>,
4341
}
4442

4543
/// `AlbTargetGroupRequestContext` contains the information to identify the load balancer invoking the lambda
@@ -52,7 +50,7 @@ pub struct AlbTargetGroupRequestContext {
5250
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
5351
#[cfg(feature = "catch-all-fields")]
5452
#[serde(flatten)]
55-
pub other: HashMap<String, Value>,
53+
pub other: serde_json::Map<String, Value>,
5654
}
5755

5856
/// `ElbContext` contains the information to identify the ARN invoking the lambda
@@ -67,7 +65,7 @@ pub struct ElbContext {
6765
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
6866
#[cfg(feature = "catch-all-fields")]
6967
#[serde(flatten)]
70-
pub other: HashMap<String, Value>,
68+
pub other: serde_json::Map<String, Value>,
7169
}
7270

7371
/// `AlbTargetGroupResponse` configures the response to be returned by the ALB Lambda target group for the request
@@ -92,7 +90,7 @@ pub struct AlbTargetGroupResponse {
9290
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
9391
#[cfg(feature = "catch-all-fields")]
9492
#[serde(flatten)]
95-
pub other: HashMap<String, Value>,
93+
pub other: serde_json::Map<String, Value>,
9694
}
9795

9896
#[cfg(test)]

lambda-events/src/event/apigw/mod.rs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub struct ApiGatewayProxyRequest {
5252
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
5353
#[cfg(feature = "catch-all-fields")]
5454
#[serde(flatten)]
55-
pub other: HashMap<String, Value>,
55+
pub other: serde_json::Map<String, Value>,
5656
}
5757

5858
/// `ApiGatewayProxyResponse` configures the response to be returned by API Gateway for the request
@@ -75,7 +75,7 @@ pub struct ApiGatewayProxyResponse {
7575
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
7676
#[cfg(feature = "catch-all-fields")]
7777
#[serde(flatten)]
78-
pub other: HashMap<String, Value>,
78+
pub other: serde_json::Map<String, Value>,
7979
}
8080

8181
/// `ApiGatewayProxyRequestContext` contains the information to identify the AWS account and resources invoking the
@@ -127,7 +127,7 @@ pub struct ApiGatewayProxyRequestContext {
127127
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
128128
#[cfg(feature = "catch-all-fields")]
129129
#[serde(flatten)]
130-
pub other: HashMap<String, Value>,
130+
pub other: serde_json::Map<String, Value>,
131131
}
132132

133133
/// `ApiGatewayV2httpRequest` contains data coming from the new HTTP API Gateway
@@ -183,7 +183,7 @@ pub struct ApiGatewayV2httpRequest {
183183
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
184184
#[cfg(feature = "catch-all-fields")]
185185
#[serde(flatten)]
186-
pub other: HashMap<String, Value>,
186+
pub other: serde_json::Map<String, Value>,
187187
}
188188

189189
/// `ApiGatewayV2httpRequestContext` contains the information to identify the AWS account and resources invoking the Lambda function.
@@ -221,7 +221,7 @@ pub struct ApiGatewayV2httpRequestContext {
221221
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
222222
#[cfg(feature = "catch-all-fields")]
223223
#[serde(flatten)]
224-
pub other: HashMap<String, Value>,
224+
pub other: serde_json::Map<String, Value>,
225225
}
226226

227227
/// `ApiGatewayRequestAuthorizer` contains authorizer information for the request context.
@@ -244,7 +244,7 @@ pub struct ApiGatewayRequestAuthorizer {
244244
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
245245
#[cfg(feature = "catch-all-fields")]
246246
#[serde(flatten)]
247-
pub other: HashMap<String, Value>,
247+
pub other: serde_json::Map<String, Value>,
248248
}
249249

250250
/// `ApiGatewayRequestAuthorizerJwtDescription` contains JWT authorizer information for the request context.
@@ -261,7 +261,7 @@ pub struct ApiGatewayRequestAuthorizerJwtDescription {
261261
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
262262
#[cfg(feature = "catch-all-fields")]
263263
#[serde(flatten)]
264-
pub other: HashMap<String, Value>,
264+
pub other: serde_json::Map<String, Value>,
265265
}
266266

267267
/// `ApiGatewayRequestAuthorizerIamDescription` contains IAM information for the request context.
@@ -287,7 +287,7 @@ pub struct ApiGatewayRequestAuthorizerIamDescription {
287287
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
288288
#[cfg(feature = "catch-all-fields")]
289289
#[serde(flatten)]
290-
pub other: HashMap<String, Value>,
290+
pub other: serde_json::Map<String, Value>,
291291
}
292292

293293
/// `ApiGatewayRequestAuthorizerCognitoIdentity` contains Cognito identity information for the request context.
@@ -304,7 +304,7 @@ pub struct ApiGatewayRequestAuthorizerCognitoIdentity {
304304
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
305305
#[cfg(feature = "catch-all-fields")]
306306
#[serde(flatten)]
307-
pub other: HashMap<String, Value>,
307+
pub other: serde_json::Map<String, Value>,
308308
}
309309

310310
/// `ApiGatewayV2httpRequestContextHttpDescription` contains HTTP information for the request context.
@@ -326,7 +326,7 @@ pub struct ApiGatewayV2httpRequestContextHttpDescription {
326326
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
327327
#[cfg(feature = "catch-all-fields")]
328328
#[serde(flatten)]
329-
pub other: HashMap<String, Value>,
329+
pub other: serde_json::Map<String, Value>,
330330
}
331331

332332
/// `ApiGatewayV2httpResponse` configures the response to be returned by API Gateway V2 for the request
@@ -350,7 +350,7 @@ pub struct ApiGatewayV2httpResponse {
350350
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
351351
#[cfg(feature = "catch-all-fields")]
352352
#[serde(flatten)]
353-
pub other: HashMap<String, Value>,
353+
pub other: serde_json::Map<String, Value>,
354354
}
355355

356356
/// `ApiGatewayRequestIdentity` contains identity information for the request caller.
@@ -389,7 +389,7 @@ pub struct ApiGatewayRequestIdentity {
389389
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
390390
#[cfg(feature = "catch-all-fields")]
391391
#[serde(flatten)]
392-
pub other: HashMap<String, Value>,
392+
pub other: serde_json::Map<String, Value>,
393393
}
394394

395395
/// `ApiGatewayWebsocketProxyRequest` contains data coming from the API Gateway proxy
@@ -434,7 +434,7 @@ pub struct ApiGatewayWebsocketProxyRequest {
434434
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
435435
#[cfg(feature = "catch-all-fields")]
436436
#[serde(flatten)]
437-
pub other: HashMap<String, Value>,
437+
pub other: serde_json::Map<String, Value>,
438438
}
439439

440440
/// `ApiGatewayWebsocketProxyRequestContext` contains the information to identify
@@ -504,7 +504,7 @@ pub struct ApiGatewayWebsocketProxyRequestContext {
504504
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
505505
#[cfg(feature = "catch-all-fields")]
506506
#[serde(flatten)]
507-
pub other: HashMap<String, Value>,
507+
pub other: serde_json::Map<String, Value>,
508508
}
509509

510510
/// `ApiGatewayCustomAuthorizerRequestTypeRequestIdentity` contains identity information for the request caller including certificate information if using mTLS.
@@ -524,7 +524,7 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentity {
524524
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
525525
#[cfg(feature = "catch-all-fields")]
526526
#[serde(flatten)]
527-
pub other: HashMap<String, Value>,
527+
pub other: serde_json::Map<String, Value>,
528528
}
529529

530530
/// `ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert` contains certificate information for the request caller if using mTLS.
@@ -547,7 +547,7 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert {
547547
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
548548
#[cfg(feature = "catch-all-fields")]
549549
#[serde(flatten)]
550-
pub other: HashMap<String, Value>,
550+
pub other: serde_json::Map<String, Value>,
551551
}
552552

553553
/// `ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidity` contains certificate validity information for the request caller if using mTLS.
@@ -563,7 +563,7 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestIdentityClientCertValidit
563563
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
564564
#[cfg(feature = "catch-all-fields")]
565565
#[serde(flatten)]
566-
pub other: HashMap<String, Value>,
566+
pub other: serde_json::Map<String, Value>,
567567
}
568568

569569
/// `ApiGatewayV2httpRequestContextAuthentication` contains authentication context information for the request caller including client certificate information if using mTLS.
@@ -577,7 +577,7 @@ pub struct ApiGatewayV2httpRequestContextAuthentication {
577577
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
578578
#[cfg(feature = "catch-all-fields")]
579579
#[serde(flatten)]
580-
pub other: HashMap<String, Value>,
580+
pub other: serde_json::Map<String, Value>,
581581
}
582582

583583
/// `ApiGatewayV2httpRequestContextAuthenticationClientCert` contains client certificate information for the request caller if using mTLS.
@@ -600,7 +600,7 @@ pub struct ApiGatewayV2httpRequestContextAuthenticationClientCert {
600600
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
601601
#[cfg(feature = "catch-all-fields")]
602602
#[serde(flatten)]
603-
pub other: HashMap<String, Value>,
603+
pub other: serde_json::Map<String, Value>,
604604
}
605605

606606
/// `ApiGatewayV2httpRequestContextAuthenticationClientCertValidity` contains client certificate validity information for the request caller if using mTLS.
@@ -616,7 +616,7 @@ pub struct ApiGatewayV2httpRequestContextAuthenticationClientCertValidity {
616616
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
617617
#[cfg(feature = "catch-all-fields")]
618618
#[serde(flatten)]
619-
pub other: HashMap<String, Value>,
619+
pub other: serde_json::Map<String, Value>,
620620
}
621621

622622
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
@@ -645,7 +645,7 @@ pub struct ApiGatewayV2CustomAuthorizerV1RequestTypeRequestContext {
645645
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
646646
#[cfg(feature = "catch-all-fields")]
647647
#[serde(flatten)]
648-
pub other: HashMap<String, Value>,
648+
pub other: serde_json::Map<String, Value>,
649649
}
650650

651651
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
@@ -686,7 +686,7 @@ pub struct ApiGatewayV2CustomAuthorizerV1Request {
686686
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
687687
#[cfg(feature = "catch-all-fields")]
688688
#[serde(flatten)]
689-
pub other: HashMap<String, Value>,
689+
pub other: serde_json::Map<String, Value>,
690690
}
691691

692692
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
@@ -727,7 +727,7 @@ pub struct ApiGatewayV2CustomAuthorizerV2Request {
727727
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
728728
#[cfg(feature = "catch-all-fields")]
729729
#[serde(flatten)]
730-
pub other: HashMap<String, Value>,
730+
pub other: serde_json::Map<String, Value>,
731731
}
732732

733733
/// `ApiGatewayCustomAuthorizerContext` represents the expected format of an API Gateway custom authorizer response.
@@ -745,7 +745,7 @@ pub struct ApiGatewayCustomAuthorizerContext {
745745
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
746746
#[cfg(feature = "catch-all-fields")]
747747
#[serde(flatten)]
748-
pub other: HashMap<String, Value>,
748+
pub other: serde_json::Map<String, Value>,
749749
}
750750

751751
/// `ApiGatewayCustomAuthorizerRequestTypeRequestContext` represents the expected format of an API Gateway custom authorizer response.
@@ -779,7 +779,7 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequestContext {
779779
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
780780
#[cfg(feature = "catch-all-fields")]
781781
#[serde(flatten)]
782-
pub other: HashMap<String, Value>,
782+
pub other: serde_json::Map<String, Value>,
783783
}
784784

785785
/// `ApiGatewayCustomAuthorizerRequest` contains data coming in to a custom API Gateway authorizer function.
@@ -798,7 +798,7 @@ pub struct ApiGatewayCustomAuthorizerRequest {
798798
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
799799
#[cfg(feature = "catch-all-fields")]
800800
#[serde(flatten)]
801-
pub other: HashMap<String, Value>,
801+
pub other: serde_json::Map<String, Value>,
802802
}
803803

804804
/// `ApiGatewayCustomAuthorizerRequestTypeRequest` contains data coming in to a custom API Gateway authorizer function.
@@ -841,7 +841,7 @@ pub struct ApiGatewayCustomAuthorizerRequestTypeRequest {
841841
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
842842
#[cfg(feature = "catch-all-fields")]
843843
#[serde(flatten)]
844-
pub other: HashMap<String, Value>,
844+
pub other: serde_json::Map<String, Value>,
845845
}
846846

847847
/// `ApiGatewayCustomAuthorizerResponse` represents the expected format of an API Gateway authorization response.
@@ -863,7 +863,7 @@ where
863863
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
864864
#[cfg(feature = "catch-all-fields")]
865865
#[serde(flatten)]
866-
pub other: HashMap<String, Value>,
866+
pub other: serde_json::Map<String, Value>,
867867
}
868868

869869
/// `ApiGatewayV2CustomAuthorizerSimpleResponse` represents the simple format of an API Gateway V2 authorization response.
@@ -882,7 +882,7 @@ where
882882
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
883883
#[cfg(feature = "catch-all-fields")]
884884
#[serde(flatten)]
885-
pub other: HashMap<String, Value>,
885+
pub other: serde_json::Map<String, Value>,
886886
}
887887

888888
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
@@ -902,7 +902,7 @@ where
902902
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
903903
#[cfg(feature = "catch-all-fields")]
904904
#[serde(flatten)]
905-
pub other: HashMap<String, Value>,
905+
pub other: serde_json::Map<String, Value>,
906906
}
907907

908908
/// `ApiGatewayCustomAuthorizerPolicy` represents an IAM policy
@@ -917,7 +917,7 @@ pub struct ApiGatewayCustomAuthorizerPolicy {
917917
/// If `catch-all-fields` is disabled, any additional fields that are present will be ignored.
918918
#[cfg(feature = "catch-all-fields")]
919919
#[serde(flatten)]
920-
pub other: HashMap<String, Value>,
920+
pub other: serde_json::Map<String, Value>,
921921
}
922922

923923
fn default_http_method() -> Method {

0 commit comments

Comments
 (0)