repo_name
stringlengths 1
52
| repo_creator
stringclasses 6
values | programming_language
stringclasses 4
values | code
stringlengths 0
9.68M
| num_lines
int64 1
234k
|
---|---|---|---|---|
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.NuGet
{
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\CoreNuspec.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class CoreNuspec : CoreNuspecBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<package> \r\n <metadata> \r\n <id>AWSS" +
"DK.Core</id>\r\n <title>AWSSDK - Core Runtime</title>\r\n <version>");
#line 9 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\CoreNuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["FileVersion"]));
#line default
#line hidden
#line 9 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\CoreNuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["NuGetPreviewFlag"]));
#line default
#line hidden
this.Write("</version> \r\n <authors>Amazon Web Services</authors>\r\n <description>The Ama" +
"zon Web Services SDK for .NET - Core Runtime</description>\r\n <language>en-US<" +
"/language>\r\n <license type=\"expression\">Apache-2.0</license>\r\n <projectUrl" +
">https://github.com/aws/aws-sdk-net/</projectUrl>\r\n <tags>AWS Amazon cloud aw" +
"s-sdk-v3</tags>\r\n <icon>images\\AWSLogo.png</icon>\r\n <dependencies>\r\n " +
"<group targetFramework=\"net35\">\r\n </group>\r\n <group targetFramework=\"n" +
"et45\">\r\n </group>\r\n\t <group targetFramework=\"netstandard2.0\">\r\n <" +
"dependency id=\"Microsoft.Bcl.AsyncInterfaces\" version=\"1.1.0\" />\r\n </group>" +
"\r\n <group targetFramework=\"netcoreapp3.1\">\r\n </group>\r\n </dependenc" +
"ies>\r\n </metadata> \r\n <files>\r\n <file src=\"..\\..\\nuget-content\\AWSLogo.png\"" +
" target=\"images\\\" />\r\n <file src=\"..\\..\\nuget-content\\account-management.ps1\"" +
" target=\"tools\" />\r\n\r\n <file src=\".\\bin\\Release\\net35\\AWSSDK.Core.dll\" target" +
"=\"lib\\net35\" />\r\n <file src=\".\\bin\\Release\\net35\\AWSSDK.Core.xml\" target=\"lib" +
"\\net35\" />\r\n <file src=\".\\bin\\Release\\net35\\AWSSDK.Core.pdb\" target=\"lib\\net3" +
"5\" />\r\n\r\n <file src=\".\\bin\\Release\\net45\\AWSSDK.Core.dll\" target=\"lib\\net45\" " +
"/>\r\n <file src=\".\\bin\\Release\\net45\\AWSSDK.Core.xml\" target=\"lib\\net45\" />\r\n " +
" <file src=\".\\bin\\Release\\net45\\AWSSDK.Core.pdb\" target=\"lib\\net45\" />\r\n\r\n " +
"<file src=\".\\bin\\Release\\netstandard2.0\\AWSSDK.Core.dll\" target=\"lib\\netstandard" +
"2.0\"/>\r\n <file src=\".\\bin\\Release\\netstandard2.0\\AWSSDK.Core.xml\" target=\"lib" +
"\\netstandard2.0\"/>\r\n <file src=\".\\bin\\Release\\netstandard2.0\\AWSSDK.Core.pdb\"" +
" target=\"lib\\netstandard2.0\"/>\r\n\r\n <file src=\".\\bin\\Release\\netcoreapp3.1\\AWS" +
"SDK.Core.dll\" target=\"lib\\netcoreapp3.1\"/>\r\n <file src=\".\\bin\\Release\\netcore" +
"app3.1\\AWSSDK.Core.xml\" target=\"lib\\netcoreapp3.1\"/>\r\n <file src=\".\\bin\\Relea" +
"se\\netcoreapp3.1\\AWSSDK.Core.pdb\" target=\"lib\\netcoreapp3.1\"/>\r\n </files>\r\n</pa" +
"ckage>");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class CoreNuspecBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
public System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 346 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.NuGet
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\NuGetPackageReadmeSection.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class NuGetPackageReadmeSection : NuGetPackageReadmeSectionBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("\r\n");
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\NuGetPackageReadmeSection.tt"
foreach(var kvp in ((IDictionary<string, string>)this.Session["NugetPackages"]))
{
#line default
#line hidden
this.Write("* [");
#line 11 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\NuGetPackageReadmeSection.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(kvp.Key));
#line default
#line hidden
this.Write("](https://www.nuget.org/packages/");
#line 11 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\NuGetPackageReadmeSection.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(kvp.Key));
#line default
#line hidden
this.Write("/)\r\n\t* ");
#line 12 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\NuGetPackageReadmeSection.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(kvp.Value));
#line default
#line hidden
this.Write("\r\n");
#line 13 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\NuGetPackageReadmeSection.tt"
}
#line default
#line hidden
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class NuGetPackageReadmeSectionBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 350 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.NuGet
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Nuspec : NuspecBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<package> \r\n <metadata> \r\n <id>");
#line 10 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write("</id>\r\n <title>");
#line 11 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["NuGetTitle"]));
#line default
#line hidden
this.Write("</title>\r\n <version>");
#line 12 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyVersion"]));
#line default
#line hidden
#line 12 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["NuGetPreviewFlag"]));
#line default
#line hidden
this.Write("</version> \r\n <authors>Amazon Web Services</authors>\r\n <description>");
#line 14 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyDescription"]));
#line default
#line hidden
this.Write("</description>\r\n <language>en-US</language>\r\n <license type=\"expression\">Ap" +
"ache-2.0</license>\r\n <projectUrl>https://github.com/aws/aws-sdk-net/</project" +
"Url>\r\n <tags>AWS Amazon cloud ");
#line 18 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["BaseName"]));
#line default
#line hidden
this.Write(" aws-sdk-v3");
#line 18 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["ExtraTags"]));
#line default
#line hidden
this.Write("</tags>\r\n <icon>images\\AWSLogo.png</icon>\r\n");
#line 20 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
if (bool.Parse(this.Session["requireLicenseAcceptance"].ToString()))
{
#line default
#line hidden
this.Write(" <requireLicenseAcceptance>");
#line 23 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["requireLicenseAcceptance"]));
#line default
#line hidden
this.Write("</requireLicenseAcceptance>\r\n");
#line 24 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
}
#line default
#line hidden
this.Write(" <dependencies>\r\n");
#line 28 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
if(this.Session.ContainsKey("NugetDependencies"))
{
var dependencies = (Dictionary<string,List<Dependency>>)this.Session["NugetDependencies"];
foreach(var dependencyList in dependencies)
{
var projectFileConfigurations = (IEnumerable<ProjectFileConfiguration>)this.Session["ProjectFileConfigurations"];
var targetFramework = projectFileConfigurations.Single(p=>p.Name.Equals(dependencyList.Key)).NuGetTargetPlatform;
#line default
#line hidden
this.Write("\t\t\t\r\n <group targetFramework=\"");
#line 37 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(targetFramework));
#line default
#line hidden
this.Write("\">\r\n");
#line 38 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
foreach(var dependency in dependencyList.Value)
{
#line default
#line hidden
this.Write(" <dependency id=\"");
#line 42 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dependency.Name));
#line default
#line hidden
this.Write("\" version=\"");
#line 42 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(dependency.Version));
#line default
#line hidden
this.Write("\" />\r\n");
#line 43 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
}
#line default
#line hidden
#line 46 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
foreach(var awsDependencyKVP in ((IDictionary<string, string>)this.Session["AWSDependencies"]))
{
#line default
#line hidden
this.Write(" <dependency id=\"");
#line 50 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(awsDependencyKVP.Key));
#line default
#line hidden
this.Write("\" version=\"");
#line 50 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(awsDependencyKVP.Value));
#line default
#line hidden
this.Write("\" />\r\n");
#line 51 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
}
#line default
#line hidden
this.Write(" </group>\r\n");
#line 55 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
}
}
#line default
#line hidden
this.Write(" <group>\r\n");
#line 60 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
foreach(var awsDependencyKVP in ((IDictionary<string, string>)this.Session["AWSDependencies"]))
{
#line default
#line hidden
this.Write(" <dependency id=\"");
#line 64 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(awsDependencyKVP.Key));
#line default
#line hidden
this.Write("\" version=\"");
#line 64 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(awsDependencyKVP.Value));
#line default
#line hidden
this.Write("\" />\r\n");
#line 65 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
}
#line default
#line hidden
this.Write(" </group>\r\n </dependencies>\r\n </metadata> \r\n <files>\r\n <file src=\".." +
"\\..\\..\\nuget-content\\AWSLogo.png\" target=\"images\\\" />\r\n <file src=\"..\\..\\..\\c" +
"ode-analysis\\ServiceAnalysis\\");
#line 73 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["CodeAnalysisServiceFolder"]));
#line default
#line hidden
this.Write(@"\bin\Release\*.dll"" target=""analyzers\dotnet\cs"" exclude=""**\Microsoft.CodeAnalysis.*;**\System.Collections.Immutable.*;**\System.Reflection.Metadata.*;**\System.Composition.*"" />
<file src=""..\..\..\code-analysis\NuGetInstallScripts\*.ps1"" target=""tools\"" />
<file src="".\bin\Release\net35\");
#line 76 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".dll\" target=\"lib\\net35\" />\r\n <file src=\".\\bin\\Release\\net35\\");
#line 77 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".xml\" target=\"lib\\net35\" />\r\n <file src=\".\\bin\\Release\\net35\\");
#line 78 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".pdb\" target=\"lib\\net35\" />\r\n\r\n <file src=\".\\bin\\Release\\net45\\");
#line 80 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".dll\" target=\"lib\\net45\" />\r\n <file src=\".\\bin\\Release\\net45\\");
#line 81 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".xml\" target=\"lib\\net45\" />\r\n <file src=\".\\bin\\Release\\net45\\");
#line 82 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".pdb\" target=\"lib\\net45\" />\r\n\r\n");
#line 84 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
if(Convert.ToBoolean(this.Session["NetStandardSupport"]))
{
#line default
#line hidden
this.Write(" <file src=\".\\bin\\Release\\netstandard2.0\\");
#line 88 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".dll\" target=\"lib\\netstandard2.0\" />\r\n <file src=\".\\bin\\Release\\netstandard2.0" +
"\\");
#line 89 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".xml\" target=\"lib\\netstandard2.0\" />\r\n <file src=\".\\bin\\Release\\netstandard2.0" +
"\\");
#line 90 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".pdb\" target=\"lib\\netstandard2.0\" />\r\n\r\n <file src=\".\\bin\\Release\\netcoreapp3." +
"1\\");
#line 92 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".dll\" target=\"lib\\netcoreapp3.1\" />\r\n <file src=\".\\bin\\Release\\netcoreapp3.1\\");
#line 93 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".xml\" target=\"lib\\netcoreapp3.1\" />\r\n <file src=\".\\bin\\Release\\netcoreapp3.1\\");
#line 94 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(".pdb\" target=\"lib\\netcoreapp3.1\" />\r\n");
#line 95 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\NuGet\Nuspec.tt"
}
#line default
#line hidden
this.Write("\r\n </files>\r\n</package>");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class NuspecBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
public System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 635 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.ProjectFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class SolutionFileBclAndNetStandard : SolutionFileBclAndNetStandardBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""Core"", ""Core"", ""{9863FCB3-BFA4-4B9C-B8F6-302BA5F660B8}""
EndProject
");
#line 12 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["CoreProjects"])
{
#line default
#line hidden
this.Write("Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"");
#line 16 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 16 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 16 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 18 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
#line default
#line hidden
this.Write("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Services\", \"Services\", \"{939" +
"EC5C2-8345-43E2-8F97-72EEEBEEA0AB}\"\r\nEndProject\r\n");
#line 23 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var folder in (List<SolutionFileCreator.ServiceSolutionFolder>)this.Session["ServiceSolutionFolders"])
{
#line default
#line hidden
this.Write("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"");
#line 27 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.Name));
#line default
#line hidden
this.Write("\", \"");
#line 27 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.Name));
#line default
#line hidden
this.Write("\", \"");
#line 27 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 29 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in folder.Projects)
{
#line default
#line hidden
this.Write("Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"");
#line 34 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 34 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 34 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 36 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
}
#line default
#line hidden
this.Write("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Test\", \"Test\", \"{12EC4E4B-7E" +
"2C-4B63-8EF9-7B959F82A89B}\"\r\nEndProject\r\n");
#line 42 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["TestProjects"])
{
// This check will not be needed once we migrate to using service specific slns for releases
if(string.IsNullOrEmpty(project.RelativePath))
{
#line default
#line hidden
this.Write("Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"");
#line 49 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 49 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 49 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 51 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
else
{
#line default
#line hidden
this.Write("Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"");
#line 56 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 56 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.RelativePath));
#line default
#line hidden
this.Write("\", \"");
#line 56 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 58 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
}
if(this.Session.ContainsKey("IntegrationTestDependencies"))
{
#line default
#line hidden
this.Write("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"IntegrationTestDependencies\"" +
", \"IntegrationTestDependencies\", \"{939EC5C2-8345-43E2-8F97-72EEEBEEA0AC}\"\r\nEndPr" +
"oject\r\n");
#line 66 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["IntegrationTestDependencies"])
{
#line default
#line hidden
this.Write("Project(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"");
#line 70 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 70 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 70 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 72 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
}
#line default
#line hidden
this.Write("Global\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Any" +
" CPU = Debug|Any CPU\r\n\t\tRelease|Any CPU = Release|Any CPU\r\n\tEndGlobalSection\r\n\tG" +
"lobalSection(ProjectConfigurationPlatforms) = postSolution\r\n");
#line 82 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["CoreProjects"])
{
#line default
#line hidden
this.Write("\t\t");
#line 86 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t");
#line 87 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t");
#line 88 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t");
#line 89 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.Build.0 = Release|Any CPU\r\n");
#line 90 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
foreach(var folder in (List<SolutionFileCreator.ServiceSolutionFolder>)this.Session["ServiceSolutionFolders"])
{
foreach(var project in folder.Projects)
{
#line default
#line hidden
this.Write("\t\t");
#line 97 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t");
#line 98 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t");
#line 99 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t");
#line 100 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.Build.0 = Release|Any CPU\r\n");
#line 101 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
}
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["TestProjects"])
{
#line default
#line hidden
this.Write("\t\t");
#line 107 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t");
#line 108 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t");
#line 109 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t");
#line 110 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.Build.0 = Release|Any CPU\r\n");
#line 111 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["IntegrationTestDependencies"])
{
#line default
#line hidden
this.Write("\t\t");
#line 116 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t");
#line 117 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t");
#line 118 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t");
#line 119 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".Release|Any CPU.Build.0 = Release|Any CPU\r\n");
#line 120 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
#line default
#line hidden
this.Write("\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSoluti" +
"onNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(NestedProjects) = preSolution\r" +
"\n");
#line 128 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["CoreProjects"])
{
#line default
#line hidden
this.Write("\t\t");
#line 132 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = {9863FCB3-BFA4-4B9C-B8F6-302BA5F660B8}\r\n");
#line 133 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
foreach(var folder in (List<SolutionFileCreator.ServiceSolutionFolder>)this.Session["ServiceSolutionFolders"])
{
#line default
#line hidden
this.Write("\t\t");
#line 139 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.ProjectGuid));
#line default
#line hidden
this.Write(" = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AB}\r\n");
#line 140 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
foreach(var project in folder.Projects)
{
#line default
#line hidden
this.Write("\t\t");
#line 144 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = ");
#line 144 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.ProjectGuid));
#line default
#line hidden
this.Write("\r\n");
#line 145 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
}
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["TestProjects"])
{
#line default
#line hidden
this.Write("\t\t");
#line 151 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = {12EC4E4B-7E2C-4B63-8EF9-7B959F82A89B}\r\n");
#line 152 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
if(this.Session.ContainsKey("IntegrationTestDependencies"))
{
foreach(var project in (IList<SolutionFileCreator.Project>)this.Session["IntegrationTestDependencies"])
{
#line default
#line hidden
this.Write("\t\t");
#line 159 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = {939EC5C2-8345-43E2-8F97-72EEEBEEA0AC}\r\n");
#line 160 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
}
}
#line default
#line hidden
this.Write("\tEndGlobalSection\r\n\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n\t\tSolutio" +
"nGuid = {");
#line 167 "C:\dev\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileBclAndNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["SolutionGuid"]));
#line default
#line hidden
this.Write("}\r\n\tEndGlobalSection\r\nEndGlobal");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class SolutionFileBclAndNetStandardBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 842 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.ProjectFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class SolutionFileGenerator : SolutionFileGeneratorBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""Core"", ""Core"", ""{1523203C-CD16-4B4A-8F9D-8ECCA3A327AA}""
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""Services"", ""Services"", ""{03245B8D-0A27-4C11-9AAC-7047A9F6DFB0}""
EndProject
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""Tests"", ""Tests"", ""{AAB6968E-1FCE-47C8-B34C-4850E27458F1}""
EndProject
");
#line 16 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["CoreProjects"])
{
#line default
#line hidden
this.Write("Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"");
#line 20 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 20 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 20 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 22 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
foreach(var folder in (List<SolutionFileCreator.ServiceSolutionFolder>)this.Session["ServiceSolutionFolders"])
{
#line default
#line hidden
this.Write("Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"");
#line 28 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.Name));
#line default
#line hidden
this.Write("\", \"");
#line 28 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.Name));
#line default
#line hidden
this.Write("\", \"");
#line 28 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 30 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in folder.Projects)
{
#line default
#line hidden
this.Write("Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"");
#line 35 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 35 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 35 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 37 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
}
#line default
#line hidden
#line 41 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["TestProjects"])
{
#line default
#line hidden
this.Write("Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"");
#line 45 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.Name));
#line default
#line hidden
this.Write("\", \"");
#line 45 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectPath));
#line default
#line hidden
this.Write("\", \"");
#line 45 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write("\"\r\nEndProject\r\n");
#line 47 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
#line default
#line hidden
this.Write("Global\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n");
#line 52 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach (var c in (List<string>)this.Session["Configurations"])
{
#line default
#line hidden
this.Write("\t\t");
#line 56 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c));
#line default
#line hidden
this.Write(" = ");
#line 56 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(c));
#line default
#line hidden
this.Write("\r\n");
#line 57 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
#line default
#line hidden
this.Write("\tEndGlobalSection\r\n GlobalSection(ProjectConfigurationPlatforms) = postSolutio" +
"n\r\n");
#line 62 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
var allProjectConfigurations = this.Session["AllProjects"] as Dictionary<string, ProjectFileCreator.ProjectConfigurationData>;
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["CoreProjects"])
{
var projectConfigurations = allProjectConfigurations[project.Name];
foreach (var config in projectConfigurations.ConfigurationPlatforms)
{
#line default
#line hidden
this.Write("\t\t");
#line 70 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".");
#line 70 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write(".ActiveCfg = ");
#line 70 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write("\r\n\t\t");
#line 71 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".");
#line 71 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write(".Build.0 = ");
#line 71 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write("\r\n");
#line 72 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
}
foreach(var folder in (List<SolutionFileCreator.ServiceSolutionFolder>)this.Session["ServiceSolutionFolders"])
{
foreach(var project in folder.Projects)
{
var projectConfigurations = allProjectConfigurations[project.Name];
foreach (var config in projectConfigurations.ConfigurationPlatforms)
{
#line default
#line hidden
this.Write("\t\t");
#line 84 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".");
#line 84 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write(".ActiveCfg = ");
#line 84 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write("\r\n\t\t");
#line 85 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".");
#line 85 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write(".Build.0 = ");
#line 85 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write("\r\n");
#line 86 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
}
}
#line default
#line hidden
#line 91 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["TestProjects"])
{
var projectConfigurations = allProjectConfigurations[project.Name];
foreach (var config in projectConfigurations.ConfigurationPlatforms)
{
#line default
#line hidden
this.Write("\t\t");
#line 98 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".");
#line 98 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write(".ActiveCfg = ");
#line 98 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write("\r\n\t\t");
#line 99 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(".");
#line 99 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write(".Build.0 = ");
#line 99 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(config));
#line default
#line hidden
this.Write("\r\n");
#line 100 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
}
#line default
#line hidden
this.Write(" EndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSol" +
"utionNode = FALSE\r\n\tEndGlobalSection\r\n\tGlobalSection(NestedProjects) = preSoluti" +
"on\r\n");
#line 109 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["CoreProjects"])
{
#line default
#line hidden
this.Write("\t\t");
#line 113 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = {1523203C-CD16-4B4A-8F9D-8ECCA3A327AA}\r\n");
#line 114 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
foreach(var folder in (List<SolutionFileCreator.ServiceSolutionFolder>)this.Session["ServiceSolutionFolders"])
{
#line default
#line hidden
this.Write("\t\t");
#line 120 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.ProjectGuid));
#line default
#line hidden
this.Write(" = {03245B8D-0A27-4C11-9AAC-7047A9F6DFB0}\r\n");
#line 121 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in folder.Projects)
{
#line default
#line hidden
this.Write("\t\t");
#line 125 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = ");
#line 125 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(folder.ProjectGuid));
#line default
#line hidden
this.Write("\r\n");
#line 126 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
}
#line default
#line hidden
#line 130 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
foreach(var project in (List<SolutionFileCreator.Project>)this.Session["TestProjects"])
{
#line default
#line hidden
this.Write("\t\t");
#line 134 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(project.ProjectGuid));
#line default
#line hidden
this.Write(" = {AAB6968E-1FCE-47C8-B34C-4850E27458F1}\r\n");
#line 135 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\SolutionFileGenerator.tt"
}
#line default
#line hidden
this.Write("\tEndGlobalSection\r\nEndGlobal");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class SolutionFileGeneratorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 788 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 16.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.ProjectFiles
{
using System.Linq;
using System.Text;
using System.IO;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class UnitTestProjectFile : UnitTestProjectFileBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"<?xml version=""1.0"" encoding=""utf-8""?>
<Project ToolsVersion=""12.0"" DefaultTargets=""Build"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
<PropertyGroup>
<Configuration Condition="" '$(Configuration)' == '' "">Debug</Configuration>
<Platform Condition="" '$(Platform)' == '' "">AnyCPU</Platform>
<ProjectGuid>");
#line 11 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["ProjectGuid"]));
#line default
#line hidden
this.Write("</ProjectGuid>\r\n <OutputType>Library</OutputType>\r\n <AppDesignerFolder>Prop" +
"erties</AppDesignerFolder>\r\n <RootNamespace>");
#line 14 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["RootNamespace"]));
#line default
#line hidden
this.Write("</RootNamespace>\r\n <AssemblyName>");
#line 15 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["AssemblyName"]));
#line default
#line hidden
this.Write(@"</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition=""'$(VisualStudioVersion)' == ''"">10.0</VisualStudioVersion>
<VSToolsPath Condition=""'$(VSToolsPath)' == ''"">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<ReferenceServiceDLLs Condition=""'$(ReferenceServiceDLLs)'==''"">false</ReferenceServiceDLLs>
</PropertyGroup>
<PropertyGroup Condition="" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>");
#line 31 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["DebugOutputPath"]));
#line default
#line hidden
this.Write("</OutputPath>\r\n <DefineConstants>");
#line 32 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["DebugDefineConstants"]));
#line default
#line hidden
this.Write(@"</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>");
#line 40 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["ReleaseOutputPath"]));
#line default
#line hidden
this.Write("</OutputPath>\r\n <DefineConstants>");
#line 41 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["ReleaseDefineConstants"]));
#line default
#line hidden
this.Write(@"</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include=""System"" />
<Reference Include=""System.Configuration"" />
<Reference Include=""System.XML"" />
<Reference Include=""System.Xml.Linq"" />
");
#line 51 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
IList<string> references = this.Session["Reference"] as IList<string>;
if (references != null)
{
foreach(var reference in references)
{
#line default
#line hidden
this.Write(" <Reference Include=\"");
#line 58 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference));
#line default
#line hidden
this.Write("\" />\r\n");
#line 59 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
}
}
#line default
#line hidden
this.Write(@" </ItemGroup>
<ItemGroup>
<Reference Include=""Microsoft.VisualStudio.QualityTools.UnitTestFramework"" />
</ItemGroup>
<ItemGroup>
<Compile Include=""Generated\Customizations\*\*.cs"" />
<Compile Include=""Generated\Marshalling\*.cs"" />
<Compile Include=""Custom\*\*\*.cs"" />
<Compile Include=""Custom\*\*.cs"" />
<Compile Include=""Custom\*.cs"" />
");
#line 73 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
IList<string> compileInclude = this.Session["CompileInclude"] as IList<string>;
if(compileInclude != null)
{
foreach(var entry in compileInclude)
{
#line default
#line hidden
this.Write(" <Compile Include=\"");
#line 80 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(entry));
#line default
#line hidden
this.Write("\" />\r\n");
#line 81 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
}
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n");
#line 86 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
IList<ProjectFileCreator.ProjectReference> commonReferences = this.Session["CommonReferences"] as IList<ProjectFileCreator.ProjectReference>;
if (commonReferences != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 92 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
foreach(var reference in commonReferences)
{
#line default
#line hidden
this.Write(" <ProjectReference Include=\"");
#line 96 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.IncludePath));
#line default
#line hidden
this.Write("\">\r\n <Project>");
#line 97 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.ProjectGuid));
#line default
#line hidden
this.Write("</Project>\r\n <Name>");
#line 98 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.Name));
#line default
#line hidden
this.Write("</Name>\r\n </ProjectReference>\r\n");
#line 100 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n");
#line 104 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
}
IList<ProjectFileCreator.ProjectReference> serviceReferences = this.Session["ServiceProjectReferences"] as IList<ProjectFileCreator.ProjectReference>;
if (serviceReferences != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 112 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
foreach(var reference in serviceReferences)
{
#line default
#line hidden
this.Write(" <ProjectReference Include=\"");
#line 116 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.IncludePath));
#line default
#line hidden
this.Write("\">\r\n <Project>");
#line 117 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.ProjectGuid));
#line default
#line hidden
this.Write("</Project>\r\n <Name>");
#line 118 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.Name));
#line default
#line hidden
this.Write("</Name>\r\n </ProjectReference>\r\n");
#line 120 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n");
#line 124 "C:\Users\costleya\Work\aws-sdk-net\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\UnitTestProjectFile.tt"
}
#line default
#line hidden
this.Write(" <ItemGroup>\r\n <ProjectReference Include=\"..\\..\\..\\generator\\ServiceClientGen" +
"eratorLib\\ServiceClientGeneratorLib.csproj\">\r\n <Project>{7BEE7C44-BE12-43CC" +
"-AFB9-B5852A1F43C8}</Project>\r\n <Name>ServiceClientGeneratorLib</Name>\r\n " +
" </ProjectReference>\r\n </ItemGroup>\r\n <ItemGroup>\r\n <Service Include=\"{5083" +
"49B6-6B84-4DF5-91F0-309BEEBAD82D}\" />\r\n </ItemGroup>\r\n <ItemGroup>\r\n <None " +
"Include=\"App.config\" />\r\n </ItemGroup>\r\n <Choose>\r\n <When Condition=\"\'$(Vis" +
"ualStudioVersion)\' == \'10.0\' And \'$(IsCodedUITest)\' == \'True\'\">\r\n <ItemGrou" +
"p>\r\n <Reference Include=\"Microsoft.VisualStudio.QualityTools.CodedUITestF" +
"ramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, pr" +
"ocessorArchitecture=MSIL\">\r\n <Private>False</Private>\r\n </Refere" +
"nce>\r\n <Reference Include=\"Microsoft.VisualStudio.TestTools.UITest.Common" +
", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorA" +
"rchitecture=MSIL\">\r\n <Private>False</Private>\r\n </Reference>\r\n " +
" <Reference Include=\"Microsoft.VisualStudio.TestTools.UITest.Extension, Ver" +
"sion=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchit" +
"ecture=MSIL\">\r\n <Private>False</Private>\r\n </Reference>\r\n " +
" <Reference Include=\"Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0." +
"0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\"" +
">\r\n <Private>False</Private>\r\n </Reference>\r\n </ItemGroup>\r" +
"\n </When>\r\n </Choose>\r\n <Import Project=\"$(VSToolsPath)\\TeamTest\\Microsoft." +
"TestTools.targets\" Condition=\"Exists(\'$(VSToolsPath)\\TeamTest\\Microsoft.TestTool" +
"s.targets\')\" />\r\n <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets" +
"\" />\r\n <!-- To modify your build process, add your task inside one of the targe" +
"ts below and uncomment it. \r\n Other similar extension points exist, see Mi" +
"crosoft.Common.targets.\r\n <Target Name=\"BeforeBuild\">\r\n </Target>\r\n <Target N" +
"ame=\"AfterBuild\">\r\n </Target>\r\n -->\r\n</Project>");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public class UnitTestProjectFileBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 609 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.ProjectFiles
{
using System.Linq;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class VS2017ProjectFile : VS2017ProjectFileBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("<Project Sdk=\"Microsoft.NET.Sdk\">\r\n <PropertyGroup>\r\n <RunAnalyzersDuringBuild" +
" Condition=\"\'$(RunAnalyzersDuringBuild)\'==\'\'\">true</RunAnalyzersDuringBuild>\r\n");
#line 7 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (this.Project.TargetFrameworks.Count() == 1)
{
#line default
#line hidden
this.Write(" <TargetFramework>");
#line 11 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.TargetFrameworks.Single()));
#line default
#line hidden
this.Write("</TargetFramework>\r\n");
#line 12 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
else
{
#line default
#line hidden
this.Write(" <TargetFrameworks>");
#line 17 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(string.Join(";", this.Project.TargetFrameworks)));
#line default
#line hidden
this.Write("</TargetFrameworks>\r\n");
#line 19 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" <DefineConstants>$(DefineConstants);");
#line 22 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(string.Join(";", this.Project.DefineConstants)));
#line default
#line hidden
this.Write("</DefineConstants>\r\n");
#line 24 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (this.Project.TargetFrameworks.Contains("netstandard2.0"))
{
#line default
#line hidden
this.Write(" <DefineConstants Condition=\"\'$(TargetFramework)\' == \'netstandard2.0\'\">$(Defin" +
"eConstants);NETSTANDARD20;AWS_ASYNC_ENUMERABLES_API</DefineConstants>\r\n");
#line 29 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.TargetFrameworks.Contains("netcoreapp3.1"))
{
#line default
#line hidden
this.Write(" <DefineConstants Condition=\"\'$(TargetFramework)\' == \'netcoreapp3.1\'\">$(Define" +
"Constants);AWS_ASYNC_ENUMERABLES_API</DefineConstants>\r\n");
#line 35 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" <DebugType>portable</DebugType>\r\n <GenerateDocumentationFile>true</Generat" +
"eDocumentationFile>\r\n <AssemblyName>");
#line 40 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.AssemblyName));
#line default
#line hidden
this.Write("</AssemblyName>\r\n <PackageId>");
#line 41 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.AssemblyName));
#line default
#line hidden
this.Write(@"</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
");
#line 52 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (!string.IsNullOrEmpty(this.Project.FrameworkPathOverride))
{
#line default
#line hidden
this.Write(" <!-- workaround per https://github.com/Microsoft/msbuild/issues/1333 -->\r\n " +
" <FrameworkPathOverride>");
#line 57 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.FrameworkPathOverride));
#line default
#line hidden
this.Write("</FrameworkPathOverride>\r\n");
#line 58 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.TargetFrameworks.Contains("net35"))
{
#line default
#line hidden
this.Write(" <!-- workaround per https://github.com/dotnet/msbuild/issues/5985 -->\r\n <A" +
"utomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssembl" +
"yPackages>\r\n");
#line 66 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (!string.IsNullOrEmpty(this.Project.SupressWarnings))
{
#line default
#line hidden
this.Write(" <NoWarn>");
#line 72 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.SupressWarnings));
#line default
#line hidden
this.Write("</NoWarn>\r\n");
#line 73 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (!string.IsNullOrEmpty(this.Project.OutputPathOverride))
{
#line default
#line hidden
this.Write(" <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>\r" +
"\n <OutputPath>");
#line 80 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.OutputPathOverride));
#line default
#line hidden
this.Write("</OutputPath>\r\n");
#line 81 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" </PropertyGroup>\r\n");
#line 85 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (this.Project.TargetFrameworks.Contains("netstandard2.0"))
{
#line default
#line hidden
this.Write(" <!-- Async Enumerable Compatibility -->\r\n <PropertyGroup Condition=\"\'$(TargetF" +
"ramework)\' == \'netstandard2.0\'\">\r\n <LangVersion>8.0</LangVersion>\r\n </Proper" +
"tyGroup>\r\n");
#line 93 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
#line 96 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (!this.Project.AssemblyName.Contains("UnitTests"))
{
#line default
#line hidden
this.Write(" <PropertyGroup Condition=\" \'$(RuleSetFileForBuild)\' == \'false\' Or \'$(RuleSetFil" +
"eForBuild)\' == \'\' \">\r\n\t<CodeAnalysisRuleSet>");
#line 101 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.FxcopAnalyzerRuleSetFilePath));
#line default
#line hidden
this.Write("</CodeAnalysisRuleSet>\r\n </PropertyGroup>\r\n <PropertyGroup Condition=\" \'$(RuleS" +
"etFileForBuild)\' == \'true\' \">\r\n\t<CodeAnalysisRuleSet>");
#line 104 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.FxcopAnalyzerRuleSetFilePathForBuild));
#line default
#line hidden
this.Write("</CodeAnalysisRuleSet>\r\n </PropertyGroup>\r\n\r\n");
#line 107 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.SignBinaries)
{
#line default
#line hidden
this.Write(@" <Choose>
<When Condition="" '$(AWSKeyFile)' == '' "">
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\..\awssdk.dll.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(AWSKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Otherwise>
</Choose>
");
#line 125 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if(this.Project.CustomRoslynAnalyzersDllDirectory != null)
{
#line default
#line hidden
this.Write(" <ItemGroup Condition=\"$(RunAnalyzersDuringBuild)\">\r\n <Analyzer Include= \"");
#line 131 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Project.CustomRoslynAnalyzersDllDirectory));
#line default
#line hidden
this.Write("\" />\r\n </ItemGroup>\r\n");
#line 133 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if(this.Project.IndividualFileIncludes != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 139 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach (var compileIncludeEntry in this.Project.IndividualFileIncludes)
{
#line default
#line hidden
this.Write(" <Compile Include=\"");
#line 143 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(compileIncludeEntry));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 144 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n");
#line 148 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.CompileRemoveList != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 155 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach (var compileRemoveEntry in this.Project.CompileRemoveList)
{
if (compileRemoveEntry == "bin" || compileRemoveEntry == "obj")
{
#line default
#line hidden
this.Write(" <Compile Remove=\"**/");
#line 161 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(compileRemoveEntry));
#line default
#line hidden
this.Write("/**\"/>\r\n\t<None Remove=\"**/");
#line 162 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(compileRemoveEntry));
#line default
#line hidden
this.Write("/**\" />\r\n");
#line 163 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
continue;
}
#line default
#line hidden
this.Write(" <Compile Remove=\"**/");
#line 167 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(compileRemoveEntry));
#line default
#line hidden
this.Write("/**\"/>\r\n");
#line 168 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n\r\n");
#line 173 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
#line 176 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (this.Project.ProjectReferences != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 181 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach (var projectReference in this.Project.ProjectReferences)
{
#line default
#line hidden
this.Write(" <ProjectReference Include=\"");
#line 185 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(projectReference.IncludePath));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 186 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n\r\n");
#line 191 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
#line 194 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
if (this.Project.PackageReferences != null)
{
#line default
#line hidden
this.Write(" <ItemGroup Condition=\"$(RunAnalyzersDuringBuild)\">\r\n");
#line 199 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach(var package in this.Project.PackageReferences.Where(p => p.IsAnalyzer))
{
if(package.HasPrivateAssets)
{
#line default
#line hidden
this.Write(" <PackageReference Include=\"");
#line 205 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Include));
#line default
#line hidden
this.Write("\" Version=\"");
#line 205 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Version));
#line default
#line hidden
this.Write("\">\r\n <PrivateAssets>");
#line 206 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.PrivateAssets));
#line default
#line hidden
this.Write("</PrivateAssets>\r\n </PackageReference>\r\n");
#line 208 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
else
{
#line default
#line hidden
this.Write("\t <PackageReference Include=\"");
#line 213 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Include));
#line default
#line hidden
this.Write("\" Version=\"");
#line 213 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Version));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 214 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n <ItemGroup>\r\n");
#line 220 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach(var package in this.Project.PackageReferences.Where(p => !p.IsAnalyzer))
{
if(package.HasPrivateAssets)
{
#line default
#line hidden
this.Write(" <PackageReference Include=\"");
#line 226 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Include));
#line default
#line hidden
this.Write("\" Version=\"");
#line 226 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Version));
#line default
#line hidden
this.Write("\">\r\n <PrivateAssets>");
#line 227 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.PrivateAssets));
#line default
#line hidden
this.Write("</PrivateAssets>\r\n </PackageReference>\r\n");
#line 229 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
else
{
#line default
#line hidden
this.Write("\t <PackageReference Include=\"");
#line 234 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Include));
#line default
#line hidden
this.Write("\" Version=\"");
#line 234 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(package.Version));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 235 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n\r\n");
#line 241 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.ReferenceDependencies != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 247 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach (var reference in this.Project.ReferenceDependencies)
{
if (string.IsNullOrEmpty(reference.HintPath))
{
#line default
#line hidden
this.Write(" <Reference Include=\"");
#line 253 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.Name));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 254 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
else
{
#line default
#line hidden
this.Write(" <Reference Include=\"");
#line 259 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.Name));
#line default
#line hidden
this.Write("\">\r\n <HintPath>");
#line 260 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(reference.HintPath));
#line default
#line hidden
this.Write("</HintPath>\r\n </Reference>\r\n");
#line 262 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n\r\n");
#line 268 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.EmbeddedResources != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 274 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach (var resource in this.Project.EmbeddedResources)
{
#line default
#line hidden
this.Write(" <EmbeddedResource Include=\"");
#line 278 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resource));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 279 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n");
#line 283 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
if (this.Project.Services != null)
{
#line default
#line hidden
this.Write(" <ItemGroup>\r\n");
#line 290 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
foreach (var service in this.Project.Services)
{
#line default
#line hidden
this.Write(" <Service Include=\"");
#line 294 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(service));
#line default
#line hidden
this.Write("\"/>\r\n");
#line 295 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write(" </ItemGroup>\r\n");
#line 299 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
}
#line default
#line hidden
this.Write("\r\n</Project>\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 305 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\ProjectFiles\VS2017ProjectFile.tt"
public Project Project { get; set; }
public ServiceConfiguration ServiceConfiguration { get; set; }
#line default
#line hidden
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class VS2017ProjectFileBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 1,044 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class AssemblyInfo : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write(@"
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle(""");
#line 12 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.AssemblyTitle));
#line default
#line hidden
this.Write("\")]\r\n#if BCL35\r\n[assembly: AssemblyDescription(\"");
#line 14 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.AssemblyDescription(versionIdentifier: "3.5")));
#line default
#line hidden
this.Write("\")]\r\n#elif BCL45\r\n[assembly: AssemblyDescription(\"");
#line 16 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.AssemblyDescription(versionIdentifier: "4.5")));
#line default
#line hidden
this.Write("\")]\r\n#elif NETSTANDARD20\r\n[assembly: AssemblyDescription(\"");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.AssemblyDescription(versionIdentifier: "NetStandard 2.0")));
#line default
#line hidden
this.Write("\")]\r\n#elif NETCOREAPP3_1\r\n[assembly: AssemblyDescription(\"");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.AssemblyDescription(versionIdentifier: ".NET Core 3.1")));
#line default
#line hidden
this.Write(@""")]
#else
#error Unknown platform constant - unable to set correct AssemblyDescription
#endif
[assembly: AssemblyConfiguration("""")]
[assembly: AssemblyProduct(""Amazon Web Services SDK for .NET"")]
[assembly: AssemblyCompany(""Amazon.com, Inc"")]
[assembly: AssemblyCopyright(""Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved."")]
[assembly: AssemblyTrademark("""")]
[assembly: AssemblyCulture("""")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion(""1.0.*"")]
[assembly: AssemblyVersion(""");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceVersion));
#line default
#line hidden
this.Write("\")]\r\n[assembly: AssemblyFileVersion(\"");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\AssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceFileVersion));
#line default
#line hidden
this.Write("\")]\r\n\r\n[assembly: System.CLSCompliant(true)]\r\n\r\n#if BCL\r\n[assembly: System.Securi" +
"ty.AllowPartiallyTrustedCallers]\r\n#endif");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 122 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class BasePaginator : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing Sys" +
"tem.Collections;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing " +
"Amazon.Runtime;\r\n \r\nnamespace ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n /// <summary>\r\n /// Base class for ");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write(" paginators.\r\n /// </summary>\r\n internal sealed partial class ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Paginator : IPaginator<");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response>, I");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Paginator\r\n {\r\n private readonly IAmazon");
#line 25 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" _client;\r\n private readonly ");
#line 26 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Request _request;\r\n private int _isPaginatorInUse = 0;\r\n \r\n " +
"/// <summary>\r\n /// Enumerable containing all full responses for the oper" +
"ation\r\n /// </summary>\r\n public IPaginatedEnumerable<");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response> Responses => new PaginatedResponse<");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response>(this);\r\n");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
foreach(var resultKey in this.Operation.Paginators.ResultKeys.Where(r => r.ListItemType != null))
{
#line default
#line hidden
this.Write("\r\n /// <summary>\r\n /// Enumerable containing all of the ");
#line 39 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.Member.PropertyName));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n public IPaginatedEnumerable<");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.ListItemType));
#line default
#line hidden
this.Write("> ");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.Member.PropertyName));
#line default
#line hidden
this.Write(" => \r\n new PaginatedResultKeyResponse<");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response, ");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.ListItemType));
#line default
#line hidden
this.Write(">(this, (i) => i.");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.PropertyName));
#line default
#line hidden
this.Write(");\r\n");
#line 43 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write("\r\n internal ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Paginator(IAmazon");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" client, ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Request request)\r\n {\r\n this._client = client;\r\n this" +
"._request = request;\r\n }\r\n#if BCL\r\n IEnumerable<");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response> IPaginator<");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write(@"Response>.Paginate()
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException(""Paginator has already been consumed and cannot be reused. Please create a new instance."");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
");
#line 60 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
foreach(var inputToken in this.Operation.Paginators.InputTokens)
{
#line default
#line hidden
this.Write(" var ");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.Member.ArgumentName));
#line default
#line hidden
this.Write(" = _request.");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.PropertyName));
#line default
#line hidden
this.Write(";\r\n");
#line 65 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" ");
#line 68 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response response;\r\n do\r\n {\r\n");
#line 71 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
foreach(var inputToken in this.Operation.Paginators.InputTokens)
{
#line default
#line hidden
this.Write(" _request.");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.PropertyName));
#line default
#line hidden
this.Write(" = ");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.Member.ArgumentName));
#line default
#line hidden
this.Write(";\r\n");
#line 76 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" response = _client.");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("(_request);\r\n");
#line 80 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
for(var i = 0; i < this.Operation.Paginators.InputTokens.Count; i++)
{
#line default
#line hidden
this.Write(" ");
#line 84 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.InputTokens[i].Member.ArgumentName));
#line default
#line hidden
this.Write(" = response.");
#line 84 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.OutputTokens[i].PropertyName));
#line default
#line hidden
this.Write(";\r\n");
#line 85 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" yield return response;\r\n }\r\n");
#line 90 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
if (this.Operation.Paginators.MoreResults != null)
{
#line default
#line hidden
this.Write(" while (response.");
#line 94 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.MoreResults.PropertyName));
#line default
#line hidden
this.Write(");\r\n");
#line 95 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
else if (this.Operation.Paginators.InputTokens[0].IsListOrDict)
{
#line default
#line hidden
this.Write(" while (");
#line 100 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.InputTokens[0].Member.ArgumentName));
#line default
#line hidden
this.Write(".Count > 0);\r\n");
#line 101 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
else
{
#line default
#line hidden
this.Write(" while (!string.IsNullOrEmpty(");
#line 106 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.InputTokens[0].Member.ArgumentName));
#line default
#line hidden
this.Write("));\r\n");
#line 107 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" }\r\n#endif\r\n#if AWS_ASYNC_ENUMERABLES_API\r\n async IAsyncEnumerable<" +
"");
#line 113 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response> IPaginator<");
#line 113 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write(@"Response>.PaginateAsync(CancellationToken cancellationToken = default)
{
if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0)
{
throw new System.InvalidOperationException(""Paginator has already been consumed and cannot be reused. Please create a new instance."");
}
PaginatorUtils.SetUserAgentAdditionOnRequest(_request);
");
#line 120 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
foreach(var inputToken in this.Operation.Paginators.InputTokens)
{
#line default
#line hidden
this.Write(" var ");
#line 124 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.Member.ArgumentName));
#line default
#line hidden
this.Write(" = _request.");
#line 124 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.PropertyName));
#line default
#line hidden
this.Write(";\r\n");
#line 125 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" ");
#line 128 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response response;\r\n do\r\n {\r\n");
#line 131 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
foreach(var inputToken in this.Operation.Paginators.InputTokens)
{
#line default
#line hidden
this.Write(" _request.");
#line 135 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.PropertyName));
#line default
#line hidden
this.Write(" = ");
#line 135 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(inputToken.Member.ArgumentName));
#line default
#line hidden
this.Write(";\r\n");
#line 136 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" response = await _client.");
#line 139 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Async(_request, cancellationToken).ConfigureAwait(false);\r\n");
#line 140 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
for(var i = 0; i < this.Operation.Paginators.InputTokens.Count; i++)
{
#line default
#line hidden
this.Write(" ");
#line 144 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.InputTokens[i].Member.ArgumentName));
#line default
#line hidden
this.Write(" = response.");
#line 144 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.OutputTokens[i].PropertyName));
#line default
#line hidden
this.Write(";\r\n");
#line 145 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" cancellationToken.ThrowIfCancellationRequested();\r\n " +
" yield return response;\r\n }\r\n");
#line 151 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
if (this.Operation.Paginators.MoreResults != null)
{
#line default
#line hidden
this.Write(" while (response.");
#line 155 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.MoreResults.PropertyName));
#line default
#line hidden
this.Write(");\r\n");
#line 156 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
else if (this.Operation.Paginators.InputTokens[0].IsListOrDict)
{
#line default
#line hidden
this.Write(" while (");
#line 161 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.InputTokens[0].Member.ArgumentName));
#line default
#line hidden
this.Write(".Count > 0);\r\n");
#line 162 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
else
{
#line default
#line hidden
this.Write(" while (!string.IsNullOrEmpty(");
#line 167 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Paginators.InputTokens[0].Member.ArgumentName));
#line default
#line hidden
this.Write("));\r\n");
#line 168 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
}
#line default
#line hidden
this.Write(" }\r\n#endif\r\n }\r\n}\r\n \r\n");
return this.GenerationEnvironment.ToString();
}
#line 176 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginator.tt"
// The operation the marshaller will be used on
public Operation Operation { get; set; }
#line default
#line hidden
}
#line default
#line hidden
}
| 600 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class BasePaginatorInterface : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("using Amazon.Runtime;\r\n\r\nnamespace ");
#line 11 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n /// <summary>\r\n /// Paginator for the ");
#line 14 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write(" operation\r\n ///</summary>\r\n public interface I");
#line 16 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Paginator\r\n {\r\n /// <summary>\r\n /// Enumerable containing all fu" +
"ll responses for the operation\r\n /// </summary>\r\n IPaginatedEnumer" +
"able<");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write("Response> Responses { get; }\r\n");
#line 22 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
foreach(var resultKey in this.Operation.Paginators.ResultKeys)
{
if (resultKey.ListItemType != null)
{
#line default
#line hidden
this.Write("\r\n /// <summary>\r\n /// Enumerable containing all of the ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.Member.PropertyName));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n IPaginatedEnumerable<");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.ListItemType));
#line default
#line hidden
this.Write("> ");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(resultKey.Member.PropertyName));
#line default
#line hidden
this.Write(" { get; }\r\n");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}\r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BasePaginatorInterface.tt"
// The operation the marshaller will be used on
public Operation Operation { get; set; }
#line default
#line hidden
}
#line default
#line hidden
}
| 129 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseRequest.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class BaseRequest : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseRequest.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing Amazon.Runtime;\r\n\r\nnamespace ");
#line 12 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseRequest.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n /// <summary>\r\n /// Base class for ");
#line 15 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseRequest.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" operation requests.\r\n /// </summary>\r\n public partial class Amazon");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseRequest.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Request : AmazonWebServiceRequest\r\n {\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 68 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class BaseServiceException : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("using System;\r\nusing System.Collections.Generic;\r\nusing System.Net;\r\nusing System" +
".Text;\r\n\r\nusing Amazon.Runtime;\r\n\r\nnamespace ");
#line 16 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n ///<summary>\r\n /// Common exception for the ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" service.\r\n /// </summary>\r\n#if !NETSTANDARD\r\n [Serializable]\r\n#endif\r\n " +
"public partial class Amazon");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception : AmazonServiceException\r\n {\r\n /// <summary>\r\n /// Con" +
"struct instance of Amazon");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception\r\n /// </summary>\r\n /// <param name=\"message\"></param>\r\n " +
" public Amazon");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception(string message)\r\n : base(message)\r\n {\r\n }\r\n\r\n " +
" /// <summary>\r\n /// Construct instance of Amazon");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception\r\n /// </summary>\r\n /// <param name=\"message\"></param>\r\n " +
" /// <param name=\"innerException\"></param>\r\n public Amazon");
#line 40 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception(string message, Exception innerException)\r\n : base(message, " +
"innerException)\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Cons" +
"truct instance of Amazon");
#line 46 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception\r\n /// </summary>\r\n /// <param name=\"innerException\"></par" +
"am>\r\n public Amazon");
#line 49 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception(Exception innerException)\r\n : base(innerException.Message, i" +
"nnerException)\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Const" +
"ruct instance of Amazon");
#line 55 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Exception
/// </summary>
/// <param name=""message""></param>
/// <param name=""errorType""></param>
/// <param name=""errorCode""></param>
/// <param name=""requestId""></param>
/// <param name=""statusCode""></param>
public Amazon");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Exception(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode)
{
}
/// <summary>
/// Construct instance of Amazon");
#line 68 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Exception
/// </summary>
/// <param name=""message""></param>
/// <param name=""innerException""></param>
/// <param name=""errorType""></param>
/// <param name=""errorCode""></param>
/// <param name=""requestId""></param>
/// <param name=""statusCode""></param>
public Amazon");
#line 76 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Exception(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode)
{
}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the Amazon");
#line 83 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Exception class with serialized data.
/// </summary>
/// <param name=""info"">The <see cref=""T:System.Runtime.Serialization.SerializationInfo"" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name=""context"">The <see cref=""T:System.Runtime.Serialization.StreamingContext"" /> that contains contextual information about the source or destination.</param>
/// <exception cref=""T:System.ArgumentNullException"">The <paramref name=""info"" /> parameter is null. </exception>
/// <exception cref=""T:System.Runtime.Serialization.SerializationException"">The class name is null or <see cref=""P:System.Exception.HResult"" /> is zero (0). </exception>
protected Amazon");
#line 89 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\BaseServiceException.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Exception(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Ser" +
"ialization.StreamingContext context)\r\n : base(info, context)\r\n " +
" {\r\n }\r\n#endif\r\n }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 199 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\CoreAssemblyInfo.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class CoreAssemblyInfo : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write("\r\nusing System;\r\nusing System.Reflection;\r\nusing System.Runtime.InteropServices;\r" +
"\nusing System.Runtime.CompilerServices;\r\n\r\n// General Information about an assem" +
"bly is controlled through the following \r\n// set of attributes. Change these att" +
"ribute values to modify the information\r\n// associated with an assembly.\r\n[assem" +
"bly: AssemblyTitle(\"AWSSDK.Core\")]\r\n#if BCL35\r\n[assembly: AssemblyDescription(\"T" +
"he Amazon Web Services SDK for .NET (3.5) - Core Runtime\")]\r\n#elif BCL45\r\n[assem" +
"bly: AssemblyDescription(\"The Amazon Web Services SDK for .NET (4.5) - Core Runt" +
"ime\")]\r\n#elif NETSTANDARD20\r\n[assembly: AssemblyDescription(\"The Amazon Web Serv" +
"ices SDK for .NET (NetStandard 2.0) - Core Runtime\")]\r\n#elif NETCOREAPP3_1\r\n[ass" +
"embly: AssemblyDescription(\"The Amazon Web Services SDK for .NET (.NET Core 3.1)" +
" - Core Runtime\")]\r\n#else\r\n#error Unknown platform constant - unable to set corr" +
"ect AssemblyDescription\r\n#endif\r\n\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assem" +
"bly: AssemblyProduct(\"Amazon Web Services SDK for .NET\")]\r\n[assembly: AssemblyCo" +
"mpany(\"Amazon.com, Inc\")]\r\n[assembly: AssemblyCopyright(\"Copyright Amazon.com, I" +
"nc. or its affiliates. All Rights Reserved.\")]\r\n[assembly: AssemblyTrademark(\"\")" +
"]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the t" +
"ypes in this assembly not visible \r\n// to COM components. If you need to access" +
" a type in this assembly from \r\n// COM, set the ComVisible attribute to true on " +
"that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// Version information for an assem" +
"bly consists of the following four values:\r\n//\r\n// Major Version\r\n// M" +
"inor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify al" +
"l the values or you can default the Build and Revision Numbers \r\n// by using the" +
" \'*\' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: Assemb" +
"lyVersion(\"");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\CoreAssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["Version"]));
#line default
#line hidden
this.Write("\")]\r\n[assembly: AssemblyFileVersion(\"");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\CoreAssemblyInfo.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["FileVersion"]));
#line default
#line hidden
this.Write(@""")]
[assembly: System.CLSCompliant(true)]
#if BCL
[assembly: System.Security.AllowPartiallyTrustedCallers]
#endif
#if BCL45
// Setting SecurityRules to level 1 to match .NET 2.0 rules and allow the
// Amazon.Util.Settings.UserCrypto methods to work in .NET 4.5
[assembly: System.Security.SecurityRules(System.Security.SecurityRuleSet.Level1)]
#endif");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 85 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using ServiceClientGenerator.DefaultConfiguration;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class DefaultConfiguration : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write("\r\n");
this.Write("\r\n");
this.Write("\r\n");
#line 10 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Collections.Ob" +
"jectModel;\r\n\r\nusing Amazon.Runtime;\r\n\r\nnamespace ");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(base.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n /// <summary>\r\n /// Configuration for accessing Amazon ");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(base.Config.ClassName));
#line default
#line hidden
this.Write(" service\r\n /// </summary>\r\n public static class Amazon");
#line 26 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(base.Config.ClassName));
#line default
#line hidden
this.Write("DefaultConfiguration\r\n {\r\n /// <summary>\r\n /// Collection of all" +
" <see cref=\"DefaultConfiguration\"/>s supported by\r\n /// ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(base.Config.ClassName));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n public static ReadOnlyCollection<IDefaultConfig" +
"uration> GetAllConfigurations()\r\n {\r\n return new ReadOnlyColle" +
"ction<IDefaultConfiguration>(new List<IDefaultConfiguration>\r\n {\r\n " +
" ");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(string.Join(",\r\n ", base.DefaultConfigurationModel.Modes.Select(x => x.Name).ToArray())));
#line default
#line hidden
this.Write("\r\n });\r\n }\r\n\r\n");
#line 40 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
foreach (var mode in base.DefaultConfigurationModel.Modes)
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// ");
#line 45 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.Documentation));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n public static IDefaultConfiguration ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.Name));
#line default
#line hidden
this.Write(" {get;} = new DefaultConfiguration\r\n {\r\n Name = DefaultConfigur" +
"ationMode.");
#line 49 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.Name));
#line default
#line hidden
this.Write(",\r\n RetryMode = ");
#line 50 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameof(RequestRetryMode)));
#line default
#line hidden
this.Write(".");
#line 50 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.RetryMode));
#line default
#line hidden
this.Write(",\r\n StsRegionalEndpoints = ");
#line 51 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameof(StsRegionalEndpointsValue)));
#line default
#line hidden
this.Write(".");
#line 51 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.StsRegionalEndpoints));
#line default
#line hidden
this.Write(",\r\n S3UsEast1RegionalEndpoint = ");
#line 52 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(nameof(S3UsEast1RegionalEndpointValue)));
#line default
#line hidden
this.Write(".");
#line 52 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.S3UsEast1RegionalEndpoint));
#line default
#line hidden
this.Write(",\r\n");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
if (mode.ConnectTimeout.HasValue)
{
#line default
#line hidden
this.Write(" // ");
#line 57 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.ConnectTimeout.Value.ToString("g")));
#line default
#line hidden
this.Write("\r\n ConnectTimeout = TimeSpan.FromMilliseconds(");
#line 58 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.ConnectTimeout.Value.TotalMilliseconds));
#line default
#line hidden
this.Write("L),\r\n");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
else
{
#line default
#line hidden
this.Write(" ConnectTimeout = null,\r\n");
#line 65 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
if (mode.TlsNegotiationTimeout.HasValue)
{
#line default
#line hidden
this.Write(" // ");
#line 71 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.TlsNegotiationTimeout.Value.ToString("g")));
#line default
#line hidden
this.Write("\r\n TlsNegotiationTimeout = TimeSpan.FromMilliseconds(");
#line 72 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.TlsNegotiationTimeout.Value.TotalMilliseconds));
#line default
#line hidden
this.Write("L),\r\n");
#line 73 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
else
{
#line default
#line hidden
this.Write(" TlsNegotiationTimeout = null,\r\n");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
if (mode.TimeToFirstByteTimeout.HasValue)
{
#line default
#line hidden
this.Write(" // ");
#line 85 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.TimeToFirstByteTimeout.Value.ToString("g")));
#line default
#line hidden
this.Write("\r\n TimeToFirstByteTimeout = TimeSpan.FromMilliseconds(");
#line 86 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.TimeToFirstByteTimeout.Value.TotalMilliseconds));
#line default
#line hidden
this.Write("L),\r\n");
#line 87 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
else
{
#line default
#line hidden
this.Write(" TimeToFirstByteTimeout = null,\r\n");
#line 93 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
if (mode.HttpRequestTimeout.HasValue)
{
#line default
#line hidden
this.Write(" // ");
#line 99 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.HttpRequestTimeout.Value.ToString("g")));
#line default
#line hidden
this.Write("\r\n HttpRequestTimeout = TimeSpan.FromMilliseconds(");
#line 100 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.HttpRequestTimeout.Value.TotalMilliseconds));
#line default
#line hidden
this.Write("L)\r\n");
#line 101 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
else
{
#line default
#line hidden
this.Write(" HttpRequestTimeout = null\r\n");
#line 107 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
#line default
#line hidden
this.Write(" };\r\n");
#line 111 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfiguration.tt"
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 329 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class DefaultConfigurationModeGenerator : DefaultConfigurationModeGeneratorBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"/*******************************************************************************
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the ""License""). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the ""license"" file accompanying this file.
* This file is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* *****************************************************************************
* __ _ _ ___
* ( )( \/\/ )/ __)
* /__\ \ / \__ \
* (_)(_) \/\/ (___/
*
* AWS SDK for .NET
*
*/
/*
* Do not modify this file. This file is generated from the sdk-default-configuration.json file.
*/
namespace Amazon.Runtime
{
/// <summary>
/// Enumeration of the supported Default Configurations available to to <see cref=""AmazonServiceClient"" /> objects.
/// </summary>
public enum DefaultConfigurationMode
{
");
#line 35 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
foreach (var mode in DefaultConfigurationModel.Modes)
{
var trailingComma = DefaultConfigurationModel.Modes.Last() == mode ? "" : ",";
#line default
#line hidden
this.Write(" /// <summary>\r\n /// ");
#line 40 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.Documentation));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n ");
#line 42 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(mode.Name));
#line default
#line hidden
#line 42 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(trailingComma));
#line default
#line hidden
this.Write("\r\n");
#line 43 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 47 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\DefaultConfigurationModeGenerator.tt"
public ServiceClientGenerator.DefaultConfiguration.DefaultConfigurationModel DefaultConfigurationModel { get; set; }
#line default
#line hidden
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class DefaultConfigurationModeGeneratorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 386 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class EndpointsGenerator : EndpointsGeneratorBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("/*******************************************************************************\r" +
"\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\r\n * Lic" +
"ensed under the Apache License, Version 2.0 (the \"License\"). You may not use\r\n *" +
" this file except in compliance with the License. A copy of the License is loca" +
"ted at\r\n *\r\n * http://aws.amazon.com/apache2.0\r\n *\r\n * or in the \"license\" fil" +
"e accompanying this file.\r\n * This file is distributed on an \"AS IS\" BASIS, WIT" +
"HOUT WARRANTIES OR\r\n * CONDITIONS OF ANY KIND, either express or implied. See t" +
"he License for the\r\n * specific language governing permissions and limitations " +
"under the License.\r\n * *********************************************************" +
"********************\r\n * __ _ _ ___\r\n * ( )( \\/\\/ )/ __)\r\n * /__\\ \\" +
" / \\__ \\\r\n * (_)(_) \\/\\/ (___/\r\n *\r\n * AWS SDK for .NET\r\n *\r\n */\r\nnamespac" +
"e Amazon\r\n{\r\n /// <summary>\r\n /// This class contains region information u" +
"sed to lazily compute the service endpoints. The static constants representing t" +
"he \r\n /// regions can be used while constructing the AWS client instead of lo" +
"oking up the exact endpoint URL.\r\n /// </summary>\r\n public partial class R" +
"egionEndpoint\r\n {\r\n /// <summary>\r\n /// The US East (Virginia) " +
"regional endpoint.\r\n /// S3-specific, use for backward compatibility only" +
".\r\n /// </summary>\r\n private static readonly RegionEndpoint USEast" +
"1Regional = GetEndpoint(\"us-east-1-regional\", \"US East (Virginia) regional\");\r\n\r" +
"\n");
#line 37 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
foreach (var endpoint in Endpoints) {
#line default
#line hidden
this.Write(" /// <summary>\r\n /// The ");
#line 39 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.RegionName));
#line default
#line hidden
this.Write(" endpoint.\r\n /// </summary>\r\n public static readonly RegionEndpoint" +
" ");
#line 41 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.Name));
#line default
#line hidden
this.Write(" = GetEndpoint(\"");
#line 41 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.RegionCode));
#line default
#line hidden
this.Write("\", \"");
#line 41 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.RegionName));
#line default
#line hidden
this.Write("\");\r\n\r\n");
#line 43 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 47 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\EndpointsGenerator.tt"
public System.Collections.Generic.List<ServiceClientGenerator.EndpointConstant> Endpoints { get; set; }
#line default
#line hidden
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class EndpointsGeneratorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 379 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\InternalSDKUtils.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class InternalSDKUtils : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write(@"
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the ""License"").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the ""license"" file accompanying this file. This file is distributed
* on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This is a generated file.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Text;
using Amazon.Runtime.Internal.Util;
namespace Amazon.Util.Internal
{
public static partial class InternalSDKUtils
{
internal const string CoreVersionNumber = """);
#line 38 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\InternalSDKUtils.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Session["FileVersion"]));
#line default
#line hidden
this.Write("\";\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 78 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class LegacyResponseClass : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing System;\r\n\r\nnamespace ");
#line 12 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n /// <summary>\r\n /// Configuration for accessing Amazon ");
#line 15 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write(" service\r\n /// </summary>\r\n\tpublic partial class ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Response : ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Result\r\n\t{\r\n /// <summary>\r\n /// Gets and sets the ");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Result property.\r\n /// Represents the output of a ");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write(" operation.\r\n /// </summary>\r\n [Obsolete(@\"This property has been d" +
"eprecated. All properties of the ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Result class are now available on the ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Response class. You should use the properties on ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Response instead of accessing them through ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Result.\")]\r\n public ");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Result ");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.OperationName));
#line default
#line hidden
this.Write("Result\r\n {\r\n get\r\n {\r\n return this;\r\n" +
" }\r\n }\r\n }\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\LegacyResponseClass.tt"
public string OperationName { get; set; }
#line default
#line hidden
}
#line default
#line hidden
}
| 141 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class S3EnumerationsGenerator : S3EnumerationsGeneratorBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(@"/*******************************************************************************
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the ""License""). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the ""license"" file accompanying this file.
* This file is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* *****************************************************************************
* __ _ _ ___
* ( )( \/\/ )/ __)
* /__\ \ / \__ \
* (_)(_) \/\/ (___/
*
* AWS SDK for .NET
*
*/
namespace Amazon.S3
{
public sealed partial class S3Region
{
");
#line 27 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
foreach (var endpoint in Endpoints) {
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Specifies that the S3 Bucket should use the ");
#line 29 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.RegionCode));
#line default
#line hidden
this.Write(" locality.\r\n /// </summary>\r\n public static readonly S3Region ");
#line 31 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.Name));
#line default
#line hidden
this.Write(" = new S3Region(\"");
#line 31 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpoint.ConvertedRegionCode));
#line default
#line hidden
this.Write("\");\r\n\r\n");
#line 33 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 37 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\S3EnumerationsGenerator.tt"
public System.Collections.Generic.List<ServiceClientGenerator.EndpointConstant> Endpoints { get; set; }
#line default
#line hidden
}
#line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class S3EnumerationsGeneratorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
| 376 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceClients : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Net;\r\n\r\nusing " +
"");
#line 15 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 16 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations;\r\nusing ");
#line 17 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Internal;\r\nusing Amazon.Runtime;\r\nusing Amazon.Runtime.Internal;\r\nusing Amazon.R" +
"untime.Internal.Auth;\r\nusing Amazon.Runtime.Internal.Transform;\r\n\r\nnamespace ");
#line 23 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 25 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.FormatServiceClientDocumentation(this.Config.ServiceModel.Documentation);
#line default
#line hidden
this.Write("\tpublic partial class Amazon");
#line 26 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client : AmazonServiceClient, IAmazon");
#line 26 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("\r\n\t{\r\n\t\tprivate static IServiceMetadata serviceMetadata = new Amazon");
#line 28 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Metadata();\r\n\r\n");
#line 30 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
// Creates paginators for service if available
if (this.Config.ServiceModel.HasPaginators)
{
#line default
#line hidden
this.Write("#if BCL45 || AWS_ASYNC_ENUMERABLES_API\r\n private I");
#line 36 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory _paginators;\r\n\r\n /// <summary>\r\n /// Paginators fo" +
"r the service\r\n /// </summary>\r\n public I");
#line 41 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory Paginators \r\n {\r\n get \r\n {\r\n " +
" if (this._paginators == null) \r\n {\r\n " +
"this._paginators = new ");
#line 47 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory(this);\r\n }\r\n return this._paginato" +
"rs;\r\n }\r\n }\r\n#endif\r\n");
#line 53 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
#line 56 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
// Creates constructors for the service if the model specifies to do so
if(this.Config.GenerateConstructors)
{
var usesBearerAuth = this.Config.ServiceModel.SignatureVersion == "bearer";
var fallbackToAnonymousCredentials = usesBearerAuth;
#line default
#line hidden
this.Write(" #region Constructors\r\n\r\n /// <summary>\r\n /// Constructs Ama" +
"zon");
#line 67 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
public Amazon");
#line 81 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client()\r\n : base(FallbackCredentialsFactory.GetCredentials(");
#line 82 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), new Amazon");
#line 82 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config()) { }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 85 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 100 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(RegionEndpoint region)\r\n : base(FallbackCredentialsFactory.GetC" +
"redentials(");
#line 101 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), new Amazon");
#line 101 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region}) { }\r\n\r\n /// <summary>\r\n /// Constr" +
"ucts Amazon");
#line 104 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name=""config"">The Amazon");
#line 118 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 119 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(Amazon");
#line 119 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config config)\r\n : base(FallbackCredentialsFactory.GetCredentials(");
#line 120 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), config) { }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 123 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials\r\n /// </summary>\r\n /// <param name=\"cre" +
"dentials\">AWS Credentials</param>\r\n public Amazon");
#line 126 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials)\r\n : this(credentials, new Amazon");
#line 127 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 132 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials\r\n /// </summary>\r\n /// <param name=\"cre" +
"dentials\">AWS Credentials</param>\r\n /// <param name=\"region\">The region t" +
"o connect.</param>\r\n public Amazon");
#line 136 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials, RegionEndpoint region)\r\n : this(cre" +
"dentials, new Amazon");
#line 137 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region})\r\n {\r\n }\r\n\r\n /// <summary>\r\n" +
" /// Constructs Amazon");
#line 142 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials and an\r\n /// Amazon");
#line 143 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration object.\r\n /// </summary>\r\n /// <param name=\"cr" +
"edentials\">AWS Credentials</param>\r\n /// <param name=\"clientConfig\">The A" +
"mazon");
#line 146 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 147 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials, Amazon");
#line 147 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(credentials, clientConfig)\r\n {\r\n " +
" }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 153 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID and AWS Secret Key\r\n /// </summary>\r\n " +
" /// <param name=\"awsAccessKeyId\">AWS Access Key ID</param>\r\n /// <param " +
"name=\"awsSecretAccessKey\">AWS Secret Access Key</param>\r\n public Amazon");
#line 157 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey)\r\n : this(awsA" +
"ccessKeyId, awsSecretAccessKey, new Amazon");
#line 158 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 163 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 168 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)\r\n" +
" : this(awsAccessKeyId, awsSecretAccessKey, new Amazon");
#line 169 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config() {RegionEndpoint=region})\r\n {\r\n }\r\n\r\n /// <summary>\r" +
"\n /// Constructs Amazon");
#line 174 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID, AWS Secret Key and an\r\n /// Amazon");
#line 175 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration object. \r\n /// </summary>\r\n /// <param name=\"a" +
"wsAccessKeyId\">AWS Access Key ID</param>\r\n /// <param name=\"awsSecretAcce" +
"ssKey\">AWS Secret Access Key</param>\r\n /// <param name=\"clientConfig\">The" +
" Amazon");
#line 179 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 180 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, Amazon");
#line 180 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(awsAccessKeyId, awsSecretAccessKey, clie" +
"ntConfig)\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs" +
" Amazon");
#line 186 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
public Amazon");
#line 191 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)\r" +
"\n : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new Ama" +
"zon");
#line 192 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 197 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 203 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, " +
"RegionEndpoint region)\r\n : this(awsAccessKeyId, awsSecretAccessKey, a" +
"wsSessionToken, new Amazon");
#line 204 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region})\r\n {\r\n }\r\n\r\n /// <summary>\r\n" +
" /// Constructs Amazon");
#line 209 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID, AWS Secret Key and an\r\n /// Amazon");
#line 210 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client Configuration object.
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
/// <param name=""clientConfig"">The Amazon");
#line 215 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 216 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, " +
"Amazon");
#line 216 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(awsAccessKeyId, awsSecretAccessKey, awsS" +
"essionToken, clientConfig)\r\n {\r\n }\r\n\r\n #endregion\r\n");
#line 222 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write("\r\n #region Overrides\r\n\r\n \r\n /// <summary>\r\n /// Creat" +
"es the signer for the service.\r\n /// </summary>\r\n protected overri" +
"de AbstractAWSSigner CreateSigner()\r\n {\r\n return new ");
#line 234 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GeneratorHelpers.DetermineSigner(this.Config.ServiceModel.SignatureVersion, this.Config.ClassName)));
#line default
#line hidden
this.Write("();\r\n }\r\n\r\n");
#line 237 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if(this.Config.ServiceModel.Customizations.PipelineOverride != null || this.Config.EndpointsRuleSet != null) {
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Customize the pipeline\r\n /// </summary>" +
"\r\n /// <param name=\"pipeline\"></param>\r\n protected override void C" +
"ustomizeRuntimePipeline(RuntimePipeline pipeline)\r\n {\r\n");
#line 244 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
var pipelineOverrides = this.Config.ServiceModel.Customizations.PipelineOverride;
if (pipelineOverrides != null)
{
foreach(var o in pipelineOverrides.Overrides)
{
if(!string.IsNullOrEmpty(o.Condition))
{
#line default
#line hidden
this.Write(" if(");
#line 253 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.Condition));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 255 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if(o.OverrideMethod == "remove")
{
#line default
#line hidden
this.Write(" pipeline.");
#line 259 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("();\r\n");
#line 260 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
else
{
#line default
#line hidden
this.Write(" pipeline.");
#line 265 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("(new ");
#line 265 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));
#line default
#line hidden
this.Write("(");
#line 265 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));
#line default
#line hidden
this.Write("));\r\n");
#line 266 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 270 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
else if(o.OverrideMethod == "remove")
{
#line default
#line hidden
this.Write(" pipeline.");
#line 275 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("();\r\n");
#line 276 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
else
{
#line default
#line hidden
this.Write(" pipeline.");
#line 281 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("(new ");
#line 281 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));
#line default
#line hidden
this.Write("(");
#line 281 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));
#line default
#line hidden
this.Write("));\r\n");
#line 282 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
}
}
#line default
#line hidden
#line 287 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if (this.Config.EndpointsRuleSet != null) {
#line default
#line hidden
this.Write(" pipeline.RemoveHandler<Amazon.Runtime.Internal.EndpointResolver>();\r\n" +
" pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Ama" +
"zon");
#line 289 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EndpointResolver());\r\n");
#line 290 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 292 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(@" /// <summary>
/// Capture metadata for the service.
/// </summary>
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
/// <summary>
/// Disposes the service client.
/// </summary>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
");
#line 320 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
var endpointOperation = this.Config.ServiceModel.FindEndpointOperation();
if(endpointOperation != null)
{
#line default
#line hidden
this.Write(@" #region EndpointOperation Override
protected override IEnumerable<DiscoveryEndpointBase> EndpointOperation(EndpointOperationContextBase context)
{
return EndpointDiscoveryResolver.ResolveEndpoints(context, () =>
{
var request = new ");
#line 331 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpointOperation.Name));
#line default
#line hidden
this.Write("Request\r\n\t\t\t\t{\r\n");
#line 333 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if(endpointOperation.RequestHasOperationEndpointOperationMember)
{
#line default
#line hidden
this.Write("\t\t\t\t Operation = context.OperationName,\r\n");
#line 338 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
if(endpointOperation.RequestHasIdentifiersEndpointOperationMember)
{
#line default
#line hidden
this.Write("\t\t\t\t Identifiers = new Dictionary<string, string>(context.EndpointDiscoveryDat" +
"a.Identifiers),\r\n");
#line 344 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write("\t\t\t\t}; \r\n\r\n\t\t\t\tvar response = ");
#line 349 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpointOperation.Name));
#line default
#line hidden
this.Write(@"(request);
if(response.HttpStatusCode != HttpStatusCode.OK || response.Endpoints == null)
{
return null;
}
var endpoints = new List<DiscoveryEndpointBase>();
foreach(var endpoint in response.Endpoints)
{
endpoints.Add(new DiscoveryEndpoint(endpoint.Address, endpoint.CachePeriodInMinutes));
}
return endpoints;
});
}
#endregion
");
#line 366 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
// Generates methods for each operation in the model
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n #region ");
#line 375 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\r\n");
#line 376 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
this.FormatOperationDocumentationSync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 383 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 384 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(" public virtual ");
#line 387 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 387 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("()\r\n {\r\n return ");
#line 389 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(new ");
#line 389 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request());\r\n }\r\n");
#line 391 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
AddSimpleClientMethods(operation, true);
#line default
#line hidden
#line 395 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.FormatOperationDocumentationSync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 400 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 401 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(" ");
#line 404 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.IsInternal ? "internal" : "public"));
#line default
#line hidden
this.Write(" virtual ");
#line 404 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 404 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 404 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request)\r\n {\r\n var options = new InvokeOptions();\r\n " +
" options.RequestMarshaller = ");
#line 407 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller.Instance;\r\n options.ResponseUnmarshaller = ");
#line 408 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n");
#line 409 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" options.EndpointDiscoveryMarshaller = ");
#line 413 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller.Instance;\r\n options.EndpointOperation = En" +
"dpointOperation;\r\n");
#line 415 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write("\r\n return Invoke<");
#line 419 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>(request, options);\r\n }\r\n\r\n");
#line 422 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
AddBeginAsyncDocumentation(operation);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 427 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 428 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(" ");
#line 431 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.IsInternal ? "internal" : "public"));
#line default
#line hidden
this.Write(" virtual IAsyncResult Begin");
#line 431 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 431 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request, AsyncCallback callback, object state)\r\n {\r\n va" +
"r options = new InvokeOptions();\r\n options.RequestMarshaller = ");
#line 434 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller.Instance;\r\n options.ResponseUnmarshaller = ");
#line 435 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n");
#line 436 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" options.EndpointDiscoveryMarshaller = ");
#line 440 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller.Instance;\r\n options.EndpointOperation = En" +
"dpointOperation;\r\n");
#line 442 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write("\r\n return BeginInvoke(request, options, callback, state);\r\n }\r\n" +
"\r\n");
#line 449 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
AddEndAsyncDocumentation(operation);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 454 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 455 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write(" ");
#line 458 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.IsInternal ? "internal" : "public"));
#line default
#line hidden
this.Write(" virtual ");
#line 458 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response End");
#line 458 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(IAsyncResult asyncResult)\r\n {\r\n return EndInvoke<");
#line 460 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>(asyncResult);\r\n }\r\n\r\n #endregion\r\n ");
#line 464 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients.tt"
}
#line default
#line hidden
this.Write("\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 1,229 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceClients45 : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Runtime.ExceptionServices;\r\nusing System.Threadin" +
"g;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Generic;\r\nusing Syst" +
"em.Net;\r\n\r\nusing ");
#line 18 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 19 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations;\r\nusing ");
#line 20 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Internal;\r\nusing Amazon.Runtime;\r\nusing Amazon.Runtime.Internal;\r\nusing Amazon.R" +
"untime.Internal.Auth;\r\nusing Amazon.Runtime.Internal.Transform;\r\n\r\nnamespace ");
#line 26 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 28 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.FormatServiceClientDocumentation(this.Config.ServiceModel.Documentation);
#line default
#line hidden
this.Write(" public partial class Amazon");
#line 29 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client : AmazonServiceClient, IAmazon");
#line 29 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("\r\n {\r\n\t\tprivate static IServiceMetadata serviceMetadata = new Amazon");
#line 31 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Metadata();\r\n");
#line 32 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
// Creates paginators for service if available
if (this.Config.ServiceModel.HasPaginators)
{
#line default
#line hidden
this.Write(" private I");
#line 37 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory _paginators;\r\n\r\n /// <summary>\r\n /// Paginators fo" +
"r the service\r\n /// </summary>\r\n public I");
#line 42 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory Paginators \r\n {\r\n get \r\n {\r\n " +
" if (this._paginators == null) \r\n {\r\n " +
"this._paginators = new ");
#line 48 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory(this);\r\n }\r\n return this._paginato" +
"rs;\r\n }\r\n }\r\n");
#line 53 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
#line 56 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
// Generates basic constructors for the service if enabled in the model
if(this.Config.GenerateConstructors)
{
var usesBearerAuth = this.Config.ServiceModel.SignatureVersion == "bearer";
var fallbackToAnonymousCredentials = usesBearerAuth;
#line default
#line hidden
this.Write(" #region Constructors\r\n\r\n /// <summary>\r\n /// Constructs Ama" +
"zon");
#line 66 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
public Amazon");
#line 80 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client()\r\n : base(FallbackCredentialsFactory.GetCredentials(");
#line 81 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), new Amazon");
#line 81 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config()) { }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 84 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 99 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(RegionEndpoint region)\r\n : base(FallbackCredentialsFactory.GetC" +
"redentials(");
#line 100 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), new Amazon");
#line 100 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region}) { }\r\n\r\n /// <summary>\r\n /// Constr" +
"ucts Amazon");
#line 103 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name=""config"">The Amazon");
#line 117 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 118 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(Amazon");
#line 118 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config config)\r\n : base(FallbackCredentialsFactory.GetCredentials(");
#line 119 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), config) { }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 122 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials\r\n /// </summary>\r\n /// <param name=\"cre" +
"dentials\">AWS Credentials</param>\r\n public Amazon");
#line 125 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials)\r\n : this(credentials, new Amazon");
#line 126 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 131 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials\r\n /// </summary>\r\n /// <param name=\"cre" +
"dentials\">AWS Credentials</param>\r\n /// <param name=\"region\">The region t" +
"o connect.</param>\r\n public Amazon");
#line 135 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials, RegionEndpoint region)\r\n : this(cre" +
"dentials, new Amazon");
#line 136 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region})\r\n {\r\n }\r\n\r\n /// <summary>\r\n" +
" /// Constructs Amazon");
#line 141 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials and an\r\n /// Amazon");
#line 142 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration object.\r\n /// </summary>\r\n /// <param name=\"cr" +
"edentials\">AWS Credentials</param>\r\n /// <param name=\"clientConfig\">The A" +
"mazon");
#line 145 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 146 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials, Amazon");
#line 146 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(credentials, clientConfig)\r\n {\r\n " +
" }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 152 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID and AWS Secret Key\r\n /// </summary>\r\n " +
" /// <param name=\"awsAccessKeyId\">AWS Access Key ID</param>\r\n /// <param " +
"name=\"awsSecretAccessKey\">AWS Secret Access Key</param>\r\n public Amazon");
#line 156 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey)\r\n : this(awsA" +
"ccessKeyId, awsSecretAccessKey, new Amazon");
#line 157 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 162 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 167 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)\r\n" +
" : this(awsAccessKeyId, awsSecretAccessKey, new Amazon");
#line 168 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config() {RegionEndpoint=region})\r\n {\r\n }\r\n\r\n /// <summary>\r" +
"\n /// Constructs Amazon");
#line 173 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID, AWS Secret Key and an\r\n /// Amazon");
#line 174 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration object. \r\n /// </summary>\r\n /// <param name=\"a" +
"wsAccessKeyId\">AWS Access Key ID</param>\r\n /// <param name=\"awsSecretAcce" +
"ssKey\">AWS Secret Access Key</param>\r\n /// <param name=\"clientConfig\">The" +
" Amazon");
#line 178 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 179 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, Amazon");
#line 179 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(awsAccessKeyId, awsSecretAccessKey, clie" +
"ntConfig)\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs" +
" Amazon");
#line 185 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
public Amazon");
#line 190 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)\r" +
"\n : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new Ama" +
"zon");
#line 191 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 196 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 202 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, " +
"RegionEndpoint region)\r\n : this(awsAccessKeyId, awsSecretAccessKey, a" +
"wsSessionToken, new Amazon");
#line 203 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region})\r\n {\r\n }\r\n\r\n /// <summary>\r\n" +
" /// Constructs Amazon");
#line 208 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID, AWS Secret Key and an\r\n /// Amazon");
#line 209 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client Configuration object.
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
/// <param name=""clientConfig"">The Amazon");
#line 214 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 215 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, " +
"Amazon");
#line 215 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(awsAccessKeyId, awsSecretAccessKey, awsS" +
"essionToken, clientConfig)\r\n {\r\n }\r\n\r\n #endregion\r\n");
#line 221 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write("\r\n #region Overrides\r\n\r\n /// <summary>\r\n /// Creates the sig" +
"ner for the service.\r\n /// </summary>\r\n protected override Abstrac" +
"tAWSSigner CreateSigner()\r\n {\r\n return new ");
#line 232 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GeneratorHelpers.DetermineSigner(this.Config.ServiceModel.SignatureVersion, this.Config.ClassName)));
#line default
#line hidden
this.Write("();\r\n } \r\n\r\n");
#line 235 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
if(this.Config.ServiceModel.Customizations.PipelineOverride != null || this.Config.EndpointsRuleSet != null) {
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Customize the pipeline\r\n /// </summary>" +
"\r\n /// <param name=\"pipeline\"></param>\r\n protected override void C" +
"ustomizeRuntimePipeline(RuntimePipeline pipeline)\r\n {\r\n");
#line 242 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
var pipelineOverrides = this.Config.ServiceModel.Customizations.PipelineOverride;
if (pipelineOverrides != null)
{
foreach(var o in pipelineOverrides.Overrides )
{
if(!string.IsNullOrEmpty(o.Condition))
{
#line default
#line hidden
this.Write(" if(");
#line 251 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.Condition));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 253 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
if(o.OverrideMethod == "remove")
{
#line default
#line hidden
this.Write(" pipeline.");
#line 257 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("();\r\n");
#line 258 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
else
{
#line default
#line hidden
this.Write(" pipeline.");
#line 263 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("(new ");
#line 263 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));
#line default
#line hidden
this.Write("(");
#line 263 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));
#line default
#line hidden
this.Write("));\r\n");
#line 264 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 268 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
else if(o.OverrideMethod == "remove")
{
#line default
#line hidden
this.Write(" pipeline.");
#line 273 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("();\r\n");
#line 274 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
else
{
#line default
#line hidden
this.Write(" pipeline.");
#line 279 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("(new ");
#line 279 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));
#line default
#line hidden
this.Write("(");
#line 279 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));
#line default
#line hidden
this.Write("));\r\n");
#line 280 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
}
}
#line default
#line hidden
#line 285 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
if (this.Config.EndpointsRuleSet != null) {
#line default
#line hidden
this.Write(" pipeline.RemoveHandler<Amazon.Runtime.Internal.EndpointResolver>();\r\n" +
" pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Ama" +
"zon");
#line 287 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EndpointResolver());\r\n");
#line 288 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" }\t\r\n");
#line 290 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(@" /// <summary>
/// Capture metadata for the service.
/// </summary>
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
/// <summary>
/// Disposes the service client.
/// </summary>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
");
#line 318 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
var endpointOperation = this.Config.ServiceModel.FindEndpointOperation();
if(endpointOperation != null)
{
#line default
#line hidden
this.Write(@" #region EndpointOperation Override
protected override IEnumerable<DiscoveryEndpointBase> EndpointOperation(EndpointOperationContextBase context)
{
return EndpointDiscoveryResolver.ResolveEndpoints(context, () =>
{
var request = new ");
#line 329 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpointOperation.Name));
#line default
#line hidden
this.Write("Request\r\n\t\t\t\t{\r\n");
#line 331 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
if(endpointOperation.RequestHasOperationEndpointOperationMember)
{
#line default
#line hidden
this.Write("\t\t\t\t\tOperation = context.OperationName,\r\n");
#line 336 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
if(endpointOperation.RequestHasIdentifiersEndpointOperationMember)
{
#line default
#line hidden
this.Write("\t\t\t\t\tIdentifiers = new Dictionary<string, string>(context.EndpointDiscoveryData.I" +
"dentifiers),\r\n");
#line 342 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write("\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tvar response = ");
#line 347 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpointOperation.Name));
#line default
#line hidden
this.Write(@"(request);
if(response.HttpStatusCode != HttpStatusCode.OK || response.Endpoints == null)
{
return null;
}
var endpoints = new List<DiscoveryEndpointBase>();
foreach(var endpoint in response.Endpoints)
{
endpoints.Add(new DiscoveryEndpoint(endpoint.Address, endpoint.CachePeriodInMinutes));
}
return endpoints;
});
}
#endregion
");
#line 364 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n #region ");
#line 371 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\r\n\r\n");
#line 373 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
// Creates a version of the operation that takes no arguments and passes a request with no set members if specified in the customizations
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 378 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.FormatOperationDocumentationSync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 383 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 384 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" public virtual ");
#line 387 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 387 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("()\r\n {\r\n return ");
#line 389 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(new ");
#line 389 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request());\r\n }\r\n\r\n");
#line 392 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
// Adds any simple method forms specified in the customizations file
AddSimpleClientMethods(operation, true);
#line default
#line hidden
#line 397 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.FormatOperationDocumentationSync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 402 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 403 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" ");
#line 406 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.IsInternal ? "internal" : "public"));
#line default
#line hidden
this.Write(" virtual ");
#line 406 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 406 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 406 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request)\r\n {\r\n var options = new InvokeOptions();\r\n " +
" options.RequestMarshaller = ");
#line 409 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller.Instance;\r\n options.ResponseUnmarshaller = ");
#line 410 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n");
#line 411 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" options.EndpointDiscoveryMarshaller = ");
#line 415 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller.Instance;\r\n options.EndpointOperation = En" +
"dpointOperation;\r\n");
#line 417 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write("\r\n return Invoke<");
#line 421 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>(request, options);\r\n }\r\n\r\n");
#line 424 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
// Creates a version of the operation that takes no arguments and passes a request with no set members if specified in the customizations
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 429 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.FormatOperationDocumentationAsync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 434 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 435 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" public virtual Task<");
#line 438 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 438 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(System.Threading.CancellationToken cancellationToken = default(Cancellation" +
"Token))\r\n {\r\n return ");
#line 440 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(new ");
#line 440 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request(), cancellationToken);\r\n }\r\n");
#line 442 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
// Add async simple methods
AddSimpleClientMethods(operation, false);
this.FormatOperationDocumentationAsync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 452 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 453 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" ");
#line 456 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.IsInternal ? "internal" : "public"));
#line default
#line hidden
this.Write(" virtual Task<");
#line 456 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 456 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(");
#line 456 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request, System.Threading.CancellationToken cancellationToken = default(C" +
"ancellationToken))\r\n {\r\n var options = new InvokeOptions();\r\n " +
" options.RequestMarshaller = ");
#line 459 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller.Instance;\r\n options.ResponseUnmarshaller = ");
#line 460 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n");
#line 461 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" options.EndpointDiscoveryMarshaller = ");
#line 465 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller.Instance;\r\n options.EndpointOperation = En" +
"dpointOperation;\r\n");
#line 467 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write(" \r\n return InvokeAsync<");
#line 471 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>(request, options, cancellationToken);\r\n }\r\n\r\n #endregion\r" +
"\n ");
#line 475 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClients45.tt"
}
#line default
#line hidden
this.Write("\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 1,267 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceClientsNetStandard : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Runtime.ExceptionServices;\r\nusing System.Threadin" +
"g;\r\nusing System.Threading.Tasks;\r\nusing System.Collections.Generic;\r\nusing Syst" +
"em.Net;\r\n\r\nusing ");
#line 18 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 19 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations;\r\nusing ");
#line 20 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Internal;\r\nusing Amazon.Runtime;\r\nusing Amazon.Runtime.Internal;\r\nusing Amazon.R" +
"untime.Internal.Auth;\r\nusing Amazon.Runtime.Internal.Transform;\r\n\r\nnamespace ");
#line 26 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 28 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.FormatServiceClientDocumentation(this.Config.ServiceModel.Documentation);
#line default
#line hidden
this.Write(" public partial class Amazon");
#line 29 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client : AmazonServiceClient, IAmazon");
#line 29 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("\r\n {\r\n\t\tprivate static IServiceMetadata serviceMetadata = new Amazon");
#line 31 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Metadata();\r\n \r\n");
#line 33 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
// Generates generic constructors for the service if enabled in the model
if(this.Config.GenerateConstructors)
{
var usesBearerAuth = this.Config.ServiceModel.SignatureVersion == "bearer";
var fallbackToAnonymousCredentials = usesBearerAuth;
#line default
#line hidden
this.Write(" #region Constructors\r\n\r\n /// <summary>\r\n /// Constructs Ama" +
"zon");
#line 43 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
public Amazon");
#line 57 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client()\r\n : base(FallbackCredentialsFactory.GetCredentials(");
#line 58 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), new Amazon");
#line 58 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config()) { }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 61 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 76 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(RegionEndpoint region)\r\n : base(FallbackCredentialsFactory.GetC" +
"redentials(");
#line 77 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), new Amazon");
#line 77 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region}) { }\r\n\r\n /// <summary>\r\n /// Constr" +
"ucts Amazon");
#line 80 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version=""1.0"" encoding=""utf-8"" ?>
/// <configuration>
/// <appSettings>
/// <add key=""AWSProfileName"" value=""AWS Default""/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name=""config"">The Amazon");
#line 94 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 95 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(Amazon");
#line 95 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config config)\r\n : base(FallbackCredentialsFactory.GetCredentials(");
#line 96 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fallbackToAnonymousCredentials ? "fallbackToAnonymous: true" : ""));
#line default
#line hidden
this.Write("), config) { }\r\n\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 100 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials\r\n /// </summary>\r\n /// <param name=\"cre" +
"dentials\">AWS Credentials</param>\r\n public Amazon");
#line 103 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials)\r\n : this(credentials, new Amazon");
#line 104 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 109 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials\r\n /// </summary>\r\n /// <param name=\"cre" +
"dentials\">AWS Credentials</param>\r\n /// <param name=\"region\">The region t" +
"o connect.</param>\r\n public Amazon");
#line 113 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials, RegionEndpoint region)\r\n : this(cre" +
"dentials, new Amazon");
#line 114 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region})\r\n {\r\n }\r\n\r\n /// <summary>\r\n" +
" /// Constructs Amazon");
#line 119 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Credentials and an\r\n /// Amazon");
#line 120 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration object.\r\n /// </summary>\r\n /// <param name=\"cr" +
"edentials\">AWS Credentials</param>\r\n /// <param name=\"clientConfig\">The A" +
"mazon");
#line 123 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 124 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(AWSCredentials credentials, Amazon");
#line 124 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(credentials, clientConfig)\r\n {\r\n " +
" }\r\n\r\n /// <summary>\r\n /// Constructs Amazon");
#line 130 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID and AWS Secret Key\r\n /// </summary>\r\n " +
" /// <param name=\"awsAccessKeyId\">AWS Access Key ID</param>\r\n /// <param " +
"name=\"awsSecretAccessKey\">AWS Secret Access Key</param>\r\n public Amazon");
#line 134 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey)\r\n : this(awsA" +
"ccessKeyId, awsSecretAccessKey, new Amazon");
#line 135 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 140 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 145 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)\r\n" +
" : this(awsAccessKeyId, awsSecretAccessKey, new Amazon");
#line 146 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config() {RegionEndpoint=region})\r\n {\r\n }\r\n\r\n /// <summary>\r" +
"\n /// Constructs Amazon");
#line 151 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID, AWS Secret Key and an\r\n /// Amazon");
#line 152 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration object. \r\n /// </summary>\r\n /// <param name=\"a" +
"wsAccessKeyId\">AWS Access Key ID</param>\r\n /// <param name=\"awsSecretAcce" +
"ssKey\">AWS Secret Access Key</param>\r\n /// <param name=\"clientConfig\">The" +
" Amazon");
#line 156 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 157 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, Amazon");
#line 157 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(awsAccessKeyId, awsSecretAccessKey, clie" +
"ntConfig)\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs" +
" Amazon");
#line 163 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
public Amazon");
#line 168 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)\r" +
"\n : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new Ama" +
"zon");
#line 169 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config())\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Constructs " +
"Amazon");
#line 174 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
/// <param name=""region"">The region to connect.</param>
public Amazon");
#line 180 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, " +
"RegionEndpoint region)\r\n : this(awsAccessKeyId, awsSecretAccessKey, a" +
"wsSessionToken, new Amazon");
#line 181 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config{RegionEndpoint = region})\r\n {\r\n }\r\n\r\n /// <summary>\r\n" +
" /// Constructs Amazon");
#line 186 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client with AWS Access Key ID, AWS Secret Key and an\r\n /// Amazon");
#line 187 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"Client Configuration object.
/// </summary>
/// <param name=""awsAccessKeyId"">AWS Access Key ID</param>
/// <param name=""awsSecretAccessKey"">AWS Secret Access Key</param>
/// <param name=""awsSessionToken"">AWS Session Token</param>
/// <param name=""clientConfig"">The Amazon");
#line 192 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client Configuration Object</param>\r\n public Amazon");
#line 193 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, " +
"Amazon");
#line 193 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config clientConfig)\r\n : base(awsAccessKeyId, awsSecretAccessKey, awsS" +
"essionToken, clientConfig)\r\n {\r\n }\r\n\r\n #endregion\r\n");
#line 199 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
#line 202 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
// Creates paginators for service if available
if (this.Config.ServiceModel.HasPaginators)
{
#line default
#line hidden
this.Write("#if AWS_ASYNC_ENUMERABLES_API\r\n private I");
#line 208 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory _paginators;\r\n\r\n /// <summary>\r\n /// Paginators fo" +
"r the service\r\n /// </summary>\r\n public I");
#line 213 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory Paginators \r\n {\r\n get \r\n {\r\n " +
" if (this._paginators == null) \r\n {\r\n " +
"this._paginators = new ");
#line 219 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory(this);\r\n }\r\n return this._paginato" +
"rs;\r\n }\r\n }\r\n#endif\r\n");
#line 225 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write("\r\n #region Overrides\r\n\r\n\t\t/// <summary>\r\n /// Creates the signer fo" +
"r the service.\r\n /// </summary>\r\n protected override AbstractAWSSi" +
"gner CreateSigner()\r\n {\r\n return new ");
#line 236 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GeneratorHelpers.DetermineSigner(this.Config.ServiceModel.SignatureVersion, this.Config.ClassName)));
#line default
#line hidden
this.Write("();\r\n } \r\n\r\n");
#line 239 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if(this.Config.ServiceModel.Customizations.PipelineOverride != null || this.Config.EndpointsRuleSet != null) {
#line default
#line hidden
this.Write(@" /// <summary>
/// Customizes the runtime pipeline.
/// </summary>
/// <param name=""pipeline"">Runtime pipeline for the current client.</param>
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
");
#line 246 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
var pipelineOverrides = this.Config.ServiceModel.Customizations.PipelineOverride;
if (pipelineOverrides != null)
{
foreach(var o in pipelineOverrides.Overrides )
{
if(!string.IsNullOrEmpty(o.Condition))
{
#line default
#line hidden
this.Write(" if(");
#line 255 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.Condition));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 257 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if(o.OverrideMethod == "remove")
{
#line default
#line hidden
this.Write(" pipeline.");
#line 261 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("();\r\n");
#line 262 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
else
{
#line default
#line hidden
this.Write(" pipeline.");
#line 267 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("(new ");
#line 267 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));
#line default
#line hidden
this.Write("(");
#line 267 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));
#line default
#line hidden
this.Write("));\r\n");
#line 268 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 272 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
else if(o.OverrideMethod == "remove")
{
#line default
#line hidden
this.Write(" pipeline.");
#line 277 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("();\r\n");
#line 278 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
else
{
#line default
#line hidden
this.Write(" pipeline.");
#line 283 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.FormattedOverrideMethod));
#line default
#line hidden
this.Write("(new ");
#line 283 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.NewType));
#line default
#line hidden
this.Write("(");
#line 283 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(o.ConstructorInput));
#line default
#line hidden
this.Write("));\r\n");
#line 284 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
}
}
#line default
#line hidden
#line 289 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if (this.Config.EndpointsRuleSet != null) {
#line default
#line hidden
this.Write(" pipeline.RemoveHandler<Amazon.Runtime.Internal.EndpointResolver>();\r\n" +
" pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Ama" +
"zon");
#line 291 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EndpointResolver());\r\n");
#line 292 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 294 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(@" /// <summary>
/// Capture metadata for the service.
/// </summary>
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
/// <summary>
/// Disposes the service client.
/// </summary>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
");
#line 322 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
var endpointOperation = this.Config.ServiceModel.FindEndpointOperation();
if(endpointOperation != null)
{
#line default
#line hidden
this.Write(@" #region EndpointOperation Override
protected override IEnumerable<DiscoveryEndpointBase> EndpointOperation(EndpointOperationContextBase context)
{
return EndpointDiscoveryResolver.ResolveEndpoints(context, () =>
{
var request = new ");
#line 333 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpointOperation.Name));
#line default
#line hidden
this.Write("Request\r\n\t\t\t\t{\r\n");
#line 335 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if(endpointOperation.RequestHasOperationEndpointOperationMember)
{
#line default
#line hidden
this.Write("\t\t\t\t\tOperation = context.OperationName,\r\n");
#line 340 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
if(endpointOperation.RequestHasIdentifiersEndpointOperationMember)
{
#line default
#line hidden
this.Write("\t\t\t\t\tIdentifiers = new Dictionary<string, string>(context.EndpointDiscoveryData.I" +
"dentifiers),\r\n");
#line 346 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write("\t\t\t\t};\r\n\t\t\t\t \r\n\t\t\t\tvar response = ");
#line 351 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(endpointOperation.Name));
#line default
#line hidden
this.Write(@"(request);
if(response.HttpStatusCode != HttpStatusCode.OK || response.Endpoints == null)
{
return null;
}
var endpoints = new List<DiscoveryEndpointBase>();
foreach(var endpoint in response.Endpoints)
{
endpoints.Add(new DiscoveryEndpoint(endpoint.Address, endpoint.CachePeriodInMinutes));
}
return endpoints;
});
}
#endregion
");
#line 368 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
// Creates the method code for each operation in the model
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n #region ");
#line 376 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\r\n\r\n");
#line 378 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 384 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 385 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(" internal virtual ");
#line 388 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 388 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("()\r\n {\r\n return ");
#line 390 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(new ");
#line 390 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request());\r\n }\r\n");
#line 392 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 397 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 398 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(" internal virtual ");
#line 401 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 401 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 401 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request)\r\n {\r\n var options = new InvokeOptions();\r\n " +
" options.RequestMarshaller = ");
#line 404 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller.Instance;\r\n options.ResponseUnmarshaller = ");
#line 405 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n");
#line 406 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" options.EndpointDiscoveryMarshaller = ");
#line 410 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller.Instance;\r\n options.EndpointOperation = En" +
"dpointOperation;\r\n");
#line 412 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write("\r\n return Invoke<");
#line 416 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>(request, options);\r\n }\r\n\r\n");
#line 419 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
// Creates a version of the operation that takes no arguments and passes a request with no set members if specified in the customizations
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 424 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.FormatOperationDocumentationAsync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 429 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 430 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(" public virtual Task<");
#line 433 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 433 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(System.Threading.CancellationToken cancellationToken = default(Cancellation" +
"Token))\r\n {\r\n return ");
#line 435 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(new ");
#line 435 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request(), cancellationToken);\r\n }\r\n\r\n");
#line 438 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
// Add async simple methods
AddSimpleClientMethods(operation, false);
#line default
#line hidden
this.Write("\r\n");
#line 444 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.FormatOperationDocumentationAsync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 449 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 450 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write(" ");
#line 453 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.IsInternal ? "internal" : "public"));
#line default
#line hidden
this.Write(" virtual Task<");
#line 453 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 453 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(");
#line 453 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request, System.Threading.CancellationToken cancellationToken = default(C" +
"ancellationToken))\r\n {\r\n var options = new InvokeOptions();\r\n " +
" options.RequestMarshaller = ");
#line 456 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller.Instance;\r\n options.ResponseUnmarshaller = ");
#line 457 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n");
#line 458 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" options.EndpointDiscoveryMarshaller = ");
#line 462 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller.Instance;\r\n options.EndpointOperation = En" +
"dpointOperation;\r\n");
#line 464 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write("\r\n return InvokeAsync<");
#line 468 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>(request, options, cancellationToken);\r\n }\r\n\r\n #endregion\r" +
"\n ");
#line 472 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceClientsNetStandard.tt"
}
#line default
#line hidden
this.Write("\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 1,252 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceConfig : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing System;\r\nusing Amazon.Runtime;\r\nusing Amazon.Runtime.Internal;\r\nusing Ama" +
"zon.Util.Internal;\r\nusing ");
#line 14 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Internal;\r\n\r\nnamespace ");
#line 16 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n /// <summary>\r\n /// Configuration for accessing Amazon ");
#line 19 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" service\r\n /// </summary>\r\n [AWSSignerType(\"");
#line 21 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Config.ServiceModel.SignatureVersion));
#line default
#line hidden
this.Write("\")]\r\n public partial class Amazon");
#line 22 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config : ClientConfig\r\n {\r\n private static readonly string UserAgentStr" +
"ing =\r\n InternalSDKUtils.BuildUserAgentString(\"");
#line 25 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceFileVersion));
#line default
#line hidden
this.Write("\");\r\n\r\n private string _userAgent = UserAgentString;\r\n\r\n /// <summa" +
"ry>\r\n /// Default constructor\r\n /// </summary>\r\n public Ama" +
"zon");
#line 32 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Config()\r\n : base(new Amazon.Runtime.Internal.DefaultConfigurationProv" +
"ider(Amazon");
#line 33 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("DefaultConfiguration.GetAllConfigurations()))\r\n {\r\n");
#line 35 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
if(!string.IsNullOrEmpty(this.Config.AuthenticationServiceName))
{
#line default
#line hidden
this.Write(" this.AuthenticationServiceName = \"");
#line 39 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.AuthenticationServiceName));
#line default
#line hidden
this.Write("\";\r\n");
#line 40 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
}
if(this.Config.OverrideMaxRetries.HasValue)
{
#line default
#line hidden
this.Write(" this.MaxErrorRetry = ");
#line 45 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.OverrideMaxRetries));
#line default
#line hidden
this.Write(";\r\n");
#line 46 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
}
if(!string.IsNullOrEmpty(this.Config.DefaultRegion))
{
#line default
#line hidden
this.Write(" var region = FallbackRegionFactory.GetRegionEndpoint(false);\r\n " +
" this.RegionEndpoint = region ?? RegionEndpoint.");
#line 52 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.DefaultRegion));
#line default
#line hidden
this.Write(";\r\n");
#line 53 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
}
#line default
#line hidden
#line 56 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
if (this.Config.EndpointsRuleSet != null)
{
#line default
#line hidden
this.Write(" this.EndpointProvider = new Amazon");
#line 60 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EndpointProvider();\r\n");
#line 61 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
}
#line default
#line hidden
this.Write(@" }
/// <summary>
/// The constant used to lookup in the region hash the endpoint.
/// </summary>
public override string RegionEndpointServiceName
{
get
{
return """);
#line 73 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.RegionLookupName));
#line default
#line hidden
this.Write("\";\r\n }\r\n }\r\n\r\n /// <summary>\r\n /// Gets the Servi" +
"ceVersion property.\r\n /// </summary>\r\n public override string Serv" +
"iceVersion\r\n {\r\n get\r\n {\r\n return \"");
#line 84 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.APIVersion));
#line default
#line hidden
this.Write(@""";
}
}
/// <summary>
/// Gets the value of UserAgent property.
/// </summary>
public override string UserAgent
{
get
{
return _userAgent;
}
}
");
#line 99 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
if (this.Config.EndpointsRuleSet != null)
foreach(var parameter in this.Config.ServiceModel.ClientContextParameters) {
#line default
#line hidden
this.Write(" /// <summary>\r\n /// ");
#line 103 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(parameter.documentation));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n public ");
#line 105 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(parameter.nativeType));
#line default
#line hidden
this.Write(" ");
#line 105 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(parameter.name));
#line default
#line hidden
this.Write(" { get; set; }\r\n\r\n");
#line 107 "C:\Projects\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceConfig.tt"
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 273 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceEnumerations : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing System;\r\n\r\nusing Amazon.Runtime;\r\n\r\nnamespace ");
#line 14 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 16 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
foreach(var enumeration in this.Config.ServiceModel.Enumerations(false))
{
#line default
#line hidden
this.Write("\r\n /// <summary>\r\n /// Constants used for properties of type ");
#line 22 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write(".\r\n /// </summary>\r\n public class ");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write(" : ConstantClass\r\n {\r\n\r\n");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
foreach(var enumValue in enumeration.EnumerationValues)
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Constant ");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumValue.PropertyName));
#line default
#line hidden
this.Write(" for ");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n public static readonly ");
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write(" ");
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumValue.PropertyName));
#line default
#line hidden
this.Write(" = new ");
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write("(\"");
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumValue.MarshallName));
#line default
#line hidden
this.Write("\");\r\n");
#line 35 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
}
#line default
#line hidden
this.Write(@"
/// <summary>
/// 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.
/// </summary>
public ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write(@"(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name=""value"">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ");
#line 57 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write(" FindValue(string value)\r\n {\r\n return FindValue<");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write(@">(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name=""value"">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ");
#line 67 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(enumeration.Name));
#line default
#line hidden
this.Write("(string value)\r\n {\r\n return FindValue(value);\r\n }\r\n }" +
"\r\n\r\n");
#line 73 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceEnumerations.tt"
}
#line default
#line hidden
this.Write("}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 204 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceInterface : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\n\r\nusing Amazon.Runtime;\r\nus" +
"ing ");
#line 15 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\n\r\nnamespace ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.FormatServiceInterfaceDocumentation(this.Config.ServiceModel.Documentation);
#line default
#line hidden
this.Write("\tpublic partial interface IAmazon");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" : IAmazonService, IDisposable\r\n\t{\r\n\r\n\r\n");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
// Creates paginators for service if available
if (this.Config.ServiceModel.HasPaginators)
{
#line default
#line hidden
this.Write("#if BCL45 || AWS_ASYNC_ENUMERABLES_API\r\n /// <summary>\r\n /// Pagina" +
"tors for the service\r\n /// </summary>\r\n I");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory Paginators { get; }\r\n#endif\r\n");
#line 35 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
#line default
#line hidden
this.Write("\r\n\r\n\t\t");
#line 40 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
if(operation.IsInternal)
continue;
#line default
#line hidden
this.Write("\r\n\t\t#region ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\r\n\r\n");
#line 49 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
// Creates a method for the operation that takes no parameters if the operation has a request that requires no members to be set
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 54 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.FormatOperationDocumentationSync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 60 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
#line default
#line hidden
this.Write(" ");
#line 63 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 63 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("();\r\n");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
AddSimpleClientMethodInterfaces(operation, true);
#line default
#line hidden
#line 69 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.FormatOperationDocumentationSync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 74 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
#line default
#line hidden
this.Write(" ");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request);\r\n\r\n");
#line 80 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
AddBeginAsyncDocumentation(operation);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 84 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 85 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
#line default
#line hidden
this.Write(" IAsyncResult Begin");
#line 88 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 88 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request, AsyncCallback callback, object state);\r\n\r\n\r\n\r\n");
#line 92 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
AddEndAsyncDocumentation(operation);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 96 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 97 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
#line default
#line hidden
this.Write(" ");
#line 100 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response End");
#line 100 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(IAsyncResult asyncResult);\r\n\r\n\t\t#endregion\r\n\t\t");
#line 103 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface.tt"
}
#line default
#line hidden
this.Write("\r\n }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 321 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceInterface45 : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing " +
"System.Collections.Generic;\r\n\r\nusing Amazon.Runtime;\r\nusing ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\n\r\nnamespace ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.FormatServiceInterfaceDocumentation(this.Config.ServiceModel.Documentation);
#line default
#line hidden
this.Write("\tpublic partial interface IAmazon");
#line 22 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" : IAmazonService, IDisposable\r\n\t{\r\n\r\n");
#line 25 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
// Creates paginators for service if available
if (this.Config.ServiceModel.HasPaginators)
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Paginators for the service\r\n /// </summ" +
"ary>\r\n I");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory Paginators { get; }\r\n");
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
#line default
#line hidden
this.Write("\r\n\t\t");
#line 38 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
// Generates definitions for each operation in the service model
foreach(var operation in this.Config.ServiceModel.Operations)
{
if(operation.IsInternal)
continue;
#line default
#line hidden
this.Write("\r\n\t\t#region ");
#line 46 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\r\n\r\n");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
// Creates a parameterless definition of the operation if specified in the customizations file
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.FormatOperationDocumentationSync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 58 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
#line default
#line hidden
this.Write(" ");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("();\r\n\r\n");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
// Adds simple method forms defined in the customizations file
AddSimpleClientMethodInterfaces(operation, true);
#line default
#line hidden
#line 69 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.FormatOperationDocumentationSync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 74 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
#line default
#line hidden
this.Write(" ");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response ");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request);\r\n\r\n");
#line 80 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
// Creates a parameterless definition of the operation if specified in the customizations file
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 85 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.FormatOperationDocumentationAsync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 90 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 91 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
#line default
#line hidden
this.Write(" Task<");
#line 94 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 94 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(System.Threading.CancellationToken cancellationToken = default(Cancellation" +
"Token));\r\n\r\n");
#line 96 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
AddSimpleClientMethodInterfaces(operation, false);
#line default
#line hidden
this.Write("\r\n");
#line 102 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.FormatOperationDocumentationAsync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 107 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 108 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
#line default
#line hidden
this.Write(" Task<");
#line 111 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 111 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(");
#line 111 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request, CancellationToken cancellationToken = default(CancellationToken)" +
");\r\n\r\n\t\t#endregion\r\n\t\t");
#line 114 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterface45.tt"
}
#line default
#line hidden
this.Write("\r\n\t}\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 354 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceInterfaceNetStandard : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Threading;\r\nusing System.Threading.Tasks;\r\nusing " +
"System.Collections.Generic;\r\n\r\nusing Amazon.Runtime;\r\nusing ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\n\r\nnamespace ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write("\r\n{\r\n");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.FormatServiceInterfaceDocumentation(this.Config.ServiceModel.Documentation);
#line default
#line hidden
this.Write("\tpublic partial interface IAmazon");
#line 22 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" : IAmazonService, IDisposable\r\n\t{\r\n");
#line 24 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
// Creates paginators for service if available
if (this.Config.ServiceModel.HasPaginators)
{
#line default
#line hidden
this.Write("#if AWS_ASYNC_ENUMERABLES_API\r\n /// <summary>\r\n /// Paginators for " +
"the service\r\n /// </summary>\r\n I");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory Paginators { get; }\r\n#endif\r\n");
#line 35 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
}
#line default
#line hidden
this.Write("\t\t");
#line 38 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
// Generates definitions for each operation in the service model
foreach(var operation in this.Config.ServiceModel.Operations)
{
if(operation.IsInternal)
continue;
#line default
#line hidden
this.Write("\t\t\r\n\t\t#region ");
#line 46 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\r\n\r\n");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
// Creates a parameterless definition of the operation if specified in the customizations file
if (this.Config.ServiceModel.Customizations.CreateNoArgOverload(operation.Name))
{
#line default
#line hidden
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.FormatOperationDocumentationAsync(operation, false);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 58 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
}
#line default
#line hidden
this.Write(" Task<");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(System.Threading.CancellationToken cancellationToken = default(Cancellation" +
"Token));\r\n\r\n");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
}
AddSimpleClientMethodInterfaces(operation, false);
#line default
#line hidden
this.Write("\r\n");
#line 70 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.FormatOperationDocumentationAsync(operation, true);
if(operation.IsDeprecated)
{
#line default
#line hidden
this.Write("\t\t[Obsolete(\"");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 76 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
}
#line default
#line hidden
this.Write(" Task<");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response> ");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Async(");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request, System.Threading.CancellationToken cancellationToken = default(C" +
"ancellationToken));\r\n\r\n\t\t#endregion\r\n\t\t");
#line 82 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceInterfaceNetStandard.tt"
}
#line default
#line hidden
this.Write("\r\n\t}\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 245 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServiceMetadata : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing Amazon.Runtime.Internal;\r\n\r\n\r\nnamespace ");
#line 14 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Internal\r\n{\r\n /// <summary>\r\n /// Service metadata for Amazon ");
#line 17 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" service\r\n /// </summary>\r\n public partial class Amazon");
#line 19 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Metadata : IServiceMetadata\r\n {\r\n /// <summary>\r\n /// Gets the v" +
"alue of the Service Id.\r\n /// </summary>\r\n public string ServiceId" +
"\r\n {\r\n get\r\n {\r\n return \"");
#line 28 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceId));
#line default
#line hidden
this.Write(@""";
}
}
/// <summary>
/// Gets the dictionary that gives mapping of renamed operations
/// </summary>
public System.Collections.Generic.IDictionary<string, string> OperationNameMapping
{
get
{
return new System.Collections.Generic.Dictionary<string, string>(");
#line 39 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.OperationsNameMapping.Count));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 41 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
foreach(var entry in this.Config.ServiceModel.OperationsNameMapping)
{
#line default
#line hidden
this.Write(" {\"");
#line 45 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(entry.Key));
#line default
#line hidden
this.Write("\", \"");
#line 45 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(entry.Value));
#line default
#line hidden
this.Write("\"},\r\n");
#line 46 "C:\Dev\repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServiceMetadata.tt"
}
#line default
#line hidden
this.Write(" };\r\n }\r\n }\r\n }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 128 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServicePaginatorFactory : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\n\r\nnamespa" +
"ce ");
#line 14 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n /// <summary>\r\n /// Paginators for the ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write(" service\r\n ///</summary>\r\n public class ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory : I");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory\r\n {\r\n private readonly IAmazon");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" client;\r\n\r\n internal ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory(IAmazon");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(" client) \r\n {\r\n this.client = client;\r\n }\r\n");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
if (operation.Paginators != null && !operation.UnsupportedPaginatorConfig)
{
#line default
#line hidden
this.Write("\r\n /// <summary>\r\n /// Paginator for ");
#line 35 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write(" operation\r\n ///</summary>\r\n public I");
#line 37 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Paginator ");
#line 37 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 37 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request) \r\n {\r\n return new ");
#line 39 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Paginator(this.client, request);\r\n }\r\n");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactory.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 154 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class ServicePaginatorFactoryInterface : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nnamespace ");
#line 10 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n /// <summary>\r\n /// Paginators for the ");
#line 13 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write(" service\r\n ///</summary>\r\n public interface I");
#line 15 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceNameRoot));
#line default
#line hidden
this.Write("PaginatorFactory\r\n {\r\n");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
if (operation.Paginators != null && !operation.UnsupportedPaginatorConfig)
{
#line default
#line hidden
this.Write("\r\n /// <summary>\r\n /// Paginator for ");
#line 25 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write(" operation\r\n ///</summary>\r\n I");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Paginator ");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request request);\r\n");
#line 28 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\ServicePaginatorFactoryInterface.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 118 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class StructureGenerator : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("using System;\r\nusing System.Collections.Generic;\r\nusing System.Xml.Serialization;" +
"\r\nusing System.Text;\r\nusing System.IO;\r\nusing System.Net;\r\n\r\nusing Amazon.Runtim" +
"e;\r\nusing Amazon.Runtime.Internal;\r\n");
#line 18 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(this.StructureType == StructureType.Request && this.Operation.AuthType.HasValue)
{
#line default
#line hidden
this.Write("using Amazon.Runtime.Internal.Auth;\r\n");
#line 23 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 26 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(this.Structure != null && (this.Structure.IsEvent || this.Structure.IsEventStream))
{
#line default
#line hidden
this.Write("using Amazon.Runtime.EventStreams;\r\nusing Amazon.Runtime.EventStreams.Internal;\r\n" +
"");
#line 32 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write("\r\nnamespace ");
#line 36 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n");
#line 38 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(this.StructureType == StructureType.Request)
this.FormatOperationRequestDocumentation(this.Operation);
else if (this.Operation != null && GeneratorHelpers.HasSuppressedResult(this.Operation))
this.FormatVoidResultDocumentation(this.Operation.Name);
else if(this.StructureType == StructureType.Response && (this.Structure == null || string.IsNullOrEmpty(this.Structure.Documentation)))
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// This is the response object from the ");
#line 47 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write(" operation.\r\n /// </summary>\r\n");
#line 49 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else
this.FormatClassDocumentation(this.Structure);
#line default
#line hidden
#line 54 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(this.Structure != null && this.Structure.IsDeprecated)
{
#line default
#line hidden
this.Write(" [Obsolete(\"");
#line 58 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 59 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
if(this.Structure is ExceptionShape)
{
#line default
#line hidden
this.Write(" #if !NETSTANDARD\r\n [Serializable]\r\n #endif\r\n");
#line 67 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 70 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(this.Structure != null && this.Structure.IsEventStream)
{ // top if block
#line default
#line hidden
this.Write("\r\n [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Naming\", \"CA1710:Identifi" +
"ers should have correct suffix\", Justification = \"");
#line 76 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(@"Collection is not descriptive"")]
[System.Diagnostics.CodeAnalysis.SuppressMessage(""Microsoft.Design"", ""CA1063"", Justification = ""IDisposable is a transient interface from IEventStream. Users need to be able to call Dispose."")]
public sealed class ");
#line 78 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" : EnumerableEventStream<IEventStreamEvent, ");
#line 78 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"EventStreamException>
{
///summary>
///The mapping of event message to a generator function to construct the matching EventStream event
///</summary>
protected override IDictionary<string,Func<IEventStreamMessage, IEventStreamEvent>> EventMapping {get;} =
new Dictionary<string,Func<IEventStreamMessage,IEventStreamEvent>>
{
");
#line 86 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
foreach(var member in this.Structure.Members)
{
#line default
#line hidden
this.Write(" {\"");
#line 90 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("\", payload => new ");
#line 90 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
this.Write("(payload)},\r\n");
#line 91 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" };\r\n /// <summary>\r\n /// The mapping of event message to a " +
"generator function to construct the matching EventStream Exception\r\n /// " +
"</summary>\r\n protected override IDictionary<string,Func<IEventStreamMessa" +
"ge,");
#line 98 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException>> ExceptionMapping {get;} =\r\n new Dictionary<string,F" +
"unc<IEventStreamMessage,");
#line 99 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"EventStreamException>>
{
};
// Backing by a volatile bool. The flag only changes one way, so no need for a lock.
// This is located in the subclass to be CLS compliant.
private volatile bool _isProcessing;
/// <summary>
/// Whether the backround processing loop is running.
/// </summary>
protected override bool IsProcessing
{
get { return _isProcessing; }
set { _isProcessing = value; }
}
public override event EventHandler<EventStreamEventReceivedArgs<IEventStreamEvent>> EventReceived;
public override event EventHandler<EventStreamExceptionReceivedArgs<");
#line 115 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException>> ExceptionReceived;\r\n");
#line 116 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
foreach(var member in this.Structure.Members)
{
#line default
#line hidden
this.Write(" ///<summary>\r\n ///Raised when an ");
#line 121 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" event is received\r\n ///</summary>\r\n public event EventHandler<Even" +
"tStreamEventReceivedArgs<");
#line 123 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
this.Write(">> ");
#line 123 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("Received;\r\n");
#line 124 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" public ");
#line 127 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("(Stream stream) : this (stream, null)\r\n {\r\n }\r\n public ");
#line 130 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(@"(Stream stream, IEventStreamDecoder eventStreamDecoder) : base(stream, eventStreamDecoder)
{
base.EventReceived += (sender,args) => EventReceived?.Invoke(this, args);
base.ExceptionReceived += (sender,args) => ExceptionReceived?.Invoke(this, args);
//Mapping the generic Event to more specific Events
Decoder.MessageReceived += (sender, args) =>
{
IEventStreamEvent ev;
try
{
ev = ConvertMessageToEvent(args.Message);
}
catch(UnknownEventStreamException)
{
throw new UnknownEventStreamException(""Received an unknown event stream type"");
}
EventReceived?.Invoke(this, new EventStreamEventReceivedArgs<IEventStreamEvent>(ev));
//Call RaiseEvent until it returns true or all calls complete. This way only a subset of casts is perfromed
// and we can avoid a cascade of nested if else statements. The result is thrown away
var _ =
");
#line 152 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
for(int i = 0; i < this.Structure.Members.Count() - 1; i++)
{
#line default
#line hidden
this.Write(" RaiseEvent(");
#line 156 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Members[i].PropertyName));
#line default
#line hidden
this.Write("Received,ev) ||\r\n");
#line 157 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" RaiseEvent(");
#line 160 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Members.Last()));
#line default
#line hidden
this.Write(@"Received,ev);
};
}
private bool RaiseEvent<T>(EventHandler<EventStreamEventReceivedArgs<T>> eventHandler, IEventStreamEvent ev) where T : class, IEventStreamEvent
{
var convertedEvent = ev as T;
if (convertedEvent != null)
{
eventHandler?.Invoke(this, new EventStreamEventReceivedArgs<T>(convertedEvent));
return true;
}
return false;
}
");
#line 174 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 177 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
bool hasStreamingMember = this.Structure?.Members.Any(member => member.IsStreaming) ?? false;
bool structureContainsEventPayload = this.Structure?.Members.Any(member => member.IsEventPayload) ?? false;
Member payloadMember = null;
if(structureContainsEventPayload)
{
payloadMember = this.Structure?.Members.Single(member => member.IsEventPayload);
}
bool structureIsNotEventStream = this.Structure != null && !this.Structure.IsEventStream;
bool structureIsEvent = this.Structure != null && this.Structure.IsEvent;
if (structureIsNotEventStream && this.StructureType == StructureType.Response && hasStreamingMember)
{
#line default
#line hidden
this.Write(" public partial class ");
#line 191 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.ClassName));
#line default
#line hidden
#line 191 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.BaseClassString));
#line default
#line hidden
this.Write(", IDisposable\r\n {\r\n");
#line 193 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else
{
#line default
#line hidden
#line 198 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if( (this.Structure == null) || (structureIsNotEventStream))
{
#line default
#line hidden
this.Write(" public partial class ");
#line 202 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.ClassName));
#line default
#line hidden
#line 202 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.BaseClassString));
#line default
#line hidden
this.Write("\r\n");
#line 203 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(structureIsEvent)
{
#line default
#line hidden
this.Write(" : IEventStreamEvent\r\n");
#line 208 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 211 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(structureIsEvent && !structureContainsEventPayload)
{
#line default
#line hidden
this.Write(" ,IEventStreamTerminalEvent\r\n");
#line 216 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" {\r\n");
#line 220 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 223 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 226 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(structureIsEvent)
{
#line default
#line hidden
this.Write(" public ");
#line 230 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Structure.Name));
#line default
#line hidden
this.Write("()\r\n {\r\n }\r\n\r\n public ");
#line 234 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(Structure.Name));
#line default
#line hidden
this.Write("(IEventStreamMessage message)\r\n {\r\n");
#line 236 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(structureContainsEventPayload)
{
#line default
#line hidden
this.Write(" ");
#line 240 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(payloadMember.PropertyName));
#line default
#line hidden
this.Write(" = new ");
#line 240 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(payloadMember.DetermineType()));
#line default
#line hidden
this.Write("(message.");
#line 240 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(payloadMember.PropertyName));
#line default
#line hidden
this.Write(");\r\n");
#line 241 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 245 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
#line 248 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(structureIsNotEventStream)
{
if(this.IsWrapped)
{
#line default
#line hidden
this.Write(" private ");
#line 254 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" _response;\r\n\r\n /// <summary>\r\n /// Gets and sets the ");
#line 257 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" property.\r\n /// </summary>\r\n public ");
#line 259 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" ");
#line 259 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("\r\n {\r\n get { return this._response; }\r\n set { this._" +
"response = value; }\r\n }\r\n");
#line 264 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else
{
foreach(var member in this.Structure.Members)
{
if (member.IsExcluded)
continue;
#line default
#line hidden
this.Write(" private ");
#line 273 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
#line 273 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.IsNullable ? "?" : ""));
#line default
#line hidden
this.Write(" ");
#line 273 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
#line 273 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.ShouldInstantiate ? string.Format(" = new {0}();", member.DetermineType()) : ";"));
#line default
#line hidden
this.Write("\r\n");
#line 274 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write("\r\n");
#line 278 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
AddSimpleRequestConstructors(this.ClassName, this.Structure, this.Config.Namespace);
if(this.Structure is ExceptionShape)
{
var exceptionShape = (ExceptionShape)this.Structure;
if (exceptionShape.IsRetryable)
{
#line default
#line hidden
this.Write(" private RetryableDetails _retryableDetails = new RetryableDetails(");
#line 287 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exceptionShape.Throttling.ToString().ToLower()));
#line default
#line hidden
this.Write(");\r\n");
#line 288 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
#line default
#line hidden
this.Write("\r\n");
#line 291 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Constructs a new ");
#line 2 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" with the specified error\r\n /// message.\r\n /// </summary>\r\n " +
"/// <param name=\"message\">\r\n /// Describes the error encountered.\r\n " +
" /// </param>\r\n public ");
#line 8 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("(string message) \r\n : base(message) {}\r\n\r\n /// <summary>\r\n " +
" /// Construct instance of ");
#line 12 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n /// <param name=\"message\"></param>\r\n ///" +
" <param name=\"innerException\"></param>\r\n public ");
#line 16 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("(string message, Exception innerException) \r\n : base(message, innerExc" +
"eption) {}\r\n\r\n /// <summary>\r\n /// Construct instance of ");
#line 20 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("\r\n /// </summary>\r\n /// <param name=\"innerException\"></param>\r\n " +
" public ");
#line 23 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("(Exception innerException) \r\n : base(innerException) {}\r\n\r\n ///" +
" <summary>\r\n /// Construct instance of ");
#line 27 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(@"
/// </summary>
/// <param name=""message""></param>
/// <param name=""innerException""></param>
/// <param name=""errorType""></param>
/// <param name=""errorCode""></param>
/// <param name=""requestId""></param>
/// <param name=""statusCode""></param>
public ");
#line 35 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(@"(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
/// <summary>
/// Construct instance of ");
#line 39 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(@"
/// </summary>
/// <param name=""message""></param>
/// <param name=""errorType""></param>
/// <param name=""errorCode""></param>
/// <param name=""requestId""></param>
/// <param name=""statusCode""></param>
public ");
#line 46 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionConstructors.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("(string message, ErrorType errorType, string errorCode, string requestId, HttpSta" +
"tusCode statusCode) \r\n : base(message, errorType, errorCode, requestI" +
"d, statusCode) {}\r\n\r\n");
this.Write("\r\n");
this.Write("#if !NETSTANDARD\r\n /// <summary>\r\n /// Constructs a new instance of" +
" the ");
#line 3 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(@" class with serialized data.
/// </summary>
/// <param name=""info"">The <see cref=""T:System.Runtime.Serialization.SerializationInfo"" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name=""context"">The <see cref=""T:System.Runtime.Serialization.StreamingContext"" /> that contains contextual information about the source or destination.</param>
/// <exception cref=""T:System.ArgumentNullException"">The <paramref name=""info"" /> parameter is null. </exception>
/// <exception cref=""T:System.Runtime.Serialization.SerializationException"">The class name is null or <see cref=""P:System.Exception.HResult"" /> is zero (0). </exception>
protected ");
#line 9 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write("(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serializatio" +
"n.StreamingContext context)\r\n : base(info, context)\r\n {\r\n");
#line 12 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
foreach(var member in this.Structure.Members)
{
#line default
#line hidden
this.Write(" this.");
#line 16 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" = (");
#line 16 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
this.Write(")info.GetValue(\"");
#line 16 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("\", typeof(");
#line 16 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
this.Write("));\r\n");
#line 17 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
}
#line default
#line hidden
this.Write(" }\r\n\r\n /// <summary>\r\n /// Sets the <see cref=\"T:System.Runt" +
"ime.Serialization.SerializationInfo\" /> with information about the exception.\r\n " +
" /// </summary>\r\n /// <param name=\"info\">The <see cref=\"T:System.Ru" +
"ntime.Serialization.SerializationInfo\" /> that holds the serialized object data " +
"about the exception being thrown.</param>\r\n /// <param name=\"context\">The" +
" <see cref=\"T:System.Runtime.Serialization.StreamingContext\" /> that contains co" +
"ntextual information about the source or destination.</param>\r\n /// <exce" +
"ption cref=\"T:System.ArgumentNullException\">The <paramref name=\"info\" /> paramet" +
"er is a null reference (Nothing in Visual Basic). </exception>\r\n#if BCL35\r\n " +
" [System.Security.Permissions.SecurityPermission(\r\n System.Security" +
".Permissions.SecurityAction.LinkDemand,\r\n Flags = System.Security.Per" +
"missions.SecurityPermissionFlag.SerializationFormatter)]\r\n#endif\r\n [Syste" +
"m.Security.SecurityCritical]\r\n // These FxCop rules are giving false-posi" +
"tives for this method\r\n [System.Diagnostics.CodeAnalysis.SuppressMessage(" +
"\"Microsoft.Security\", \"CA2123:OverrideLinkDemandsShouldBeIdenticalToBase\")]\r\n " +
" [System.Diagnostics.CodeAnalysis.SuppressMessage(\"Microsoft.Security\", \"CA2" +
"134:MethodsMustOverrideWithConsistentTransparencyFxCopRule\")]\r\n public ov" +
"erride void GetObjectData(System.Runtime.Serialization.SerializationInfo info, S" +
"ystem.Runtime.Serialization.StreamingContext context)\r\n {\r\n ba" +
"se.GetObjectData(info, context);\r\n");
#line 40 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
foreach(var member in this.Structure.Members)
{
#line default
#line hidden
this.Write(" info.AddValue(\"");
#line 44 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("\", this.");
#line 44 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(");\r\n");
#line 45 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\.\Exceptions\ExceptionSerialization.t4"
}
#line default
#line hidden
this.Write(" }\r\n#endif\r\n");
this.Write("\r\n");
#line 296 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
foreach(var member in this.Structure.Members)
{
if (member.IsExcluded)
continue;
#line default
#line hidden
#line 303 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.FormatPropertyDocumentation(member);
#line default
#line hidden
#line 304 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(member.IsDeprecated)
{
#line default
#line hidden
this.Write(" [Obsolete(\"");
#line 308 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 309 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
var propertyAttributes = new List<string>();
if(member.IsRequired && !member.IsIdempotent)
{
propertyAttributes.Add("Required=true");
}
if (member.Shape.Sensitive)
{
propertyAttributes.Add("Sensitive=true");
}
if (member.Shape.Min.HasValue)
{
propertyAttributes.Add("Min=" + member.Shape.Min);
}
if (member.Shape.Max.HasValue)
{
propertyAttributes.Add("Max=" + member.Shape.Max);
}
if (propertyAttributes.Count > 0)
{
#line default
#line hidden
this.Write(" [AWSProperty(");
#line 332 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(string.Join(", ", propertyAttributes)));
#line default
#line hidden
this.Write(")]\r\n");
#line 333 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" ");
#line 336 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.AccessModifier));
#line default
#line hidden
this.Write(" ");
#line 336 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
#line 336 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.UseNullable ? "?" : ""));
#line default
#line hidden
this.Write(" ");
#line 336 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("\r\n {\r\n");
#line 338 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(member.IsNullable && !member.UseNullable)
{
#line default
#line hidden
this.Write(" get { return this.");
#line 342 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(".GetValueOrDefault(); }\r\n");
#line 343 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else
{
#line default
#line hidden
this.Write(" get { return this.");
#line 348 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write("; }\r\n");
#line 349 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" set { ");
#line 352 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.IsBackwardsCompatibleDateTimeProperty ? "this." + member.BackwardCompatibilityVariableName + " = " : ""));
#line default
#line hidden
this.Write("this.");
#line 352 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(" = value; }\r\n }\r\n\r\n");
#line 355 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if (member.EmitIsSetProperties)
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// This property is set to true if the property <" +
"seealso cref=\"");
#line 360 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(@"""/>
/// is set; false otherwise.
/// This property can be used to determine if the related property
/// was returned by a service response or if the related property
/// should be sent to the service during a service call.
/// </summary>
/// <returns>
/// True if the related property was set or will be sent to a service; false otherwise.
/// </returns>
");
#line 369 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(member.IsDeprecated)
{
#line default
#line hidden
this.Write(" [Obsolete(\"");
#line 373 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DeprecationMessage));
#line default
#line hidden
this.Write("\")]\r\n");
#line 374 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" public bool Is");
#line 377 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("Set\r\n {\r\n get\r\n {\r\n return Amazon.Uti" +
"l.Internal.InternalSDKUtils.GetIsSet(this.");
#line 381 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(");\r\n }\r\n set\r\n {\r\n Amazon.Util.In" +
"ternal.InternalSDKUtils.SetIsSet(value, ref this.");
#line 385 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(");\r\n");
#line 386 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if(member.IsBackwardsCompatibleDateTimeProperty)
{
#line default
#line hidden
this.Write(" \r\n Amazon.Util.Internal.InternalSDKUtils.SetIsSet(value, ref thi" +
"s.");
#line 390 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityVariableName));
#line default
#line hidden
this.Write(");\r\n");
#line 391 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n }\r\n\r\n");
#line 397 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" // Check to see if ");
#line 400 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" property is set\r\n internal bool IsSet");
#line 401 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("()\r\n {\r\n");
#line 403 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if (member.EmitIsSetProperties)
{
#line default
#line hidden
this.Write(" return this.Is");
#line 407 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("Set; \r\n");
#line 408 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else if (member.IsNullable)
{
#line default
#line hidden
this.Write(" return this.");
#line 413 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(".HasValue; \r\n");
#line 414 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else if (member.IsMap || member.IsList)
{
#line default
#line hidden
this.Write(" return this.");
#line 419 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(" != null && this.");
#line 419 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(".Count > 0; \r\n");
#line 420 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else if (member.IsDocument)
{
#line default
#line hidden
this.Write(" return !this.");
#line 425 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(".IsNull();\r\n");
#line 426 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
else
{
#line default
#line hidden
this.Write(" return this.");
#line 431 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(" != null;\r\n");
#line 432 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n\r\n");
#line 437 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
if (this.StructureType == StructureType.Request && this.Operation.AuthType.HasValue)
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// Get the signer to use for this request.\r\n " +
" /// </summary>\r\n /// <returns>A signer for this request.</returns>\r\n " +
" override protected AbstractAWSSigner CreateSigner()\r\n {\r\n");
#line 449 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
switch (this.Operation.AuthType.Value)
{
case OperationAuthType.None:
#line default
#line hidden
this.Write(" return new NullSigner();\r\n");
#line 455 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
break;
case OperationAuthType.V4:
#line default
#line hidden
this.Write(" return new AWS4Signer();\r\n");
#line 460 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
break;
case OperationAuthType.V4UnsignedBody:
#line default
#line hidden
this.Write(" return new AWS4Signer(false);\r\n");
#line 465 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
break;
case OperationAuthType.Bearer:
#line default
#line hidden
this.Write(" return new BearerTokenSigner();\r\n");
#line 470 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
break;
default:
throw new ArgumentException("Unhandled value for operation authtype:" + this.Operation.AuthType.Value);
}
#line default
#line hidden
this.Write(" }\r\n");
#line 477 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
// Flexible checksum overrides to allow response validation configuration on the request
if (this.StructureType == StructureType.Request && !string.IsNullOrEmpty(this.Operation.ChecksumConfiguration?.RequestValidationModeMember))
{
#line default
#line hidden
this.Write(@"
#region Flexible checksum properties
/// <summary>
/// This must be enabled to retrieve the checksum
/// </summary>
protected override CoreChecksumResponseBehavior CoreChecksumMode
{
get
{
if (IsSet");
#line 491 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.ChecksumConfiguration.RequestValidationModeMember));
#line default
#line hidden
this.Write("())\r\n {\r\n return (CoreChecksumResponseBehavior)" +
"Enum.Parse(typeof(CoreChecksumResponseBehavior), this.");
#line 493 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.ChecksumConfiguration.RequestValidationModeMember));
#line default
#line hidden
this.Write(");\r\n }\r\n\r\n return CoreChecksumResponseBehavior.DISA" +
"BLED;\r\n }\r\n }\r\n\r\n private static List<CoreChecksumAlgor" +
"ithm> _supportedChecksumAlgorithms = new List<CoreChecksumAlgorithm>\r\n {\r" +
"\n ");
#line 502 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(string.Join(", ", Operation.ChecksumConfiguration?.ResponseAlgorithms?.Select(s => $"CoreChecksumAlgorithm.{s}").ToArray())));
#line default
#line hidden
this.Write(@"
};
/// <summary>
/// Checksum algorithms supported by this operation for response validation
/// </summary>
protected override System.Collections.ObjectModel.ReadOnlyCollection<CoreChecksumAlgorithm> ChecksumResponseAlgorithms => _supportedChecksumAlgorithms.AsReadOnly();
#endregion
");
#line 510 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
if (this.Structure.Members.Any(m => !m.IsExcluded && m.IsBackwardsCompatibleDateTimeProperty))
{
#line default
#line hidden
this.Write("#region Backwards compatible properties\r\n");
#line 517 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
foreach(var member in this.Structure.Members)
{
if (member.IsExcluded || !member.IsBackwardsCompatibleDateTimeProperty)
continue;
#line default
#line hidden
this.Write(" private ");
#line 523 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
#line 523 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.IsNullable ? "?" : ""));
#line default
#line hidden
this.Write(" ");
#line 523 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityVariableName));
#line default
#line hidden
#line 523 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.ShouldInstantiate ? string.Format(" = new {0}();", member.DetermineType()) : ";"));
#line default
#line hidden
this.Write("\r\n");
#line 524 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write("\r\n");
#line 528 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
foreach(var member in this.Structure.Members)
{
if (member.IsExcluded || !member.IsBackwardsCompatibleDateTimeProperty)
continue;
#line default
#line hidden
#line 534 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.FormatPropertyDocumentation(member, "This property is deprecated. Setting this property results in non-UTC DateTimes " +
"not being marshalled correctly. Use " + member.PropertyName + " instead. Setting either " + member.BackwardCompatibilityPropertyName +
" or " + member.PropertyName + " results in both " + member.BackwardCompatibilityPropertyName + " and " +
member.PropertyName + " being assigned, the latest assignment to either one of the two property is reflected in " +
"the value of both. " + member.BackwardCompatibilityPropertyName + " is provided for backwards compatibility only " +
"and assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.");
#line default
#line hidden
this.Write(" [Obsolete(\"Setting this property results in non-UTC DateTimes not being m" +
"arshalled correctly. \" +\r\n \"Use ");
#line 541 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" instead. Setting either ");
#line 541 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write(" or ");
#line 541 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" results in both ");
#line 541 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write(" and \" +\r\n \"");
#line 542 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" being assigned, the latest assignment to either one of the two property is \" + \r" +
"\n \"reflected in the value of both. ");
#line 543 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write(" is provided for backwards compatibility only and \" +\r\n \"assigning a n" +
"on-Utc DateTime to it results in the wrong timestamp being passed to the service" +
".\", false)]\r\n ");
#line 545 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.AccessModifier));
#line default
#line hidden
this.Write(" ");
#line 545 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
#line 545 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.UseNullable ? "?" : ""));
#line default
#line hidden
this.Write(" ");
#line 545 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write("\r\n {\r\n get { return this.");
#line 547 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityVariableName));
#line default
#line hidden
this.Write(".GetValueOrDefault(); }\r\n set\r\n {\r\n this.");
#line 550 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityVariableName));
#line default
#line hidden
this.Write(" = value;\r\n this.");
#line 551 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(" = new DateTime(value.Ticks, DateTimeKind.Utc);\r\n }\r\n }\r\n");
#line 554 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if (member.EmitIsSetProperties)
{
#line default
#line hidden
this.Write(" /// <summary>\r\n /// This property is set to true if the property <" +
"seealso cref=\"");
#line 559 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write(@"""/>
/// is set; false otherwise.
/// This property can be used to determine if the related property
/// was returned by a service response or if the related property
/// should be sent to the service during a service call.
/// </summary>
/// <returns>
/// True if the related property was set or will be sent to a service; false otherwise.
/// </returns>
[Obsolete(""Setting ");
#line 568 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write(" results in non-UTC DateTimes not being marshalled correctly. Use ");
#line 568 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" instead.\", false)]\r\n public bool Is");
#line 569 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.BackwardCompatibilityPropertyName));
#line default
#line hidden
this.Write("Set\r\n {\r\n get\r\n {\r\n return this.Is");
#line 573 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("Set;\r\n }\r\n set\r\n {\r\n this.Is");
#line 577 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write("Set = value;;\r\n }\r\n }\r\n");
#line 580 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
}
#line default
#line hidden
this.Write("#endregion\r\n");
#line 586 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
if (this.Structure is ExceptionShape)
{
var exceptionShape = (ExceptionShape)this.Structure;
if (exceptionShape.IsRetryable)
{
#line default
#line hidden
this.Write(@" /// <summary>
/// Flag indicating if the exception is retryable and the associated retry
/// details. A null value indicates that the exception is not retryable.
/// </summary>
public override RetryableDetails Retryable
{
get
{
return _retryableDetails;
}
}
");
#line 605 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
}
}
}
else //TODO: remove this else clause. It was added just to preserve whitespaces
{
#line default
#line hidden
this.Write("\r\n");
#line 615 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
if (this.StructureType == StructureType.Response && hasStreamingMember)
{
#line default
#line hidden
this.Write(@" #region Dispose Pattern
private bool _disposed;
/// <summary>
/// Disposes of all managed and unmanaged resources.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing)
{
");
#line 640 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
if (this.Structure != null)
{
foreach (var member in this.Structure.Members)
{
if (member.IsStreaming)
{
#line default
#line hidden
this.Write(" this.");
#line 648 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write("?.Dispose();\r\n this.");
#line 649 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.VariableName));
#line default
#line hidden
this.Write(" = null;\r\n");
#line 650 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
}
}
#line default
#line hidden
this.Write(" }\r\n\r\n this._disposed = true;\r\n }\r\n\r\n #endr" +
"egion\r\n");
#line 661 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
}
#line default
#line hidden
this.Write(" }\r\n}\r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 668 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\StructureGenerator.tt"
// Set to true when the service model specifies a shape that should be wrapped in a response. ElastiCache CreateCacheCluster is an example of this.
public bool IsWrapped { get; set; }
public Operation Operation { get; set; }
public string ClassName { get; set; }
public string BaseClass { get; set; }
public Shape Structure { get; set; }
public StructureType StructureType { get; set; }
#line default
#line hidden
}
#line default
#line hidden
}
| 1,854 |
aws-sdk-net | aws | C# | namespace ServiceClientGenerator.Generators.SourceFiles
{
public partial class StructureGenerator
{
public string BaseClassString
{
get
{
if (!string.IsNullOrWhiteSpace(this.BaseClass))
{
return " : " + this.BaseClass;
}
else
{
return string.Empty;
}
}
}
}
}
| 21 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class WrappingResultGenerator : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("using System;\r\nusing System.Collections.Generic;\r\nusing System.Xml.Serialization;" +
"\r\nusing System.Text;\r\nusing System.IO;\r\n\r\nusing Amazon.Runtime;\r\nusing Amazon.Ru" +
"ntime.Internal;\r\n\r\nnamespace ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model\r\n{\r\n /// <summary>\r\n /// Contains the response data from the ");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Operation.Name));
#line default
#line hidden
this.Write(" operation.\r\n /// </summary>\r\n\tpublic partial class ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.ClassName));
#line default
#line hidden
this.Write(" : ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.BaseClass));
#line default
#line hidden
this.Write("\r\n\t{\r\n private ");
#line 25 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" ");
#line 25 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.VariableName));
#line default
#line hidden
this.Write(";\r\n\r\n /// <summary>\r\n\t\t/// Gets and sets the ");
#line 28 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.PropertyName));
#line default
#line hidden
this.Write(" member\r\n /// </summary>\r\n public ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Structure.Name));
#line default
#line hidden
this.Write(" ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.PropertyName));
#line default
#line hidden
this.Write("\r\n {\r\n get { return this.");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.VariableName));
#line default
#line hidden
this.Write("; }\r\n set { this.");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.VariableName));
#line default
#line hidden
this.Write(" = value; }\r\n }\r\n\r\n // Check to see if ");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.PropertyName));
#line default
#line hidden
this.Write(" property is set\r\n internal bool IsSet");
#line 37 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.PropertyName));
#line default
#line hidden
this.Write("()\r\n {\r\n return this.");
#line 39 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.VariableName));
#line default
#line hidden
this.Write(" != null;\r\n }\r\n }\r\n}\r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
#line 45 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\WrappingResultGenerator.tt"
public Operation Operation { get; set; }
public string ClassName { get; set; }
public string BaseClass { get; set; }
public Shape Structure { get; set; }
public string VariableName
{
get
{
string txt = "_" + this.Structure.Name[0].ToString().ToLower();
if (this.Structure.Name.Length > 1)
txt += this.Structure.Name.Substring(1);
return txt;
}
}
public string PropertyName { get; set; }
#line default
#line hidden
}
#line default
#line hidden
}
| 169 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.SourceFiles.Exceptions
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class EventStreamExceptions : BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write("\r\nusing Amazon.Runtime.EventStreams.Internal;\r\nusing System;\r\n\r\nnamespace ");
#line 10 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(@"
{
/// <summary>
/// Modeled Exception that either comes over the stream from the service model, or wraps other exceptions for the purpose of raising events. If it is
/// modelled, it will be a subclass.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public class ");
#line 19 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException : EventStreamException\r\n\t{\r\n\t\t/// <summary>\r\n /// Cre" +
"ates a new ");
#line 22 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException\r\n /// </summary>\r\n\t\tpublic ");
#line 24 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException()\r\n\t\t{\r\n\t\t}\r\n\r\n\t\t/// <summary>\r\n /// Creates a new ");
#line 29 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException\r\n /// </summary>\r\n /// <param name=\"message\"><" +
"/param>\r\n\r\n\t\tpublic ");
#line 33 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException(string message) : base (message)\r\n\t\t{\r\n\t\t}\r\n\r\n /// <s" +
"ummary>\r\n /// Creates a new ");
#line 38 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException\r\n /// </summary>\r\n /// <param name=\"message\"><" +
"/param>\r\n /// <param name=\"innerException\"></param>\r\n\t\tpublic ");
#line 42 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException(string message, Exception innerException) : base(message, in" +
"nerException)\r\n\t\t{\r\n\t\t}\r\n#if !NETSTANDARD\r\n /// <summary>\r\n /// Co" +
"nstructs a new instance of the ");
#line 47 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write(@"EventStreamException class with serialized data.
/// </summary>
/// <param name=""info"">The <see cref=""T:System.Runtime.Serialization.SerializationInfo"" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name=""context"">The <see cref=""T:System.Runtime.Serialization.StreamingContext"" /> that contains contextual information about the source or destination.</param>
/// <exception cref=""T:System.ArgumentNullException"">The <paramref name=""info"" /> parameter is null. </exception>
/// <exception cref=""T:System.Runtime.Serialization.SerializationException"">The class name is null or <see cref=""P:System.Exception.HResult"" /> is zero (0). </exception>
protected ");
#line 53 "C:\Dev\Repos\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\SourceFiles\Exceptions\EventStreamExceptions.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EventStreamException(System.Runtime.Serialization.SerializationInfo info, System." +
"Runtime.Serialization.StreamingContext context)\r\n : base(info, contex" +
"t)\r\n {\r\n }\r\n#endif\r\n\t}\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 132 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class AWSQueryEC2MarshallingTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.IO;\r\nusing System.Text;\r\nusing Microsoft.VisualSt" +
"udio.TestTools.UnitTesting;\r\n\r\nusing ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(@".Model.Internal.MarshallTransformations;
using Amazon.Runtime.Internal.Transform;
using ServiceClientGenerator;
using ServiceClientGenerator.Generators.SourceFiles;
using AWSSDK_DotNet35.UnitTests.TestTools;
namespace AWSSDK_DotNet35.UnitTests.Marshalling
{
[TestClass]
public class ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("MarshallingTests\r\n {\r\n static readonly ServiceModel service_model = Uti" +
"ls.LoadServiceModel(\"");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceDirectoryName));
#line default
#line hidden
this.Write("\");\r\n\t\t");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n\r\n [TestMethod]\r\n\t\t[TestCategory(\"UnitTest\")]\r\n\t\t[TestCategory(\"Query\")]" +
"\r\n\t\t[TestCategory(\"");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 43 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n var operation = service_model.FindOperatio" +
"n(\"");
#line 45 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n\r\n var request = InstantiateClassGenerator.Execute<");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller();\r\n var internalRequest = marshaller.Marshall(reque" +
"st);\r\n var validator = new AWSQueryValidator(internalRequest.Paramete" +
"rs, request, service_model, operation);\r\n validator.Validate();\r\n\r\n\r\n" +
"");
#line 54 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
if(operation.ResponseStructure != null)
{
#line default
#line hidden
this.Write(@" var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
UnmarshallerContext context = new EC2UnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, new WebResponseData());
var response = ");
#line 60 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.Unmarshall(context)\r\n\t\t\t\tas ");
#line 61 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response; \r\n InstantiateClassGenerator.ValidateObjectFullyInstantiat" +
"ed(response); \r\n");
#line 63 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n\r\n\t\t");
#line 68 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryEC2MarshallingTests.tt"
}
#line default
#line hidden
this.Write("\r\n }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 191 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class AWSQueryMarshallingTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusin" +
"g Microsoft.VisualStudio.TestTools.UnitTesting;\r\n\r\nusing ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations;\r\nusing Amazon.Runtime.Internal.Transform" +
";\r\n\r\nusing ServiceClientGenerator;\r\n\r\nusing AWSSDK_DotNet35.UnitTests.TestTools;" +
"\r\n\r\nnamespace AWSSDK_DotNet35.UnitTests.Marshalling\r\n{\r\n [TestClass]\r\n pub" +
"lic class ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("MarshallingTests\r\n {\r\n static readonly ServiceModel service_model = Uti" +
"ls.LoadServiceModel(\"");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceDirectoryName));
#line default
#line hidden
this.Write("\");\r\n\t\t");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n [TestCategory(\"UnitTest\")]\r\n [TestCategory" +
"(\"");
#line 40 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Type));
#line default
#line hidden
this.Write("\")]\r\n [TestCategory(\"");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n var operation = service_model.FindOperatio" +
"n(\"");
#line 44 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n\r\n var request = InstantiateClassGenerator.Execute<");
#line 46 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller();\r\n var internalRequest = marshaller.Marshall(reque" +
"st);\r\n var validator = new AWSQueryValidator(internalRequest.Paramete" +
"rs, request, service_model, operation);\r\n validator.Validate();\r\n\r\n\r\n" +
"");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
if(operation.ResponseStructure != null)
{
#line default
#line hidden
this.Write(" var payloadResponse = new XmlSampleGenerator(service_model, operation" +
").Execute();\r\n\t\t\tvar context = new XmlUnmarshallerContext(Utils.CreateStreamFrom" +
"String(payloadResponse), false, null);\r\n var response = ");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.Unmarshall(context)\r\n\t\t\t\tas ");
#line 60 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response; \r\n InstantiateClassGenerator.ValidateObjectFullyInstantiat" +
"ed(response); \r\n");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 66 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
foreach (var exception in operation.Exceptions)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n [TestCategory(\"UnitTest\")]\r\n [TestCategory" +
"(\"");
#line 73 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Type));
#line default
#line hidden
this.Write("\")]\r\n [TestCategory(\"");
#line 74 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("_");
#line 75 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n var operation = service_model.FindOperatio" +
"n(\"");
#line 77 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n\r\n var request = InstantiateClassGenerator.Execute<");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 80 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write(@"RequestMarshaller();
var internalRequest = marshaller.Marshall(request);
var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);
validator.Validate();
var exception = operation.Exceptions.First(e => e.Name.Equals(""");
#line 86 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write(@"""));
var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(exception);
var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, null, true);
var response = ");
#line 89 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpS" +
"tatusCode.OK);\r\n\r\n InstantiateClassGenerator.ValidateObjectFullyInsta" +
"ntiated(response);\r\n }\r\n");
#line 93 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\AWSQueryMarshallingTests.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 277 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class EndpointDiscoveryMarshallingTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.IO;\r\nusing System.Text;\r\nusing Microsoft.VisualSt" +
"udio.TestTools.UnitTesting;\r\n\r\nusing ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations;\r\nusing Amazon.Runtime.Internal.Transform" +
";\r\n\r\nusing ServiceClientGenerator;\r\n\r\nusing AWSSDK_DotNet35.UnitTests.TestTools;" +
"\r\n\r\nnamespace AWSSDK_DotNet35.UnitTests.Marshalling\r\n{\r\n [TestClass]\r\n pub" +
"lic class ");
#line 29 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshallingTests\r\n {\r\n static readonly ServiceModel se" +
"rvice_model = Utils.LoadServiceModel(\"");
#line 31 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceDirectoryName));
#line default
#line hidden
this.Write("\");\r\n");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
if(!operation.IsEndpointOperation && operation.EndpointDiscoveryEnabled)
{
#line default
#line hidden
this.Write(" \r\n [TestMethod]\r\n\t\t[TestCategory(\"UnitTest\")]\r\n\t\t[TestCategory(\"Json\")]\r\n" +
"\t\t[TestCategory(\"");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 43 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshallTest()\r\n {\r\n var operation = service_m" +
"odel.FindOperation(\"");
#line 45 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n var request = InstantiateClassGenerator.Execute<");
#line 46 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("EndpointDiscoveryMarshaller();\r\n\r\n var internalData = marshaller.Marsh" +
"all(request);\r\n var validator = new EndpointDiscoveryValidator(intern" +
"alData, request, service_model, operation);\r\n validator.Validate();\r\n" +
" }\r\n");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\EndpointDiscoveryMarshallingTests.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 150 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class JsonMarshallingTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.IO;\r\nusing System.Linq;\r\nusing System.Text;\r\nusin" +
"g Microsoft.VisualStudio.TestTools.UnitTesting;\r\n\r\nusing ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.Internal.MarshallTransformations;\r\nusing Amazon.Runtime.Internal.Transform" +
";\r\n\r\nusing ServiceClientGenerator;\r\n\r\nusing AWSSDK_DotNet35.UnitTests.TestTools;" +
"\r\n\r\nnamespace AWSSDK_DotNet35.UnitTests.Marshalling\r\n{\r\n [TestClass]\r\n pub" +
"lic class ");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("MarshallingTests\r\n {\r\n static readonly ServiceModel service_model = Uti" +
"ls.LoadServiceModel(\"");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceDirectoryName));
#line default
#line hidden
this.Write("\");\r\n\t\t");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n [TestCategory(\"UnitTest\")]\r\n [TestCategory" +
"(\"");
#line 40 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Type));
#line default
#line hidden
this.Write("\")]\r\n [TestCategory(\"");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n var request = InstantiateClassGenerator.Ex" +
"ecute<");
#line 44 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 45 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller();\r\n\r\n var internalRequest = marshaller.Marshall(req" +
"uest);\r\n");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
if(operation.RequestStructure != null)
{
#line default
#line hidden
this.Write(" var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content" +
");\r\n\t\t\tComparer.CompareObjectToJson<");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>(request,jsonRequest);\r\n\r\n");
#line 55 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
}
if(operation.ResponseStructure != null)
{
#line default
#line hidden
this.Write(@" var webResponse = new WebResponseData
{
Headers = {
{""x-amzn-RequestId"", Guid.NewGuid().ToString()},
{""x-amz-crc32"",""0""}
}
};
var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation(""");
#line 68 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write(@""").ResponseStructure).Execute();
webResponse.Headers.Add(""Content-Length"", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
var response = ");
#line 71 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.Unmarshall(context) as ");
#line 71 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response;\r\n\t\t\tInstantiateClassGenerator.ValidateObjectFullyInstantiated(response)" +
";\r\n");
#line 73 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 77 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
foreach (var exception in operation.Exceptions)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n [TestCategory(\"UnitTest\")]\r\n [TestCategory" +
"(\"");
#line 84 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Type));
#line default
#line hidden
this.Write("\")]\r\n [TestCategory(\"");
#line 85 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 86 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("_");
#line 86 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n var operation = service_model.FindOperati" +
"on(\"");
#line 88 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n\r\n var request = InstantiateClassGenerator.Execute<");
#line 90 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 91 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller();\r\n var internalRequest = marshaller.Marshall(reque" +
"st);\r\n var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest." +
"Content);\r\n\r\n Comparer.CompareObjectToJson<");
#line 95 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>(request,jsonRequest);\r\n\r\n var exception = operation.Exception" +
"s.First(e => e.Name.Equals(\"");
#line 97 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write(@"""));
var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute();
var webResponse = new WebResponseData
{
Headers = {
{""x-amzn-RequestId"", Guid.NewGuid().ToString()},
{""x-amz-crc32"",""0""},
{""x-amzn-ErrorType"",""");
#line 104 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write(@"""},
{""Content-Length"", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()}
}
};
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true);
var response = ");
#line 109 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpS" +
"tatusCode.OK);\r\n\r\n InstantiateClassGenerator.ValidateObjectFullyInsta" +
"ntiated(response);\r\n }\r\n");
#line 113 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\JsonMarshallingTests.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 323 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class PaginatorTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\nusing ");
#line 11 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 12 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\n\r\nusing Moq;\r\nusing System;\r\nusing System.Linq;\r\nusing AWSSDK_DotNet35.U" +
"nitTests.TestTools;\r\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\r\n\r\nname" +
"space AWSSDK_DotNet35.UnitTests.PaginatorTests\r\n{\r\n [TestClass]\r\n public c" +
"lass ");
#line 23 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("PaginatorTests\r\n {\r\n private static Mock<Amazon");
#line 25 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client> _mockClient;\r\n\r\n [ClassInitialize()]\r\n public static void C" +
"lassInitialize(TestContext a)\r\n {\r\n _mockClient = new Mock<Ama" +
"zon");
#line 30 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client>(\"access key\", \"secret\", Amazon.RegionEndpoint.USEast1);\r\n }\r\n");
#line 32 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
if (operation.Paginators != null && !operation.UnsupportedPaginatorConfig)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n [TestCategory(\"UnitTest\")]\r\n [TestCategory" +
"(\"");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Test_TwoPages()\r\n {\r\n var request = InstantiateClassGenerator.E" +
"xecute<");
#line 44 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n\r\n var firstResponse = InstantiateClassGenerator.Execute<" +
"");
#line 46 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>();\r\n var secondResponse = InstantiateClassGenerator.Execute<" +
"");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>();\r\n");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
if (operation.Paginators.MoreResults != null)
{
#line default
#line hidden
this.Write(" secondResponse.");
#line 52 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Paginators.MoreResults.PropertyName));
#line default
#line hidden
this.Write(" = false;\r\n");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
else if (operation.Paginators.InputTokens[0].IsListOrDict)
{
#line default
#line hidden
this.Write(" secondResponse.");
#line 58 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Paginators.OutputTokens[0].PropertyName));
#line default
#line hidden
this.Write(".Clear();\r\n");
#line 59 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
else
{
#line default
#line hidden
this.Write(" secondResponse.");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Paginators.OutputTokens[0].PropertyName));
#line default
#line hidden
this.Write(" = null;\r\n");
#line 65 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
#line default
#line hidden
this.Write("\r\n _mockClient.SetupSequence(x => x.");
#line 69 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(request)).Returns(firstResponse).Returns(secondResponse);\r\n var pagin" +
"ator = _mockClient.Object.Paginators.");
#line 70 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(request);\r\n \r\n Assert.AreEqual(2, paginator.Responses.ToLi" +
"st().Count);\r\n }\r\n\r\n [TestMethod]\r\n [TestCategory(\"UnitTest" +
"\")]\r\n [TestCategory(\"");
#line 77 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n [ExpectedException(typeof(System.InvalidOperationException), \"Pagina" +
"tor has already been consumed and cannot be reused. Please create a new instance" +
".\")]\r\n public void ");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Test__OnlyUsedOnce()\r\n {\r\n var request = InstantiateClassGenera" +
"tor.Execute<");
#line 81 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n\r\n var response = InstantiateClassGenerator.Execute<");
#line 83 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>();\r\n");
#line 84 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
if (operation.Paginators.MoreResults != null)
{
#line default
#line hidden
this.Write(" response.");
#line 88 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Paginators.MoreResults.PropertyName));
#line default
#line hidden
this.Write(" = false;\r\n");
#line 89 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
else if (operation.Paginators.InputTokens[0].IsListOrDict)
{
#line default
#line hidden
this.Write(" response.");
#line 94 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Paginators.OutputTokens[0].PropertyName));
#line default
#line hidden
this.Write(".Clear();\r\n");
#line 95 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
else
{
#line default
#line hidden
this.Write(" response.");
#line 100 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Paginators.OutputTokens[0].PropertyName));
#line default
#line hidden
this.Write(" = null;\r\n");
#line 101 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
#line default
#line hidden
this.Write("\r\n _mockClient.Setup(x => x.");
#line 105 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(request)).Returns(response);\r\n var paginator = _mockClient.Object.Pag" +
"inators.");
#line 106 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("(request);\r\n\r\n // Should work the first time\r\n paginator.Re" +
"sponses.ToList();\r\n\r\n // Second time should throw an exception\r\n " +
" paginator.Responses.ToList();\r\n }\r\n\r\n");
#line 115 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\PaginatorTests.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 338 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class RestMarshallingTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 7 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("\r\n\r\nusing System;\r\nusing System.Globalization;\r\nusing System.IO;\r\nusing System.Li" +
"nq;\r\nusing System.Text;\r\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\r\n\r\n" +
"using ");
#line 19 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 21 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(@".Model.Internal.MarshallTransformations;
using Amazon.Runtime.Internal.Transform;
using Amazon.Util;
using ServiceClientGenerator;
using AWSSDK_DotNet35.UnitTests.TestTools;
namespace AWSSDK_DotNet35.UnitTests.Marshalling
{
[TestClass]
public partial class ");
#line 31 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("MarshallingTests\r\n {\r\n static readonly ServiceModel service_model = Uti" +
"ls.LoadServiceModel(\"");
#line 33 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceDirectoryName));
#line default
#line hidden
this.Write("\");\r\n\t\t");
#line 34 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n\t\t[TestCategory(\"UnitTest\")]\r\n\t\t[TestCategory(\"");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Type));
#line default
#line hidden
this.Write("\")]\r\n\t\t[TestCategory(\"");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 43 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n\t\t\tvar operation = service_model.FindOperation(\"");
#line 45 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n\r\n var request = InstantiateClassGenerator.Execute<");
#line 47 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 48 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller();\r\n\r\n var internalRequest = marshaller.Marshall(req" +
"uest);\r\n TestTools.RequestValidator.Validate(\"");
#line 51 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\", request, internalRequest, service_model);\r\n\r\n");
#line 53 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if (operation.RequestHeaderMembers.Count(m => m.Shape.IsMap) > 0)
{
foreach (var member in operation.RequestHeaderMembers)
{
if (member.Shape.IsMap)
{
#line default
#line hidden
this.Write(" // Validate request headers in ");
#line 61 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" (prefix \'");
#line 61 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\')\r\n foreach (var kvp");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" in request.");
#line 62 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 64 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
// Dictionary<string, string>
if (member.ModelShape.ValueShape.IsString)
{
#line default
#line hidden
this.Write(" Assert.AreEqual(kvp");
#line 69 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value, internalRequest.Headers[$\"");
#line 69 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("{kvp");
#line 69 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key}\"]);\r\n");
#line 70 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
// Dictionary<string, List<string>>
else if (member.ModelShape.ValueShape?.ListShape?.IsString == true)
{
#line default
#line hidden
this.Write(" var flattenedHeader = string.Join(\",\", kvp");
#line 76 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value);\r\n\r\n Assert.AreEqual(flattenedHeader, internalRequest.Head" +
"ers[$\"");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("{kvp");
#line 78 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key}\"]);\r\n");
#line 79 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 83 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
}
#line default
#line hidden
#line 88 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if(operation.ResponseStructure != null)
{
#line default
#line hidden
this.Write("\t\t\tvar webResponse = new WebResponseData\r\n\t\t\t{\r\n\t\t\t\tHeaders = {\r\n");
#line 95 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if (operation.ResponseHeaderMembers.Count() > 0 )
{
foreach (var member in operation.ResponseHeaderMembers)
{
if (member.Shape.IsString)
{
if (member.IsJsonValue)
{
#line default
#line hidden
this.Write("\t\t\t\t\t{\"");
#line 106 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",Convert.ToBase64String(Encoding.UTF8.GetBytes(\"");
#line 106 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("_Value\"))},\r\n");
#line 107 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else
{
#line default
#line hidden
this.Write("\t\t\t\t\t{\"");
#line 112 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",\"");
#line 112 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("_Value\"},\r\n");
#line 113 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
else if (member.Shape.IsMap)
{
//Defer processing of the map until after the other types because
//we cannot write the code to write out the dynamic map statically
//inline.
continue;
}
else if (member.Shape.IsInt)
{
#line default
#line hidden
this.Write("\t\t\t\t\t{\"");
#line 126 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",int.MaxValue.ToString(CultureInfo.InvariantCulture)},\r\n");
#line 127 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else if (member.Shape.IsLong)
{
#line default
#line hidden
this.Write("\t\t\t\t\t{\"");
#line 132 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",long.MaxValue.ToString(CultureInfo.InvariantCulture)},\r\n");
#line 133 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else if (member.Shape.IsDateTime)
{
#line default
#line hidden
this.Write("\t\t\t\t\t{\"");
#line 138 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",ValidatorUtils.GetTestDate(TimestampFormat.");
#line 138 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.TimestampFormat));
#line default
#line hidden
this.Write(")},\r\n");
#line 139 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else
{
throw new Exception("Member " + member.Shape.Name + " cannot be handled because it's type, " + member.Shape.Type + ", is not handled. Please Update RestMarshallingTests.tt.");
}
}
}
#line default
#line hidden
this.Write("\t\t\t\t\t{\"x-amzn-RequestId\", Guid.NewGuid().ToString()},\r\n\t\t\t\t\t{\"x-amz-crc32\",\"0\"}\r\n" +
"\t\t\t\t}\r\n\t\t\t};\r\n");
#line 151 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if (operation.ResponseHeaderMembers.Count(m => m.Shape.IsMap) > 0)
{
#line default
#line hidden
this.Write("\r\n // populate a dummy response object so we can copy the headers\r\n " +
" var dummyResponse = InstantiateClassGenerator.Execute<");
#line 157 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>();\r\n\r\n");
#line 159 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
foreach (var member in operation.ResponseHeaderMembers)
{
if (member.Shape.IsMap)
{
#line default
#line hidden
this.Write(" // Populate map of response headers for ");
#line 165 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" with prefix \"");
#line 165 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\".\r\n foreach (var kvp");
#line 166 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" in dummyResponse.");
#line 166 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 168 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
// Dictionary<string, string>
if (member.ModelShape.ValueShape.IsString)
{
#line default
#line hidden
this.Write(" webResponse.Headers.Add($\"");
#line 173 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("{kvp");
#line 173 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key}\", kvp");
#line 173 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value);\r\n");
#line 174 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
// Dictionary<string, List<string>>
else if (member.ModelShape.ValueShape?.ListShape?.IsString == true)
{
#line default
#line hidden
this.Write(" webResponse.Headers.Add($\"");
#line 180 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("{kvp");
#line 180 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key}\", string.Join(\",\", kvp");
#line 180 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value.ToArray()));\r\n");
#line 181 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 185 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
}
if(this.Config.ServiceModel.Type == ServiceType.Rest_Xml)
{
#line default
#line hidden
this.Write(@"
var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
webResponse.ContentLength = payloadResponse.Length;
var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ");
#line 197 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n var response = unmarshaller.Unmarshal" +
"l(context) as ");
#line 198 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response;\r\n InstantiateClassGenerator.ValidateObjectFullyInstantiated(" +
"response);\r\n");
#line 200 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else
{
#line default
#line hidden
this.Write(@"
var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();
webResponse.Headers[""Content-Length""] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
ResponseUnmarshaller unmarshaller = ");
#line 209 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance;\r\n var response = unmarshaller.Unmarshal" +
"l(context) as ");
#line 210 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response;\r\n InstantiateClassGenerator.ValidateObjectFullyInstantiated(" +
"response);\r\n");
#line 212 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if (operation.ResponseHeaderMembers.Count(m => m.Shape.IsMap) > 0)
{
foreach (var member in operation.ResponseHeaderMembers)
{
if (member.Shape.IsMap)
{
#line default
#line hidden
this.Write(" // Validate response headers for ");
#line 220 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" with prefix \"");
#line 220 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\".\r\n foreach (var kvp");
#line 221 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" in dummyResponse.");
#line 221 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 223 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
// Dictionary<string, string>
if (member.ModelShape.ValueShape.IsString)
{
#line default
#line hidden
this.Write(" Assert.AreEqual(response.ResponseHeaders[kvp");
#line 228 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key], kvp");
#line 228 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value);\r\n");
#line 229 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
// Dictionary<string, List<string>>
else if (member.ModelShape.ValueShape?.ListShape?.IsString == true)
{
#line default
#line hidden
this.Write(" Assert.AreEqual(response.ResponseHeaders[kvp");
#line 235 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key].Count(), kvp");
#line 235 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value.Count());\r\n\r\n for (var i = 0; i < response.ResponseHeaders[" +
"kvp");
#line 237 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key].Count(); i++)\r\n Assert.AreEqual(response.ResponseHeaders" +
"[kvp");
#line 238 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key][i], kvp");
#line 238 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value[i]);\r\n");
#line 239 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 243 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
}
}
}
#line default
#line hidden
this.Write(" }\r\n");
#line 251 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
foreach (var exception in operation.Exceptions)
{
#line default
#line hidden
this.Write("\r\n [TestMethod]\r\n [TestCategory(\"UnitTest\")]\r\n [TestCategory" +
"(\"");
#line 258 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ServiceModel.Type));
#line default
#line hidden
this.Write("\")]\r\n [TestCategory(\"");
#line 259 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 260 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("_");
#line 260 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write("MarshallTest()\r\n {\r\n var operation = service_model.FindOperatio" +
"n(\"");
#line 262 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\");\r\n\r\n var request = InstantiateClassGenerator.Execute<");
#line 264 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Request>();\r\n var marshaller = new ");
#line 265 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestMarshaller();\r\n var internalRequest = marshaller.Marshall(reque" +
"st);\r\n\r\n TestTools.RequestValidator.Validate(\"");
#line 268 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\", request, internalRequest, service_model);\r\n\r\n var exception = opera" +
"tion.Exceptions.First(e => e.Name.Equals(\"");
#line 270 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write("\"));\r\n var webResponse = new WebResponseData\r\n {\r\n " +
" Headers = {\r\n");
#line 274 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if( operation.ResponseHeaderMembers.Count() > 0 )
{
foreach (var member in operation.ResponseHeaderMembers)
{
if (member.Shape.IsString)
{
if (member.IsJsonValue)
{
#line default
#line hidden
this.Write(" {\"");
#line 284 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",Convert.ToBase64String(Encoding.UTF8.GetBytes(\"");
#line 284 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("_Value\"))},\r\n");
#line 285 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else
{
#line default
#line hidden
this.Write(" {\"");
#line 290 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",\"");
#line 290 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("_Value\"},\r\n");
#line 291 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
else if (member.Shape.IsMap)
{
//Defer processing of the map until after the other types because
//we cannot write the code to write out the dynamic map statically
//inline.
continue;
}
else if (member.Shape.IsInt)
{
#line default
#line hidden
this.Write(" {\"");
#line 305 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",int.MaxValue.ToString(CultureInfo.InvariantCulture)},\r\n");
#line 306 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else if (member.Shape.IsLong)
{
#line default
#line hidden
this.Write(" {\"");
#line 311 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",long.MaxValue.ToString(CultureInfo.InvariantCulture)},\r\n");
#line 312 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else if (member.Shape.IsDateTime)
{
#line default
#line hidden
this.Write(" {\"");
#line 317 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\",ValidatorUtils.GetTestDate(TimestampFormat.");
#line 317 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.TimestampFormat));
#line default
#line hidden
this.Write(")},\r\n");
#line 318 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else
{
throw new Exception("Member " + member.Shape.Name + " cannot be handled because it's type, " + member.Shape.Type + ", is not handled. Please Update RestMarshallingTests.tt.");
}
}
}
#line default
#line hidden
this.Write(" {\"x-amzn-RequestId\", Guid.NewGuid().ToString()},\r\n " +
" {\"x-amz-crc32\",\"0\"},\r\n");
#line 329 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if(this.Config.ServiceModel.Type != ServiceType.Rest_Xml)
{
#line default
#line hidden
this.Write(" {\"x-amzn-ErrorType\",\"");
#line 333 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(exception.Name));
#line default
#line hidden
this.Write("\"},\r\n");
#line 334 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n };\r\n\r\n");
#line 340 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
if (operation.ResponseHeaderMembers.Count(m => m.Shape.IsMap) > 0)
{
#line default
#line hidden
this.Write(" // populate a dummy response object so we can copy the headers\r\n " +
" var dummyResponse = InstantiateClassGenerator.Execute<");
#line 345 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("Response>();\r\n");
#line 346 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
foreach (var member in operation.ResponseHeaderMembers)
{
if (member.Shape.IsMap)
{
#line default
#line hidden
this.Write(" // Populate map of response headers for ");
#line 353 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" with prefix \"");
#line 353 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("\".\r\n foreach (var kvp");
#line 354 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(" in dummyResponse.");
#line 354 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(")\r\n {\r\n");
#line 356 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
// Dictionary<string, string>
if (member.ModelShape.ValueShape.IsString)
{
#line default
#line hidden
this.Write(" webResponse.Headers.Add($\"");
#line 361 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("{kvp");
#line 361 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key}\", kvp");
#line 361 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value);\r\n");
#line 362 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
// Dictionary<string, List<string>>
else if (member.ModelShape.ValueShape?.ListShape?.IsString == true)
{
#line default
#line hidden
this.Write(" webResponse.Headers.Add($\"");
#line 368 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.MarshallLocationName));
#line default
#line hidden
this.Write("{kvp");
#line 368 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Key}\", string.Join(\",\", kvp");
#line 368 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.PropertyName));
#line default
#line hidden
this.Write(".Value.ToArray()));\r\n");
#line 369 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n\r\n");
#line 374 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
}
if(this.Config.ServiceModel.Type == ServiceType.Rest_Xml)
{
#line default
#line hidden
this.Write(@" var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(exception);
webResponse.Headers[""Content-Length""] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true);
var response = ");
#line 385 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpS" +
"tatusCode.OK);\r\n\r\n InstantiateClassGenerator.ValidateObjectFullyInsta" +
"ntiated(response);\r\n");
#line 388 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
else
{
#line default
#line hidden
this.Write(@" var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute();
webResponse.Headers[""Content-Length""] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true);
var response = ");
#line 396 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("ResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpS" +
"tatusCode.OK);\r\n\r\n InstantiateClassGenerator.ValidateObjectFullyInsta" +
"ntiated(response);\r\n");
#line 399 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n");
#line 403 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\RestMarshallingTests.tt"
}
}
#line default
#line hidden
this.Write(" }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 1,215 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class SimpleConstructorTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("using System.Collections.Generic;\r\nusing System.IO;\r\nusing Microsoft.VisualStudio" +
".TestTools.UnitTesting;\r\nusing ");
#line 12 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\nusing ");
#line 13 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\n\r\nnamespace AWSSDK_DotNet35.UnitTests.TestTools\r\n{\r\n [TestClass]\r\n " +
" public class ");
#line 18 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("ConstructorCustomizationsTests\r\n {\r\n");
#line 20 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
foreach (var operation in this.Config.ServiceModel.Operations)
{
if (this.Config.ServiceModel.Customizations.SimpleConstructorsModel.CreateSimpleConstructors(operation.Name + "Request"))
{
#line default
#line hidden
this.Write(" [TestMethod]\r\n\t\t[TestCategory(\"UnitTest\")]\r\n [TestCategory(\"Constr" +
"uctors\"), TestCategory(\"");
#line 28 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 29 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("RequestConstructorTests()\r\n {\r\n");
#line 31 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
foreach (var form in this.Config.ServiceModel.Customizations.SimpleConstructorsModel.SimpleConstructors[operation.Name + "Request"].Forms)
{
var docMembers = this.Config.ServiceModel.Customizations.SimpleConstructorsModel.GetFormMembers(form, this.Config.ServiceModel.FindShape(operation.RequestStructure.Name).Members);
#line default
#line hidden
this.Write(" EnsureConstructorExists(typeof(");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model.");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name + "Request"));
#line default
#line hidden
this.Write("), new System.Type[] { ");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
foreach (var member in docMembers) {
#line default
#line hidden
this.Write("typeof(");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
this.Write("), ");
#line 36 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
}
#line default
#line hidden
this.Write("});\r\n");
#line 37 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
}
#line default
#line hidden
this.Write(" }\r\n\r\n");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleConstructorTests.tt"
}
}
#line default
#line hidden
this.Write(" void EnsureConstructorExists(System.Type type, System.Type[] constructorP" +
"arams)\r\n {\r\n Assert.IsNotNull(type.GetConstructor(constructorP" +
"arams));\r\n }\r\n }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 164 |
aws-sdk-net | aws | C# | // ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 17.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace ServiceClientGenerator.Generators.TestFiles
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System;
/// <summary>
/// Class to produce the template output
/// </summary>
#line 1 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class SimpleMethodTests : Generators.BaseGenerator
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
#line 6 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
AddLicenseHeader();
#line default
#line hidden
this.Write("using System;\r\nusing System.Collections.Generic;\r\nusing System.IO;\r\nusing System." +
"Linq;\r\nusing System.Text;\r\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\r\n" +
"\r\nusing ");
#line 16 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Model;\r\nusing ");
#line 17 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(";\r\n\r\nnamespace AWSSDK_DotNet35.UnitTests.TestTools\r\n{\r\n [TestClass]\r\n publi" +
"c class ");
#line 22 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("MethodCustomizationsTests\r\n {\r\n [TestMethod]\r\n\t\t[TestCategory(\"UnitTest" +
"\")]\r\n [TestCategory(\"SimpleMethods\"), TestCategory(\"");
#line 26 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.TestCategory));
#line default
#line hidden
this.Write("\")]\r\n public void ");
#line 27 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("SimpleMethodTests()\r\n {\r\n");
#line 29 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
foreach(var operation in this.Config.ServiceModel.Operations)
{
if (this.Config.ServiceModel.Customizations.SimpleMethodsModel.CreateSimpleMethods(operation.Name))
{
var forms = this.Config.ServiceModel.Customizations.SimpleMethodsModel.SimpleMethods[operation.Name].Forms;
var members = this.Config.ServiceModel.FindShape(operation.RequestStructure.Name).Members;
foreach (var form in forms)
{
var docMembers = this.Config.ServiceModel.Customizations.SimpleMethodsModel.GetFormMembers(form, members);
#line default
#line hidden
this.Write(" EnsureSimpleMethodExists(typeof(");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
#line default
#line hidden
this.Write(".Amazon");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.ClassName));
#line default
#line hidden
this.Write("Client), \"");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(operation.Name));
#line default
#line hidden
this.Write("\", new Type[] { ");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
foreach (var member in docMembers) {
#line default
#line hidden
this.Write("typeof(");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
#line default
#line hidden
this.Write("), ");
#line 41 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
}
#line default
#line hidden
this.Write("});\r\n");
#line 42 "C:\projects\aws\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\TestFiles\SimpleMethodTests.tt"
}
}
}
#line default
#line hidden
this.Write(@" }
void EnsureSimpleMethodExists(Type type, string methodName, Type[] simpleParams)
{
Assert.IsNotNull(type.GetMethod(methodName, simpleParams), ""Failed to find simple method "" + methodName);
}
}
}");
return this.GenerationEnvironment.ToString();
}
}
#line default
#line hidden
}
| 164 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ServiceClientGeneratorLib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ServiceClientGeneratorLib")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9491a6e3-9748-4b02-92b6-bcd0f62c85f2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// IJsonWrapper.cs
/// Interface that represents a type capable of handling all kinds of JSON
/// data. This is mainly used when mapping objects through JsonMapper, and
/// it's implemented by JsonData.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System.Collections;
using System.Collections.Specialized;
namespace Json.LitJson
{
public enum JsonType
{
None,
Object,
Array,
String,
Int,
Long,
Double,
Boolean
}
public interface IJsonWrapper : IList, IOrderedDictionary
{
bool IsArray { get; }
bool IsBoolean { get; }
bool IsDouble { get; }
bool IsInt { get; }
bool IsLong { get; }
bool IsObject { get; }
bool IsString { get; }
bool GetBoolean ();
double GetDouble ();
int GetInt ();
JsonType GetJsonType ();
long GetLong ();
string GetString ();
void SetBoolean (bool val);
void SetDouble (double val);
void SetInt (int val);
void SetJsonType (JsonType type);
void SetLong (long val);
void SetString (string val);
string ToJson ();
void ToJson (JsonWriter writer);
}
}
| 61 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonData.cs
/// Generic type to hold JSON data (objects, arrays, and so on). This is
/// the default type returned by JsonMapper.ToObject().
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
namespace Json.LitJson
{
public class JsonData : IJsonWrapper, IEquatable<JsonData>
{
#region Fields
private IList<JsonData> inst_array;
private bool inst_boolean;
private double inst_double;
private int inst_int;
private long inst_long;
private IDictionary<string, JsonData> inst_object;
private string inst_string;
private string json;
private JsonType type;
// Used to implement the IOrderedDictionary interface
private IList<KeyValuePair<string, JsonData>> object_list;
#endregion
#region Properties
public int Count {
get { return EnsureCollection ().Count; }
}
public bool IsArray {
get { return type == JsonType.Array; }
}
public bool IsBoolean {
get { return type == JsonType.Boolean; }
}
public bool IsDouble {
get { return type == JsonType.Double; }
}
public bool IsInt {
get { return type == JsonType.Int; }
}
public bool IsLong {
get { return type == JsonType.Long; }
}
public bool IsObject {
get { return type == JsonType.Object; }
}
public bool IsString {
get { return type == JsonType.String; }
}
#endregion
#region ICollection Properties
int ICollection.Count {
get {
return Count;
}
}
bool ICollection.IsSynchronized {
get {
return EnsureCollection ().IsSynchronized;
}
}
object ICollection.SyncRoot {
get {
return EnsureCollection ().SyncRoot;
}
}
#endregion
#region IDictionary Properties
bool IDictionary.IsFixedSize {
get {
return EnsureDictionary ().IsFixedSize;
}
}
bool IDictionary.IsReadOnly {
get {
return EnsureDictionary ().IsReadOnly;
}
}
ICollection IDictionary.Keys {
get {
EnsureDictionary ();
IList<string> keys = new List<string> ();
foreach (KeyValuePair<string, JsonData> entry in
object_list) {
keys.Add (entry.Key);
}
return (ICollection) keys;
}
}
ICollection IDictionary.Values {
get {
EnsureDictionary ();
IList<JsonData> values = new List<JsonData> ();
foreach (KeyValuePair<string, JsonData> entry in
object_list) {
values.Add (entry.Value);
}
return (ICollection) values;
}
}
#endregion
#region IJsonWrapper Properties
bool IJsonWrapper.IsArray {
get { return IsArray; }
}
bool IJsonWrapper.IsBoolean {
get { return IsBoolean; }
}
bool IJsonWrapper.IsDouble {
get { return IsDouble; }
}
bool IJsonWrapper.IsInt {
get { return IsInt; }
}
bool IJsonWrapper.IsLong {
get { return IsLong; }
}
bool IJsonWrapper.IsObject {
get { return IsObject; }
}
bool IJsonWrapper.IsString {
get { return IsString; }
}
#endregion
#region IList Properties
bool IList.IsFixedSize {
get {
return EnsureList ().IsFixedSize;
}
}
bool IList.IsReadOnly {
get {
return EnsureList ().IsReadOnly;
}
}
#endregion
#region IDictionary Indexer
object IDictionary.this[object key] {
get {
return EnsureDictionary ()[key];
}
set {
if (! (key is String))
throw new ArgumentException (
"The key has to be a string");
JsonData data = ToJsonData (value);
this[(string) key] = data;
}
}
#endregion
#region IOrderedDictionary Indexer
object IOrderedDictionary.this[int idx] {
get {
EnsureDictionary ();
return object_list[idx].Value;
}
set {
EnsureDictionary ();
JsonData data = ToJsonData (value);
KeyValuePair<string, JsonData> old_entry = object_list[idx];
inst_object[old_entry.Key] = data;
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> (old_entry.Key, data);
object_list[idx] = entry;
}
}
#endregion
#region IList Indexer
object IList.this[int index] {
get {
return EnsureList ()[index];
}
set {
EnsureList ();
JsonData data = ToJsonData (value);
this[index] = data;
}
}
#endregion
#region Public Indexers
public IEnumerable<string> PropertyNames
{
get
{
EnsureDictionary();
return inst_object.Keys;
}
}
public JsonData this[string prop_name] {
get {
EnsureDictionary ();
JsonData data = null;
inst_object.TryGetValue(prop_name, out data);
return data;
}
set {
EnsureDictionary ();
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> (prop_name, value);
if (inst_object.ContainsKey (prop_name)) {
for (int i = 0; i < object_list.Count; i++) {
if (object_list[i].Key == prop_name) {
object_list[i] = entry;
break;
}
}
} else
object_list.Add (entry);
inst_object[prop_name] = value;
json = null;
}
}
public JsonData this[int index] {
get {
EnsureCollection ();
if (type == JsonType.Array)
return inst_array[index];
return object_list[index].Value;
}
set {
EnsureCollection ();
if (type == JsonType.Array)
inst_array[index] = value;
else {
KeyValuePair<string, JsonData> entry = object_list[index];
KeyValuePair<string, JsonData> new_entry =
new KeyValuePair<string, JsonData> (entry.Key, value);
object_list[index] = new_entry;
inst_object[entry.Key] = value;
}
json = null;
}
}
#endregion
#region Constructors
public JsonData ()
{
}
public JsonData (bool boolean)
{
type = JsonType.Boolean;
inst_boolean = boolean;
}
public JsonData (double number)
{
type = JsonType.Double;
inst_double = number;
}
public JsonData (int number)
{
type = JsonType.Int;
inst_int = number;
}
public JsonData (long number)
{
type = JsonType.Long;
inst_long = number;
}
public JsonData (object obj)
{
if (obj is Boolean) {
type = JsonType.Boolean;
inst_boolean = (bool) obj;
return;
}
if (obj is Double) {
type = JsonType.Double;
inst_double = (double) obj;
return;
}
if (obj is Int32) {
type = JsonType.Int;
inst_int = (int) obj;
return;
}
if (obj is Int64) {
type = JsonType.Long;
inst_long = (long) obj;
return;
}
if (obj is String) {
type = JsonType.String;
inst_string = (string) obj;
return;
}
throw new ArgumentException (
"Unable to wrap the given object with JsonData");
}
public JsonData (string str)
{
type = JsonType.String;
inst_string = str;
}
#endregion
#region Implicit Conversions
public static implicit operator JsonData (Boolean data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Double data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Int32 data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Int64 data)
{
return new JsonData (data);
}
public static implicit operator JsonData (String data)
{
return new JsonData (data);
}
#endregion
#region Explicit Conversions
public static explicit operator Boolean (JsonData data)
{
if (data.type != JsonType.Boolean)
throw new InvalidCastException (
"Instance of JsonData doesn't hold a double");
return data.inst_boolean;
}
public static explicit operator Double (JsonData data)
{
if (data.type != JsonType.Double)
throw new InvalidCastException (
"Instance of JsonData doesn't hold a double");
return data.inst_double;
}
public static explicit operator Int32 (JsonData data)
{
if (data.type != JsonType.Int)
throw new InvalidCastException (
"Instance of JsonData doesn't hold an int");
return data.inst_int;
}
public static explicit operator Int64 (JsonData data)
{
if (data.type != JsonType.Long)
throw new InvalidCastException (
"Instance of JsonData doesn't hold an int");
return data.inst_long;
}
public static explicit operator String (JsonData data)
{
if (data.type != JsonType.String)
throw new InvalidCastException (
"Instance of JsonData doesn't hold a string");
return data.inst_string;
}
#endregion
#region ICollection Methods
void ICollection.CopyTo (Array array, int index)
{
EnsureCollection ().CopyTo (array, index);
}
#endregion
#region IDictionary Methods
void IDictionary.Add (object key, object value)
{
JsonData data = ToJsonData (value);
EnsureDictionary ().Add (key, data);
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> ((string) key, data);
object_list.Add (entry);
json = null;
}
void IDictionary.Clear ()
{
EnsureDictionary ().Clear ();
object_list.Clear ();
json = null;
}
bool IDictionary.Contains (object key)
{
return EnsureDictionary ().Contains (key);
}
IDictionaryEnumerator IDictionary.GetEnumerator ()
{
return ((IOrderedDictionary) this).GetEnumerator ();
}
void IDictionary.Remove (object key)
{
EnsureDictionary ().Remove (key);
for (int i = 0; i < object_list.Count; i++) {
if (object_list[i].Key == (string) key) {
object_list.RemoveAt (i);
break;
}
}
json = null;
}
#endregion
#region IEnumerable Methods
IEnumerator IEnumerable.GetEnumerator ()
{
return EnsureCollection ().GetEnumerator ();
}
#endregion
#region IJsonWrapper Methods
bool IJsonWrapper.GetBoolean ()
{
if (type != JsonType.Boolean)
throw new InvalidOperationException (
"JsonData instance doesn't hold a boolean");
return inst_boolean;
}
double IJsonWrapper.GetDouble ()
{
if (type != JsonType.Double)
throw new InvalidOperationException (
"JsonData instance doesn't hold a double");
return inst_double;
}
int IJsonWrapper.GetInt ()
{
if (type != JsonType.Int)
throw new InvalidOperationException (
"JsonData instance doesn't hold an int");
return inst_int;
}
long IJsonWrapper.GetLong ()
{
if (type != JsonType.Long)
throw new InvalidOperationException (
"JsonData instance doesn't hold a long");
return inst_long;
}
string IJsonWrapper.GetString ()
{
if (type != JsonType.String)
throw new InvalidOperationException (
"JsonData instance doesn't hold a string");
return inst_string;
}
void IJsonWrapper.SetBoolean (bool val)
{
type = JsonType.Boolean;
inst_boolean = val;
json = null;
}
void IJsonWrapper.SetDouble (double val)
{
type = JsonType.Double;
inst_double = val;
json = null;
}
void IJsonWrapper.SetInt (int val)
{
type = JsonType.Int;
inst_int = val;
json = null;
}
void IJsonWrapper.SetLong (long val)
{
type = JsonType.Long;
inst_long = val;
json = null;
}
void IJsonWrapper.SetString (string val)
{
type = JsonType.String;
inst_string = val;
json = null;
}
string IJsonWrapper.ToJson ()
{
return ToJson ();
}
void IJsonWrapper.ToJson (JsonWriter writer)
{
ToJson (writer);
}
#endregion
#region IList Methods
int IList.Add (object value)
{
return Add (value);
}
void IList.Clear ()
{
EnsureList ().Clear ();
json = null;
}
bool IList.Contains (object value)
{
return EnsureList ().Contains (value);
}
int IList.IndexOf (object value)
{
return EnsureList ().IndexOf (value);
}
void IList.Insert (int index, object value)
{
EnsureList ().Insert (index, value);
json = null;
}
void IList.Remove (object value)
{
EnsureList ().Remove (value);
json = null;
}
void IList.RemoveAt (int index)
{
EnsureList ().RemoveAt (index);
json = null;
}
#endregion
#region IOrderedDictionary Methods
IDictionaryEnumerator IOrderedDictionary.GetEnumerator ()
{
EnsureDictionary ();
return new OrderedDictionaryEnumerator (
object_list.GetEnumerator ());
}
void IOrderedDictionary.Insert (int idx, object key, object value)
{
string property = (string) key;
JsonData data = ToJsonData (value);
this[property] = data;
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> (property, data);
object_list.Insert (idx, entry);
}
void IOrderedDictionary.RemoveAt (int idx)
{
EnsureDictionary ();
inst_object.Remove (object_list[idx].Key);
object_list.RemoveAt (idx);
}
#endregion
#region Private Methods
private ICollection EnsureCollection ()
{
if (type == JsonType.Array)
return (ICollection) inst_array;
if (type == JsonType.Object)
return (ICollection) inst_object;
throw new InvalidOperationException (
"The JsonData instance has to be initialized first");
}
private IDictionary EnsureDictionary ()
{
if (type == JsonType.Object)
return (IDictionary) inst_object;
if (type != JsonType.None)
throw new InvalidOperationException (
"Instance of JsonData is not a dictionary");
type = JsonType.Object;
inst_object = new Dictionary<string, JsonData> ();
object_list = new List<KeyValuePair<string, JsonData>> ();
return (IDictionary) inst_object;
}
private IList EnsureList ()
{
if (type == JsonType.Array)
return (IList) inst_array;
if (type != JsonType.None)
throw new InvalidOperationException (
"Instance of JsonData is not a list");
type = JsonType.Array;
inst_array = new List<JsonData> ();
return (IList) inst_array;
}
private JsonData ToJsonData (object obj)
{
if (obj == null)
return null;
if (obj is JsonData)
return (JsonData) obj;
return new JsonData (obj);
}
private static void WriteJson (IJsonWrapper obj, JsonWriter writer)
{
if (obj.IsString) {
writer.Write (obj.GetString ());
return;
}
if (obj.IsBoolean) {
writer.Write (obj.GetBoolean ());
return;
}
if (obj.IsDouble) {
writer.Write (obj.GetDouble ());
return;
}
if (obj.IsInt) {
writer.Write (obj.GetInt ());
return;
}
if (obj.IsLong) {
writer.Write (obj.GetLong ());
return;
}
if (obj.IsArray) {
writer.WriteArrayStart ();
foreach (object elem in (IList) obj)
WriteJson ((JsonData) elem, writer);
writer.WriteArrayEnd ();
return;
}
if (obj.IsObject) {
writer.WriteObjectStart ();
foreach (DictionaryEntry entry in ((IDictionary) obj)) {
writer.WritePropertyName ((string) entry.Key);
WriteJson ((JsonData) entry.Value, writer);
}
writer.WriteObjectEnd ();
return;
}
}
#endregion
public int Add (object value)
{
JsonData data = ToJsonData (value);
json = null;
return EnsureList ().Add (data);
}
public void Clear ()
{
if (IsObject) {
((IDictionary) this).Clear ();
return;
}
if (IsArray) {
((IList) this).Clear ();
return;
}
}
public bool Equals (JsonData x)
{
if (x == null)
return false;
if (x.type != this.type)
return false;
switch (this.type) {
case JsonType.None:
return true;
case JsonType.Object:
return this.inst_object.Equals (x.inst_object);
case JsonType.Array:
return this.inst_array.Equals (x.inst_array);
case JsonType.String:
return this.inst_string.Equals (x.inst_string);
case JsonType.Int:
return this.inst_int.Equals (x.inst_int);
case JsonType.Long:
return this.inst_long.Equals (x.inst_long);
case JsonType.Double:
return this.inst_double.Equals (x.inst_double);
case JsonType.Boolean:
return this.inst_boolean.Equals (x.inst_boolean);
}
return false;
}
public JsonType GetJsonType ()
{
return type;
}
public void SetJsonType (JsonType type)
{
if (this.type == type)
return;
switch (type) {
case JsonType.None:
break;
case JsonType.Object:
inst_object = new Dictionary<string, JsonData> ();
object_list = new List<KeyValuePair<string, JsonData>> ();
break;
case JsonType.Array:
inst_array = new List<JsonData> ();
break;
case JsonType.String:
inst_string = default (String);
break;
case JsonType.Int:
inst_int = default (Int32);
break;
case JsonType.Long:
inst_long = default (Int64);
break;
case JsonType.Double:
inst_double = default (Double);
break;
case JsonType.Boolean:
inst_boolean = default (Boolean);
break;
}
this.type = type;
}
public string ToJson ()
{
if (json != null)
return json;
StringWriter sw = new StringWriter ();
JsonWriter writer = new JsonWriter (sw);
writer.Validate = false;
WriteJson (this, writer);
json = sw.ToString ();
return json;
}
public void ToJson (JsonWriter writer)
{
bool old_validate = writer.Validate;
writer.Validate = false;
WriteJson (this, writer);
writer.Validate = old_validate;
}
public override string ToString ()
{
switch (type) {
case JsonType.Array:
return "JsonData array";
case JsonType.Boolean:
return inst_boolean.ToString ();
case JsonType.Double:
return inst_double.ToString ();
case JsonType.Int:
return inst_int.ToString ();
case JsonType.Long:
return inst_long.ToString ();
case JsonType.Object:
return "JsonData object";
case JsonType.String:
return inst_string;
}
return "Uninitialized JsonData";
}
}
internal class OrderedDictionaryEnumerator : IDictionaryEnumerator
{
IEnumerator<KeyValuePair<string, JsonData>> list_enumerator;
public object Current {
get { return Entry; }
}
public DictionaryEntry Entry {
get {
KeyValuePair<string, JsonData> curr = list_enumerator.Current;
return new DictionaryEntry (curr.Key, curr.Value);
}
}
public object Key {
get { return list_enumerator.Current.Key; }
}
public object Value {
get { return list_enumerator.Current.Value; }
}
public OrderedDictionaryEnumerator (
IEnumerator<KeyValuePair<string, JsonData>> enumerator)
{
list_enumerator = enumerator;
}
public bool MoveNext ()
{
return list_enumerator.MoveNext ();
}
public void Reset ()
{
list_enumerator.Reset ();
}
}
}
| 1,006 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonException.cs
/// Base class throwed by LitJSON when a parsing error occurs.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
namespace Json.LitJson
{
public class JsonException : Exception
{
public JsonException () : base ()
{
}
internal JsonException (ParserToken token) :
base (String.Format (
"Invalid token '{0}' in input string", token))
{
}
internal JsonException (ParserToken token,
Exception inner_exception) :
base (String.Format (
"Invalid token '{0}' in input string", token),
inner_exception)
{
}
internal JsonException (int c) :
base (String.Format (
"Invalid character '{0}' in input string", (char) c))
{
}
internal JsonException (int c, Exception inner_exception) :
base (String.Format (
"Invalid character '{0}' in input string", (char) c),
inner_exception)
{
}
public JsonException (string message) : base (message)
{
}
public JsonException (string message, Exception inner_exception) :
base (message, inner_exception)
{
}
}
}
| 62 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonMapper.cs
/// JSON to .Net object and object to JSON conversions.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
namespace Json.LitJson
{
internal struct PropertyMetadata
{
public MemberInfo Info;
public bool IsField;
public Type Type;
}
internal struct ArrayMetadata
{
private Type element_type;
private bool is_array;
private bool is_list;
public Type ElementType {
get {
if (element_type == null)
return typeof (JsonData);
return element_type;
}
set { element_type = value; }
}
public bool IsArray {
get { return is_array; }
set { is_array = value; }
}
public bool IsList {
get { return is_list; }
set { is_list = value; }
}
}
internal struct ObjectMetadata
{
private Type element_type;
private bool is_dictionary;
private IDictionary<string, PropertyMetadata> properties;
public Type ElementType {
get {
if (element_type == null)
return typeof (JsonData);
return element_type;
}
set { element_type = value; }
}
public bool IsDictionary {
get { return is_dictionary; }
set { is_dictionary = value; }
}
public IDictionary<string, PropertyMetadata> Properties {
get { return properties; }
set { properties = value; }
}
}
internal delegate void ExporterFunc (object obj, JsonWriter writer);
public delegate void ExporterFunc<T> (T obj, JsonWriter writer);
internal delegate object ImporterFunc (object input);
public delegate TValue ImporterFunc<TJson, TValue> (TJson input);
public delegate IJsonWrapper WrapperFactory ();
public class JsonMapper
{
#region Fields
private static int max_nesting_depth;
private static IFormatProvider datetime_format;
private static IDictionary<Type, ExporterFunc> base_exporters_table;
private static IDictionary<Type, ExporterFunc> custom_exporters_table;
private static IDictionary<Type,
IDictionary<Type, ImporterFunc>> base_importers_table;
private static IDictionary<Type,
IDictionary<Type, ImporterFunc>> custom_importers_table;
private static IDictionary<Type, ArrayMetadata> array_metadata;
private static readonly object array_metadata_lock = new Object ();
private static IDictionary<Type,
IDictionary<Type, MethodInfo>> conv_ops;
private static readonly object conv_ops_lock = new Object ();
private static IDictionary<Type, ObjectMetadata> object_metadata;
private static readonly object object_metadata_lock = new Object ();
private static IDictionary<Type,
IList<PropertyMetadata>> type_properties;
private static readonly object type_properties_lock = new Object ();
private static JsonWriter static_writer;
private static readonly object static_writer_lock = new Object ();
#endregion
#region Constructors
static JsonMapper ()
{
max_nesting_depth = 100;
array_metadata = new Dictionary<Type, ArrayMetadata> ();
conv_ops = new Dictionary<Type, IDictionary<Type, MethodInfo>> ();
object_metadata = new Dictionary<Type, ObjectMetadata> ();
type_properties = new Dictionary<Type,
IList<PropertyMetadata>> ();
static_writer = new JsonWriter ();
datetime_format = DateTimeFormatInfo.InvariantInfo;
base_exporters_table = new Dictionary<Type, ExporterFunc> ();
custom_exporters_table = new Dictionary<Type, ExporterFunc> ();
base_importers_table = new Dictionary<Type,
IDictionary<Type, ImporterFunc>> ();
custom_importers_table = new Dictionary<Type,
IDictionary<Type, ImporterFunc>> ();
RegisterBaseExporters ();
RegisterBaseImporters ();
}
#endregion
#region Private Methods
private static void AddArrayMetadata (Type type)
{
if (array_metadata.ContainsKey (type))
return;
ArrayMetadata data = new ArrayMetadata ();
data.IsArray = type.IsArray;
if (type.GetInterface("System.Collections.IList") != null)
data.IsList = true;
foreach (PropertyInfo p_info in type.GetProperties())
{
if (p_info.Name != "Item")
continue;
ParameterInfo[] parameters = p_info.GetIndexParameters ();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType == typeof (int))
data.ElementType = p_info.PropertyType;
}
lock (array_metadata_lock) {
try {
array_metadata.Add (type, data);
} catch (ArgumentException) {
return;
}
}
}
private static void AddObjectMetadata (Type type)
{
if (object_metadata.ContainsKey (type))
return;
ObjectMetadata data = new ObjectMetadata ();
if (type.GetInterface("System.Collections.IDictionary") != null)
data.IsDictionary = true;
data.Properties = new Dictionary<string, PropertyMetadata> ();
foreach (PropertyInfo p_info in type.GetProperties())
{
if (p_info.Name == "Item") {
ParameterInfo[] parameters = p_info.GetIndexParameters ();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType == typeof (string))
data.ElementType = p_info.PropertyType;
continue;
}
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = p_info;
p_data.Type = p_info.PropertyType;
data.Properties.Add (p_info.Name, p_data);
}
foreach (FieldInfo f_info in type.GetFields())
{
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = f_info;
p_data.IsField = true;
p_data.Type = f_info.FieldType;
data.Properties.Add (f_info.Name, p_data);
}
lock (object_metadata_lock) {
try {
object_metadata.Add (type, data);
} catch (ArgumentException) {
return;
}
}
}
private static void AddTypeProperties (Type type)
{
if (type_properties.ContainsKey (type))
return;
IList<PropertyMetadata> props = new List<PropertyMetadata> ();
foreach (PropertyInfo p_info in type.GetProperties())
{
if (p_info.Name == "Item")
continue;
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = p_info;
p_data.IsField = false;
props.Add (p_data);
}
foreach (FieldInfo f_info in type.GetFields())
{
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = f_info;
p_data.IsField = true;
props.Add (p_data);
}
lock (type_properties_lock) {
try {
type_properties.Add (type, props);
} catch (ArgumentException) {
return;
}
}
}
private static MethodInfo GetConvOp (Type t1, Type t2)
{
lock (conv_ops_lock) {
if (! conv_ops.ContainsKey (t1))
conv_ops.Add (t1, new Dictionary<Type, MethodInfo> ());
}
if (conv_ops[t1].ContainsKey (t2))
return conv_ops[t1][t2];
MethodInfo op = t1.GetMethod(
"op_Implicit", new Type[] { t2 });
lock (conv_ops_lock) {
try {
conv_ops[t1].Add (t2, op);
} catch (ArgumentException) {
return conv_ops[t1][t2];
}
}
return op;
}
private static object ReadValue (Type inst_type, JsonReader reader)
{
reader.Read ();
if (reader.Token == JsonToken.ArrayEnd)
return null;
if (reader.Token == JsonToken.Null) {
if (!inst_type.IsClass)
throw new JsonException (String.Format (
"Can't assign null to an instance of type {0}",
inst_type));
return null;
}
if (reader.Token == JsonToken.Double ||
reader.Token == JsonToken.Int ||
reader.Token == JsonToken.Long ||
reader.Token == JsonToken.String ||
reader.Token == JsonToken.Boolean) {
Type json_type = reader.Value.GetType ();
if (inst_type.IsAssignableFrom(json_type))
return reader.Value;
// If there's a custom importer that fits, use it
if (custom_importers_table.ContainsKey (json_type) &&
custom_importers_table[json_type].ContainsKey (
inst_type)) {
ImporterFunc importer =
custom_importers_table[json_type][inst_type];
return importer (reader.Value);
}
// Maybe there's a base importer that works
if (base_importers_table.ContainsKey (json_type) &&
base_importers_table[json_type].ContainsKey (
inst_type)) {
ImporterFunc importer =
base_importers_table[json_type][inst_type];
return importer (reader.Value);
}
// Maybe it's an enum
if (inst_type.IsEnum)
return Enum.ToObject (inst_type, reader.Value);
// Try using an implicit conversion operator
MethodInfo conv_op = GetConvOp (inst_type, json_type);
if (conv_op != null)
return conv_op.Invoke (null,
new object[] { reader.Value });
// No luck
throw new JsonException (String.Format (
"Can't assign value '{0}' (type {1}) to type {2}",
reader.Value, json_type, inst_type));
}
object instance = null;
if (reader.Token == JsonToken.ArrayStart) {
AddArrayMetadata (inst_type);
ArrayMetadata t_data = array_metadata[inst_type];
if (! t_data.IsArray && ! t_data.IsList)
throw new JsonException (String.Format (
"Type {0} can't act as an array",
inst_type));
IList list;
Type elem_type;
if (! t_data.IsArray) {
list = (IList) Activator.CreateInstance (inst_type);
elem_type = t_data.ElementType;
} else {
list = new List<object> ();
elem_type = inst_type.GetElementType ();
}
while (true) {
object item = ReadValue (elem_type, reader);
if (reader.Token == JsonToken.ArrayEnd)
break;
list.Add (item);
}
if (t_data.IsArray) {
int n = list.Count;
instance = Array.CreateInstance (elem_type, n);
for (int i = 0; i < n; i++)
((Array) instance).SetValue (list[i], i);
} else
instance = list;
} else if (reader.Token == JsonToken.ObjectStart) {
AddObjectMetadata (inst_type);
ObjectMetadata t_data = object_metadata[inst_type];
instance = Activator.CreateInstance (inst_type);
while (true) {
reader.Read ();
if (reader.Token == JsonToken.ObjectEnd)
break;
string property = (string) reader.Value;
if (t_data.Properties.ContainsKey (property)) {
PropertyMetadata prop_data =
t_data.Properties[property];
if (prop_data.IsField) {
((FieldInfo) prop_data.Info).SetValue (
instance, ReadValue (prop_data.Type, reader));
} else {
PropertyInfo p_info =
(PropertyInfo) prop_data.Info;
if (p_info.CanWrite)
p_info.SetValue (
instance,
ReadValue (prop_data.Type, reader),
null);
else
ReadValue (prop_data.Type, reader);
}
} else {
if (! t_data.IsDictionary)
throw new JsonException (String.Format (
"The type {0} doesn't have the " +
"property '{1}'", inst_type, property));
((IDictionary) instance).Add (
property, ReadValue (
t_data.ElementType, reader));
}
}
}
return instance;
}
private static IJsonWrapper ReadValue (WrapperFactory factory,
JsonReader reader)
{
reader.Read ();
if (reader.Token == JsonToken.ArrayEnd ||
reader.Token == JsonToken.Null)
return null;
IJsonWrapper instance = factory ();
if (reader.Token == JsonToken.String) {
instance.SetString ((string) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Double) {
instance.SetDouble ((double) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Int) {
instance.SetInt ((int) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Long) {
instance.SetLong ((long) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Boolean) {
instance.SetBoolean ((bool) reader.Value);
return instance;
}
if (reader.Token == JsonToken.ArrayStart) {
instance.SetJsonType (JsonType.Array);
while (true) {
IJsonWrapper item = ReadValue (factory, reader);
// nij - added check to see if the item is not null. This is to handle arrays within arrays.
// In those cases when the outer array read the inner array an item was returned back the current
// reader.Token is at the ArrayEnd for the inner array.
if (item == null && reader.Token == JsonToken.ArrayEnd)
break;
((IList) instance).Add (item);
}
}
else if (reader.Token == JsonToken.ObjectStart) {
instance.SetJsonType (JsonType.Object);
while (true) {
reader.Read ();
if (reader.Token == JsonToken.ObjectEnd)
break;
string property = (string) reader.Value;
((IDictionary) instance)[property] = ReadValue (
factory, reader);
}
}
return instance;
}
private static void RegisterBaseExporters ()
{
base_exporters_table[typeof (byte)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((byte) obj));
};
base_exporters_table[typeof (char)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToString ((char) obj));
};
base_exporters_table[typeof (DateTime)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToString ((DateTime) obj,
datetime_format));
};
base_exporters_table[typeof (decimal)] =
delegate (object obj, JsonWriter writer) {
writer.Write ((decimal) obj);
};
base_exporters_table[typeof (sbyte)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((sbyte) obj));
};
base_exporters_table[typeof (short)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((short) obj));
};
base_exporters_table[typeof (ushort)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((ushort) obj));
};
base_exporters_table[typeof (uint)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToUInt64 ((uint) obj));
};
base_exporters_table[typeof (ulong)] =
delegate (object obj, JsonWriter writer) {
writer.Write ((ulong) obj);
};
}
private static void RegisterBaseImporters ()
{
ImporterFunc importer;
importer = delegate (object input) {
return Convert.ToByte ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (byte), importer);
importer = delegate (object input) {
return Convert.ToUInt64 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (ulong), importer);
importer = delegate (object input) {
return Convert.ToSByte ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (sbyte), importer);
importer = delegate (object input) {
return Convert.ToInt16 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (short), importer);
importer = delegate (object input) {
return Convert.ToUInt16 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (ushort), importer);
importer = delegate (object input) {
return Convert.ToUInt32 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (uint), importer);
importer = delegate (object input) {
return Convert.ToSingle ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (float), importer);
importer = delegate (object input) {
return Convert.ToDouble ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (double), importer);
importer = delegate (object input) {
return Convert.ToDecimal ((double) input);
};
RegisterImporter (base_importers_table, typeof (double),
typeof (decimal), importer);
importer = delegate (object input) {
return Convert.ToUInt32 ((long) input);
};
RegisterImporter (base_importers_table, typeof (long),
typeof (uint), importer);
importer = delegate (object input) {
return Convert.ToChar ((string) input);
};
RegisterImporter (base_importers_table, typeof (string),
typeof (char), importer);
importer = delegate (object input) {
return Convert.ToDateTime ((string) input, datetime_format);
};
RegisterImporter (base_importers_table, typeof (string),
typeof (DateTime), importer);
}
private static void RegisterImporter (
IDictionary<Type, IDictionary<Type, ImporterFunc>> table,
Type json_type, Type value_type, ImporterFunc importer)
{
if (! table.ContainsKey (json_type))
table.Add (json_type, new Dictionary<Type, ImporterFunc> ());
table[json_type][value_type] = importer;
}
private static void WriteValue (object obj, JsonWriter writer,
bool writer_is_private,
int depth)
{
if (depth > max_nesting_depth)
throw new JsonException (
String.Format ("Max allowed object depth reached while " +
"trying to export from type {0}",
obj.GetType ()));
if (obj == null) {
writer.Write (null);
return;
}
if (obj is IJsonWrapper) {
if (writer_is_private)
writer.TextWriter.Write (((IJsonWrapper) obj).ToJson ());
else
((IJsonWrapper) obj).ToJson (writer);
return;
}
if (obj is String) {
writer.Write ((string) obj);
return;
}
if (obj is Double) {
writer.Write ((double) obj);
return;
}
if (obj is Int32) {
writer.Write ((int) obj);
return;
}
if (obj is Boolean) {
writer.Write ((bool) obj);
return;
}
if (obj is Int64) {
writer.Write ((long) obj);
return;
}
if (obj is Array) {
writer.WriteArrayStart ();
foreach (object elem in (Array) obj)
WriteValue (elem, writer, writer_is_private, depth + 1);
writer.WriteArrayEnd ();
return;
}
if (obj is IList) {
writer.WriteArrayStart ();
foreach (object elem in (IList) obj)
WriteValue (elem, writer, writer_is_private, depth + 1);
writer.WriteArrayEnd ();
return;
}
if (obj is IDictionary) {
writer.WriteObjectStart ();
foreach (DictionaryEntry entry in (IDictionary) obj) {
writer.WritePropertyName ((string) entry.Key);
WriteValue (entry.Value, writer, writer_is_private,
depth + 1);
}
writer.WriteObjectEnd ();
return;
}
Type obj_type = obj.GetType ();
// See if there's a custom exporter for the object
if (custom_exporters_table.ContainsKey (obj_type)) {
ExporterFunc exporter = custom_exporters_table[obj_type];
exporter (obj, writer);
return;
}
// If not, maybe there's a base exporter
if (base_exporters_table.ContainsKey (obj_type)) {
ExporterFunc exporter = base_exporters_table[obj_type];
exporter (obj, writer);
return;
}
// Last option, let's see if it's an enum
if (obj is Enum) {
Type e_type = Enum.GetUnderlyingType (obj_type);
if (e_type == typeof (long)
|| e_type == typeof (uint)
|| e_type == typeof (ulong))
writer.Write ((ulong) obj);
else
writer.Write ((int) obj);
return;
}
// Okay, so it looks like the input should be exported as an
// object
AddTypeProperties (obj_type);
IList<PropertyMetadata> props = type_properties[obj_type];
writer.WriteObjectStart ();
foreach (PropertyMetadata p_data in props) {
if (p_data.IsField) {
writer.WritePropertyName (p_data.Info.Name);
WriteValue (((FieldInfo) p_data.Info).GetValue (obj),
writer, writer_is_private, depth + 1);
}
else {
PropertyInfo p_info = (PropertyInfo) p_data.Info;
if (p_info.CanRead) {
writer.WritePropertyName (p_data.Info.Name);
WriteValue (p_info.GetValue (obj, null),
writer, writer_is_private, depth + 1);
}
}
}
writer.WriteObjectEnd ();
}
#endregion
public static string ToJson (object obj)
{
lock (static_writer_lock) {
static_writer.Reset ();
WriteValue (obj, static_writer, true, 0);
return static_writer.ToString ();
}
}
public static void ToJson (object obj, JsonWriter writer)
{
WriteValue (obj, writer, false, 0);
}
public static JsonData ToObject (JsonReader reader)
{
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, reader);
}
public static JsonData ToObject (TextReader reader)
{
JsonReader json_reader = new JsonReader (reader);
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, json_reader);
}
public static JsonData ToObject (string json)
{
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, json);
}
public static T ToObject<T> (JsonReader reader)
{
return (T) ReadValue (typeof (T), reader);
}
public static T ToObject<T> (TextReader reader)
{
JsonReader json_reader = new JsonReader (reader);
return (T) ReadValue (typeof (T), json_reader);
}
public static T ToObject<T> (string json)
{
JsonReader reader = new JsonReader (json);
return (T) ReadValue (typeof (T), reader);
}
public static IJsonWrapper ToWrapper (WrapperFactory factory,
JsonReader reader)
{
return ReadValue (factory, reader);
}
public static IJsonWrapper ToWrapper (WrapperFactory factory,
string json)
{
JsonReader reader = new JsonReader (json);
return ReadValue (factory, reader);
}
public static void RegisterExporter<T> (ExporterFunc<T> exporter)
{
ExporterFunc exporter_wrapper =
delegate (object obj, JsonWriter writer) {
exporter ((T) obj, writer);
};
custom_exporters_table[typeof (T)] = exporter_wrapper;
}
public static void RegisterImporter<TJson, TValue> (
ImporterFunc<TJson, TValue> importer)
{
ImporterFunc importer_wrapper =
delegate (object input) {
return importer ((TJson) input);
};
RegisterImporter (custom_importers_table, typeof (TJson),
typeof (TValue), importer_wrapper);
}
public static void UnregisterExporters ()
{
custom_exporters_table.Clear ();
}
public static void UnregisterImporters ()
{
custom_importers_table.Clear ();
}
}
}
| 919 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonReader.cs
/// Stream-like access to JSON text.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace Json.LitJson
{
public enum JsonToken
{
None,
ObjectStart,
PropertyName,
ObjectEnd,
ArrayStart,
ArrayEnd,
Int,
Long,
Double,
String,
Boolean,
Null
}
public class JsonReader
{
#region Fields
private Stack<JsonToken> depth = new Stack<JsonToken>();
private int current_input;
private int current_symbol;
private bool end_of_json;
private bool end_of_input;
private Lexer lexer;
private bool parser_in_string;
private bool parser_return;
private bool read_started;
private TextReader reader;
private bool reader_is_owned;
private object token_value;
private JsonToken token;
#endregion
#region Public Properties
public bool AllowComments {
get { return lexer.AllowComments; }
set { lexer.AllowComments = value; }
}
public bool AllowSingleQuotedStrings {
get { return lexer.AllowSingleQuotedStrings; }
set { lexer.AllowSingleQuotedStrings = value; }
}
public bool EndOfInput {
get { return end_of_input; }
}
public bool EndOfJson {
get { return end_of_json; }
}
public JsonToken Token {
get { return token; }
}
public object Value {
get { return token_value; }
}
#endregion
#region Constructors
public JsonReader (string json_text) :
this (new StringReader (json_text), true)
{
}
public JsonReader (TextReader reader) :
this (reader, false)
{
}
private JsonReader (TextReader reader, bool owned)
{
if (reader == null)
throw new ArgumentNullException ("reader");
parser_in_string = false;
parser_return = false;
read_started = false;
lexer = new Lexer (reader);
end_of_input = false;
end_of_json = false;
this.reader = reader;
reader_is_owned = owned;
}
#endregion
#region Private Methods
private void ProcessNumber (string number)
{
if (number.IndexOf ('.') != -1 ||
number.IndexOf ('e') != -1 ||
number.IndexOf ('E') != -1) {
double n_double;
if (Double.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_double))
{
token = JsonToken.Double;
token_value = n_double;
return;
}
}
int n_int32;
if (Int32.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_int32))
{
token = JsonToken.Int;
token_value = n_int32;
return;
}
long n_int64;
if (Int64.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_int64))
{
token = JsonToken.Long;
token_value = n_int64;
return;
}
// Shouldn't happen, but just in case, return something
token = JsonToken.Int;
token_value = 0;
}
private void ProcessSymbol ()
{
if (current_symbol == '[') {
token = JsonToken.ArrayStart;
parser_return = true;
} else if (current_symbol == ']') {
token = JsonToken.ArrayEnd;
parser_return = true;
} else if (current_symbol == '{') {
token = JsonToken.ObjectStart;
parser_return = true;
} else if (current_symbol == '}') {
token = JsonToken.ObjectEnd;
parser_return = true;
} else if (current_symbol == '"') {
if (parser_in_string) {
parser_in_string = false;
parser_return = true;
} else {
if (token == JsonToken.None)
token = JsonToken.String;
parser_in_string = true;
}
} else if (current_symbol == (int) ParserToken.CharSeq) {
token_value = lexer.StringValue;
} else if (current_symbol == (int) ParserToken.False) {
token = JsonToken.Boolean;
token_value = false;
parser_return = true;
} else if (current_symbol == (int) ParserToken.Null) {
token = JsonToken.Null;
parser_return = true;
} else if (current_symbol == (int) ParserToken.Number) {
ProcessNumber (lexer.StringValue);
parser_return = true;
} else if (current_symbol == (int) ParserToken.Pair) {
token = JsonToken.PropertyName;
} else if (current_symbol == (int) ParserToken.True) {
token = JsonToken.Boolean;
token_value = true;
parser_return = true;
}
}
private bool ReadToken ()
{
if (end_of_input)
return false;
lexer.NextToken ();
if (lexer.EndOfInput) {
Close ();
return false;
}
current_input = lexer.Token;
return true;
}
#endregion
public void Close ()
{
if (end_of_input)
return;
end_of_input = true;
end_of_json = true;
reader = null;
}
public bool Read()
{
if (end_of_input)
return false;
if (end_of_json)
{
end_of_json = false;
}
token = JsonToken.None;
parser_in_string = false;
parser_return = false;
// Check if the first read call. If so then do an extra ReadToken because Read assumes that the previous
// call to Read has already called ReadToken.
if (!read_started)
{
read_started = true;
if (!ReadToken())
return false;
}
do
{
current_symbol = current_input;
ProcessSymbol();
if (parser_return)
{
if (this.token == JsonToken.ObjectStart || this.token == JsonToken.ArrayStart)
{
depth.Push(this.token);
}
else if (this.token == JsonToken.ObjectEnd || this.token == JsonToken.ArrayEnd)
{
// Clear out property name if is on top. This could happen if the value for the property was null.
if (depth.Peek() == JsonToken.PropertyName)
depth.Pop();
// Pop the opening token for this closing token. Make sure it is of the right type otherwise
// the document is invalid.
var opening = depth.Pop();
if (this.token == JsonToken.ObjectEnd && opening != JsonToken.ObjectStart)
throw new JsonException("Error: Current token is ObjectEnd which does not match the opening " + opening.ToString());
if (this.token == JsonToken.ArrayEnd && opening != JsonToken.ArrayStart)
throw new JsonException("Error: Current token is ArrayEnd which does not match the opening " + opening.ToString());
// If that last element is popped then we reached the end of the JSON object.
if (depth.Count == 0)
{
end_of_json = true;
}
}
// If the top of the stack is an object start and the next read is a string then it must be a property name
// to add to the stack.
else if (depth.Count > 0 && depth.Peek() != JsonToken.PropertyName &&
this.token == JsonToken.String && depth.Peek() == JsonToken.ObjectStart)
{
this.token = JsonToken.PropertyName;
depth.Push(this.token);
}
if (
(this.token == JsonToken.ObjectEnd ||
this.token == JsonToken.ArrayEnd ||
this.token == JsonToken.String ||
this.token == JsonToken.Boolean ||
this.token == JsonToken.Double ||
this.token == JsonToken.Int ||
this.token == JsonToken.Long ||
this.token == JsonToken.Null ||
this.token == JsonToken.String
))
{
// If we found a value but we are not in an array or object then the document is an invalid json document.
if (depth.Count == 0)
{
if (this.token != JsonToken.ArrayEnd && this.token != JsonToken.ObjectEnd)
{
throw new JsonException("Value without enclosing object or array");
}
}
// The valud of the property has been processed so pop the property name from the stack.
else if (depth.Peek() == JsonToken.PropertyName)
{
depth.Pop();
}
}
// Read the next token that will be processed the next time the Read method is called.
// This is done ahead of the next read so we can detect if we are at the end of the json document.
// Otherwise EndOfInput would not return true until an attempt to read was made.
if (!ReadToken() && depth.Count != 0)
throw new JsonException("Incomplete JSON Document");
return true;
}
} while (ReadToken());
// If we reached the end of the document but there is still elements left in the depth stack then
// the document is invalid JSON.
if (depth.Count != 0)
throw new JsonException("Incomplete JSON Document");
end_of_input = true;
return false;
}
}
}
| 367 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonWriter.cs
/// Stream-like facility to output JSON text.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace Json.LitJson
{
internal enum Condition
{
InArray,
InObject,
NotAProperty,
Property,
Value
}
internal class WriterContext
{
public int Count;
public bool InArray;
public bool InObject;
public bool ExpectingValue;
public int Padding;
}
public class JsonWriter
{
#region Fields
private static NumberFormatInfo number_format;
private WriterContext context;
private Stack<WriterContext> ctx_stack;
private bool has_reached_end;
private char[] hex_seq;
private int indentation;
private int indent_value;
private StringBuilder inst_string_builder;
private bool pretty_print;
private bool validate;
private TextWriter writer;
#endregion
#region Properties
public int IndentValue {
get { return indent_value; }
set {
indentation = (indentation / indent_value) * value;
indent_value = value;
}
}
public bool PrettyPrint {
get { return pretty_print; }
set { pretty_print = value; }
}
public TextWriter TextWriter {
get { return writer; }
}
public bool Validate {
get { return validate; }
set { validate = value; }
}
#endregion
#region Constructors
static JsonWriter ()
{
number_format = NumberFormatInfo.InvariantInfo;
}
public JsonWriter ()
{
inst_string_builder = new StringBuilder ();
writer = new StringWriter (inst_string_builder);
Init ();
}
public JsonWriter (StringBuilder sb) :
this (new StringWriter (sb))
{
}
public JsonWriter (TextWriter writer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
this.writer = writer;
Init ();
}
#endregion
#region Private Methods
private void DoValidation (Condition cond)
{
if (! context.ExpectingValue)
context.Count++;
if (! validate)
return;
if (has_reached_end)
throw new JsonException (
"A complete JSON symbol has already been written");
switch (cond) {
case Condition.InArray:
if (! context.InArray)
throw new JsonException (
"Can't close an array here");
break;
case Condition.InObject:
if (! context.InObject || context.ExpectingValue)
throw new JsonException (
"Can't close an object here");
break;
case Condition.NotAProperty:
if (context.InObject && ! context.ExpectingValue)
throw new JsonException (
"Expected a property");
break;
case Condition.Property:
if (! context.InObject || context.ExpectingValue)
throw new JsonException (
"Can't add a property here");
break;
case Condition.Value:
if (! context.InArray &&
(! context.InObject || ! context.ExpectingValue))
throw new JsonException (
"Can't add a value here");
break;
}
}
private void Init ()
{
has_reached_end = false;
hex_seq = new char[4];
indentation = 0;
indent_value = 4;
pretty_print = false;
validate = true;
ctx_stack = new Stack<WriterContext> ();
context = new WriterContext ();
ctx_stack.Push (context);
}
private static void IntToHex (int n, char[] hex)
{
int num;
for (int i = 0; i < 4; i++) {
num = n % 16;
if (num < 10)
hex[3 - i] = (char) ('0' + num);
else
hex[3 - i] = (char) ('A' + (num - 10));
n >>= 4;
}
}
private void Indent ()
{
if (pretty_print)
indentation += indent_value;
}
private void Put (string str)
{
if (pretty_print && ! context.ExpectingValue)
for (int i = 0; i < indentation; i++)
writer.Write (' ');
writer.Write (str);
}
private void PutNewline ()
{
PutNewline (true);
}
private void PutNewline (bool add_comma)
{
if (add_comma && ! context.ExpectingValue &&
context.Count > 1)
writer.Write (',');
if (pretty_print && ! context.ExpectingValue)
writer.Write ("\r\n");
}
private void PutString (string str)
{
Put (String.Empty);
writer.Write ('"');
int n = str.Length;
for (int i = 0; i < n; i++)
{
char c = str[i];
switch (c) {
case '\n':
writer.Write ("\\n");
continue;
case '\r':
writer.Write ("\\r");
continue;
case '\t':
writer.Write ("\\t");
continue;
case '"':
case '\\':
writer.Write ('\\');
writer.Write (c);
continue;
case '\f':
writer.Write ("\\f");
continue;
case '\b':
writer.Write ("\\b");
continue;
}
if ((int) c >= 32 && (int) c <= 126) {
writer.Write (c);
continue;
}
if (c < ' ' || (c >= '\u0080' && c < '\u00a0'))
{
// Turn into a \uXXXX sequence
IntToHex((int)c, hex_seq);
writer.Write("\\u");
writer.Write(hex_seq);
}
else
{
writer.Write(c);
}
}
writer.Write ('"');
}
private void Unindent ()
{
if (pretty_print)
indentation -= indent_value;
}
#endregion
public override string ToString ()
{
if (inst_string_builder == null)
return String.Empty;
return inst_string_builder.ToString ();
}
public void Reset ()
{
has_reached_end = false;
ctx_stack.Clear ();
context = new WriterContext ();
ctx_stack.Push (context);
if (inst_string_builder != null)
inst_string_builder.Remove (0, inst_string_builder.Length);
}
public void Write (bool boolean)
{
DoValidation (Condition.Value);
PutNewline ();
Put (boolean ? "true" : "false");
context.ExpectingValue = false;
}
public void Write (decimal number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write (double number)
{
DoValidation (Condition.Value);
PutNewline ();
string str = Convert.ToString (number, number_format);
Put (str);
if (str.IndexOf ('.') == -1 &&
str.IndexOf ('E') == -1)
writer.Write (".0");
context.ExpectingValue = false;
}
public void Write (int number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write (long number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number));
context.ExpectingValue = false;
}
public void Write (string str)
{
DoValidation (Condition.Value);
PutNewline ();
if (str == null)
Put ("null");
else
PutString (str);
context.ExpectingValue = false;
}
public void Write (ulong number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write(DateTime date)
{
DoValidation(Condition.Value);
PutNewline();
Put(ServiceClientGenerator.GeneratorHelpers.ConvertToUnixEpochSecondsDouble(date).ToString(CultureInfo.InvariantCulture));
context.ExpectingValue = false;
}
public void WriteArrayEnd ()
{
DoValidation (Condition.InArray);
PutNewline (false);
ctx_stack.Pop ();
if (ctx_stack.Count == 1)
has_reached_end = true;
else {
context = ctx_stack.Peek ();
context.ExpectingValue = false;
}
Unindent ();
Put ("]");
}
public void WriteArrayStart ()
{
DoValidation (Condition.NotAProperty);
PutNewline ();
Put ("[");
context = new WriterContext ();
context.InArray = true;
ctx_stack.Push (context);
Indent ();
}
public void WriteObjectEnd ()
{
DoValidation (Condition.InObject);
PutNewline (false);
ctx_stack.Pop ();
if (ctx_stack.Count == 1)
has_reached_end = true;
else {
context = ctx_stack.Peek ();
context.ExpectingValue = false;
}
Unindent ();
Put ("}");
}
public void WriteObjectStart ()
{
DoValidation (Condition.NotAProperty);
PutNewline ();
Put ("{");
context = new WriterContext ();
context.InObject = true;
ctx_stack.Push (context);
Indent ();
}
public void WritePropertyName (string property_name)
{
DoValidation (Condition.Property);
PutNewline ();
PutString (property_name);
if (pretty_print) {
if (property_name.Length > context.Padding)
context.Padding = property_name.Length;
for (int i = context.Padding - property_name.Length;
i >= 0; i--)
writer.Write (' ');
writer.Write (": ");
} else
writer.Write (':');
context.ExpectingValue = true;
}
}
}
| 483 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// Lexer.cs
/// JSON lexer implementation based on a finite state machine.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace Json.LitJson
{
internal class FsmContext
{
public bool Return;
public int NextState;
public Lexer L;
public int StateStack;
}
internal class Lexer
{
#region Fields
private delegate bool StateHandler (FsmContext ctx);
private static int[] fsm_return_table;
private static StateHandler[] fsm_handler_table;
private bool allow_comments;
private bool allow_single_quoted_strings;
private bool end_of_input;
private FsmContext fsm_context;
private int input_buffer;
private int input_char;
private TextReader reader;
private int state;
private StringBuilder string_buffer;
private string string_value;
private int token;
private int unichar;
#endregion
#region Properties
public bool AllowComments {
get { return allow_comments; }
set { allow_comments = value; }
}
public bool AllowSingleQuotedStrings {
get { return allow_single_quoted_strings; }
set { allow_single_quoted_strings = value; }
}
public bool EndOfInput {
get { return end_of_input; }
}
public int Token {
get { return token; }
}
public string StringValue {
get { return string_value; }
}
#endregion
#region Constructors
static Lexer ()
{
PopulateFsmTables ();
}
public Lexer (TextReader reader)
{
allow_comments = true;
allow_single_quoted_strings = true;
input_buffer = 0;
string_buffer = new StringBuilder (128);
state = 1;
end_of_input = false;
this.reader = reader;
fsm_context = new FsmContext ();
fsm_context.L = this;
}
#endregion
#region Static Methods
private static int HexValue (int digit)
{
switch (digit) {
case 'a':
case 'A':
return 10;
case 'b':
case 'B':
return 11;
case 'c':
case 'C':
return 12;
case 'd':
case 'D':
return 13;
case 'e':
case 'E':
return 14;
case 'f':
case 'F':
return 15;
default:
return digit - '0';
}
}
private static void PopulateFsmTables ()
{
fsm_handler_table = new StateHandler[28] {
State1,
State2,
State3,
State4,
State5,
State6,
State7,
State8,
State9,
State10,
State11,
State12,
State13,
State14,
State15,
State16,
State17,
State18,
State19,
State20,
State21,
State22,
State23,
State24,
State25,
State26,
State27,
State28
};
fsm_return_table = new int[28] {
(int) ParserToken.Char,
0,
(int) ParserToken.Number,
(int) ParserToken.Number,
0,
(int) ParserToken.Number,
0,
(int) ParserToken.Number,
0,
0,
(int) ParserToken.True,
0,
0,
0,
(int) ParserToken.False,
0,
0,
(int) ParserToken.Null,
(int) ParserToken.CharSeq,
(int) ParserToken.Char,
0,
0,
(int) ParserToken.CharSeq,
(int) ParserToken.Char,
0,
0,
0,
0
};
}
private static char ProcessEscChar (int esc_char)
{
switch (esc_char) {
case '"':
case '\'':
case '\\':
case '/':
return Convert.ToChar (esc_char);
case 'n':
return '\n';
case 't':
return '\t';
case 'r':
return '\r';
case 'b':
return '\b';
case 'f':
return '\f';
default:
// Unreachable
return '?';
}
}
private static bool State1 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r')
continue;
if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
case '"':
ctx.NextState = 19;
ctx.Return = true;
return true;
case ',':
case ':':
case '[':
case ']':
case '{':
case '}':
ctx.NextState = 1;
ctx.Return = true;
return true;
case '-':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 2;
return true;
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 4;
return true;
case 'f':
ctx.NextState = 12;
return true;
case 'n':
ctx.NextState = 16;
return true;
case 't':
ctx.NextState = 9;
return true;
case '\'':
if (! ctx.L.allow_single_quoted_strings)
return false;
ctx.L.input_char = '"';
ctx.NextState = 23;
ctx.Return = true;
return true;
case '/':
if (! ctx.L.allow_comments)
return false;
ctx.NextState = 25;
return true;
default:
return false;
}
}
return true;
}
private static bool State2 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '1' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 4;
return true;
default:
return false;
}
}
private static bool State3 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case '.':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 5;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
return true;
}
private static bool State4 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case '.':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 5;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
private static bool State5 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 6;
return true;
}
return false;
}
private static bool State6 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
return true;
}
private static bool State7 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 8;
return true;
}
switch (ctx.L.input_char) {
case '+':
case '-':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 8;
return true;
default:
return false;
}
}
private static bool State8 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char<= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
return true;
}
private static bool State9 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'r':
ctx.NextState = 10;
return true;
default:
return false;
}
}
private static bool State10 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 11;
return true;
default:
return false;
}
}
private static bool State11 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'e':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State12 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'a':
ctx.NextState = 13;
return true;
default:
return false;
}
}
private static bool State13 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.NextState = 14;
return true;
default:
return false;
}
}
private static bool State14 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 's':
ctx.NextState = 15;
return true;
default:
return false;
}
}
private static bool State15 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'e':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State16 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 17;
return true;
default:
return false;
}
}
private static bool State17 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.NextState = 18;
return true;
default:
return false;
}
}
private static bool State18 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State19 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '"':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 20;
return true;
case '\\':
ctx.StateStack = 19;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
private static bool State20 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '"':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State21 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 22;
return true;
case '"':
case '\'':
case '/':
case '\\':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
ctx.L.string_buffer.Append (
ProcessEscChar (ctx.L.input_char));
ctx.NextState = ctx.StateStack;
return true;
default:
return false;
}
}
private static bool State22 (FsmContext ctx)
{
int counter = 0;
int mult = 4096;
ctx.L.unichar = 0;
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9' ||
ctx.L.input_char >= 'A' && ctx.L.input_char <= 'F' ||
ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') {
ctx.L.unichar += HexValue (ctx.L.input_char) * mult;
counter++;
mult /= 16;
if (counter == 4) {
ctx.L.string_buffer.Append (
Convert.ToChar (ctx.L.unichar));
ctx.NextState = ctx.StateStack;
return true;
}
continue;
}
return false;
}
return true;
}
private static bool State23 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '\'':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 24;
return true;
case '\\':
ctx.StateStack = 23;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
private static bool State24 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '\'':
ctx.L.input_char = '"';
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State25 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '*':
ctx.NextState = 27;
return true;
case '/':
ctx.NextState = 26;
return true;
default:
return false;
}
}
private static bool State26 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '\n') {
ctx.NextState = 1;
return true;
}
}
return true;
}
private static bool State27 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*') {
ctx.NextState = 28;
return true;
}
}
return true;
}
private static bool State28 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*')
continue;
if (ctx.L.input_char == '/') {
ctx.NextState = 1;
return true;
}
ctx.NextState = 27;
return true;
}
return true;
}
#endregion
private bool GetChar ()
{
if ((input_char = NextChar ()) != -1)
return true;
end_of_input = true;
return false;
}
private int NextChar ()
{
if (input_buffer != 0) {
int tmp = input_buffer;
input_buffer = 0;
return tmp;
}
return reader.Read ();
}
public bool NextToken ()
{
StateHandler handler;
fsm_context.Return = false;
while (true) {
handler = fsm_handler_table[state - 1];
if (! handler (fsm_context))
throw new JsonException (input_char);
if (end_of_input)
return false;
if (fsm_context.Return) {
string_value = string_buffer.ToString ();
string_buffer.Length = 0;
token = fsm_return_table[state - 1];
if (token == (int) ParserToken.Char)
token = input_char;
state = fsm_context.NextState;
return true;
}
state = fsm_context.NextState;
}
}
private void UngetChar ()
{
input_buffer = input_char;
}
}
}
| 912 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// ParserToken.cs
/// Internal representation of the tokens used by the lexer and the parser.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
namespace Json.LitJson
{
internal enum ParserToken
{
// Lexer tokens
None = System.Char.MaxValue + 1,
Number,
True,
False,
Null,
CharSeq,
// Single char
Char,
// Parser Rules
Text,
Object,
ObjectPrime,
Pair,
PairRest,
Array,
ArrayPrime,
Value,
ValueRest,
String,
// End of input
End,
// The empty rule
Epsilon
}
}
| 46 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Linq;
using Moq;
using ServiceClientGenerator.DefaultConfiguration;
using ServiceClientGeneratorTests.Utils;
using Should;
using Xunit;
namespace ServiceClientGeneratorTests
{
[Trait("Category", "UnitTests")]
public class DefaultConfigurationControllerTests
{
/// <summary>
/// Controller should find the 'Legacy' Default Configuration Mode
/// and explicitly set timeouts.
/// </summary>
[Fact]
public void ControllerEnrichesLegacyDefaultConfigurationMode()
{
var fakeJson = "fakeJson";
var fakeDocumentation = "fakeDocumentation";
var mockParsedDefaultConfigurationModel = new DefaultConfigurationModel
{
Modes = new List<DefaultConfigurationMode>
{
new DefaultConfigurationMode
{
Name = "Legacy",
Documentation = fakeDocumentation,
TimeToFirstByteTimeout = TimeSpan.Zero
}
}
};
var fakeParser = new Mock<IDefaultConfigurationParser>();
fakeParser
.Setup(x => x.Parse(It.Is<string>(j => j == fakeJson)))
.Returns(mockParsedDefaultConfigurationModel);
var controller =
new DefaultConfigurationController(
new FakeFileReader(fakeJson),
fakeParser.Object);
var defaultConfigurationModel = controller.LoadDefaultConfiguration("../path/ignored/by/fake/parser");
var legacyMode =
defaultConfigurationModel
.Modes
.FirstOrDefault(x => x.Name == "Legacy");
legacyMode.ShouldNotBeNull();
legacyMode.Documentation.ShouldEqual(fakeDocumentation);
// Controller should have modified timeout
legacyMode.TimeToFirstByteTimeout.ShouldBeGreaterThan(TimeSpan.Zero);
}
}
} | 60 |
aws-sdk-net | aws | C# | using System;
using System.Linq;
using ServiceClientGenerator.DefaultConfiguration;
using ServiceClientGeneratorTests.Utils;
using Should;
using Xunit;
namespace ServiceClientGeneratorTests
{
[Trait("Category", "UnitTests")]
public class DefaultConfigurationParserTests
{
private readonly DefaultConfigurationParser _defaultConfigurationParser;
private readonly string _testDefaultConfigurationJson;
public DefaultConfigurationParserTests()
{
_defaultConfigurationParser = new DefaultConfigurationParser();
_testDefaultConfigurationJson =
new EmbeddedResourceHelper().LoadContent($"{nameof(ServiceClientGeneratorTests)}.Content.sdk-default-configuration.json");
}
[Fact]
public void ParsesExampleConfigurationFileAndDoesNotThrowException()
{
Exception exc = null;
DefaultConfigurationModel config = null;
try
{
config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
}
catch (Exception e)
{
exc = e;
}
exc.ShouldBeNull();
config.ShouldNotBeNull();
}
/// <summary>
/// The test json file has a value for every property. This test make sure
/// the Parser assigns a value to every property in <see cref="DefaultConfigurationMode"/>.
/// </summary>
[Fact]
public void AllPropertiesHaveAValue()
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
// only need to check the first Mode
var mode = config.Modes.First();
// NOTE: Skip checking enums - they default to 0 anyway
mode.Documentation.ShouldNotBeEmpty();
mode.ConnectTimeout.ShouldBeGreaterThan(TimeSpan.Zero);
mode.HttpRequestTimeout.ShouldBeGreaterThan(TimeSpan.Zero);
mode.Name.ShouldNotBeEmpty();
mode.TimeToFirstByteTimeout.ShouldBeGreaterThan(TimeSpan.Zero);
mode.TlsNegotiationTimeout.ShouldBeGreaterThan(TimeSpan.Zero);
}
[Theory]
[InlineData("Standard")] // replaced 'standard' - validates capitalize single word,
[InlineData("InRegion")] // replaced 'in-region' - validates capitalize multi word and handle dash,
public void NormalizesNames(string expectedName)
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
var names =
config
.Modes
.Select(x => x.Name)
.ToArray();
names.ShouldContain(expectedName);
}
/// <summary>
/// <see cref="SdkDefaultConfigurationJsonDataModel.Documentation.Modes"/> is
/// the complete list of configuration modes. A mode does not need any overrides.
/// <para />
/// Requires the embedded sdk-default-configuration.json file
/// to have the following:
/// <code>
/// <![CDATA[
/// "modes": { },
/// "documentation": {
/// "mode-with-no-overrides": ""
/// ]]>
/// </code>
/// </summary>
[Fact]
public void IncludesModesWithNoOverrides()
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
var foundModeWithNoOverride = config.Modes.Any(x => x.Name == "ModeWithNoOverrides");
foundModeWithNoOverride.ShouldBeTrue();
}
/// <summary>
/// Requires the embedded sdk-default-configuration.json file
/// to have the following:
/// <code>
/// <![CDATA[
/// "base": {
/// "connectTimeoutInMillis": 1100,
/// },
/// "modes": {
/// "standard": {
/// "connectTimeoutInMillis": {
/// "multiply": 2.8
/// ]]>
/// </code>
/// </summary>
[Fact]
public void MultiplyOperationTest()
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
config.Modes
.First(x => x.Name == "Standard")
.ConnectTimeout
.Value
.TotalMilliseconds
.ShouldEqual(1100 * 2.8);
}
/// <summary>
/// Requires the embedded sdk-default-configuration.json file
/// to have the following:
/// <code>
/// <![CDATA[
/// "base": {
/// "connectTimeoutInMillis": 1100,
/// },
/// "modes": {
/// "add-test": {
/// "connectTimeoutInMillis": {
/// "add": 42
/// ]]>
/// </code>
/// </summary>
[Fact]
public void AddOperationTest()
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
config.Modes
.First(x => x.Name == "AddTest")
.ConnectTimeout
.Value
.TotalMilliseconds
.ShouldEqual(1100 + 42);
}
/// <summary>
/// Requires the embedded sdk-default-configuration.json file
/// to have the following:
/// <code>
/// <![CDATA[
/// "base": {
/// "connectTimeoutInMillis": 1100,
/// },
/// "modes": {
/// "mobile": {
/// "connectTimeoutInMillis": {
/// "override": 10000
/// ]]>
/// </code>
/// </summary>
[Fact]
public void OverrideNumberOperationTest()
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
config.Modes
.First(x => x.Name == "Mobile")
.ConnectTimeout
.Value
.TotalMilliseconds
.ShouldEqual(10000);
}
/// <summary>
/// Requires the embedded sdk-default-configuration.json file
/// to have the following:
/// <code>
/// <![CDATA[
/// "base": {
/// "retryMode": "standard",
/// },
/// "modes": {
/// "override-enum-test": {
/// "retryMode": {
/// "override": "adaptive"
/// ]]>
/// </code>
/// </summary>
[Fact]
public void OverrideEnumOperationTest()
{
var config = _defaultConfigurationParser.Parse(_testDefaultConfigurationJson);
config.Modes
.First(x => x.Name == "OverrideEnumTest")
.RetryMode
.ShouldEqual(RequestRetryMode.Adaptive);
}
}
} | 214 |
aws-sdk-net | aws | C# | using Json.LitJson;
using ServiceClientGenerator;
using System;
using System.Collections.Generic;
using System.Reflection;
using Xunit;
using System.Linq;
namespace ServiceClientGeneratorTests
{
[Trait("Category", "UnitTests")]
public class UnitTests
{
private const string _modelsPath = "../../../Content/TestModel.json";
private const string _paginatorsPath = "../../../Content/TestPaginators.json";
[Theory]
[InlineData("notJmespath", false)]
[InlineData("notJmespath.", false)]
[InlineData(".notJmespath", false)]
[InlineData("Is.Jmespath", true)]
[InlineData("Is.Jmespath2", true)]
[InlineData("One.Two.Three", true)]
[InlineData("One.Two.Three.", false)]
public void TestIsJmesPath(string input, bool result)
{
JsonData node = new JsonData(input);
char? jmespathChar = null;
// Use reflection to get internal static method
MethodInfo isJmesPathMethod = typeof(OperationPaginatorConfig).GetMethod("IsJmesPath",
BindingFlags.NonPublic | BindingFlags.Static);
var methodResult = isJmesPathMethod.Invoke(null, new object[] { node, jmespathChar });
Assert.Equal(result, bool.Parse(methodResult.ToString()));
}
[Theory]
[InlineData("ListItems", "ParentItem.ChildItem", "ChildItem")]
[InlineData("ListItems", "ParentItem.NextToken", "NextToken")]
[InlineData("ListItems", "ParentItem.SubItem.ChildItem", "ChildItem")]
public void TestHandleJmesPathWithServiceModel(string operationName, string jmesPathInput, string childName)
{
var model = new ServiceModel(_modelsPath, null, _paginatorsPath);
var operation = model.Operations.Single(x => x.Name.Equals(operationName));
var shapes = operation.model.Shapes;
var testNode = new JsonData(jmesPathInput);
// Use reflection to get internal static method
MethodInfo handleJmesPathMethod = typeof(OperationPaginatorConfig).GetMethod("HandleJmesPath",
BindingFlags.NonPublic | BindingFlags.Static);
var methodResult = handleJmesPathMethod.Invoke(null, new object[] { testNode, '.', operation });
Assert.Equal(childName, ((OperationPaginatorConfigOption)methodResult).Member.PropertyName);
Assert.Equal(jmesPathInput, ((OperationPaginatorConfigOption)methodResult).PropertyName);
}
[Theory]
[InlineData("us-east-1", "USEast1")]
[InlineData("cn-northwest-1", "CNNorthWest1")]
[InlineData("ap-southeast-1", "APSoutheast1")]
[InlineData("us-gov-east-1", "USGovCloudEast1")]
public void TestEndpointNameConstruction(string regionCode, string expectedName)
{
Assert.Equal(GeneratorDriver.ConstructEndpointName(regionCode), expectedName);
}
}
}
| 71 |
aws-sdk-net | aws | C# | using System;
using System.IO;
using System.Linq;
namespace ServiceClientGeneratorTests
{
public class EmbeddedResourceHelper
{
public string LoadContent(string resourceNamespace)
{
var allResources = GetType().Assembly.GetManifestResourceNames();
if (!allResources.Contains(resourceNamespace))
throw new ArgumentException(
$"Could not find Resource [{resourceNamespace}]. " +
$"Have {string.Join(",", allResources)}");
var contents = GetType().Assembly.GetManifestResourceStream(resourceNamespace) ?? new MemoryStream();
using (var sr = new StreamReader(contents))
return sr.ReadToEnd();
}
}
}
| 25 |
aws-sdk-net | aws | C# | using ServiceClientGenerator;
namespace ServiceClientGeneratorTests.Utils
{
public class FakeFileReader : IFileReader
{
private readonly string _contents;
public FakeFileReader(string contents)
{
_contents = contents;
}
public string ReadAllText(string path)
{
return _contents;
}
}
} | 19 |
aws-sdk-net | aws | C# | using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TestHelper;
using MockAnalyzer;
namespace Analyzer1.Test
{
[TestClass]
public class PropertyValueTests : DiagnosticVerifier
{
//Diagnostic and CodeFix both triggered and checked for
[TestMethod]
public void TestStringRules()
{
var test = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace MockCode
{
public class Driver
{
public void Execute()
{
var code = new AnalyzedClass();
code.Name = ""aa""
}
}
public class AnalyzedClass
{
public string Name {get; set;}
}
}";
var expected = new DiagnosticResult
{
Id = "MockAnalyzer1000",
Message = "Value \"aa\" is too short for Name, it must be at least 3 characters",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 29)
}
};
VerifyCSharpDiagnostic(test, expected);
test = test.Replace("\"aa\"", "\"aaa\"");
VerifyCSharpDiagnostic(test);
test = test.Replace("\"aaa\"", "\"aaaaa\"");
VerifyCSharpDiagnostic(test);
test = test.Replace("\"aaaaa\"", "\"aaaaaa\"");
expected = new DiagnosticResult
{
Id = "MockAnalyzer1001",
Message = "Value \"aaaaaa\" is too long for Name, it must be at most 5 characters",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 29)
}
};
VerifyCSharpDiagnostic(test, expected);
test = test.Replace("\"aaaaaa\"", "\"#aaa\"");
expected = new DiagnosticResult
{
Id = "MockAnalyzer1002",
Message = "Value \"#aaa\" does not match required pattern \"[0-9a-z\\-_]+\" for property Name",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 29)
}
};
VerifyCSharpDiagnostic(test, expected);
}
[TestMethod]
public void TestIntRules()
{
var test = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace MockCode
{
public class Driver
{
public void Execute()
{
var code = new AnalyzedClass();
code.Size = 9;
}
}
public class AnalyzedClass
{
public int Size {get; set;}
}
}";
var expected = new DiagnosticResult
{
Id = "MockAnalyzer1003",
Message = "Value \"9\" is less than minimum of 10 for property Size",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 29)
}
};
VerifyCSharpDiagnostic(test, expected);
test = test.Replace("9", "10");
VerifyCSharpDiagnostic(test);
test = test.Replace("10", "20");
VerifyCSharpDiagnostic(test);
test = test.Replace("20", "21");
expected = new DiagnosticResult
{
Id = "MockAnalyzer1004",
Message = "Value \"21\" is greater than maximum of 20 for property Size",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 29)
}
};
VerifyCSharpDiagnostic(test, expected);
}
[TestMethod]
public void TestNonLiteralExpression()
{
var test = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace MockCode
{
public class Driver
{
public void Execute()
{
var code = new AnalyzedClass();
code.Size = expression;
}
}
public class AnalyzedClass
{
public int Size {get; set;}
}
}";
var expected = new DiagnosticResult
{
Id = "MockAnalyzer1003",
Message = "Value \"-1\" is less than minimum of 10 for property Size",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 29)
}
};
string testCode = test.Replace("expression", "(-1)");
VerifyCSharpDiagnostic(testCode, expected);
testCode = test.Replace("expression", "2-3");
VerifyCSharpDiagnostic(testCode, expected);
testCode = test.Replace("expression", "(2*3)-7");
VerifyCSharpDiagnostic(testCode, expected);
testCode = test.Replace("expression", "(2*3)-someValue");
VerifyCSharpDiagnostic(testCode);
test = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace MockCode
{
public class Driver
{
public void Execute()
{
var code = new AnalyzedClass();
code.Name = expression
}
}
public class AnalyzedClass
{
public string Name {get; set;}
}
}";
expected = new DiagnosticResult
{
Id = "MockAnalyzer1000",
Message = "Value \"aa\" is too short for Name, it must be at least 3 characters",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
new DiagnosticResultLocation("Test0.cs", 16, 30)
}
};
testCode = test.Replace("expression", @" ""a"" + ""a"" ");
VerifyCSharpDiagnostic(testCode, expected);
testCode = test.Replace("expression", @"string.Format(""aa"")");
VerifyCSharpDiagnostic(testCode);
}
protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
{
return new PropertyValueAssignmentAnalyzer();
}
}
} | 252 |
aws-sdk-net | aws | C# | using Microsoft.CodeAnalysis;
using System;
namespace TestHelper
{
/// <summary>
/// Location where the diagnostic appears, as determined by path, line number, and column number.
/// </summary>
public struct DiagnosticResultLocation
{
public DiagnosticResultLocation(string path, int line, int column)
{
if (line < -1)
{
throw new ArgumentOutOfRangeException(nameof(line), "line must be >= -1");
}
if (column < -1)
{
throw new ArgumentOutOfRangeException(nameof(line), "column must be >= -1");
}
this.Path = path;
this.Line = line;
this.Column = column;
}
public string Path { get; private set; }
public int Line { get; private set; }
public int Column { get; private set; }
}
/// <summary>
/// Struct that stores information about a Diagnostic appearing in a source
/// </summary>
public struct DiagnosticResult
{
private DiagnosticResultLocation[] locations;
public DiagnosticResultLocation[] Locations
{
get
{
if (this.locations == null)
{
this.locations = new DiagnosticResultLocation[] { };
}
return this.locations;
}
set
{
this.locations = value;
}
}
public DiagnosticSeverity Severity { get; set; }
public string Id { get; set; }
public string Message { get; set; }
public string Path
{
get
{
return this.Locations.Length > 0 ? this.Locations[0].Path : "";
}
}
public int Line
{
get
{
return this.Locations.Length > 0 ? this.Locations[0].Line : -1;
}
}
public int Column
{
get
{
return this.Locations.Length > 0 ? this.Locations[0].Column : -1;
}
}
}
} | 87 |
aws-sdk-net | aws | C# | using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Text;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
namespace TestHelper
{
/// <summary>
/// Class for turning strings into documents and getting the diagnostics on them
/// All methods are static
/// </summary>
public abstract partial class DiagnosticVerifier
{
private static readonly MetadataReference CorlibReference = MetadataReference.CreateFromFile(typeof(object).Assembly.Location);
private static readonly MetadataReference SystemCoreReference = MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location);
private static readonly MetadataReference CSharpSymbolsReference = MetadataReference.CreateFromFile(typeof(CSharpCompilation).Assembly.Location);
private static readonly MetadataReference CodeAnalysisReference = MetadataReference.CreateFromFile(typeof(Compilation).Assembly.Location);
internal static string DefaultFilePathPrefix = "Test";
internal static string CSharpDefaultFileExt = "cs";
internal static string VisualBasicDefaultExt = "vb";
internal static string TestProjectName = "TestProject";
#region Get Diagnostics
/// <summary>
/// Given classes in the form of strings, their language, and an IDiagnosticAnlayzer to apply to it, return the diagnostics found in the string after converting it to a document.
/// </summary>
/// <param name="sources">Classes in the form of strings</param>
/// <param name="language">The language the source classes are in</param>
/// <param name="analyzer">The analyzer to be run on the sources</param>
/// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns>
private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer)
{
return GetSortedDiagnosticsFromDocuments(analyzer, GetDocuments(sources, language));
}
/// <summary>
/// Given an analyzer and a document to apply it to, run the analyzer and gather an array of diagnostics found in it.
/// The returned diagnostics are then ordered by location in the source document.
/// </summary>
/// <param name="analyzer">The analyzer to run on the documents</param>
/// <param name="documents">The Documents that the analyzer will be run on</param>
/// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns>
protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents)
{
var projects = new HashSet<Project>();
foreach (var document in documents)
{
projects.Add(document.Project);
}
var diagnostics = new List<Diagnostic>();
foreach (var project in projects)
{
var compilationWithAnalyzers = project.GetCompilationAsync().Result.WithAnalyzers(ImmutableArray.Create(analyzer));
var diags = compilationWithAnalyzers.GetAnalyzerDiagnosticsAsync().Result;
foreach (var diag in diags)
{
if (diag.Location == Location.None || diag.Location.IsInMetadata)
{
diagnostics.Add(diag);
}
else
{
for (int i = 0; i < documents.Length; i++)
{
var document = documents[i];
var tree = document.GetSyntaxTreeAsync().Result;
if (tree == diag.Location.SourceTree)
{
diagnostics.Add(diag);
}
}
}
}
}
var results = SortDiagnostics(diagnostics);
diagnostics.Clear();
return results;
}
/// <summary>
/// Sort diagnostics by location in source document
/// </summary>
/// <param name="diagnostics">The list of Diagnostics to be sorted</param>
/// <returns>An IEnumerable containing the Diagnostics in order of Location</returns>
private static Diagnostic[] SortDiagnostics(IEnumerable<Diagnostic> diagnostics)
{
return diagnostics.OrderBy(d => d.Location.SourceSpan.Start).ToArray();
}
#endregion
#region Set up compilation and documents
/// <summary>
/// Given an array of strings as sources and a language, turn them into a project and return the documents and spans of it.
/// </summary>
/// <param name="sources">Classes in the form of strings</param>
/// <param name="language">The language the source code is in</param>
/// <returns>A Tuple containing the Documents produced from the sources and their TextSpans if relevant</returns>
private static Document[] GetDocuments(string[] sources, string language)
{
var project = CreateProject(sources, language);
var documents = project.Documents.ToArray();
if (sources.Length != documents.Length)
{
throw new SystemException("Amount of sources did not match amount of Documents created");
}
return documents;
}
/// <summary>
/// Create a Document from a string through creating a project that contains it.
/// </summary>
/// <param name="source">Classes in the form of a string</param>
/// <param name="language">The language the source code is in</param>
/// <returns>A Document created from the source string</returns>
internal static Document CreateDocument(string source, string language = LanguageNames.CSharp)
{
return CreateProject(new[] { source }, language).Documents.First();
}
/// <summary>
/// Create a project using the inputted strings as sources.
/// </summary>
/// <param name="sources">Classes in the form of strings</param>
/// <param name="language">The language the source code is in</param>
/// <returns>A Project created out of the Documents created from the source strings</returns>
private static Project CreateProject(string[] sources, string language = LanguageNames.CSharp)
{
if (language != LanguageNames.CSharp && language != LanguageNames.VisualBasic)
{
throw new ArgumentException("Unsupported Language");
}
string fileNamePrefix = DefaultFilePathPrefix;
string fileExt = language == LanguageNames.CSharp ? CSharpDefaultFileExt : VisualBasicDefaultExt;
var projectId = ProjectId.CreateNewId(debugName: TestProjectName);
var solution = new AdhocWorkspace()
.CurrentSolution
.AddProject(projectId, TestProjectName, TestProjectName, language)
.AddMetadataReference(projectId, CorlibReference)
.AddMetadataReference(projectId, SystemCoreReference)
.AddMetadataReference(projectId, CSharpSymbolsReference)
.AddMetadataReference(projectId, CodeAnalysisReference);
int count = 0;
foreach (var source in sources)
{
var newFileName = fileNamePrefix + count + "." + fileExt;
var documentId = DocumentId.CreateNewId(projectId, debugName: newFileName);
solution = solution.AddDocument(documentId, newFileName, SourceText.From(source));
count++;
}
return solution.GetProject(projectId);
}
#endregion
}
}
| 171 |
aws-sdk-net | aws | C# | using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestHelper
{
/// <summary>
/// Superclass of all Unit Tests for DiagnosticAnalyzers
/// </summary>
public abstract partial class DiagnosticVerifier
{
#region To be implemented by Test classes
/// <summary>
/// Get the CSharp analyzer being tested - to be implemented in non-abstract class
/// </summary>
protected virtual DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
{
return null;
}
/// <summary>
/// Get the Visual Basic analyzer being tested (C#) - to be implemented in non-abstract class
/// </summary>
protected virtual DiagnosticAnalyzer GetBasicDiagnosticAnalyzer()
{
return null;
}
#endregion
#region Verifier wrappers
/// <summary>
/// Called to test a C# DiagnosticAnalyzer when applied on the single inputted string as a source
/// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary>
/// <param name="source">A class in the form of a string to run the analyzer on</param>
/// <param name="expected"> DiagnosticResults that should appear after the analyzer is run on the source</param>
protected void VerifyCSharpDiagnostic(string source, params DiagnosticResult[] expected)
{
VerifyDiagnostics(new[] { source }, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected);
}
/// <summary>
/// Called to test a VB DiagnosticAnalyzer when applied on the single inputted string as a source
/// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary>
/// <param name="source">A class in the form of a string to run the analyzer on</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the source</param>
protected void VerifyBasicDiagnostic(string source, params DiagnosticResult[] expected)
{
VerifyDiagnostics(new[] { source }, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected);
}
/// <summary>
/// Called to test a C# DiagnosticAnalyzer when applied on the inputted strings as a source
/// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param>
protected void VerifyCSharpDiagnostic(string[] sources, params DiagnosticResult[] expected)
{
VerifyDiagnostics(sources, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected);
}
/// <summary>
/// Called to test a VB DiagnosticAnalyzer when applied on the inputted strings as a source
/// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param>
protected void VerifyBasicDiagnostic(string[] sources, params DiagnosticResult[] expected)
{
VerifyDiagnostics(sources, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected);
}
/// <summary>
/// General method that gets a collection of actual diagnostics found in the source after the analyzer is run,
/// then verifies each of them.
/// </summary>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on</param>
/// <param name="language">The language of the classes represented by the source strings</param>
/// <param name="analyzer">The analyzer to be run on the source code</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param>
private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected)
{
var diagnostics = GetSortedDiagnostics(sources, language, analyzer);
VerifyDiagnosticResults(diagnostics, analyzer, expected);
}
#endregion
#region Actual comparisons and verifications
/// <summary>
/// Checks each of the actual Diagnostics found and compares them with the corresponding DiagnosticResult in the array of expected results.
/// Diagnostics are considered equal only if the DiagnosticResultLocation, Id, Severity, and Message of the DiagnosticResult match the actual diagnostic.
/// </summary>
/// <param name="actualResults">The Diagnostics found by the compiler after running the analyzer on the source code</param>
/// <param name="analyzer">The analyzer that was being run on the sources</param>
/// <param name="expectedResults">Diagnostic Results that should have appeared in the code</param>
private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults)
{
int expectedCount = expectedResults.Count();
int actualCount = actualResults.Count();
if (expectedCount != actualCount)
{
string diagnosticsOutput = actualResults.Any() ? FormatDiagnostics(analyzer, actualResults.ToArray()) : " NONE.";
Assert.IsTrue(false,
string.Format("Mismatch between number of diagnostics returned, expected \"{0}\" actual \"{1}\"\r\n\r\nDiagnostics:\r\n{2}\r\n", expectedCount, actualCount, diagnosticsOutput));
}
for (int i = 0; i < expectedResults.Length; i++)
{
var actual = actualResults.ElementAt(i);
var expected = expectedResults[i];
if (expected.Line == -1 && expected.Column == -1)
{
if (actual.Location != Location.None)
{
Assert.IsTrue(false,
string.Format("Expected:\nA project diagnostic with No location\nActual:\n{0}",
FormatDiagnostics(analyzer, actual)));
}
}
else
{
VerifyDiagnosticLocation(analyzer, actual, actual.Location, expected.Locations.First());
var additionalLocations = actual.AdditionalLocations.ToArray();
if (additionalLocations.Length != expected.Locations.Length - 1)
{
Assert.IsTrue(false,
string.Format("Expected {0} additional locations but got {1} for Diagnostic:\r\n {2}\r\n",
expected.Locations.Length - 1, additionalLocations.Length,
FormatDiagnostics(analyzer, actual)));
}
for (int j = 0; j < additionalLocations.Length; ++j)
{
VerifyDiagnosticLocation(analyzer, actual, additionalLocations[j], expected.Locations[j + 1]);
}
}
if (actual.Id != expected.Id)
{
Assert.IsTrue(false,
string.Format("Expected diagnostic id to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Id, actual.Id, FormatDiagnostics(analyzer, actual)));
}
if (actual.Severity != expected.Severity)
{
Assert.IsTrue(false,
string.Format("Expected diagnostic severity to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Severity, actual.Severity, FormatDiagnostics(analyzer, actual)));
}
if (actual.GetMessage() != expected.Message)
{
Assert.IsTrue(false,
string.Format("Expected diagnostic message to be \"{0}\" was \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Message, actual.GetMessage(), FormatDiagnostics(analyzer, actual)));
}
}
}
/// <summary>
/// Helper method to VerifyDiagnosticResult that checks the location of a diagnostic and compares it with the location in the expected DiagnosticResult.
/// </summary>
/// <param name="analyzer">The analyzer that was being run on the sources</param>
/// <param name="diagnostic">The diagnostic that was found in the code</param>
/// <param name="actual">The Location of the Diagnostic found in the code</param>
/// <param name="expected">The DiagnosticResultLocation that should have been found</param>
private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected)
{
var actualSpan = actual.GetLineSpan();
Assert.IsTrue(actualSpan.Path == expected.Path || (actualSpan.Path != null && actualSpan.Path.Contains("Test0.") && expected.Path.Contains("Test.")),
string.Format("Expected diagnostic to be in file \"{0}\" was actually in file \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Path, actualSpan.Path, FormatDiagnostics(analyzer, diagnostic)));
var actualLinePosition = actualSpan.StartLinePosition;
// Only check line position if there is an actual line in the real diagnostic
if (actualLinePosition.Line > 0)
{
if (actualLinePosition.Line + 1 != expected.Line)
{
Assert.IsTrue(false,
string.Format("Expected diagnostic to be on line \"{0}\" was actually on line \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Line, actualLinePosition.Line + 1, FormatDiagnostics(analyzer, diagnostic)));
}
}
// Only check column position if there is an actual column position in the real diagnostic
if (actualLinePosition.Character > 0)
{
if (actualLinePosition.Character + 1 != expected.Column)
{
Assert.IsTrue(false,
string.Format("Expected diagnostic to start at column \"{0}\" was actually at column \"{1}\"\r\n\r\nDiagnostic:\r\n {2}\r\n",
expected.Column, actualLinePosition.Character + 1, FormatDiagnostics(analyzer, diagnostic)));
}
}
}
#endregion
#region Formatting Diagnostics
/// <summary>
/// Helper method to format a Diagnostic into an easily readable string
/// </summary>
/// <param name="analyzer">The analyzer that this verifier tests</param>
/// <param name="diagnostics">The Diagnostics to be formatted</param>
/// <returns>The Diagnostics formatted as a string</returns>
private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
{
var builder = new StringBuilder();
for (int i = 0; i < diagnostics.Length; ++i)
{
builder.AppendLine("// " + diagnostics[i].ToString());
var analyzerType = analyzer.GetType();
var rules = analyzer.SupportedDiagnostics;
foreach (var rule in rules)
{
if (rule != null && rule.Id == diagnostics[i].Id)
{
var location = diagnostics[i].Location;
if (location == Location.None)
{
builder.AppendFormat("GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id);
}
else
{
Assert.IsTrue(location.IsInSource,
string.Format("Test base does not currently handle diagnostics in metadata locations. Diagnostic in metadata: {0}\r\n",
diagnostics[i]));
string resultMethodName = diagnostics[i].Location.SourceTree.FilePath.EndsWith(".cs") ? "GetCSharpResultAt" : "GetBasicResultAt";
var linePosition = diagnostics[i].Location.GetLineSpan().StartLinePosition;
builder.AppendFormat("{0}({1}, {2}, {3}.{4})",
resultMethodName,
linePosition.Line + 1,
linePosition.Character + 1,
analyzerType.Name,
rule.Id);
}
if (i != diagnostics.Length - 1)
{
builder.Append(',');
}
builder.AppendLine();
break;
}
}
}
return builder.ToString();
}
#endregion
}
}
| 271 |
aws-sdk-net | aws | C# | using Amazon.CodeAnalysis.Shared;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis;
namespace MockAnalyzer
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "MockAnalyzer";
}
}
} | 15 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AccessAnalyzer.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AccessAnalyzer";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AccessAnalyzer")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Access Analyzer. Introducing AWS IAM Access Analyzer, an IAM feature that makes it easy for AWS customers to ensure that their resource-based policies provide only the intended access to resources outside their AWS accounts.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.103.84")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.Account.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "Account";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.Account")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Account. This release of the Account Management API enables customers to manage the alternate contacts for their AWS accounts. For more information, see https://docs.aws.amazon.com/accounts/latest/reference/accounts-welcome.html")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.103.1")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ACMPCA.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ACMPCA";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ACMPCA")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Certificate Manager Private Certificate Authority. AWS Certificate Manager (ACM) Private Certificate Authority (CA) is a managed private CA service that helps you easily and securely manage the lifecycle of your private certificates. ACM Private CA provides you a highly-available private CA service without the upfront investment and ongoing maintenance costs of operating your own private CA. ACM Private CA extends ACM's certificate management capabilities to private certificates, enabling you to manage public and private certificates centrally.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.102.98")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AlexaForBusiness.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AlexaForBusiness";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AlexaForBusiness")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Alexa For Business. Alexa for Business is now generally available for production use. Alexa for Business makes it easy for you to use Alexa in your organization. The Alexa for Business SDK gives you APIs to manage Alexa devices, enroll users, and assign skills at scale. For more information about Alexa for Business, go to https://aws.amazon.com/alexaforbusiness")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.147")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.Amplify.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "Amplify";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.Amplify")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Amplify. Amplify is a fully managed continuous deployment and hosting service for modern web apps.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.101.127")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AmplifyBackend.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AmplifyBackend";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AmplifyBackend")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AmplifyBackend. (New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.101.98")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AmplifyUIBuilder.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AmplifyUIBuilder";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AmplifyUIBuilder")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Amplify UI Builder. This release introduces the actions and data types for the new Amplify UI Builder API. The Amplify UI Builder API provides a programmatic interface for creating and configuring user interface (UI) component libraries and themes for use in Amplify applications.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.102.3")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.APIGateway.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "APIGateway";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.APIGateway")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon API Gateway. Amazon API Gateway helps developers deliver robust, secure and scalable mobile and web application backends. Amazon API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.147")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ApiGatewayManagementApi.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ApiGatewayManagementApi";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ApiGatewayManagementApi")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AmazonApiGatewayManagementApi. This is the initial SDK release for the Amazon API Gateway Management API, which allows you to directly manage runtime aspects of your APIs. This release makes it easy to send data directly to clients connected to your WebSocket-based APIs.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.147")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ApiGatewayV2.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ApiGatewayV2";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ApiGatewayV2")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AmazonApiGatewayV2. This is the initial SDK release for the Amazon API Gateway v2 APIs. This SDK will allow you to manage and configure APIs in Amazon API Gateway; this first release provides the capabilities that allow you to programmatically setup and manage WebSocket APIs end to end.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.147")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AppConfig.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AppConfig";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AppConfig")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon AppConfig. Introducing AWS AppConfig, a new service that enables customers to quickly deploy validated configurations to applications of any size in a controlled and monitored fashion.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.102.74")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AppConfigData.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AppConfigData";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AppConfigData")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS AppConfig Data. AWS AppConfig Data is a new service that allows you to retrieve configuration deployed by AWS AppConfig. See the AppConfig user guide for more details on getting started. https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.101.74")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AppFabric.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AppFabric";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AppFabric")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AppFabric. Initial release of AWS AppFabric for connecting SaaS applications for better productivity and security.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.0")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.Appflow.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "Appflow";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.Appflow")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon Appflow. Amazon AppFlow is a fully managed integration service that securely transfers data between AWS services and SaaS applications. This update releases the first version of Amazon AppFlow APIs and SDK.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.113.0")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AppIntegrationsService.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AppIntegrationsService";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AppIntegrationsService")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon AppIntegrations Service. The Amazon AppIntegrations service (in preview release) enables you to configure and reuse connections to external applications.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.101.58")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ApplicationAutoScaling.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ApplicationAutoScaling";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ApplicationAutoScaling")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Application Auto Scaling. Application Auto Scaling is a general purpose Auto Scaling service for supported elastic AWS resources. With Application Auto Scaling, you can automatically scale your AWS resources, with an experience similar to that of Amazon EC2 Auto Scaling.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.106.12")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ApplicationCostProfiler.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ApplicationCostProfiler";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ApplicationCostProfiler")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Application Cost Profiler. APIs for AWS Application Cost Profiler.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.147")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ApplicationDiscoveryService.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ApplicationDiscoveryService";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ApplicationDiscoveryService")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - AWS Application Discovery Service. AWS Application Discovery Service helps Systems Integrators quickly and reliably plan application migration projects by automatically identifying applications running in your data center, their associated dependencies, and their performance profile.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.102.1")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.ApplicationInsights.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "ApplicationInsights";
}
}
} | 25 |
aws-sdk-net | aws | C# | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.ApplicationInsights")]
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon CloudWatch Application Insights. CloudWatch Application Insights detects errors and exceptions from logs, including .NET custom application logs, SQL Server logs, IIS logs, and more, and uses a combination of built-in rules and machine learning, such as dynamic baselining, to identify common problems. You can then easily drill into specific issues with CloudWatch Automatic Dashboards that are dynamically generated. These dashboards contain the most recent alarms, a summary of relevant metrics, and log snippets to help you identify root cause.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3")]
[assembly: AssemblyFileVersion("3.7.100.147")] | 32 |
aws-sdk-net | aws | C# | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Linq;
using System.Xml.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Amazon.CodeAnalysis.Shared;
namespace Amazon.AppMesh.CodeAnalysis
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class PropertyValueAssignmentAnalyzer : AbstractPropertyValueAssignmentAnalyzer
{
public override string GetServiceName()
{
return "AppMesh";
}
}
} | 25 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.