<#@ template language="C#" inherits="BaseMarshaller" #> <#@ assembly name="System.Core" #> <#@ import namespace="System.Linq" #> <#@ import namespace="System.Text" #> <#@ import namespace="System.Collections.Generic" #> <# AddLicenseHeader(); AddCommonUsingStatements(); AddSource(); #> <#+ // The operation to unmarshall a response from public Operation Operation { get; set; } protected void AddSingletonMethod() { #> private static <#=this.Operation.Name #>EndpointDiscoveryMarshaller _instance = new <#=this.Operation.Name #>EndpointDiscoveryMarshaller(); /// /// Gets the singleton. /// public static <#=this.Operation.Name #>EndpointDiscoveryMarshaller Instance { get { return _instance; } } <#+ } protected void ProcessRequestEndpointDiscoveryIds(string variableName, IEnumerable members) { foreach(var member in members) { #> if(<#=variableName#>.IsSet<#=member.PropertyName#>()) endpointDiscoveryData.Identifiers.Add("<#=member.PropertyName#>", <#=member.PrimitiveMarshaller#>(<#=variableName#>.<#=member.PropertyName#>)); <#+ } } protected void AddSource() { #> namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations { /// /// Endpoint discovery parameters for <#=this.Operation.Name #> operation /// public class <#=this.Operation.Name #>EndpointDiscoveryMarshaller : IMarshallerRequest> , IMarshaller { /// /// Marshaller the endpoint discovery object. /// /// /// public EndpointDiscoveryDataBase Marshall(AmazonWebServiceRequest input) { return this.Marshall((<#=this.Operation.Name#>Request)input); } /// /// Marshaller the request object to the HTTP request. /// /// /// public EndpointDiscoveryDataBase Marshall(<#=this.Operation.Name #>Request publicRequest) { var endpointDiscoveryData = new EndpointDiscoveryData(<#=this.Operation.IsEndpointDiscoveryRequired.ToString().ToLowerInvariant()#>); <#+ if(this.Operation.RequestHasEndpointDiscoveryIdMembers) { ProcessRequestEndpointDiscoveryIds("publicRequest", this.Operation.RequestEndpointDiscoveryIdMembers); } #> return endpointDiscoveryData; } <#+ this.AddSingletonMethod(); #> } } <#+ } #>