mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 12:42:32 +00:00
[FEAT]: Custom Properties (#2933)
* add custom properties model and clients * observable * observable tests * add search * error CS8370: 'target-typed object creation' * Error CS8370: 'target-typed object creation' * add patch with body that return status code * fixes for failed ConventionTests * working UnitTests * (de)serialization and model tests * Update Repository.cs
This commit is contained in:
@@ -460,6 +460,20 @@ namespace Octokit
|
||||
return Connection.Patch(uri);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI of the API resource to patch</param>
|
||||
/// <param name="data">Object that describes the API resource; this will be serialized and used as the request's body</param>
|
||||
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
|
||||
public Task Patch(Uri uri, object data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
Ensure.ArgumentNotNull(data, nameof(data));
|
||||
|
||||
return Connection.Patch(uri, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
@@ -474,6 +488,22 @@ namespace Octokit
|
||||
return Connection.Patch(uri, accepts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI of the API resource to patch</param>
|
||||
/// <param name="data">Object that describes the API resource; this will be serialized and used as the request's body</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
|
||||
public Task Patch(Uri uri, object data, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
Ensure.ArgumentNotNull(data, nameof(data));
|
||||
Ensure.ArgumentNotNull(accepts, nameof(accepts));
|
||||
|
||||
return Connection.Patch(uri, data, accepts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
@@ -498,6 +498,21 @@ namespace Octokit
|
||||
return response.HttpResponse.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="body">The object to serialize as the body of the request</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
public async Task<HttpStatusCode> Patch(Uri uri, object body)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
Ensure.ArgumentNotNull(body, nameof(body));
|
||||
|
||||
var response = await SendData<object>(uri, new HttpMethod("PATCH"), body, null, null, CancellationToken.None).ConfigureAwait(false);
|
||||
return response.HttpResponse.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
@@ -513,6 +528,23 @@ namespace Octokit
|
||||
return response.HttpResponse.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="body">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
public async Task<HttpStatusCode> Patch(Uri uri, object body, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
Ensure.ArgumentNotNull(body, nameof(body));
|
||||
Ensure.ArgumentNotNull(accepts, nameof(accepts));
|
||||
|
||||
var response = await SendData<object>(uri, new HttpMethod("PATCH"), body, accepts, null, CancellationToken.None).ConfigureAwait(false);
|
||||
return response.HttpResponse.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PUT request that expects an empty response.
|
||||
/// </summary>
|
||||
|
||||
@@ -306,6 +306,14 @@ namespace Octokit
|
||||
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
|
||||
Task Patch(Uri uri);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI of the API resource to patch</param>
|
||||
/// <param name="data">Object that describes the API resource; this will be serialized and used as the request's body</param>
|
||||
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
|
||||
Task Patch(Uri uri, object data);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
@@ -314,6 +322,15 @@ namespace Octokit
|
||||
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
|
||||
Task Patch(Uri uri, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI of the API resource to patch</param>
|
||||
/// <param name="data">Object that describes the API resource; this will be serialized and used as the request's body</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
|
||||
Task Patch(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
@@ -117,6 +117,14 @@ namespace Octokit
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
Task<HttpStatusCode> Patch(Uri uri);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="body">The object to serialize as the body of the request</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
Task<HttpStatusCode> Patch(Uri uri, object body);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
@@ -125,6 +133,15 @@ namespace Octokit
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
Task<HttpStatusCode> Patch(Uri uri, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="body">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
Task<HttpStatusCode> Patch(Uri uri, object body, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
|
||||
Reference in New Issue
Block a user