using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Amazon.Lambda.CognitoEvents
{
///
/// AWS Cognito Trigger Common Parameters
/// https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#cognito-user-pools-lambda-trigger-syntax-shared
///
[DataContract]
public abstract class CognitoTriggerEvent
where TRequest : CognitoTriggerRequest, new()
where TResponse : CognitoTriggerResponse, new()
{
///
/// The version number of your Lambda function.
///
[DataMember(Name = "version")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("version")]
#endif
public string Version { get; set; }
///
/// The AWS Region, as an AWSRegion instance.
///
[DataMember(Name = "region")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("region")]
#endif
public string Region { get; set; }
///
/// The user pool ID for the user pool.
///
[DataMember(Name = "userPoolId")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("userPoolId")]
#endif
public string UserPoolId { get; set; }
///
/// The username of the current user.
///
[DataMember(Name = "userName")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("userName")]
#endif
public string UserName { get; set; }
///
/// The caller context
///
[DataMember(Name = "callerContext")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("callerContext")]
#endif
public CognitoTriggerCallerContext CallerContext { get; set; } = new CognitoTriggerCallerContext();
///
/// The name of the event that triggered the Lambda function.For a description of each triggerSource see User pool Lambda trigger sources.
///
[DataMember(Name = "triggerSource")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("triggerSource")]
#endif
public string TriggerSource { get; set; }
///
/// The request from the Amazon Cognito service
///
[DataMember(Name = "request")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("request")]
#endif
public TRequest Request { get; set; } = new TRequest();
///
/// The response from your Lambda trigger.The return parameters in the response depend on the triggering event.
///
[DataMember(Name = "response")]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("response")]
#endif
public TResponse Response { get; set; } = new TResponse();
}
}