#@ 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;
using Amazon.Runtime.Internal;
using Amazon.Util.Internal;
using <#=this.Config.Namespace#>.Internal;
namespace <#=this.Config.Namespace#>
{
///
/// Configuration for accessing Amazon <#=this.Config.ClassName#> service
///
[AWSSignerType("<#=Config.ServiceModel.SignatureVersion#>")]
public partial class Amazon<#=this.Config.ClassName#>Config : ClientConfig
{
private static readonly string UserAgentString =
InternalSDKUtils.BuildUserAgentString("<#=this.Config.ServiceFileVersion #>");
private string _userAgent = UserAgentString;
///
/// The ServiceId, which is the unique identifier for a service.
///
public static new string ServiceId
{
get
{
return "<#=this.Config.ServiceId#>";
}
}
///
/// Default constructor
///
public Amazon<#=this.Config.ClassName#>Config()
: base(new Amazon.Runtime.Internal.DefaultConfigurationProvider(Amazon<#= this.Config.ClassName#>DefaultConfiguration.GetAllConfigurations()))
{
base.ServiceId = "<#=this.Config.ServiceId#>";
<#
if(!string.IsNullOrEmpty(this.Config.AuthenticationServiceName))
{
#>
this.AuthenticationServiceName = "<#=this.Config.AuthenticationServiceName#>";
<#
}
if(this.Config.OverrideMaxRetries.HasValue)
{
#>
this.MaxErrorRetry = <#=this.Config.OverrideMaxRetries#>;
<#
}
if(!string.IsNullOrEmpty(this.Config.DefaultRegion))
{
#>
var region = FallbackRegionFactory.GetRegionEndpoint(false);
this.RegionEndpoint = region ?? RegionEndpoint.<#=this.Config.DefaultRegion#>;
<#
}
#>
<#
if (this.Config.EndpointsRuleSet != null)
{
#>
this.EndpointProvider = new Amazon<#=this.Config.ClassName#>EndpointProvider();
<#
}
#>
}
///
/// The constant used to lookup in the region hash the endpoint.
///
public override string RegionEndpointServiceName
{
get
{
return "<#=this.Config.RegionLookupName#>";
}
}
///
/// Gets the ServiceVersion property.
///
public override string ServiceVersion
{
get
{
return "<#=this.Config.ServiceModel.APIVersion#>";
}
}
///
/// Gets the value of UserAgent property.
///
public override string UserAgent
{
get
{
return _userAgent;
}
}
<# if (this.Config.EndpointsRuleSet != null)
foreach(var parameter in this.Config.ServiceModel.ClientContextParameters) {
#>
///
/// <#=parameter.documentation#>
///
public <#=parameter.nativeType#> <#=parameter.name#> { get; set; }
<#}#>
}
}