24
24
25
25
26
26
class OAuth2Authorizer (BaseModel ):
27
- AuthorizationScopes : Optional [ List [ str ]] = oauth2authorizer ("AuthorizationScopes" )
28
- IdentitySource : Optional [ str ] = oauth2authorizer ("IdentitySource" )
29
- JwtConfiguration : Optional [ PassThroughProp ] = oauth2authorizer ("JwtConfiguration" )
27
+ AuthorizationScopes : list [ str ] | None = oauth2authorizer ("AuthorizationScopes" )
28
+ IdentitySource : str | None = oauth2authorizer ("IdentitySource" )
29
+ JwtConfiguration : PassThroughProp | None = oauth2authorizer ("JwtConfiguration" )
30
30
31
31
32
32
class LambdaAuthorizerIdentity (BaseModel ):
33
- Context : Optional [ List [ str ]] = lambdauthorizeridentity ("Context" )
34
- Headers : Optional [ List [ str ]] = lambdauthorizeridentity ("Headers" )
35
- QueryStrings : Optional [ List [ str ]] = lambdauthorizeridentity ("QueryStrings" )
36
- ReauthorizeEvery : Optional [ int ] = lambdauthorizeridentity ("ReauthorizeEvery" )
37
- StageVariables : Optional [ List [ str ]] = lambdauthorizeridentity ("StageVariables" )
33
+ Context : list [ str ] | None = lambdauthorizeridentity ("Context" )
34
+ Headers : list [ str ] | None = lambdauthorizeridentity ("Headers" )
35
+ QueryStrings : list [ str ] | None = lambdauthorizeridentity ("QueryStrings" )
36
+ ReauthorizeEvery : int | None = lambdauthorizeridentity ("ReauthorizeEvery" )
37
+ StageVariables : list [ str ] | None = lambdauthorizeridentity ("StageVariables" )
38
38
39
39
40
40
class LambdaAuthorizer (BaseModel ):
41
41
# TODO: Many tests use floats for the version string; docs only mention string
42
- AuthorizerPayloadFormatVersion : Union [ Literal ["1.0" , "2.0" ], float ] = lambdaauthorizer (
42
+ AuthorizerPayloadFormatVersion : Literal ["1.0" , "2.0" ] | float = lambdaauthorizer (
43
43
"AuthorizerPayloadFormatVersion"
44
44
)
45
- EnableSimpleResponses : Optional [ bool ] = lambdaauthorizer ("EnableSimpleResponses" )
45
+ EnableSimpleResponses : bool | None = lambdaauthorizer ("EnableSimpleResponses" )
46
46
FunctionArn : SamIntrinsicable [str ] = lambdaauthorizer ("FunctionArn" )
47
- FunctionInvokeRole : Optional [ SamIntrinsicable [str ]] = lambdaauthorizer ("FunctionInvokeRole" )
48
- EnableFunctionDefaultPermissions : Optional [ bool ] # TODO: add docs
49
- Identity : Optional [ LambdaAuthorizerIdentity ] = lambdaauthorizer ("Identity" )
47
+ FunctionInvokeRole : SamIntrinsicable [str ] | None = lambdaauthorizer ("FunctionInvokeRole" )
48
+ EnableFunctionDefaultPermissions : bool | None # TODO: add docs
49
+ Identity : LambdaAuthorizerIdentity | None = lambdaauthorizer ("Identity" )
50
50
51
51
52
52
class Auth (BaseModel ):
53
53
# TODO: Docs doesn't say it's a map
54
- Authorizers : Optional [
55
- Dict [
54
+ Authorizers : None | (
55
+ dict [
56
56
str ,
57
- Union [
58
- OAuth2Authorizer ,
59
- LambdaAuthorizer ,
60
- ] ,
57
+ (
58
+ OAuth2Authorizer |
59
+ LambdaAuthorizer
60
+ ) ,
61
61
]
62
- ] = auth ("Authorizers" )
63
- DefaultAuthorizer : Optional [ str ] = auth ("DefaultAuthorizer" )
64
- EnableIamAuthorizer : Optional [ bool ] = auth ("EnableIamAuthorizer" )
62
+ ) = auth ("Authorizers" )
63
+ DefaultAuthorizer : str | None = auth ("DefaultAuthorizer" )
64
+ EnableIamAuthorizer : bool | None = auth ("EnableIamAuthorizer" )
65
65
66
66
67
67
class CorsConfiguration (BaseModel ):
68
- AllowCredentials : Optional [ bool ] = corsconfiguration ("AllowCredentials" )
69
- AllowHeaders : Optional [ List [ str ]] = corsconfiguration ("AllowHeaders" )
70
- AllowMethods : Optional [ List [ str ]] = corsconfiguration ("AllowMethods" )
71
- AllowOrigins : Optional [ List [ str ]] = corsconfiguration ("AllowOrigins" )
72
- ExposeHeaders : Optional [ List [ str ]] = corsconfiguration ("ExposeHeaders" )
73
- MaxAge : Optional [ int ] = corsconfiguration ("MaxAge" )
68
+ AllowCredentials : bool | None = corsconfiguration ("AllowCredentials" )
69
+ AllowHeaders : list [ str ] | None = corsconfiguration ("AllowHeaders" )
70
+ AllowMethods : list [ str ] | None = corsconfiguration ("AllowMethods" )
71
+ AllowOrigins : list [ str ] | None = corsconfiguration ("AllowOrigins" )
72
+ ExposeHeaders : list [ str ] | None = corsconfiguration ("ExposeHeaders" )
73
+ MaxAge : int | None = corsconfiguration ("MaxAge" )
74
74
75
75
76
76
class DefinitionUri (BaseModel ):
77
77
Bucket : str = definitionuri ("Bucket" )
78
78
Key : str = definitionuri ("Key" )
79
- Version : Optional [ str ] = definitionuri ("Version" )
79
+ Version : str | None = definitionuri ("Version" )
80
80
81
81
82
82
class Route53 (BaseModel ):
83
- DistributionDomainName : Optional [ PassThroughProp ] = route53 ("DistributionDomainName" )
84
- EvaluateTargetHealth : Optional [ PassThroughProp ] = route53 ("EvaluateTargetHealth" )
85
- HostedZoneId : Optional [ PassThroughProp ] = route53 ("HostedZoneId" )
86
- HostedZoneName : Optional [ PassThroughProp ] = route53 ("HostedZoneName" )
87
- IpV6 : Optional [ bool ] = route53 ("IpV6" )
88
- SetIdentifier : Optional [ PassThroughProp ] # TODO: add docs
89
- Region : Optional [ PassThroughProp ] # TODO: add docs
83
+ DistributionDomainName : PassThroughProp | None = route53 ("DistributionDomainName" )
84
+ EvaluateTargetHealth : PassThroughProp | None = route53 ("EvaluateTargetHealth" )
85
+ HostedZoneId : PassThroughProp | None = route53 ("HostedZoneId" )
86
+ HostedZoneName : PassThroughProp | None = route53 ("HostedZoneName" )
87
+ IpV6 : bool | None = route53 ("IpV6" )
88
+ SetIdentifier : PassThroughProp | None # TODO: add docs
89
+ Region : PassThroughProp | None # TODO: add docs
90
90
91
91
92
92
class Domain (BaseModel ):
93
- BasePath : Optional [ List [ str ]] = domain ("BasePath" )
93
+ BasePath : list [ str ] | None = domain ("BasePath" )
94
94
CertificateArn : PassThroughProp = domain ("CertificateArn" )
95
95
DomainName : PassThroughProp = domain ("DomainName" )
96
- EndpointConfiguration : Optional [ SamIntrinsicable [Literal ["REGIONAL" ]]] = domain ("EndpointConfiguration" )
97
- MutualTlsAuthentication : Optional [ PassThroughProp ] = domain ("MutualTlsAuthentication" )
98
- OwnershipVerificationCertificateArn : Optional [ PassThroughProp ] = domain ("OwnershipVerificationCertificateArn" )
99
- Route53 : Optional [ Route53 ] = domain ("Route53" )
100
- SecurityPolicy : Optional [ PassThroughProp ] = domain ("SecurityPolicy" )
96
+ EndpointConfiguration : SamIntrinsicable [Literal ["REGIONAL" ]] | None = domain ("EndpointConfiguration" )
97
+ MutualTlsAuthentication : PassThroughProp | None = domain ("MutualTlsAuthentication" )
98
+ OwnershipVerificationCertificateArn : PassThroughProp | None = domain ("OwnershipVerificationCertificateArn" )
99
+ Route53 : Route53 | None = domain ("Route53" )
100
+ SecurityPolicy : PassThroughProp | None = domain ("SecurityPolicy" )
101
101
102
102
103
103
AccessLogSettings = Optional [PassThroughProp ]
@@ -110,39 +110,39 @@ class Domain(BaseModel):
110
110
111
111
112
112
class Properties (BaseModel ):
113
- AccessLogSettings : Optional [ AccessLogSettings ] = properties ("AccessLogSettings" )
114
- Auth : Optional [ Auth ] = properties ("Auth" )
113
+ AccessLogSettings : AccessLogSettings | None = properties ("AccessLogSettings" )
114
+ Auth : Auth | None = properties ("Auth" )
115
115
# TODO: Also string like in the docs?
116
- CorsConfiguration : Optional [ CorsConfigurationType ] = properties ("CorsConfiguration" )
117
- DefaultRouteSettings : Optional [ DefaultRouteSettings ] = properties ("DefaultRouteSettings" )
118
- DefinitionBody : Optional [ DictStrAny ] = properties ("DefinitionBody" )
119
- DefinitionUri : Optional [ Union [ str , DefinitionUri ]] = properties ("DefinitionUri" )
120
- Description : Optional [ str ] = properties ("Description" )
121
- DisableExecuteApiEndpoint : Optional [ PassThroughProp ] = properties ("DisableExecuteApiEndpoint" )
122
- Domain : Optional [ Domain ] = properties ("Domain" )
123
- FailOnWarnings : Optional [ FailOnWarnings ] = properties ("FailOnWarnings" )
124
- RouteSettings : Optional [ RouteSettings ] = properties ("RouteSettings" )
125
- StageName : Optional [ PassThroughProp ] = properties ("StageName" )
126
- StageVariables : Optional [ StageVariables ] = properties ("StageVariables" )
127
- Tags : Optional [ Tags ] = properties ("Tags" )
128
- PropagateTags : Optional [ bool ] # TODO: add docs
129
- Name : Optional [ PassThroughProp ] = properties ("Name" )
116
+ CorsConfiguration : CorsConfigurationType | None = properties ("CorsConfiguration" )
117
+ DefaultRouteSettings : DefaultRouteSettings | None = properties ("DefaultRouteSettings" )
118
+ DefinitionBody : DictStrAny | None = properties ("DefinitionBody" )
119
+ DefinitionUri : str | DefinitionUri | None = properties ("DefinitionUri" )
120
+ Description : str | None = properties ("Description" )
121
+ DisableExecuteApiEndpoint : PassThroughProp | None = properties ("DisableExecuteApiEndpoint" )
122
+ Domain : Domain | None = properties ("Domain" )
123
+ FailOnWarnings : FailOnWarnings | None = properties ("FailOnWarnings" )
124
+ RouteSettings : RouteSettings | None = properties ("RouteSettings" )
125
+ StageName : PassThroughProp | None = properties ("StageName" )
126
+ StageVariables : StageVariables | None = properties ("StageVariables" )
127
+ Tags : Tags | None = properties ("Tags" )
128
+ PropagateTags : bool | None # TODO: add docs
129
+ Name : PassThroughProp | None = properties ("Name" )
130
130
131
131
132
132
class Globals (BaseModel ):
133
- Auth : Optional [ Auth ] = properties ("Auth" )
134
- AccessLogSettings : Optional [ AccessLogSettings ] = properties ("AccessLogSettings" )
135
- StageVariables : Optional [ StageVariables ] = properties ("StageVariables" )
136
- Tags : Optional [ Tags ] = properties ("Tags" )
137
- RouteSettings : Optional [ RouteSettings ] = properties ("RouteSettings" )
138
- FailOnWarnings : Optional [ FailOnWarnings ] = properties ("FailOnWarnings" )
139
- Domain : Optional [ Domain ] = properties ("Domain" )
140
- CorsConfiguration : Optional [ CorsConfigurationType ] = properties ("CorsConfiguration" )
141
- DefaultRouteSettings : Optional [ DefaultRouteSettings ] = properties ("DefaultRouteSettings" )
142
- PropagateTags : Optional [ bool ] # TODO: add docs
133
+ Auth : Auth | None = properties ("Auth" )
134
+ AccessLogSettings : AccessLogSettings | None = properties ("AccessLogSettings" )
135
+ StageVariables : StageVariables | None = properties ("StageVariables" )
136
+ Tags : Tags | None = properties ("Tags" )
137
+ RouteSettings : RouteSettings | None = properties ("RouteSettings" )
138
+ FailOnWarnings : FailOnWarnings | None = properties ("FailOnWarnings" )
139
+ Domain : Domain | None = properties ("Domain" )
140
+ CorsConfiguration : CorsConfigurationType | None = properties ("CorsConfiguration" )
141
+ DefaultRouteSettings : DefaultRouteSettings | None = properties ("DefaultRouteSettings" )
142
+ PropagateTags : bool | None # TODO: add docs
143
143
144
144
145
145
class Resource (ResourceAttributes ):
146
146
Type : Literal ["AWS::Serverless::HttpApi" ]
147
- Properties : Optional [ Properties ]
148
- Connectors : Optional [ Dict [ str , EmbeddedConnector ]]
147
+ Properties : Properties | None
148
+ Connectors : dict [ str , EmbeddedConnector ] | None
0 commit comments