mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user