Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace {{packageName}}.Controllers
{ {{#responses}}
{{#dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode({{code}}, default({{&dataType}}));
// return StatusCode({{code}}, default);
{{/dataType}}
{{^dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

var example = exampleJson != null
? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson)
: default({{{returnType}}});
: default;
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace {{apiPackage}}
{{#responses}}
{{#dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode({{code}}, default({{&dataType}}));
// return StatusCode({{code}}, default);
{{/dataType}}
{{^dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

var example = exampleJson != null
? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson)
: default({{{returnType}}});
: default;
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace {{apiPackage}}
{{#responses}}
{{#dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode({{code}}, default({{&dataType}}));
// return StatusCode({{code}}, default);
{{/dataType}}
{{^dataType}}
//TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

var example = exampleJson != null
? {{#useNewtonsoft}}JsonConvert.DeserializeObject{{/useNewtonsoft}}{{^useNewtonsoft}}JsonSerializer.Deserialize{{/useNewtonsoft}}<{{{returnType}}}>(exampleJson)
: default({{{returnType}}});
: default;
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ namespace {{packageName}}.Client
}

{{#supportsAsync}}
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default)
{
RestClient client = new RestClient(_baseUrl);

Expand Down Expand Up @@ -663,7 +663,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken);
Expand All @@ -678,7 +678,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken);
Expand All @@ -693,7 +693,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken);
Expand All @@ -708,7 +708,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken);
Expand All @@ -723,7 +723,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken);
Expand All @@ -738,7 +738,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken);
Expand All @@ -753,7 +753,7 @@ namespace {{packageName}}.Client
/// GlobalConfiguration has been done before calling this method.</param>
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
/// <returns>A Task containing ApiResponse</returns>
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default)
{
var config = configuration ?? GlobalConfiguration.Instance;
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), config, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the POST http verb.
Expand All @@ -32,7 +32,7 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the PUT http verb.
Expand All @@ -43,7 +43,7 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the DELETE http verb.
Expand All @@ -54,7 +54,7 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the HEAD http verb.
Expand All @@ -65,7 +65,7 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the OPTIONS http verb.
Expand All @@ -76,7 +76,7 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Executes a non-blocking call to some <paramref name="path"/> using the PATCH http verb.
Expand All @@ -87,6 +87,6 @@ namespace {{packageName}}.Client
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <typeparam name="T">The return type.</typeparam>
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default);
}
}
Loading
Loading