forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPIGatewayHttpApiV2ProxyRequest.cs
198 lines (166 loc) · 6.09 KB
/
APIGatewayHttpApiV2ProxyRequest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
using System;
using System.Collections.Generic;
using System.Text;
namespace Amazon.Lambda.APIGatewayEvents
{
/// <summary>
/// For request using using API Gateway HTTP API version 2 payload proxy format
/// https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
/// </summary>
public class APIGatewayHttpApiV2ProxyRequest
{
/// <summary>
/// The payload format version
/// </summary>
public string Version { get; set; }
/// <summary>
/// The route key
/// </summary>
public string RouteKey { get; set; }
/// <summary>
/// The raw path
/// </summary>
public string RawPath { get; set; }
/// <summary>
/// The raw query string
/// </summary>
public string RawQueryString { get; set; }
/// <summary>
/// Cookies sent along with the request
/// </summary>
public string[] Cookies { get; set; }
/// <summary>
/// Headers sent with the request. Multiple values for the same header will be separated by a comma.
/// </summary>
public IDictionary<string, string> Headers { get; set; }
/// <summary>
/// Query string parameters sent with the request. Multiple values for the same parameter will be separated by a comma.
/// </summary>
public IDictionary<string, string> QueryStringParameters { get; set; }
/// <summary>
/// The request context for the request
/// </summary>
public ProxyRequestContext RequestContext { get; set; }
/// <summary>
/// The HTTP request body.
/// </summary>
public string Body { get; set; }
/// <summary>
/// Path parameters sent with the request.
/// </summary>
public IDictionary<string, string> PathParameters { get; set; }
/// <summary>
/// True if the body of the request is base 64 encoded.
/// </summary>
public bool IsBase64Encoded { get; set; }
/// <summary>
/// The stage variables defined for the stage in API Gateway
/// </summary>
public IDictionary<string, string> StageVariables { get; set; }
/// <summary>
/// The ProxyRequestContext contains the information to identify the AWS account and resources invoking the
/// Lambda function.
/// </summary>
public class ProxyRequestContext
{
/// <summary>
/// The account id that owns the executing Lambda function
/// </summary>
public string AccountId { get; set; }
/// <summary>
/// The API Gateway rest API Id.
/// </summary>
public string ApiId { get; set; }
/// <summary>
/// Information about the current requesters authorization including claims and scopes.
/// </summary>
public AuthorizerDescription Authorizer { get; set; }
/// <summary>
/// The domin name.
/// </summary>
public string DomainName { get; set; }
/// <summary>
/// The domain prefix
/// </summary>
public string DomainPrefix { get; set; }
/// <summary>
/// Information about the HTTP request like the method and path.
/// </summary>
public HttpDescription Http {get;set;}
/// <summary>
/// The unique request id
/// </summary>
public string RequestId { get; set; }
/// <summary>
/// The route id
/// </summary>
public string RouteId { get; set; }
/// <summary>
/// The selected route key.
/// </summary>
public string RouteKey { get; set; }
/// <summary>
/// The API Gateway stage name
/// </summary>
public string Stage { get; set; }
/// <summary>
/// Gets and sets the request time.
/// </summary>
public string Time { get; set; }
/// <summary>
/// Gets and sets the request time as an epoch.
/// </summary>
public long TimeEpoch { get; set; }
}
/// <summary>
/// Information about the HTTP elements for the request.
/// </summary>
public class HttpDescription
{
/// <summary>
/// The HTTP method like POST or GET.
/// </summary>
public string Method { get; set; }
/// <summary>
/// The path of the request.
/// </summary>
public string Path { get; set; }
/// <summary>
/// The protocal used ot make the rquest
/// </summary>
public string Protocol { get; set; }
/// <summary>
/// The source ip for the request.
/// </summary>
public string SourceIp { get; set; }
/// <summary>
/// The user agent for the request.
/// </summary>
public string UserAgent { get; set; }
}
/// <summary>
/// Information about the current requesters authorization.
/// </summary>
public class AuthorizerDescription
{
/// <summary>
/// The JWT description including claims and scopes.
/// </summary>
public JwtDescription Jwt { get; set; }
/// <summary>
/// Describes the information in the JWT token
/// </summary>
public class JwtDescription
{
/// <summary>
/// Map of the claims for the requester.
/// </summary>
public IDictionary<string, string> Claims { get; set; }
/// <summary>
/// List of the scopes for the requester.
/// </summary>
public string[] Scopes { get; set; }
}
}
}
}