forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPIGatewayProxyRequest.cs
182 lines (149 loc) · 5.55 KB
/
APIGatewayProxyRequest.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
namespace Amazon.Lambda.APIGatewayEvents
{
using System;
using System.Collections.Generic;
/// <summary>
/// For request coming in from API Gateway proxy
/// http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html
/// </summary>
public class APIGatewayProxyRequest
{
/// <summary>
/// The resource path defined in API Gateway
/// </summary>
public string Resource { get; set; }
/// <summary>
/// The url path for the caller
/// </summary>
public string Path { get; set; }
/// <summary>
/// The HTTP method used
/// </summary>
public string HttpMethod { get; set; }
/// <summary>
/// The headers sent with the request
/// </summary>
public IDictionary<string, string> Headers { get; set; }
/// <summary>
/// The query string parameters that were part of the request
/// </summary>
public IDictionary<string, string> QueryStringParameters { get; set; }
/// <summary>
/// The path parameters that were part of the request
/// </summary>
public IDictionary<string, string> PathParameters { get; set; }
/// <summary>
/// The stage variables defined for the stage in API Gateway
/// </summary>
public IDictionary<string, string> StageVariables { 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>
/// True of the body of the request is base 64 encoded.
/// </summary>
public bool IsBase64Encoded { get; set; }
/// <summary>
/// The ProxyRequestContext contains the information to identify the AWS account and resources invoking the
/// Lambda function. It also includes Cognito identity information for the caller.
/// </summary>
public class ProxyRequestContext
{
/// <summary>
/// The resource full path including the API Gateway stage
/// </summary>
public string Path { get; set; }
/// <summary>
/// The account id that owns the executing Lambda function
/// </summary>
public string AccountId { get; set; }
/// <summary>
/// The resource id.
/// </summary>
public string ResourceId { get; set; }
/// <summary>
/// The API Gateway stage name
/// </summary>
public string Stage { get; set; }
/// <summary>
/// The unique request id
/// </summary>
public string RequestId { get; set; }
/// <summary>
/// The identity information for the request caller
/// </summary>
public RequestIdentity Identity { get; set; }
/// <summary>
/// The resource path defined in API Gateway
/// </summary>
public string ResourcePath { get; set; }
/// <summary>
/// The HTTP method used
/// </summary>
public string HttpMethod { get; set; }
/// <summary>
/// The API Gateway rest API Id.
/// </summary>
public string ApiId { get; set; }
/// <summary>
/// The APIGatewayCustomAuthorizerContext containing the custom properties set by a custom authorizer.
/// </summary>
public APIGatewayCustomAuthorizerContext Authorizer { get; set; }
}
/// <summary>
/// The RequestIdentity contains identity information for the request caller.
/// </summary>
public class RequestIdentity
{
/// <summary>
/// The Cognito identity pool id.
/// </summary>
public string CognitoIdentityPoolId { get; set; }
/// <summary>
/// The account id of the caller.
/// </summary>
public string AccountId { get; set; }
/// <summary>
/// The cognito identity id.
/// </summary>
public string CognitoIdentityId { get; set; }
/// <summary>
/// The caller
/// </summary>
public string Caller { get; set; }
/// <summary>
/// The API Key
/// </summary>
public string ApiKey { get; set; }
/// <summary>
/// The source IP of the request
/// </summary>
public string SourceIp { get; set; }
/// <summary>
/// The Cognito authentication type used for authentication
/// </summary>
public string CognitoAuthenticationType { get; set; }
/// <summary>
/// The Cognito authentication provider
/// </summary>
public string CognitoAuthenticationProvider { get; set; }
/// <summary>
/// The user arn
/// </summary>
public string UserArn { get; set; }
/// <summary>
/// The user agent
/// </summary>
public string UserAgent { get; set; }
/// <summary>
/// The user
/// </summary>
public string User { get; set; }
}
}
}