using System;
using System.Collections.Generic;
using System.Text;
namespace Amazon.Lambda.APIGatewayEvents
{
///
/// 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
///
public class APIGatewayHttpApiV2ProxyRequest
{
///
/// The payload format version
///
public string Version { get; set; }
///
/// The route key
///
public string RouteKey { get; set; }
///
/// The raw path
///
public string RawPath { get; set; }
///
/// The raw query string
///
public string RawQueryString { get; set; }
///
/// Cookies sent along with the request
///
public string[] Cookies { get; set; }
///
/// Headers sent with the request. Multiple values for the same header will be separated by a comma.
///
public IDictionary Headers { get; set; }
///
/// Query string parameters sent with the request. Multiple values for the same parameter will be separated by a comma.
///
public IDictionary QueryStringParameters { get; set; }
///
/// The request context for the request
///
public ProxyRequestContext RequestContext { get; set; }
///
/// The HTTP request body.
///
public string Body { get; set; }
///
/// Path parameters sent with the request.
///
public IDictionary PathParameters { get; set; }
///
/// True if the body of the request is base 64 encoded.
///
public bool IsBase64Encoded { get; set; }
///
/// The stage variables defined for the stage in API Gateway
///
public IDictionary StageVariables { get; set; }
///
/// The ProxyRequestContext contains the information to identify the AWS account and resources invoking the
/// Lambda function.
///
public class ProxyRequestContext
{
///
/// The account id that owns the executing Lambda function
///
public string AccountId { get; set; }
///
/// The API Gateway rest API Id.
///
public string ApiId { get; set; }
///
/// Information about the current requesters authorization including claims and scopes.
///
public AuthorizerDescription Authorizer { get; set; }
///
/// The domin name.
///
public string DomainName { get; set; }
///
/// The domain prefix
///
public string DomainPrefix { get; set; }
///
/// Information about the HTTP request like the method and path.
///
public HttpDescription Http {get;set;}
///
/// The unique request id
///
public string RequestId { get; set; }
///
/// The route id
///
public string RouteId { get; set; }
///
/// The selected route key.
///
public string RouteKey { get; set; }
///
/// The API Gateway stage name
///
public string Stage { get; set; }
///
/// Gets and sets the request time.
///
public string Time { get; set; }
///
/// Gets and sets the request time as an epoch.
///
public long TimeEpoch { get; set; }
///
/// Properties for authentication.
///
public ProxyRequestAuthentication Authentication { get; set; }
}
///
/// Container for authentication properties.
///
public class ProxyRequestAuthentication
{
///
/// 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; }
}
///
/// Information about the HTTP elements for the request.
///
public class HttpDescription
{
///
/// The HTTP method like POST or GET.
///
public string Method { get; set; }
///
/// The path of the request.
///
public string Path { get; set; }
///
/// The protocal used to make the rquest
///
public string Protocol { get; set; }
///
/// The source ip for the request.
///
public string SourceIp { get; set; }
///
/// The user agent for the request.
///
public string UserAgent { get; set; }
}
///
/// Information about the current requesters authorization.
///
public class AuthorizerDescription
{
///
/// The JWT description including claims and scopes.
///
public JwtDescription Jwt { get; set; }
///
/// The Lambda authorizer description
///
public IDictionary Lambda { get; set; }
///
/// The IAM authorizer description
///
public IAMDescription IAM { get; set; }
///
/// Describes the information from an IAM authorizer
///
public class IAMDescription
{
///
/// The Access Key of the IAM Authorizer
///
public string AccessKey { get; set; }
///
/// The Account Id of the IAM Authorizer
///
public string AccountId { get; set; }
///
/// The Caller Id of the IAM Authorizer
///
public string CallerId { get; set; }
///
/// The Cognito Identity of the IAM Authorizer
///
public CognitoIdentityDescription CognitoIdentity { get; set; }
///
/// The Principal Org Id of the IAM Authorizer
///
public string PrincipalOrgId { get; set; }
///
/// The User ARN of the IAM Authorizer
///
public string UserARN { get; set; }
///
/// The User Id of the IAM Authorizer
///
public string UserId { get; set; }
}
///
/// The Cognito identity description for an IAM authorizer
///
public class CognitoIdentityDescription
{
///
/// The AMR of the IAM Authorizer
///
public IList AMR { get; set; }
///
/// The Identity Id of the IAM Authorizer
///
public string IdentityId { get; set; }
///
/// The Identity Pool Id of the IAM Authorizer
///
public string IdentityPoolId { get; set; }
}
///
/// Describes the information in the JWT token
///
public class JwtDescription
{
///
/// Map of the claims for the requester.
///
public IDictionary Claims { get; set; }
///
/// List of the scopes for the requester.
///
public string[] Scopes { get; set; }
}
}
}
}