#@ template language="C#" inherits="BaseGenerator" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#
AddLicenseHeader();
#>
using System;
using Amazon.Runtime;
namespace <#=this.Config.Namespace#>
{
<#
foreach(var enumeration in this.Config.ServiceModel.Enumerations(false))
{
#>
///
/// Constants used for properties of type <#=enumeration.Name#>.
///
public class <#=enumeration.Name#> : ConstantClass
{
<#
foreach(var enumValue in enumeration.EnumerationValues)
{
#>
///
/// Constant <#=enumValue.PropertyName#> for <#=enumeration.Name#>
///
public static readonly <#=enumeration.Name#> <#=enumValue.PropertyName#> = new <#=enumeration.Name#>("<#=enumValue.MarshallName#>");
<#
}
#>
///
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
///
public <#=enumeration.Name#>(string value)
: base(value)
{
}
///
/// Finds the constant for the unique value.
///
/// The unique value for the constant
/// The constant for the unique value
public static <#=enumeration.Name#> FindValue(string value)
{
return FindValue<<#=enumeration.Name#>>(value);
}
///
/// Utility method to convert strings to the constant class.
///
/// The string value to convert to the constant class.
///
public static implicit operator <#=enumeration.Name#>(string value)
{
return FindValue(value);
}
}
<#
}
#>
}