-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add repositoryId overloads to methods on I(Observable)RepositoryForksClient #1356
Changes from 9 commits
ad74d91
23eaf16
053fb58
1e7804f
9dc231d
55ba6cf
140920e
e589501
c66b1e2
5a57ab3
c9de835
d0dc6db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ public ObservableRepositoryForksClient(IGitHubClient client) | |
/// </remarks> | ||
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <returns>A <see cref="IObservable{Repository}"/> of <see cref="Repository"/>s representing forks of specified repository.</returns> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(string owner, string name) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
|
@@ -44,6 +44,19 @@ public IObservable<Repository> GetAll(string owner, string name) | |
return GetAll(owner, name, ApiOptions.None); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
/// <remarks> | ||
/// See <a href="http://developer.github.com/v3/repos/forks/#list-forks">API documentation</a> for more information. | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(int repositoryId) | ||
{ | ||
return GetAll(repositoryId, ApiOptions.None); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
|
@@ -53,7 +66,7 @@ public IObservable<Repository> GetAll(string owner, string name) | |
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
/// <returns>A <see cref="IObservable{Repository}"/> of <see cref="Repository"/>s representing forks of specified repository.</returns> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(string owner, string name, ApiOptions options) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
|
@@ -63,6 +76,22 @@ public IObservable<Repository> GetAll(string owner, string name, ApiOptions opti | |
return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.RepositoryForks(owner, name), options); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
/// <remarks> | ||
/// See <a href="http://developer.github.com/v3/repos/forks/#list-forks">API documentation</a> for more information. | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(int repositoryId, ApiOptions options) | ||
{ | ||
Ensure.ArgumentNotNull(options, "options"); | ||
|
||
return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.RepositoryForks(repositoryId), options); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
|
@@ -72,7 +101,7 @@ public IObservable<Repository> GetAll(string owner, string name, ApiOptions opti | |
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="request">Used to request and filter a list of repository forks</param> | ||
/// <returns>A <see cref="IObservable{Repository}"/> of <see cref="Repository"/>s representing forks of specified repository.</returns> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(string owner, string name, RepositoryForksListRequest request) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
|
@@ -81,6 +110,20 @@ public IObservable<Repository> GetAll(string owner, string name, RepositoryForks | |
return GetAll(owner, name, request, ApiOptions.None); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
/// <remarks> | ||
/// See <a href="http://developer.github.com/v3/repos/forks/#list-forks">API documentation</a> for more information. | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
/// <param name="request">Used to request and filter a list of repository forks</param> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(int repositoryId, RepositoryForksListRequest request) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done! |
||
return GetAll(repositoryId, request, ApiOptions.None); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
|
@@ -91,7 +134,7 @@ public IObservable<Repository> GetAll(string owner, string name, RepositoryForks | |
/// <param name="name">The name of the repository</param> | ||
/// <param name="request">Used to request and filter a list of repository forks</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
/// <returns>A <see cref="IObservable{Repository}"/> of <see cref="Repository"/>s representing forks of specified repository.</returns> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(string owner, string name, RepositoryForksListRequest request, ApiOptions options) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think here it would be a breaking change, isn't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we allow |
||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
|
@@ -102,6 +145,24 @@ public IObservable<Repository> GetAll(string owner, string name, RepositoryForks | |
_connection.GetAndFlattenAllPages<Repository>(ApiUrls.RepositoryForks(owner, name), request.ToParametersDictionary(), options); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list of forks defined for a repository | ||
/// </summary> | ||
/// <remarks> | ||
/// See <a href="http://developer.github.com/v3/repos/forks/#list-forks">API documentation</a> for more information. | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
/// <param name="request">Used to request and filter a list of repository forks</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
/// <returns></returns> | ||
public IObservable<Repository> GetAll(int repositoryId, RepositoryForksListRequest request, ApiOptions options) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think here it would be a breaking change, isn't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand - this is a new method we're adding here? |
||
Ensure.ArgumentNotNull(options, "options"); | ||
|
||
return request == null ? _connection.GetAndFlattenAllPages<Repository>(ApiUrls.RepositoryForks(repositoryId), options) : | ||
_connection.GetAndFlattenAllPages<Repository>(ApiUrls.RepositoryForks(repositoryId), request.ToParametersDictionary(), options); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a fork for a repository. Specify organization in the fork parameter to create for an organization. | ||
/// </summary> | ||
|
@@ -111,7 +172,7 @@ public IObservable<Repository> GetAll(string owner, string name, RepositoryForks | |
/// <param name="owner">The owner of the repository</param> | ||
/// <param name="name">The name of the repository</param> | ||
/// <param name="fork">Used to fork a repository</param> | ||
/// <returns>A <see cref="IObservable{Repository}"/> of <see cref="Repository"/> representing the created fork of specified repository.</returns> | ||
/// <returns></returns> | ||
public IObservable<Repository> Create(string owner, string name, NewRepositoryFork fork) | ||
{ | ||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); | ||
|
@@ -120,5 +181,21 @@ public IObservable<Repository> Create(string owner, string name, NewRepositoryFo | |
|
||
return _client.Create(owner, name, fork).ToObservable(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a fork for a repository. Specify organization in the fork parameter to create for an organization. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <a href="http://developer.github.com/v3/repos/forks/#create-a-fork">API documentation</a> for more information. | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
/// <param name="fork">Used to fork a repository</param> | ||
/// <returns></returns> | ||
public IObservable<Repository> Create(int repositoryId, NewRepositoryFork fork) | ||
{ | ||
Ensure.ArgumentNotNull(fork, "fork"); | ||
|
||
return _client.Create(repositoryId, fork).ToObservable(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure.ArgumentNotNull(request, "request")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!