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:
Haacked
2015-03-19 16:25:03 -07:00
parent ba9452ed3f
commit a94051d6b0
27 changed files with 75 additions and 78 deletions
+12 -1
View File
@@ -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.