Skip to content

Commit c01ef50

Browse files
committed
refactor(parser): Improve Transfer Family models with examples and descriptions
Enhances the Transfer Family parser models with field descriptions and examples using Pydantic's Field() functionality. This improvement provides better documentation and metadata for Transfer Family event parsing, following the pattern established in PR #7100. All field descriptions are based on official AWS Transfer Family Lambda authorizer documentation and include realistic examples from actual test events. Closes #7119
1 parent f21fcb7 commit c01ef50

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

aws_lambda_powertools/utilities/parser/models/transfer_family.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,28 @@
55

66

77
class TransferFamilyAuthorizer(BaseModel):
8-
username: str
9-
password: Optional[str] = None
10-
protocol: Literal["SFTP", "FTP", "FTPS"]
11-
server_id: str = Field(..., alias="serverId")
12-
source_ip: IPvAnyAddress = Field(..., alias="sourceIp")
8+
username: str = Field(
9+
description="The username of the user attempting to authenticate.",
10+
examples=["bobusa", "john.doe", "sftp-user-123", "data-transfer-user"],
11+
)
12+
password: Optional[str] = Field(
13+
default=None,
14+
description="The password for authentication.",
15+
examples=["mysecretpassword", "Password1234", "secure-pass", None],
16+
)
17+
protocol: Literal["SFTP", "FTP", "FTPS"] = Field(
18+
description="The protocol used for the connection.",
19+
examples=["SFTP", "FTPS", "FTP"],
20+
)
21+
server_id: str = Field(
22+
...,
23+
alias="serverId",
24+
description="The server ID of the Transfer Family server.",
25+
examples=["s-abcd123456", "s-1234567890abcdef0", "s-example123"],
26+
)
27+
source_ip: IPvAnyAddress = Field(
28+
...,
29+
alias="sourceIp",
30+
description="The IP address of the client connecting to the Transfer Family server.",
31+
examples=["192.168.0.100", "10.0.0.50", "127.0.0.1", "203.0.113.12"],
32+
)

0 commit comments

Comments
 (0)