Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Fix comments and add compile-mono.sh #1863

Merged
merged 3 commits into from
Jan 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("Newtonsoft.Json.dll", "bin", "Newtonsoft.Json.dll"));
supportingFiles.add(new SupportingFile("RestSharp.dll", "bin", "RestSharp.dll"));
supportingFiles.add(new SupportingFile("compile.mustache", "", "compile.bat"));
supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh"));
supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor" + java.io.File.separator, "packages.config"));
supportingFiles.add(new SupportingFile("README.md", "", "README.md"));

if (optionalAssemblyInfoFlag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ namespace {{packageName}}.Client
/// </summary>
/// <param name="content">HTTP body (e.g. string, JSON).</param>
/// <param name="type">Object type.</param>
/// <param name="headers">HTTP headers.</param>
/// <returns>Object representation of the JSON string.</returns>
public object Deserialize(string content, Type type, IList<Parameter> headers=null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace {{packageName}}.Client {
/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="basePath">The base path.</param>
public ApiException() {}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ using {{packageName}}.Client;
namespace {{packageName}}.Api
{
{{#operations}}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface I{{classname}}
{
{{#operation}}
/// <summary>
/// {{summary}} {{notes}}
/// </summary>
{{#allParams}}/// <param name="{{paramName}}">{{description}}</param>
{{/allParams}}/// <returns>{{#returnType}}{{{returnType}}}{{/returnType}}</returns>
{{/allParams}}/// <returns>{{#returnType}}{{returnType}}{{/returnType}}</returns>
{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
{{/operation}}
}
Expand Down Expand Up @@ -71,15 +74,15 @@ namespace {{packageName}}.Api
/// <summary>
/// Gets or sets the API client.
/// </summary>
/// <value>An instance of the ApiClient</param>
/// <value>An instance of the ApiClient</value>
public ApiClient ApiClient {get; set;}

{{#operation}}
/// <summary>
/// {{summary}} {{notes}}
/// </summary>
{{#allParams}}/// <param name="{{paramName}}">{{description}}</param>
{{/allParams}}/// <returns>{{#returnType}}{{{returnType}}}{{/returnType}}</returns>
{{/allParams}}/// <returns>{{#returnType}}{{returnType}}{{/returnType}}</returns>
public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
{{#allParams}}{{#required}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\
System.Runtime.Serialization.dll \
-target:library \
-out:bin/{{packageName}}.dll \
-recurse:src/*.cs \
-recurse:'src/*.cs' \
-doc:bin/{{packageName}}.xml \
-platform:anycpu
-platform:anycpu
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ namespace {{packageName}}.Client
public T Data { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse"/> class.
/// Initializes a new instance of the <see cref="ApiResponse&lt;T&gt;" /> class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
/// <param name="headers">HTTP headers.</param>
/// <param name="data">Data (parsed HTTP body)</param>
public ApiResponse(int statusCode, IDictionary<string, string> headers, T data)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace {{packageName}}.Client
/// <param name="apiKeyPrefix">Dictionary of API key prefix</param>
/// <param name="tempFolderPath">Temp folder path</param>
/// <param name="dateTimeFormat">DateTime format string</param>
/// <param name="timeout">HTTP connection timeout (in milliseconds)</param>
public Configuration(ApiClient apiClient = null,
Dictionary<String, String> defaultHeader = null,
string username = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
wget -nc https://nuget.org/nuget.exe;
mozroots --import --sync
mono nuget.exe install vendor/packages.config -o vendor;
mkdir -p bin;
mcs -sdk:45 -r:vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll,\
vendor/RestSharp.105.2.3/lib/net45/RestSharp.dll,\
System.Runtime.Serialization.dll \
-target:library \
-out:bin/{{packageName}}.dll \
-recurse:'src/*.cs' \
-doc:bin/{{packageName}}.xml \
-platform:anycpu
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace {{packageName}}.Model
/// <summary>
/// Returns true if {{classname}} instances are equal
/// </summary>
/// <param name="obj">Instance of {{classname}} to be compared</param>
/// <param name="other">Instance of {{classname}} to be compared</param>
/// <returns>Boolean</returns>
public bool Equals({{classname}} other)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.2.3" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" developmentDependency="true" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\
System.Runtime.Serialization.dll \
-target:library \
-out:bin/IO.Swagger.dll \
-recurse:src/*.cs \
-recurse:'src/*.cs' \
-doc:bin/IO.Swagger.xml \
-platform:anycpu
-platform:anycpu
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
namespace IO.Swagger.Api
{

/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IPetApi
{

Expand All @@ -29,14 +32,14 @@ public interface IPetApi
/// Finds Pets by status Multiple status values can be provided with comma seperated strings
/// </summary>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns>List<Pet></returns>
/// <returns>List&lt;Pet&gt;</returns>
List<Pet> FindPetsByStatus (List<string> status);

/// <summary>
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
/// </summary>
/// <param name="tags">Tags to filter by</param>
/// <returns>List<Pet></returns>
/// <returns>List&lt;Pet&gt;</returns>
List<Pet> FindPetsByTags (List<string> tags);

/// <summary>
Expand Down Expand Up @@ -124,7 +127,7 @@ public String GetBasePath(String basePath)
/// <summary>
/// Gets or sets the API client.
/// </summary>
/// <value>An instance of the ApiClient</param>
/// <value>An instance of the ApiClient</value>
public ApiClient ApiClient {get; set;}


Expand Down Expand Up @@ -212,7 +215,7 @@ public void AddPet (Pet body)
/// Finds Pets by status Multiple status values can be provided with comma seperated strings
/// </summary>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns>List<Pet></returns>
/// <returns>List&lt;Pet&gt;</returns>
public List<Pet> FindPetsByStatus (List<string> status)
{

Expand Down Expand Up @@ -252,7 +255,7 @@ public List<Pet> FindPetsByStatus (List<string> status)
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
/// </summary>
/// <param name="tags">Tags to filter by</param>
/// <returns>List<Pet></returns>
/// <returns>List&lt;Pet&gt;</returns>
public List<Pet> FindPetsByTags (List<string> tags)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
namespace IO.Swagger.Api
{

/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IStoreApi
{

/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <returns>Dictionary<String, int?></returns>
/// <returns>Dictionary&lt;String, int?&gt;</returns>
Dictionary<String, int?> GetInventory ();

/// <summary>
Expand Down Expand Up @@ -90,14 +93,14 @@ public String GetBasePath(String basePath)
/// <summary>
/// Gets or sets the API client.
/// </summary>
/// <value>An instance of the ApiClient</param>
/// <value>An instance of the ApiClient</value>
public ApiClient ApiClient {get; set;}


/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <returns>Dictionary<String, int?></returns>
/// <returns>Dictionary&lt;String, int?&gt;</returns>
public Dictionary<String, int?> GetInventory ()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
namespace IO.Swagger.Api
{

/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IUserApi
{

Expand Down Expand Up @@ -120,7 +123,7 @@ public String GetBasePath(String basePath)
/// <summary>
/// Gets or sets the API client.
/// </summary>
/// <value>An instance of the ApiClient</param>
/// <value>An instance of the ApiClient</value>
public ApiClient ApiClient {get; set;}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public string ParameterToString(object obj)
/// </summary>
/// <param name="content">HTTP body (e.g. string, JSON).</param>
/// <param name="type">Object type.</param>
/// <param name="headers">HTTP headers.</param>
/// <returns>Object representation of the JSON string.</returns>
public object Deserialize(string content, Type type, IList<Parameter> headers=null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class ApiException : Exception {
/// <summary>
/// Initializes a new instance of the <see cref="ApiException"/> class.
/// </summary>
/// <param name="basePath">The base path.</param>
public ApiException() {}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ public string ParameterToString(object obj)
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
// For example: 2009-06-15T13:45:30.0000000
return ((DateTime)obj).ToString (Configuration.DateTimeFormat);
else if (obj is DateTimeOffset)
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
// For example: 2009-06-15T13:45:30.0000000
return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat);
else if (obj is IList)
{
var flattenedString = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public class ApiResponse<T>
public T Data { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse"/> class.
/// Initializes a new instance of the <see cref="ApiResponse&lt;T&gt;" /> class.
/// </summary>
/// <param name="statusCode">HTTP status code.</param>
/// <param name="message">Error message.</param>
/// <param name="headers">HTTP headers.</param>
/// <param name="data">Data (parsed HTTP body)</param>
public ApiResponse(int statusCode, IDictionary<string, string> headers, T data)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class Configuration
/// <param name="apiKeyPrefix">Dictionary of API key prefix</param>
/// <param name="tempFolderPath">Temp folder path</param>
/// <param name="dateTimeFormat">DateTime format string</param>
/// <param name="timeout">HTTP connection timeout (in milliseconds)</param>
public Configuration(ApiClient apiClient = null,
Dictionary<String, String> defaultHeader = null,
string username = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override bool Equals(object obj)
/// <summary>
/// Returns true if Category instances are equal
/// </summary>
/// <param name="obj">Instance of Category to be compared</param>
/// <param name="other">Instance of Category to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Category other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public override bool Equals(object obj)
/// <summary>
/// Returns true if Order instances are equal
/// </summary>
/// <param name="obj">Instance of Order to be compared</param>
/// <param name="other">Instance of Order to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Order other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public override bool Equals(object obj)
/// <summary>
/// Returns true if Pet instances are equal
/// </summary>
/// <param name="obj">Instance of Pet to be compared</param>
/// <param name="other">Instance of Pet to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Pet other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override bool Equals(object obj)
/// <summary>
/// Returns true if Tag instances are equal
/// </summary>
/// <param name="obj">Instance of Tag to be compared</param>
/// <param name="other">Instance of Tag to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Tag other)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public override bool Equals(object obj)
/// <summary>
/// Returns true if User instances are equal
/// </summary>
/// <param name="obj">Instance of User to be compared</param>
/// <param name="other">Instance of User to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(User other)
{
Expand Down