using System; using System.Collections.Generic; using System.Linq; using Amazon.Lambda.Annotations.SourceGenerator.Models.Attributes; namespace Amazon.Lambda.Annotations.SourceGenerator.Models { /// /// Represents container class for the Lambda function. /// public class LambdaFunctionModel : ILambdaFunctionSerializable { /// /// Gets or sets original method model. /// public LambdaMethodModel LambdaMethod { get; set; } /// /// Gets or sets generated method model. /// public GeneratedMethodModel GeneratedMethod { get; set; } /// /// Gets or sets the type of the Startup.cs class that contains the Configure method. /// Returns null if there doesn't exist a Startup class. /// public TypeModel StartupType { get; set; } /// /// Gets or sets fully qualified name of the serializer used for serialization or deserialization. /// public string Serializer { get; set; } /// public string Handler => $"{LambdaMethod.ContainingAssembly}::{GeneratedMethod.ContainingType.FullName}::{LambdaMethod.Name}"; /// public string ResourceName => LambdaMethod.LambdaFunctionAttribute.Data.ResourceName ?? string.Join(string.Empty, GeneratedMethod.ContainingType.FullName.Where(char.IsLetterOrDigit)); /// public uint? Timeout => LambdaMethod.LambdaFunctionAttribute.Data.Timeout; /// public uint? MemorySize => LambdaMethod.LambdaFunctionAttribute.Data.MemorySize; /// public string Role => LambdaMethod.LambdaFunctionAttribute.Data.Role; /// public string Policies => LambdaMethod.LambdaFunctionAttribute.Data.Policies; /// /// The default value is set to Zip public LambdaPackageType PackageType => LambdaMethod.LambdaFunctionAttribute.Data.PackageType; /// public IList Attributes => LambdaMethod.Attributes ?? new List(); /// public string SourceGeneratorVersion { get; set; } } }