mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 11:24:44 +00:00
[WIP] Protected branches updates - granular methods (#1443)
* Add get method for required status checks * Add api urls for required status checks * change name of apir url for required status checks * fix xml comment * add update method for required status checks * add delete method for required status checks * fix api url * fix xml comment * add api url for required status cehcks contexts * add get method for required status checks contexts * add replace method for required status checks contexts * add add method for required status checks contexts * add new overload for delete method * add delete method for required status checks contexts; fix overloads for delete * add api url for restrictions * add get method for restrictions * add delete method for restrictions * add api url for teams restrictions * add get method for team restrictions; fix delete method restrictions * fix overhead for get team restrictions * fix httpmethod for update required status checks * add set method for team restrictions * add add method for team restrictions * add delete method for team restrictions * add api url for user restrictions * add get method for user restrictions * add set method for user restrictions * add add method for user restrictions * add delete method for user restrictions * Add unit test; fix api urls * Add ExcludeFromTest class * add exclude attribute to methods * Add attribute usage * Add parameter to interface * add observable unit tests * rename excludefromtest exclude all the tests for the new api endpoints because they broke the pagination and syncobsverable tests. * rename excludefromattribute * refactor observable methods * [WIP] Add integration tests * finish integration test * fix renamed branch protection restrictions * add team and user collections * rename set to update * rename test methods * optimize integration tests * made some tidy ups - fixup comment wording Edit => Replace - remove spurious characters from description - remove un-needed exclude attributes * remove ForOrgRepo tests * remove unused org contexts * dispose contexts * remove obsolete GetRedirect * add clarifying comment to restriction methods
This commit is contained in:
committed by
Ryan Gribble
parent
6a21ce5df6
commit
93ae832311
@@ -494,6 +494,25 @@ namespace Octokit
|
||||
return Connection.Delete(uri, data, accepts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP DELETE request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to map the response to</typeparam>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="data">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
public async Task<T> Delete<T>(Uri uri, object data, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
Ensure.ArgumentNotNull(accepts, "accepts");
|
||||
|
||||
var response = await Connection.Delete<T>(uri, data, accepts).ConfigureAwait(false);
|
||||
|
||||
return response.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for API calls which
|
||||
/// queue long running calculations and return a collection of a resource.
|
||||
|
||||
@@ -490,6 +490,22 @@ namespace Octokit
|
||||
return response.HttpResponse.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP DELETE request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to map the response to</typeparam>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="data">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
public Task<IApiResponse<T>> Delete<T>(Uri uri, object data, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(accepts, "accepts");
|
||||
|
||||
return SendData<T>(uri, HttpMethod.Delete, data, accepts, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base address for the connection.
|
||||
/// </summary>
|
||||
|
||||
@@ -320,6 +320,17 @@ namespace Octokit
|
||||
/// <returns>The returned <seealso cref="HttpStatusCode"/></returns>
|
||||
Task Delete(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP DELETE request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The API resource's type.</typeparam>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="data">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
/// <returns>The returned <seealso cref="HttpStatusCode"/></returns>
|
||||
Task<T> Delete<T>(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for API calls which
|
||||
/// queue long running calculations and return a collection of a resource.
|
||||
|
||||
@@ -237,6 +237,16 @@ namespace Octokit
|
||||
/// <returns>The returned <seealso cref="HttpStatusCode"/></returns>
|
||||
Task<HttpStatusCode> Delete(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP DELETE request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to map the response to</typeparam>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="data">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accept response media type</param>
|
||||
Task<IApiResponse<T>> Delete<T>(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Base address for the connection.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user