Skip to content

Commit e8a18db

Browse files
author
Joris Conijn
committed
docs: describe the typing utility
1 parent 2fe2e8a commit e8a18db

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

docs/content/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Utility | Description
6666
[Metrics](./core/metrics) | Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)
6767
[Bring your own middleware](.//utilities/middleware_factory) | Decorator factory to create your own middleware to run logic before, and after each Lambda invocation
6868
[Parameters utility](./utilities/parameters) | Retrieve parameter values from AWS Systems Manager Parameter Store, AWS Secrets Manager, or Amazon DynamoDB, and cache them for a specific amount of time
69+
[Typing utility](./utilities/typing) | Static typing classes to speedup development in your IDE
6970

7071
## Environment variables
7172

176 KB
Loading

docs/content/utilities/typing.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Typing
3+
description: Utility
4+
---
5+
6+
import Note from "../../src/components/Note"
7+
8+
This typing utility provides static typing classes that can be used to ease the development by providing the IDE type hints.
9+
10+
![Utilities Typing](../media/utilities_typing.png)
11+
12+
## LambdaEvent and LambdaContext
13+
14+
The `LambdaEvent` and the `LambdaContext` typings are typically used in the handler method for the Lambda function.
15+
16+
```python:title=index.py
17+
from aws_lambda_powertools.utilities.typing import LambdaEvent, LambdaContext
18+
19+
# highlight-start
20+
def handler(event: LambdaEvent, context: LambdaContext) -> LambdaEvent:
21+
# highlight-end
22+
# Insert business logic
23+
return event
24+
```

docs/gatsby-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = {
3232
'Utilities': [
3333
'utilities/middleware_factory',
3434
'utilities/parameters',
35+
'utilities/typing',
3536
],
3637
},
3738
navConfig: {

0 commit comments

Comments
 (0)