namespace Amazon.Lambda.APIGatewayEvents
{
using System;
using System.Collections.Generic;
///
/// For request coming in from API Gateway proxy
/// http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html
///
public class APIGatewayProxyRequest
{
///
/// The resource path defined in API Gateway
///
/// This field is only set for REST API requests.
///
///
public string Resource { get; set; }
///
/// The url path for the caller
///
/// This field is only set for REST API requests.
///
///
public string Path { get; set; }
///
/// The HTTP method used
///
/// This field is only set for REST API requests.
///
///
public string HttpMethod { get; set; }
///
/// The headers sent with the request. This collection will only contain a single value for a header.
///
/// API Gateway will populate both the Headers and MultiValueHeaders collection for every request. If multiple values
/// are set for a header then the Headers collection will just contain the last value.
///
/// This field is only set for REST API requests.
///
///
public IDictionary Headers { get; set; }
///
/// The headers sent with the request. This collection supports multiple values for a single header.
///
/// API Gateway will populate both the Headers and MultiValueHeaders collection for every request. If multiple values
/// are set for a header then the Headers collection will just contain the last value.
///
/// This field is only set for REST API requests.
///
///
public IDictionary> MultiValueHeaders { get; set; }
///
/// The query string parameters that were part of the request. This collection will only contain a single value for a query parameter.
///
/// API Gateway will populate both the QueryStringParameters and MultiValueQueryStringParameters collection for every request. If multiple values
/// are set for a query parameter then the QueryStringParameters collection will just contain the last value.
///
/// This field is only set for REST API requests.
///
///
public IDictionary QueryStringParameters { get; set; }
///
/// The query string parameters that were part of the request. This collection supports multiple values for a single query parameter.
///
/// API Gateway will populate both the QueryStringParameters and MultiValueQueryStringParameters collection for every request. If multiple values
/// are set for a query parameter then the QueryStringParameters collection will just contain the last value.
///
/// This field is only set for REST API requests.
///
///
public IDictionary> MultiValueQueryStringParameters { get; set; }
///
/// The path parameters that were part of the request
///
/// This field is only set for REST API requests.
///
///
public IDictionary PathParameters { get; set; }
///
/// The stage variables defined for the stage in API Gateway
///
public IDictionary StageVariables { get; set; }
///
/// The request context for the request
///
public ProxyRequestContext RequestContext { get; set; }
///
/// The HTTP request body.
///
public string Body { get; set; }
///
/// True if the body of the request is base 64 encoded.
///
public bool IsBase64Encoded { get; set; }
///
/// 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.
///
public class ProxyRequestContext
{
///
/// The resource full path including the API Gateway stage
///
/// This field is only set for REST API requests.
///
///
public string Path { get; set; }
///
/// The account id that owns the executing Lambda function
///
public string AccountId { get; set; }
///
/// The resource id.
///
public string ResourceId { get; set; }
///
/// The API Gateway stage name
///
public string Stage { get; set; }
///
/// The unique request id
///
public string RequestId { get; set; }
///
/// The identity information for the request caller
///
public RequestIdentity Identity { get; set; }
///
/// The resource path defined in API Gateway
///
/// This field is only set for REST API requests.
///
///
public string ResourcePath { get; set; }
///
/// The HTTP method used
///
/// This field is only set for REST API requests.
///
///
public string HttpMethod { get; set; }
///
/// The API Gateway rest API Id.
///
public string ApiId { get; set; }
///
/// An automatically generated ID for the API call, which contains more useful information for debugging/troubleshooting.
///
public string ExtendedRequestId { get; set; }
///
/// The connectionId identifies a unique client connection in a WebSocket API.
///
/// This field is only set for WebSocket API requests.
///
///
public string ConnectionId { get; set; }
///
/// The Epoch-formatted connection time in a WebSocket API.
///
/// This field is only set for WebSocket API requests.
///
///
public long ConnectedAt { get; set; }
///
/// A domain name for the WebSocket API. This can be used to make a callback to the client (instead of a hard-coded value).
///
/// This field is only set for WebSocket API requests.
///
///
public string DomainName { get; set; }
///
/// The first label of the DomainName. This is often used as a caller/customer identifier.
///
public string DomainPrefix { get; set; }
///
/// The event type: CONNECT, MESSAGE, or DISCONNECT.
///
/// This field is only set for WebSocket API requests.
///
///
public string EventType { get; set; }
///
/// A unique server-side ID for a message. Available only when the $context.eventType is MESSAGE.
///
/// This field is only set for WebSocket API requests.
///
///
public string MessageId { get; set; }
///
/// The selected route key.
///
/// This field is only set for WebSocket API requests.
///
///
public string RouteKey { get; set; }
///
/// The APIGatewayCustomAuthorizerContext containing the custom properties set by a custom authorizer.
///
public APIGatewayCustomAuthorizerContext Authorizer { get; set; }
///
/// Gets and sets the operation name.
///
public string OperationName { get; set; }
///
/// Gets and sets the error.
///
public string Error { get; set; }
///
/// Gets and sets the integration latency.
///
public string IntegrationLatency { get; set; }
///
/// Gets and sets the message direction.
///
public string MessageDirection { get; set; }
///
/// Gets and sets the request time.
///
public string RequestTime { get; set; }
///
/// Gets and sets the request time as an epoch.
///
public long RequestTimeEpoch { get; set; }
///
/// Gets and sets the status.
///
public string Status { get; set; }
}
///
/// The RequestIdentity contains identity information for the request caller.
///
public class RequestIdentity
{
///
/// The Cognito identity pool id.
///
public string CognitoIdentityPoolId { get; set; }
///
/// The account id of the caller.
///
public string AccountId { get; set; }
///
/// The cognito identity id.
///
public string CognitoIdentityId { get; set; }
///
/// The caller
///
public string Caller { get; set; }
///
/// The API Key
///
public string ApiKey { get; set; }
///
/// The API Key ID
///
public string ApiKeyId { get; set; }
///
/// The Access Key
///
public string AccessKey { get; set; }
///
/// The source IP of the request
///
public string SourceIp { get; set; }
///
/// The Cognito authentication type used for authentication
///
public string CognitoAuthenticationType { get; set; }
///
/// The Cognito authentication provider
///
public string CognitoAuthenticationProvider { get; set; }
///
/// The user arn
///
public string UserArn { get; set; }
///
/// The user agent
///
public string UserAgent { get; set; }
///
/// The user
///
public string User { get; set; }
///
/// Properties for a client certificate.
///
public ProxyRequestClientCert ClientCert { get; set; }
}
///
/// Container for the properties of the client certificate.
///
public class ProxyRequestClientCert
{
///
/// The PEM-encoded client certificate that the client presented during mutual TLS authentication.
/// Present when a client accesses an API by using a custom domain name that has mutual
/// TLS enabled. Present only in access logs if mutual TLS authentication fails.
///
public string ClientCertPem { get; set; }
///
/// The distinguished name of the subject of the certificate that a client presents.
/// Present when a client accesses an API by using a custom domain name that has
/// mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
///
public string SubjectDN { get; set; }
///
/// The distinguished name of the issuer of the certificate that a client presents.
/// Present when a client accesses an API by using a custom domain name that has
/// mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
///
public string IssuerDN { get; set; }
///
/// The serial number of the certificate. Present when a client accesses an API by
/// using a custom domain name that has mutual TLS enabled.
/// Present only in access logs if mutual TLS authentication fails.
///
public string SerialNumber { get; set; }
///
/// The rules for when the client cert is valid.
///
public ClientCertValidity Validity { get; set; }
}
///
/// Container for the validation properties of a client cert.
///
public class ClientCertValidity
{
///
/// The date before which the certificate is invalid. Present when a client accesses an API by using a custom domain name
/// that has mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
///
public string NotBefore { get; set; }
///
/// The date after which the certificate is invalid. Present when a client accesses an API by using a custom domain name that
/// has mutual TLS enabled. Present only in access logs if mutual TLS authentication fails.
///
public string NotAfter { get; set; }
}
}
}