using Octokit.Internal; using System; using System.Diagnostics; namespace Octokit { /// /// Represents updatable fields on a repository. Values that are null will not be sent in the request. /// Use string.empty if you want to clear a value. /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class RepositoryUpdate { /// /// Creates an object that describes an update to a repository on GitHub. /// public RepositoryUpdate() { } /// /// Creates an object that describes an update to a repository on GitHub. /// /// The name of the repository. This is the only required parameter. [Obsolete("Use the constructor with no parameters as name is no longer a required field")] public RepositoryUpdate(string name) { Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Name = name; } /// /// Required. Gets or sets the repository name. /// public string Name { get; set; } /// /// Optional. Gets or sets the repository description. The default is null (do not update) /// public string Description { get; set; } /// /// Optional. Gets or sets the repository homepage url. The default is null (do not update). /// public string Homepage { get; set; } /// /// Gets or sets whether to make the repository private. The default is null (do not update). /// public bool? Private { get; set; } /// /// Optional. Gets or sets whether the new repository is public, private, or internal. A value provided here overrides any value set in the existing private field. /// public RepositoryVisibility? Visibility { get; set; } // Yet to be implemented //public object SecurityAndAnalysis { get; set; } /// /// Gets or sets whether to enable issues for the repository. The default is null (do not update). The default when created is true. /// public bool? HasIssues { get; set; } /// /// Gets or sets whether to enable projects for the repository. The default is null (do not update). The default when created is true. /// public bool? HasProjects { get; set; } /// /// Optional. Gets or sets whether to enable the wiki for the repository. The default is null (do not update). The default when created is true. /// public bool? HasWiki { get; set; } /// /// Optional. Gets or sets whether to enable downloads for the repository. The default is null (do not update). No longer appears on the documentation but still works. /// public bool? HasDownloads { get; set; } /// /// Optional. Gets or sets whether the repository is a template. The default is null (do not update). The default when created is false. /// public bool? IsTemplate { get; set; } /// /// Optional. Gets or sets the default branch. The default is null (do not update). /// public string DefaultBranch { get; set; } /// /// Optional. Allows the "Squash Merge" merge method to be used. The default is null (do not update). The default when created is true. /// public bool? AllowSquashMerge { get; set; } /// /// Optional. Allows the "Create a merge commit" merge method to be used. The default is null (do not update). The default when created is true. /// public bool? AllowMergeCommit { get; set; } /// /// Optional. Allows the "Rebase and Merge" method to be used. The default is null (do not update). The default when created is true. /// public bool? AllowRebaseMerge { get; set; } /// /// Optional. Allows the auto merge feature to be used. The default is null (do not update). The default when created is false. /// public bool? AllowAutoMerge { get; set; } /// /// Optional. Automatically delete branches on PR merge. The default is null (do not update). The default when created is false. /// public bool? DeleteBranchOnMerge { get; set; } /// /// Optional. Automatically set the title of squashed commits to be the PR title. The default is null (do not update). The default when created is false. /// public bool? UseSquashPrTitleAsDefault { get; set; } /// /// Optional. True to archive this repository. Note: you cannot unarchive repositories through the API. The default is null (do not update). The default when created is false. /// public bool? Archived { get; set; } /// /// Optional. Get or set whether to allow this repository to be forked or not. The default is null (do not update). The default when created is false. /// public bool? AllowForking { get; set; } internal string DebuggerDisplay => new SimpleJsonSerializer().Serialize(this); } }