using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Octokit { /// /// Describes a new repository to create via the method. /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewRepository { /// /// Creates an object that describes the repository to create on GitHub. /// /// The name of the repository. This is the only required parameter. public NewRepository(string name) { Ensure.ArgumentNotNullOrEmptyString(name, "name"); Name = name; } /// /// Optional. Gets or sets whether to create an initial commit with empty README. The default is false. /// public bool? AutoInit { get; set; } /// /// Required. Gets or sets the new repository's description /// public string Description { get; set; } /// /// Optional. Gets or sets whether to enable downloads for the new repository. The default is true. /// public bool? HasDownloads { get; set; } /// /// Optional. Gets or sets whether to enable issues for the new repository. The default is true. /// public bool? HasIssues { get; set; } /// /// Optional. Gets or sets whether to enable the wiki for the new repository. The default is true. /// public bool? HasWiki { get; set; } /// /// Optional. Gets or sets the new repository's optional website. /// public string Homepage { get; set; } /// /// Optional. Gets or sets the desired language's or platform's .gitignore template to apply. Use the name of the template without the extension; "Haskell", for example. Ignored if is null or false. /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gitignore", Justification = "It needs to be this way for proper serialization.")] public string GitignoreTemplate { get; set; } /// /// Optional. Gets or sets the desired Desired LICENSE template to apply. Use the name of the template without /// the extension. For example, “mit” or “mozilla”. /// /// /// The list of license templates are here: https://github.com/github/choosealicense.com/tree/gh-pages/_licenses /// Just omit the ".txt" file extension for the template name. /// public string LicenseTemplate { get; set; } /// /// Required. Gets or sets the new repository's name. /// public string Name { get; private set; } /// /// Optional. Gets or sets whether the new repository is private; the default is false. /// public bool? Private { get; set; } /// /// Optional. Gets or sets the ID of the team to grant access to this repository. This is only valid when creating a repository for an organization. /// public int? TeamId { get; set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Name: {0} Description: {1}", Name, Description); } } } }