mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 11:40:42 +00:00
Repository name is required when creating a repo
I was trying to create a repository and I wasn't sure which parameters were required. Following our philosophy of exposing required parameters in the constructor, I change the `NewRepository` object to take in a repository name and to make that property readonly.
This commit is contained in:
@@ -11,6 +11,17 @@ namespace Octokit
|
||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||
public class NewRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates an object that describes the repository to create on GitHub.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the repository. This is the only required parameter.</param>
|
||||
public NewRepository(string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
|
||||
Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Optional. Gets or sets whether to create an initial commit with empty README. The default is false.
|
||||
/// </summary>
|
||||
@@ -50,7 +61,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// Required. Gets or sets the new repository's name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional. Gets or sets whether the new repository is private; the default is false.
|
||||
|
||||
Reference in New Issue
Block a user